262d89a92eac4838d4ced3b106f2aadb791a7528
[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         @echo "[$@] doc"
14         @echo "/$(HTML_DIR)/" > $@
15         @echo "/$(MAN_DIR)/" >> $@
16         @echo "/$(LATEX_DIR)/" >> $@
17         @echo "/$(TMP_DOX_FILE)" >> $@
18         @echo "/$(PDF_NAME)" >> $@
19
20 clean:
21         @echo "[$@] doc"
22         @rm -fr "$(TMP_DOX_FILE)" "$(HTML_DIR)" "$(LATEX_DIR)" "$(MAN_DIR)" "$(PDF_NAME)"
23
24 all: clean $(DOX_FILE)
25         @echo "[$@] doc"
26         @sed \
27           -e "s/__PLUGIN_VER__/$(PLUGIN_VER)/" \
28           -e "s/__LIBNAME__/$(PLUGIN_NAME)/" \
29           "$(DOX_FILE)" > "$(TMP_DOX_FILE)"
30         @doxygen "$(TMP_DOX_FILE)"
31         @rm "$(TMP_DOX_FILE)"
32         @$(MAKE) -s -C $(LATEX_DIR) all > /dev/null 2>&1
33         @mv "$(LATEX_DIR)/refman.pdf" "$(PDF_NAME)"
34         @rm -fr "$(LATEX_DIR)"