1 .PHONY: all build gtags \
6 clean src-clean gtags-clean \
7 test-clean doc-clean doc_inner-clean
9 CMD := casl2 comet2 dumpword
25 bindir ?= $(prefix)/bin
26 libdir ?= $(prefix)/share
28 VERSION := $(shell $(CAT) VERSION)
30 VERSIONGITREF := $(shell $(GIT) show-ref -s --tags $(VERSION))
32 MASTERGITREF := $(shell $(GIT) show-ref -s refs/heads/master)
34 VERSIONFILES = include/package.h \
35 test/system/casl2/opt_v/0.txt \
36 test/system/comet2/opt_v/0.txt \
37 test/system/dumpword/opt_v/0.txt
43 $(CP) $(addprefix src/,$(CMD)) ./
46 $(if $(strip $(shell $(WHICH) $(GTAGS))),$(GTAGS),@$(ECHO) '$(GTAGS): not found')
52 INSTALL: doc/install.txt
59 $(MAKE) -C doc_inner all
62 $(MAKE) -sC test/system
64 install: casl2 comet2 dumpword install-info install-casl2lib
65 $(INSTALL) -d $(bindir)
66 $(INSTALL) $(CMD) $(bindir)/
69 $(MAKE) -C doc install-info
72 $(MAKE) -C as/casl2lib install-casl2lib
74 uninstall: uninstall-info uninstall-casl2lib
75 $(RM) $(prefix $(bindir)/,$(CMD))
77 version: $(VERSIONFILES)
78 @$(ECHO) "YACASL2 Version: $(VERSION)"
80 $(VERSIONFILES): VERSION
81 @$(SED) -e "s/@@VERSION@@/$(VERSION)/g" $@.version >$@
84 if test `$(GIT) status -s | $(WC) -l` -gt 0; then $(ECHO) "Error: commit, first."; exit 1; fi; if test "$(VERSIONGITREF)" != "$(MASTERGITREF)"; then $(GIT) tag $(VERSION); fi
86 distclean: cmd-clean src-distclean gtags-clean version-clean clean
88 clean: src-clean doc-clean doc_inner-clean
97 $(MAKE) -sC src distclean
100 $(RM) GPATH GRTAGS GSYMS GTAGS
103 $(MAKE) -sC doc clean
106 $(MAKE) -sC doc_inner clean
109 $(RM) $(VERSIONFILES)
112 $(MAKE) -sC test clean