X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Makefile;h=c1b648341e42f65b7a69c42cca1a315ccbacdb0f;hb=269dc2f6c836027e0be757cfcea7922292620390;hp=01f60a941f34a7f88167b99d4d5d0de2699128df;hpb=198e25154f34db7d31ff87bcaf402a827cc5ddec;p=YACASL2.git diff --git a/Makefile b/Makefile index 01f60a9..c1b6483 100644 --- a/Makefile +++ b/Makefile @@ -1,64 +1,108 @@ -.PHONY: build check doc doxygen clean gtags htags clean_htags -MKDIR = mkdir -p -MV = mv -DOXYGEN = doxygen -GTAGS = gtags -HTAGS = htags -HTAGSFLAG = -anosx +.PHONY: all build gtags \ + check \ + doc info html doc-inner \ + install uninstall \ + install-info uninstall-info \ + install-casl2lib uninstall-casl2lib \ + version gittag \ + clean src-clean gtags-clean \ + test-clean doc-clean doc-inner-clean + +CMD := casl2 comet2 dumpword + +CAT := cat +CP := cp +ECHO := echo +GITTAG := git tag +GTAGS := gtags +INSTALL := install +SED := sed +WHICH := which + +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 + +all: build doc gtags + +build: version + $(MAKE) -C src all + $(CP) $(addprefix src/,$(CMD)) ./ + +gtags: + $(if $(strip $(shell $(WHICH) $(GTAGS))),$(GTAGS),@$(ECHO) '$(GTAGS): not found') -all: build gtags +doc: + $(MAKE) -C doc base + $(MAKE) INSTALL + +INSTALL: doc/install.txt + $(CP) $< $@ + +alldoc: + $(MAKE) -C doc all + +info: + $(MAKE) -C doc info + +html: + $(MAKE) -C doc html -build: - $(MAKE) -C src +doc-inner: + $(MAKE) -C doc_inner all check: - @$(MAKE) -sC test/system + $(MAKE) -sC test/system -doc: - @$(MAKE) -sC doc +install: casl2 comet2 dumpword install-info install-casl2lib + $(INSTALL) -d $(bindir) + $(INSTALL) $(CMD) $(bindir)/ -doxygen: doc_inner - @$(DOXYGEN) +uninstall: uninstall-info uninstall-casl2lib + $(RM) $(prefix $(bindir)/,$(CMD)) -gtags: clean_gtags - @$(GTAGS) +install-info: + $(MAKE) -C doc install-info -htags: doc_inner - @$(MAKE) clean_htags - @$(MAKE) gtags - @$(HTAGS) $(HTAGSFLAG) $< - @$(MV) $$@ + +gittag: VERSION + $(GITTAG) $(VERSION) -clean_gtags: - @rm -f GPATH GRTAGS GSYMS GTAGS +clean: cmd-clean src-clean gtags-clean doc-clean doc-inner-clean version-clean -clean_systemtest: - @$(MAKE) -sC test/system/casl2 clean - @$(MAKE) -sC test/system/comet2 clean - @$(MAKE) -sC test/system/dumpword clean +cmd-clean: + @$(RM) $(CMD) + +src-clean: + @$(MAKE) -sC src clean -clean_unittest: - @$(MAKE) -sC test/unit clean +gtags-clean: + @$(RM) GPATH GRTAGS GSYMS GTAGS -clean_doc: +doc-clean: @$(MAKE) -sC doc clean -clean_doc_inner: - @rm -rf doc_inner +doc-inner-clean: + @$(MAKE) -sC doc_inner clean -clean_htags: - @rm -rf doc_inner/htags +version-clean: + @$(RM) $(VERSIONFILES) -clean_doxygen: - @rm -rf doc_inner/doxygen +test-clean: + @$(MAKE) -sC test clean