1 .PHONY: all clean doxyfile-update doxygen-clean gnu_global-clean cmetrics-clean
15 DOXYGEN_DIR := doxygen
17 GNU_GLOBAL_DIR := gnu_global
18 GNU_GLOBAL_SRCDIR := ..
19 CMETRICS_DIR := cmetrics
20 CMETRICS_SRCDIR := ../src
22 # chk_file_ext: 指定されたコマンドが実在する場合にターゲットを指定。
23 # 用例: $(call chk_cmd_ext,cmd,target)
25 $(if $(strip $(shell $(WHICH) $1)),$2)
28 all: $(call chk_cmd_ext,$(DOXYGEN),$(DOXYGEN_DIR)) $(call chk_cmd_ext,$(HTAGS),$(GNU_GLOBAL_DIR)) $(call chk_cmd_ext $(CMETRICS),$(CMETRICS_DIR))
30 # doxygenのHTMLドキュメント作成先は、
31 # ../Doxyfileで設定された以下のディレクトリーの下のhtmlディレクトリー
32 # OUTPUT_DIRECTORY = doc_inner
33 $(DOXYGEN_DIR): $(DOXYSRCDIR)/Doxyfile ../src ../include
34 $(INSTALL) -d $(DOXYGEN_DIR)
35 $(CD) $(DOXYSRCDIR) && $(DOXYGEN)
37 doxyfile-update: Doxyfile
40 $(DOXYSRCDIR)/Doxyfile: doxyfile-update
41 @$(CP) -vf Doxyfile $(DOXYSRCDIR)/
43 # htagsのHTMLドキュメント作成先は、
44 # 引数DIRで指定されたディレクトリーの下のHTMLディレクトリー
45 $(GNU_GLOBAL_DIR): ../src ../include
46 $(MAKE) -C $(GNU_GLOBAL_SRCDIR) gtags
47 $(CD) $(GNU_GLOBAL_SRCDIR) && $(HTAGS) -anos $(CURDIR) && $(RMR) $(CURDIR)/$@ && $(MV) $(CURDIR)/HTML $(CURDIR)/$@
50 $(INSTALL) -d $(CMETRICS_DIR)
51 $(CMETRICS) $(CMETRICS_SRCDIR) | $(SED) -e '1s/ \{2,\}/ /g' -e '2,$$s/ \{1,\}/ /g' >$(CMETRICS_DIR)/files.tsv
52 $(CMETRICS) -f $(CMETRICS_SRCDIR) | $(SED) -e '1s/ \{2,\}/ /g' -e '2,$$s/ \{1,\}/ /g' >$(CMETRICS_DIR)/functions.tsv
54 clean: doxygen-clean gnu_global-clean cmetrics-clean
63 $(RMR) $(GNU_GLOBAL_DIR)
66 $(RMR) $(CMETRICS_DIR)