ドキュメントをインストールの説明とマニュアルに分割し、整理
[YACASL2.git] / Makefile
1 .PHONY: all build gtags check doc info html doc-inner install uninstall install-info uninstall-info install-casl2lib uninstall-casl2lib version clean clean-src clean-gtags clean-test clean-doc clean-doc-inner
2
3 GTAGS ?= gtags
4 RMF ?= rm -f
5 WHICH ?= which
6 ECHO ?= echo
7 INSTALL ?= install
8 SED ?= sed
9 CAT ?= cat
10
11 prefix ?= ~
12 bindir ?= $(prefix)/bin
13
14 VERSIONFILES = include/package.h test/system/casl2/opt_v/0.txt test/system/comet2/opt_v/0.txt test/system/dumpword/opt_v/0.txt
15
16 all: build docall gtags
17
18 build:
19         $(MAKE) -C src all
20
21 gtags:
22         @$(WHICH) $(GTAGS) >/dev/null && $(GTAGS) || $(ECHO) "$(GTAGS): not found"
23
24 docall:
25         $(MAKE) -C doc all
26
27 info:
28         $(MAKE) -C doc info
29
30 html:
31         $(MAKE) -C doc html
32
33 doc-inner:
34         $(MAKE) -C doc_inner all
35
36 check:
37         $(MAKE) -sC test/system
38
39 install: casl2 comet2 dumpword install-info install-casl2lib
40         $(INSTALL) -d $(bindir)
41         $(INSTALL) casl2 comet2 dumpword $(bindir)/
42
43 uninstall: uninstall-info uninstall-casl2lib
44         $(RMF) $(bindir)/casl2 $(bindir)/comet2 $(bindir)/dumpword
45
46 install-info:
47         $(MAKE) -C doc install-info
48
49 uninstall-info:
50         @$(MAKE) -C doc uninstall-info
51
52 install-casl2lib:
53         $(MAKE) -C as/casl2lib install-casl2lib
54
55 uninstall-casl2lib:
56         @$(MAKE) -C as/casl2lib uninstall-casl2lib
57
58 version: VERSION $(VERSIONFILES)
59         @$(ECHO) "YACASL2 Version:" `$(CAT) VERSION`
60
61 $(VERSIONFILES): VERSION
62         $(SED) -e "s/@@VERSION@@/`cat VERSION`/g" $@.version >$@
63
64 clean: clean-src clean-gtags clean-doc clean-doc-inner clean-version
65
66 clean-src:
67         @$(MAKE) -sC src clean
68
69 clean-gtags:
70         @$(RMF) GPATH GRTAGS GSYMS GTAGS
71
72 clean-doc:
73         @$(MAKE) -sC doc clean
74
75 clean-doc-inner:
76         @$(MAKE) -sC doc_inner clean
77
78 clean-test:
79         @$(MAKE) -sC test clean
80
81 clean-version:
82         @$(RMF) $(VERSIONFILES)