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
27 VERSION := $(shell $(CAT) VERSION)
29 VERSIONGITREF := $(shell $(GIT) show-ref -s --tags $(VERSION))
31 MASTERGITREF := $(shell $(GIT) show-ref -s refs/heads/master)
33 VERSIONFILES = include/package.h \
34 test/system/casl2/opt_v/0.txt \
35 test/system/comet2/opt_v/0.txt \
36 test/system/dumpword/opt_v/0.txt
42 $(CP) $(addprefix src/,$(CMD)) ./
45 $(if $(strip $(shell $(WHICH) $(GTAGS))),$(GTAGS),@$(ECHO) '$(GTAGS): not found')
51 INSTALL: doc/install.txt
58 $(MAKE) -C doc_inner all
61 $(MAKE) -sC test/system
63 install: casl2 comet2 dumpword install-info install-casl2lib
64 $(INSTALL) -d $(bindir)
65 $(INSTALL) $(CMD) $(bindir)/
67 uninstall: uninstall-info uninstall-casl2lib
68 $(RM) $(prefix $(bindir)/,$(CMD))
70 version: $(VERSIONFILES)
71 @$(ECHO) "YACASL2 Version: $(VERSION)"
73 $(VERSIONFILES): VERSION
74 @$(SED) -e "s/@@VERSION@@/$(VERSION)/g" $@.version >$@
77 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
79 distclean: cmd-clean src-distclean gtags-clean version-clean clean
81 clean: src-clean doc-clean doc_inner-clean
90 $(MAKE) -sC src distclean
93 $(RM) GPATH GRTAGS GSYMS GTAGS
99 $(MAKE) -sC doc_inner clean
102 $(RM) $(VERSIONFILES)
105 $(MAKE) -sC test clean