1 .PHONY: all build gtags \
6 clean src-clean gtags-clean \
7 test-clean doc-clean doc_inner-clean
9 CMD := casl2 comet2 dumpword
24 bindir ?= $(prefix)/bin
26 VERSION := $(shell $(CAT) VERSION)
28 VERSIONGITREF := $(shell $(GIT) show-ref -s --tags $(VERSION))
30 MASTERGITREF := $(shell $(GIT) show-ref -s refs/heads/master)
32 VERSIONFILES = include/package.h \
33 test/system/casl2/opt_v/0.txt \
34 test/system/comet2/opt_v/0.txt \
35 test/system/dumpword/opt_v/0.txt
41 $(CP) $(addprefix src/,$(CMD)) ./
44 $(if $(strip $(shell $(WHICH) $(GTAGS))),$(GTAGS),@$(ECHO) '$(GTAGS): not found')
50 INSTALL: doc/install.txt
57 $(MAKE) -C doc_inner all
60 $(MAKE) -sC test/system
62 install: casl2 comet2 dumpword install-info install-casl2lib
63 $(INSTALL) -d $(bindir)
64 $(INSTALL) $(CMD) $(bindir)/
66 uninstall: uninstall-info uninstall-casl2lib
67 $(RM) $(prefix $(bindir)/,$(CMD))
69 version: $(VERSIONFILES)
70 @$(ECHO) "YACASL2 Version: $(VERSION)"
72 $(VERSIONFILES): VERSION
73 @$(SED) -e "s/@@VERSION@@/$(VERSION)/g" $@.version >$@
76 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
78 distclean: cmd-clean src-distclean gtags-clean version-clean clean
80 clean: src-clean doc-clean doc_inner-clean
89 $(MAKE) -sC src distclean
92 $(RM) GPATH GRTAGS GSYMS GTAGS
98 $(MAKE) -sC doc_inner clean
101 $(RM) $(VERSIONFILES)
104 $(MAKE) -sC test clean