X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?p=YACASL2.git;a=blobdiff_plain;f=Makefile;h=fae8d3aa1fea5dcf263a5e1b32e3c21939cabe84;hp=ad22d42f5e74133dbfd0f3535ea4a815df9b55ad;hb=d767cf8e4ba83b6074722b76afcfba420e1281f5;hpb=19875f416e24340460868fbc4e09ed2c8faaa127 diff --git a/Makefile b/Makefile index ad22d42..fae8d3a 100644 --- a/Makefile +++ b/Makefile @@ -1,31 +1,44 @@ .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 +EXPR := expr +GIT := git +GREP := grep GTAGS := gtags INSTALL := install SED := sed +WC := wc WHICH := which +XARGS := xargs prefix ?= ~ bindir ?= $(prefix)/bin +libdir ?= $(prefix)/share -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 +55,7 @@ INSTALL: doc/install.txt alldoc: $(MAKE) -C doc all -doc-inner: +doc_inner: $(MAKE) -C doc_inner all check: @@ -52,6 +65,12 @@ install: casl2 comet2 dumpword install-info install-casl2lib $(INSTALL) -d $(bindir) $(INSTALL) $(CMD) $(bindir)/ +install-info: + $(MAKE) -C doc install-info + +install-casl2lib: + $(MAKE) -C as/casl2lib install-casl2lib + uninstall: uninstall-info uninstall-casl2lib $(RM) $(prefix $(bindir)/,$(CMD)) @@ -61,12 +80,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 +93,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: