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