X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?p=YACASL2.git;a=blobdiff_plain;f=Makefile;h=5d57356ed15d79f72276945cbed81e89446c54a2;hp=5192135045326b06c042f2381407490cba14c716;hb=9f3a6f1ba1a71d44e77e75c74a9b03b6db903d62;hpb=9a90bce10b932f8aa7045b9dceb4b99156666920 diff --git a/Makefile b/Makefile index 5192135..5d57356 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,83 @@ -.PHONY: build check doc clean +.PHONY: all build gtags check doc info html doc-inner install uninstall install-info uninstall-info install-casl2lib uninstall-casl2lib version clean clean-src clean-gtags clean-test clean-doc clean-doc-inner + +GTAGS ?= gtags +RMF ?= rm -f +WHICH ?= which +ECHO ?= echo +INSTALL ?= install +SED ?= sed +CAT ?= cat + +prefix ?= ~ +bindir ?= $(prefix)/bin +casl2libdir ?= $(prefix)/lib/casl2 + +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 info html gtags build: - $(MAKE) -C src + $(MAKE) -C src all + +gtags: + @$(WHICH) $(GTAGS) >/dev/null && $(GTAGS) || $(ECHO) "$(GTAGS): not found" + +docall: doc + $(MAKE) -C doc all + +info: + $(MAKE) -C doc info + +html: + $(MAKE) -C doc html + +doc-inner: + $(MAKE) -C doc_inner all check: - @$(MAKE) -sC test/system + $(MAKE) -sC test/system + +install: casl2 comet2 dumpword install-info install-casl2lib + $(INSTALL) -d $(bindir) + $(INSTALL) casl2 comet2 dumpword $(bindir)/ + +uninstall: uninstall-info uninstall-casl2lib + $(RMF) $(bindir)/casl2 $(bindir)/comet2 $(bindir)/dumpword -doc: - @$(MAKE) -sC doc +install-info: + $(MAKE) -C doc install-info -clean: +uninstall-info: + @$(MAKE) -C doc uninstall-info + +install-casl2lib: + $(MAKE) -C as/casl2lib install-casl2lib + +uninstall-casl2lib: + @$(MAKE) -C as/casl2lib uninstall-casl2lib + +version: VERSION $(VERSIONFILES) + @$(ECHO) "YACASL2 Version:" `$(CAT) VERSION` + +$(VERSIONFILES): VERSION + $(SED) -e "s/@@VERSION@@/`cat VERSION`/g" $@.version >$@ + +clean: clean-src clean-gtags clean-doc clean-doc-inner clean-version + +clean-src: @$(MAKE) -sC src clean - @$(MAKE) -sC test/system/casl2 clean - @$(MAKE) -sC test/system/comet2 clean - @$(MAKE) -sC test/system/dumpword clean - @$(MAKE) -sC test/unit clean - @rm -f casl2 comet2 dumpword + +clean-gtags: + @$(RMF) GPATH GRTAGS GSYMS GTAGS + +clean-doc: + @$(MAKE) -sC doc clean + +clean-doc-inner: + @$(MAKE) -sC doc_inner clean + +clean-test: + @$(MAKE) -sC test clean + +clean-version: + @$(RMF) $(VERSIONFILES)