1 .PHONY: all srcall 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 CMDFILES := casl2 comet2 dumpword casl2rev comet2monitor
39 all: build INSTALL gtags
43 @(for f in $(CMDFILES); do if test ! -e $$f -o src/$$f -nt $$f; then $(CP) src/$$f $$f; fi; done)
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 smoke
67 $(MAKE) -sC test/system valgrind
69 install: casl2 comet2 dumpword install-info
70 $(INSTALL) -d $(bindir)
71 $(INSTALL) $(CMD) $(bindir)/
74 $(MAKE) -C doc install-info
76 uninstall: uninstall-info
77 $(RM) $(prefix $(bindir)/,$(CMD))
79 version: $(VERSIONFILES)
80 @$(ECHO) "YACASL2 Version: $(VERSION)"
82 $(VERSIONFILES): VERSION
83 @$(SED) -e "s/@@VERSION@@/$(VERSION)/g" $@.version >$@
86 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
88 distclean: cmd-clean src-distclean gtags-clean version-clean clean
90 clean: src-clean doc-clean doc_inner-clean
99 $(MAKE) -sC src distclean
102 $(RM) GPATH GRTAGS GSYMS GTAGS
105 $(MAKE) -sC doc clean
108 $(MAKE) -sC doc_inner clean
111 $(RM) $(VERSIONFILES)
114 $(MAKE) -sC test clean