-.PHONY: all build gtags check doc info html doc-inner install uninstall install-info uninstall-info install-casl2lib uninstall-casl2lib version gittag clean clean-src clean-gtags clean-test clean-doc clean-doc-inner
+.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
INSTALL: doc/install.txt
$(CP) $< $@
-docall:
+alldoc:
$(MAKE) -C doc all
info:
gittag: VERSION
$(GITTAG) $(VERSION)
-clean: clean-cmd clean-src clean-gtags clean-doc clean-doc-inner clean-version
+clean: cmd-clean src-clean gtags-clean doc-clean doc-inner-clean version-clean
-clean-cmd:
+cmd-clean:
@$(RM) $(CMD)
-clean-src:
+src-clean:
@$(MAKE) -sC src clean
-clean-gtags:
+gtags-clean:
@$(RM) GPATH GRTAGS GSYMS GTAGS
-clean-doc:
+doc-clean:
@$(MAKE) -sC doc clean
-clean-doc-inner:
+doc-inner-clean:
@$(MAKE) -sC doc_inner clean
-clean-version:
+version-clean:
@$(RM) $(VERSIONFILES)
-clean-test:
+test-clean:
@$(MAKE) -sC test clean
prefix ?= ~
infodir ?= $(prefix)/share/info
-.PHONY: base all info html htmls pdf install-info uninstall-info clean clean-textmp
+.PHONY: base all info html htmls pdf install-info uninstall-info clean textmp-clean
.INTERMEDIATE: *.dvi
$(INSTALL-INFO) --delete $(infodir)/yacasl2.info $(infodir)/dir
$(RM) $(infodir)/yacasl2.info
-clean: clean-textmp
+clean: textmp-clean
@$(RMR) *_html *.info *.html *.pdf *.dvi *.txt
-clean-textmp:
+textmp-clean:
@$(RM) *.aux *.cp *.cps *.fn *.ky *.log *.pg *.pgs *.tmp *.toc *.tp *.vr
# ../Doxyfileで設定された以下のディレクトリーの下のhtmlディレクトリー
# OUTPUT_DIRECTORY = doc_inner
$(DOXYGEN_DIR): ../Doxyfile
- @($(WHICH) $(DOXYGEN) && ($(CD) .. && $(DOXYGEN) && $(CD) - && $(MV) html $@) >/dev/null || $(ECHO) "$(DOXYGEN): not found")
+ $(if $(strip $(shell $(WHICH) $(DOXYGEN))),$(CD) .. && $(DOXYGEN) && $(MV) $(CURDIR)/html $(CURDIR)/$@,$(ECHO) '$(DOXYGEN): not found')
# htagsのHTMLドキュメント作成先は、
# 引数DIRで指定されたディレクトリーの下のHTMLディレクトリー
$(GNU_GLOBAL_DIR):
$(MAKE) -C .. gtags
- $(WHICH) $(HTAGS) && ($(CD) .. && $(HTAGS) -anosx doc_inner && $(CD) - && $(MV) HTML $@) >/dev/null || $(ECHO) "$(HTAGS): not found"
+ $(if $(strip $(shell $(WHICH) $(HTAGS))),$(CD) .. && $(HTAGS) -anosx $(CURDIR) && $(MV) $(CURDIR)/HTML $(CURDIR)/$@,@$(ECHO) '$(HTAGS): not found')
clean: doxygen-clean gnu_global-clean
# .dファイルからヘッダファイルの依存関係を取得する
# ターゲットに clean が含まれている場合は除く
-ifneq ($(findstring $(MAKECMDGOALS),clean),clean)
+ifeq (,$(filter %clean,$(MAKECMDGOALS)))
-include $(addsuffix .d,$(CMDOBJ) $(COMMONOBJ) $(CASL2OBJ) $(ASOBJ) $(EXECOBJ))
endif
$(if $(strip $(shell $(WHICH) $(ETAGS))),$(ETAGS) $^,@$(ECHO) '$(ETAGS): not found')
# makeで生成したファイルの削除
-clean: clean-cmd clean-work clean-tag
+clean: cmd-clean work-clean tag-clean
-clean-cmd:
+cmd-clean:
@$(RM) casl2 comet2 dumpword
-clean-work:
+work-clean:
@$(RM) *.o *.d
-clean-tag:
+tag-clean:
@$(RM) TAGS tags
-clean: clean_systemtest clean_unittest
+.PHONY: clean systemtest-clean unittest-clean
-clean_systemtest:
+clean: systemtest-clean unittest-clean
+
+systemtest-clean:
@$(MAKE) -sC system/casl2 clean
@$(MAKE) -sC system/comet2 clean
@$(MAKE) -sC system/dumpword clean
-clean_unittest:
+unittest-clean:
@$(MAKE) -sC unit clean
# 複数の子ディレクトリーでmakeを実行
-CMDS = casl2 comet2 dumpword
+CMD = casl2 comet2 dumpword
define make_dirs
$(foreach d,$1,$(MAKE) -sC $d $2)
endef
.PHONY: check clean
check:
- @$(call make_dirs,$(CMDS),$@; )
+ @$(call make_dirs,$(CMD),$@; )
clean:
- @$(call make_dirs,$(CMDS),$@; )
+ @$(call make_dirs,$(CMD),$@; )