X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Makefile;h=6e145d7ce28e99c040c8462e10ddc5142d4374e8;hb=4dacfc4d9d163108765ab13e03cff7670e63640a;hp=d8e2f6adefc22dc7900d74f2616da7b20a36a74e;hpb=b22ffc2662e5fe300bfab3adb46ca97b5b630d8b;p=YACASL2.git diff --git a/Makefile b/Makefile index d8e2f6a..6e145d7 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,81 @@ -.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 -build: - make -C src +GTAGS ?= gtags +RMF ?= rm -f +WHICH ?= which +ECHO ?= echo +INSTALL ?= install +SED ?= sed + +prefix ?= ~ +bindir ?= $(prefix)/bin +casl2libdir ?= $(prefix)/yacasl2/casl2lib + +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: version + $(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 + +install-info: + $(MAKE) -C doc install-info + +uninstall-info: + @$(MAKE) -C doc uninstall-info + +install-casl2lib: + $(MAKE) -C as/casl2lib install-casl2lib + +uninstall-casl2lib: + @$(MAKE) -C as/casl2lib uninstall-casl2lib + +version: $(VERSIONFILES) + +$(VERSIONFILES): + for f in $(VERSIONFILES); do $(SED) -e "s/@@VERSION@@/`cat VERSION`/g" $$f.version >$$f; done + +clean: clean-src clean-gtags clean-doc clean-doc-inner clean-version + +clean-src: + @$(MAKE) -sC src clean + +clean-gtags: + @$(RMF) GPATH GRTAGS GSYMS GTAGS + +clean-doc: + @$(MAKE) -sC doc clean + +clean-doc-inner: + @$(MAKE) -sC doc_inner clean -doc: - make -sC doc +clean-test: + @$(MAKE) -sC test clean -clean: - @make -sC src $@ - @make -sC test/system $@ - @make -sC test/unit $@ - @rm -f casl2 comet2 dumpword +clean-version: + @$(RMF) $(VERSIONFILES)