X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Makefile;h=c1b648341e42f65b7a69c42cca1a315ccbacdb0f;hb=94cceb9f3ada858e33ed04b595f5247c3c19fa5c;hp=77168cbf756c2c248fb1dcd843388ef77d9998f7;hpb=97c1993b79101d519c13b2c905191fb61583872c;p=YACASL2.git diff --git a/Makefile b/Makefile index 77168cb..c1b6483 100644 --- a/Makefile +++ b/Makefile @@ -1,53 +1,108 @@ -.PHONY: build check doc doxygen clean gtags 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 -build: - $(MAKE) -C src +CMD := casl2 comet2 dumpword -check: - @$(MAKE) -sC test/system +CAT := cat +CP := cp +ECHO := echo +GITTAG := git tag +GTAGS := gtags +INSTALL := install +SED := sed +WHICH := which -doc: - @$(MAKE) -sC doc +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 -doxygen: doc_inner - @$(DOXYGEN) +all: build doc gtags + +build: version + $(MAKE) -C src all + $(CP) $(addprefix src/,$(CMD)) ./ gtags: - @$(GTAGS) + $(if $(strip $(shell $(WHICH) $(GTAGS))),$(GTAGS),@$(ECHO) '$(GTAGS): not found') -htags: doc_inner gtags - @$(HTAGS) $(HTAGSFLAG) $$@ + +gittag: VERSION + $(GITTAG) $(VERSION) + +clean: cmd-clean src-clean gtags-clean doc-clean doc-inner-clean version-clean + +cmd-clean: + @$(RM) $(CMD) + +src-clean: + @$(MAKE) -sC src clean + +gtags-clean: + @$(RM) GPATH GRTAGS GSYMS GTAGS + +doc-clean: @$(MAKE) -sC doc clean + +doc-inner-clean: + @$(MAKE) -sC doc_inner clean + +version-clean: + @$(RM) $(VERSIONFILES) + +test-clean: + @$(MAKE) -sC test clean