1
2# This should be "include"d from the top-level Makefile, and nowhere else
3
4# Extra commands
5HTML2PDF=		htmldoc --footer d.1
6GRASS_PDFDIR=		$(DOCSDIR)/pdf
7
8# generate programmer's manual as single HTML document:
9
10htmldocs-single:
11	$(MAKE) -C . htmldox-single
12	for dir in lib ; do \
13	  $(MAKE) -C $$dir htmldox-single ; \
14	done
15
16# generate programmer's manual as multiple HTML documents:
17docs_dirs = \
18	lib/db \
19	lib/raster3d \
20	lib/gis \
21	lib/gmath \
22	lib/gpde \
23	lib/proj \
24	lib/ogsf \
25	lib/segment \
26	lib/vector \
27	lib/vector/dglib
28
29htmldocs_dirs := $(patsubst %,%/html,$(docs_dirs))
30latexdocs_dirs := $(patsubst %,%/latex,$(docs_dirs))
31
32htmldocs:
33	$(MAKE) -C . htmldox
34	for dir in $(docs_dirs) ; do \
35	  $(MAKE) -C $$dir htmldox ; \
36	  done
37
38packagehtmldocs: htmldocs
39	tar chvfz $(GRASS_NAME)refman_$(DATE)_html.tar.gz $(htmldocs_dirs)
40
41#alternatively, the docs can be generated as single PDF document (see doxygen FAQ for 'TeX capacity exceeded'):
42#  (cd lib/ ; make pdfdox)
43
44pdfdocs:
45	for dir in $(docs_dirs) ; do \
46	  $(MAKE) -C $$dir pdfdox ; \
47	  done
48	@echo "Written PDF docs in: $(latexdocs_dirs)"
49
50cleandocs:
51	$(MAKE) -C . cleandox
52	for dir in $(docs_dirs) ; do \
53	  $(MAKE) -C $$dir cleandox ; \
54	  done
55
56indices = \
57	database.html \
58	display.html \
59	general.html \
60	imagery.html \
61	miscellaneous.html \
62	photo.html \
63	postscript.html \
64	raster.html \
65	raster3d.html \
66	vector.html
67
68html_pdf = \
69	cd $(ARCH_DISTDIR)/docs/html && \
70	$(HTML2PDF) --webpage $(1).html $(2).*.html -f $(GRASS_PDFDIR)/$(GRASS_NAME)$(1).pdf
71
72html2pdfdoc:
73	@ echo "Light PDF document from modules' HTML documentation"
74	@ # http://www.htmldoc.org
75	@test -d $(GRASS_PDFDIR) || mkdir -p $(GRASS_PDFDIR)
76	$(call html_pdf commands,--no-links $(indices))
77
78html2pdfdoccomplete:
79	@ echo "Complete PDF document from modules' HTML documentation"
80	@ # http://www.htmldoc.org
81	@test -d $(GRASS_PDFDIR) || mkdir -p $(GRASS_PDFDIR)
82	$(call html_pdf database,db.*.html)
83	$(call html_pdf display,d.*.html)
84	$(call html_pdf general,g.*.html)
85	$(call html_pdf imagery,i.*.html)
86	$(call html_pdf miscellaneous,m.*.html)
87	$(call html_pdf photo,i.ortho*.html photo*.html)
88	$(call html_pdf postscript,ps.*.html)
89	$(call html_pdf raster,r.*.html)
90	$(call html_pdf raster3d,r3.*.html)
91	$(call html_pdf vector,v.*.html)
92
93changelog:
94	@ echo "creating ChangeLog file (following 'releasebranch_7_8' only)..."
95	@ # tools/gitlog2changelog.py creates a GNU style ChangeLog file:
96	python tools/gitlog2changelog.py
97
98.PHONY: htmldocs-single htmldocs packagehtmldocs pdfdocs cleandocs html2pdfdoc
99.PHONY: html2pdfdoccomplete changelog
100