X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Makefile;h=8bd9f1ad71c1994ad7acdb7f7aff582316fbc63e;hb=9c8852e2e89096b8f20f3d2d5bac52ea68863bb0;hp=ad22d42f5e74133dbfd0f3535ea4a815df9b55ad;hpb=19875f416e24340460868fbc4e09ed2c8faaa127;p=YACASL2.git diff --git a/Makefile b/Makefile index ad22d42..8bd9f1a 100644 --- a/Makefile +++ b/Makefile @@ -1,31 +1,42 @@ .PHONY: all build gtags \ check \ - doc alldoc doc-inner \ + doc alldoc doc_inner \ install uninstall \ version gittag \ clean src-clean gtags-clean \ - test-clean doc-clean doc-inner-clean + test-clean doc-clean doc_inner-clean CMD := casl2 comet2 dumpword CAT := cat CP := cp -ECHO := echo -GITTAG := git tag +ECHO := /bin/echo +GIT := git +GREP := grep GTAGS := gtags INSTALL := install SED := sed WHICH := which +EXPR := expr +XARGS := xargs prefix ?= ~ bindir ?= $(prefix)/bin -VERSION = $(shell $(CAT) VERSION) -VERSIONFILES = include/package.h test/system/casl2/opt_v/0.txt test/system/comet2/opt_v/0.txt test/system/dumpword/opt_v/0.txt +VERSION := $(shell $(CAT) VERSION) + +VERSIONGITREF := $(shell $(GIT) show-ref -s --tags $(VERSION)) + +MASTERGITREF := $(shell $(GIT) show-ref -s refs/heads/master) + +VERSIONFILES = include/package.h \ + test/system/casl2/opt_v/0.txt \ + test/system/comet2/opt_v/0.txt \ + test/system/dumpword/opt_v/0.txt all: build doc gtags -build: version +build: $(MAKE) -C src all $(CP) $(addprefix src/,$(CMD)) ./ @@ -42,7 +53,7 @@ INSTALL: doc/install.txt alldoc: $(MAKE) -C doc all -doc-inner: +doc_inner: $(MAKE) -C doc_inner all check: @@ -61,12 +72,12 @@ version: $(VERSIONFILES) $(VERSIONFILES): VERSION @$(SED) -e "s/@@VERSION@@/$(VERSION)/g" $@.version >$@ -gittag: VERSION - $(GITTAG) $(VERSION) +gittag: + 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 -distclean: cmd-clean gtags-clean version-clean clean +distclean: cmd-clean src-distclean gtags-clean version-clean clean -clean: src-clean doc-clean doc-inner-clean +clean: src-clean doc-clean doc_inner-clean cmd-clean: $(RM) $(CMD) @@ -74,13 +85,16 @@ cmd-clean: src-clean: $(MAKE) -sC src clean +src-distclean: + $(MAKE) -sC src distclean + gtags-clean: $(RM) GPATH GRTAGS GSYMS GTAGS doc-clean: $(MAKE) -sC doc clean -doc-inner-clean: +doc_inner-clean: $(MAKE) -sC doc_inner clean version-clean: