1 .PHONY: all build gtags \
6 clean src-clean gtags-clean \
7 test-clean doc-clean doc_inner-clean
23 bindir ?= $(prefix)/bin
24 libdir ?= $(prefix)/share
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/version.h \
33 test/system/casl2_opt/opt_v/0.txt \
34 test/system/comet2_opt/opt_v/0.txt \
35 test/system/dumpword/opt_v/0.txt
37 all: casl2 comet2 dumpword casl2rev INSTALL gtags
42 casl2 comet2 dumpword casl2rev: build
48 $(if $(strip $(shell $(WHICH) $(GTAGS))),$(GTAGS),@$(ECHO) '$(GTAGS): not found')
50 INSTALL: doc/install.txt
60 $(MAKE) -C doc_inner all
63 $(MAKE) -sC test/system
66 $(MAKE) -sC test/system valgrind
68 install: casl2 comet2 dumpword install-info
69 $(INSTALL) -d $(bindir)
70 $(INSTALL) $(CMD) $(bindir)/
73 $(MAKE) -C doc install-info
75 uninstall: uninstall-info
76 $(RM) $(prefix $(bindir)/,$(CMD))
78 version: $(VERSIONFILES)
79 @$(ECHO) "YACASL2 Version: $(VERSION)"
81 $(VERSIONFILES): VERSION
82 @$(SED) -e "s/@@VERSION@@/$(VERSION)/g" $@.version >$@
85 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
87 distclean: cmd-clean src-distclean gtags-clean version-clean clean
89 clean: src-clean doc-clean doc_inner-clean
98 $(MAKE) -sC src distclean
101 $(RM) GPATH GRTAGS GSYMS GTAGS
104 $(MAKE) -sC doc clean
107 $(MAKE) -sC doc_inner clean
110 $(RM) $(VERSIONFILES)
113 $(MAKE) -sC test clean