1 .PHONY: all build gtags \
6 clean src-clean gtags-clean \
7 test-clean doc-clean doc_inner-clean
9 CMD := casl2 comet2 dumpword casl2rev
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/version.h \
35 test/system/casl2_opt/opt_v/0.txt \
36 test/system/comet2_opt/opt_v/0.txt \
37 test/system/dumpword/opt_v/0.txt
39 all: build INSTALL gtags
43 $(CP) $(addprefix src/,$(CMD)) ./
46 $(if $(strip $(shell $(WHICH) $(GTAGS))),$(GTAGS),@$(ECHO) '$(GTAGS): not found')
48 INSTALL: doc/install.txt
58 $(MAKE) -C doc_inner all
61 $(MAKE) -sC test/system
64 $(MAKE) -sC test/system valgrind
66 install: casl2 comet2 dumpword install-info
67 $(INSTALL) -d $(bindir)
68 $(INSTALL) $(CMD) $(bindir)/
71 $(MAKE) -C doc install-info
73 uninstall: uninstall-info
74 $(RM) $(prefix $(bindir)/,$(CMD))
76 version: $(VERSIONFILES)
77 @$(ECHO) "YACASL2 Version: $(VERSION)"
79 $(VERSIONFILES): VERSION
80 @$(SED) -e "s/@@VERSION@@/$(VERSION)/g" $@.version >$@
83 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
85 distclean: cmd-clean src-distclean gtags-clean version-clean clean
87 clean: src-clean doc-clean doc_inner-clean
96 $(MAKE) -sC src distclean
99 $(RM) GPATH GRTAGS GSYMS GTAGS
102 $(MAKE) -sC doc clean
105 $(MAKE) -sC doc_inner clean
108 $(RM) $(VERSIONFILES)
111 $(MAKE) -sC test clean