X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?p=YACASL2.git;a=blobdiff_plain;f=doc_inner%2FMakefile;h=e57591f6e4c5b45207806723ba87aa3d26a9eb88;hp=e8b89035220ac80bb093877ed0d1293910739791;hb=2f0b91ab1a54973a084e1609b46a1432c8b8e334;hpb=85df2ded4d5734d032d7556d2804cf1e4d058003 diff --git a/doc_inner/Makefile b/doc_inner/Makefile index e8b8903..e57591f 100644 --- a/doc_inner/Makefile +++ b/doc_inner/Makefile @@ -7,7 +7,6 @@ DOXYGEN := doxygen ECHO := echo HTAGS := htags INSTALL := install -MAKE := make MV := mv RMR := rm -rf SED := sed @@ -20,30 +19,39 @@ GNU_GLOBAL_SRCDIR := .. CMETRICS_DIR := cmetrics CMETRICS_SRCDIR := ../src -all: $(DOXYGEN_DIR) $(GNU_GLOBAL_DIR) $(CMETRICS_DIR) +# chk_file_ext: 指定されたコマンドが実在する場合にターゲットを指定。 +# 用例: $(call chk_cmd_ext,cmd,target) +define chk_cmd_ext + $(if $(strip $(shell $(WHICH) $1)),$2) +endef + +all: $(call chk_cmd_ext,$(DOXYGEN),$(DOXYGEN_DIR)) $(call chk_cmd_ext,$(HTAGS),$(GNU_GLOBAL_DIR)) $(call chk_cmd_ext $(CMETRICS),$(CMETRICS_DIR)) # doxygenのHTMLドキュメント作成先は、 # ../Doxyfileで設定された以下のディレクトリーの下のhtmlディレクトリー # OUTPUT_DIRECTORY = doc_inner -$(DOXYGEN_DIR): $(DOXYSRCDIR)/Doxyfile - $(if $(strip $(shell $(WHICH) $(DOXYGEN))),$(CD) $(DOXYSRCDIR) && $(DOXYGEN) && $(MV) $(CURDIR)/html $(CURDIR)/$@,$(ECHO) '$(DOXYGEN): not found') +$(DOXYGEN_DIR): $(DOXYSRCDIR)/Doxyfile ../src ../include + $(INSTALL) -d $(DOXYGEN_DIR) + $(CD) $(DOXYSRCDIR) && $(DOXYGEN) -$(DOXYSRCDIR)/Doxyfile: - $(CP) -f Doxyfile $(DOXYSRCDIR)/ +$(DOXYSRCDIR)/Doxyfile: Doxyfile + @$(CP) -vf Doxyfile $(DOXYSRCDIR)/ # htagsのHTMLドキュメント作成先は、 # 引数DIRで指定されたディレクトリーの下のHTMLディレクトリー -$(GNU_GLOBAL_DIR): +$(GNU_GLOBAL_DIR): ../src ../include $(MAKE) -C $(GNU_GLOBAL_SRCDIR) gtags - $(if $(strip $(shell $(WHICH) $(HTAGS))),$(CD) $(GNU_GLOBAL_SRCDIR) && $(HTAGS) -anosx $(CURDIR) && $(MV) $(CURDIR)/HTML $(CURDIR)/$@,@$(ECHO) '$(HTAGS): not found') + $(CD) $(GNU_GLOBAL_SRCDIR) && $(HTAGS) -anos $(CURDIR) && $(RMR) $(CURDIR)/$@ && $(MV) $(CURDIR)/HTML $(CURDIR)/$@ $(CMETRICS_DIR): $(INSTALL) -d $(CMETRICS_DIR) - $(CMETRICS) $(CMETRICS_SRCDIR) | $(SED) -e '1s/ \{2,\}/\t/g' -e '2,$$s/ \{1,\}/\t/g' >$(CMETRICS_DIR)/files.tsv - $(CMETRICS) -f $(CMETRICS_SRCDIR) | $(SED) -e '1s/ \{2,\}/\t/g' -e '2,$$s/ \{1,\}/\t/g' >$(CMETRICS_DIR)/functions.tsv + $(CMETRICS) $(CMETRICS_SRCDIR) | $(SED) -e '1s/ \{2,\}/ /g' -e '2,$$s/ \{1,\}/ /g' >$(CMETRICS_DIR)/files.tsv + $(CMETRICS) -f $(CMETRICS_SRCDIR) | $(SED) -e '1s/ \{2,\}/ /g' -e '2,$$s/ \{1,\}/ /g' >$(CMETRICS_DIR)/functions.tsv clean: doxygen-clean gnu_global-clean cmetrics-clean +distclean: clean + doxygen-clean: $(RMR) $(DOXYGEN_DIR) $(RM) ../Doxyfile