improve VERBOSE handling
[olsrd.git] / lib / pud / doc / Makefile
1 include ../Makefile.inc
2
3 HTML_DIR = html
4 MAN_DIR = man
5 LATEX_DIR = latex
6 PDF_NAME = $(PLUGIN_NAME).pdf
7 DOX_FILE = doxygen.conf
8 TMP_DOX_FILE = $(DOX_FILE).temp
9
10 .PHONY: .gitignore all clean
11
12 .gitignore:
13 ifeq ($(VERBOSE),0)
14         @echo "[$@] doc"
15 endif
16         $(MAKECMDPREFIX)echo "/$(HTML_DIR)/" > $@
17         $(MAKECMDPREFIX)echo "/$(MAN_DIR)/" >> $@
18         $(MAKECMDPREFIX)echo "/$(LATEX_DIR)/" >> $@
19         $(MAKECMDPREFIX)echo "/$(TMP_DOX_FILE)" >> $@
20         $(MAKECMDPREFIX)echo "/$(PDF_NAME)" >> $@
21
22 clean:
23 ifeq ($(VERBOSE),0)
24         @echo "[$@] doc"
25 endif
26         $(MAKECMDPREFIX)rm -fr "$(TMP_DOX_FILE)" "$(HTML_DIR)" "$(LATEX_DIR)" "$(MAN_DIR)" "$(PDF_NAME)"
27
28 all: clean $(DOX_FILE)
29 ifeq ($(VERBOSE),0)
30         @echo "[$@] doc"
31 endif
32         $(MAKECMDPREFIX)sed \
33           -e "s/__PLUGIN_VER__/$(PLUGIN_VER)/" \
34           -e "s/__LIBNAME__/$(PLUGIN_NAME)/" \
35           "$(DOX_FILE)" > "$(TMP_DOX_FILE)"
36         $(MAKECMDPREFIX)doxygen "$(TMP_DOX_FILE)"
37         $(MAKECMDPREFIX)rm "$(TMP_DOX_FILE)"
38         $(MAKECMDPREFIX)$(MAKE) -s -C $(LATEX_DIR) all > /dev/null 2>&1
39         $(MAKECMDPREFIX)mv "$(LATEX_DIR)/refman.pdf" "$(PDF_NAME)"
40         $(MAKECMDPREFIX)rm -fr "$(LATEX_DIR)"