Debian Codegraph @

documentation/Makefile

raw ◀ ▶
1 Debian patch touch this file
1 #
2 # Makefile for the Fast Light Tool Kit (FLTK) documentation.
3 #
4 # Copyright 1998-2024 by Bill Spitzak and others.
5 #
6 # This library is free software. Distribution and use rights are outlined in
7 # the file "COPYING" which should have been included with this file. If this
8 # file is missing or damaged, see the license at:
9 #
10 # https://www.fltk.org/COPYING.php
11 #
12 # Please see the following page on how to report bugs and issues:
13 #
14 # https://www.fltk.org/bugs.php
15 #
16
17 # Get configuration stuff...
18 include ../makeinclude
19
20 # make sure that all docs are (re-)created independent of missing deps
21 .PHONY: pdf html refman.pdf
22
23 SRC_DOCDIR = ./src
24
25 # These are the HTML "source" files...
26 HTMLFILES = \
27 $(SRC_DOCDIR)/index.dox \
28 $(SRC_DOCDIR)/preface.dox \
29 $(SRC_DOCDIR)/intro.dox \
30 $(SRC_DOCDIR)/basics.dox \
31 $(SRC_DOCDIR)/common.dox \
32 $(SRC_DOCDIR)/coordinates.dox \
33 $(SRC_DOCDIR)/resize.dox \
34 $(SRC_DOCDIR)/editor.dox \
35 $(SRC_DOCDIR)/drawing.dox \
36 $(SRC_DOCDIR)/events.dox \
37 $(SRC_DOCDIR)/subclassing.dox \
38 $(SRC_DOCDIR)/opengl.dox \
39 $(SRC_DOCDIR)/fltk-options.dox \
40 $(SRC_DOCDIR)/advanced.dox \
41 $(SRC_DOCDIR)/unicode.dox \
42 $(SRC_DOCDIR)/enumerations.dox \
43 $(SRC_DOCDIR)/glut.dox \
44 $(SRC_DOCDIR)/forms.dox \
45 $(SRC_DOCDIR)/osissues.dox \
46 $(SRC_DOCDIR)/migration_1_4.dox \
47 $(SRC_DOCDIR)/development.dox \
48 $(SRC_DOCDIR)/license.dox \
49 $(SRC_DOCDIR)/examples.dox \
50 $(SRC_DOCDIR)/faq.dox \
51 $(SRC_DOCDIR)/Fl_Terminal.dox
52
53 MANPAGES = $(SRC_DOCDIR)/fltk.$(CAT3EXT) $(SRC_DOCDIR)/fltk-config.$(CAT1EXT) \
54 $(SRC_DOCDIR)/fluid.$(CAT1EXT) $(SRC_DOCDIR)/blocks.$(CAT6EXT) \
55 $(SRC_DOCDIR)/checkers.$(CAT6EXT) $(SRC_DOCDIR)/sudoku.$(CAT6EXT) \
56 $(SRC_DOCDIR)/fltk-options.$(CAT1EXT)
57
58 # Get FLTK's Git Revision either from Git /or/ from fltk_git_rev.dat (Issue #499)
59 #
60 # Note: this may fail (return "unknown") if the sources were downloaded
61 # from GitHub as a "release" (zip) archive. This is not supported.
62
63 # Test/debug only: should be commented out unless used (see: debug_git_rev)
64 # GIT_REV_FROM_GIT := "$$(git rev-parse HEAD 2>/dev/null)"
65 # GIT_REV_FROM_FILE := "$$(cat ../fltk_git_rev.dat 2>/dev/null)"
66
67 FLTK_GIT_REVISION := "`( (git rev-parse HEAD || cat ../fltk_git_rev.dat;) || echo 'unknown'; ) 2>/dev/null`"
68
•69 export DEB_DATE := $(shell cd .. && dpkg-parsechangelog -S Date)
70
71 all: $(MANPAGES)
72
73 # Use `make docs' to create all docs for distribution files.
74 # You need installed versions of Doxygen and LaTeX for this.
75
76 docs: all html pdf
77
78 # Synonyms for docs:
79
80 alldocs: docs
81 dist: docs
82
83 debug_git_rev:
84 # echo "GIT_REV_FROM_GIT = $(GIT_REV_FROM_GIT)"
85 # echo "GIT_REV_FROM_FILE = $(GIT_REV_FROM_FILE)"
86 echo "FLTK_GIT_REVISION = $(FLTK_GIT_REVISION)"
87
88 clean:
89 $(RM) Doxyfile Doxybook
90 $(RM) copyright.dox generated.dox make_pdf
91 $(RM) fltk.pdf refman.pdf src/fltk-title.tex src/fltk-book.tex.in src/fltk-book.tex
92 $(RMDIR) html latex
93 $(RM) *~ *.bck *.bak *.log
94 $(RM) $(MANPAGES) $(SRC_DOCDIR)/*.0
95
96 depend:
97
98 install: $(MANPAGES)
99 echo "Installing documentation files in $(DESTDIR)$(docdir) ..."
•100 -$(INSTALL_DIR) "$(DESTDIR)$(docdir)/HTML"
101 if test -f html/index.html ; then \
102 for file in html/* ; do \
•103 $(INSTALL_DATA) $$file "$(DESTDIR)$(docdir)/HTML"; \
104 done \
105 fi
106 if test -f fltk.pdf ; then \
107 echo "Installing fltk.pdf in $(DESTDIR)$(docdir) ..."; \
108 $(INSTALL_DATA) fltk.pdf "$(DESTDIR)$(docdir)"; \
109 fi
110 echo "Installing man pages in $(DESTDIR)$(mandir) ..."
111 -$(INSTALL_DIR) "$(DESTDIR)$(mandir)/cat1"
112 $(INSTALL_MAN) $(SRC_DOCDIR)/fluid.$(CAT1EXT) "$(DESTDIR)$(mandir)/cat1"
113 $(INSTALL_MAN) $(SRC_DOCDIR)/fltk-config.$(CAT1EXT) "$(DESTDIR)$(mandir)/cat1"
114 $(INSTALL_MAN) $(SRC_DOCDIR)/fltk-options.$(CAT1EXT) "$(DESTDIR)$(mandir)/cat1"
115 -$(INSTALL_DIR) "$(DESTDIR)$(mandir)/cat3"
116 $(INSTALL_MAN) $(SRC_DOCDIR)/fltk.$(CAT3EXT) "$(DESTDIR)$(mandir)/cat3"
117 -$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
118 $(INSTALL_MAN) $(SRC_DOCDIR)/fluid.man "$(DESTDIR)$(mandir)/man1/fluid.1"
119 $(INSTALL_MAN) $(SRC_DOCDIR)/fltk-config.man "$(DESTDIR)$(mandir)/man1/fltk-config.1"
120 $(INSTALL_MAN) $(SRC_DOCDIR)/fltk-options.man "$(DESTDIR)$(mandir)/man1/fltk-options.1"
121 -$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man3"
122 $(INSTALL_MAN) $(SRC_DOCDIR)/fltk.man "$(DESTDIR)$(mandir)/man3/fltk.3"
123
124 install-linux install-osx:
125 -$(INSTALL_DIR) "$(DESTDIR)$(mandir)/cat6"
126 $(INSTALL_MAN) $(SRC_DOCDIR)/blocks.$(CAT6EXT) "$(DESTDIR)$(mandir)/cat6"
127 $(INSTALL_MAN) $(SRC_DOCDIR)/checkers.$(CAT6EXT) "$(DESTDIR)$(mandir)/cat6"
128 $(INSTALL_MAN) $(SRC_DOCDIR)/sudoku.$(CAT6EXT) "$(DESTDIR)$(mandir)/cat6"
129 -$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man6"
130 $(INSTALL_MAN) $(SRC_DOCDIR)/blocks.man "$(DESTDIR)$(mandir)/man6/blocks.6"
131 $(INSTALL_MAN) $(SRC_DOCDIR)/checkers.man "$(DESTDIR)$(mandir)/man6/checkers.6"
132 $(INSTALL_MAN) $(SRC_DOCDIR)/sudoku.man "$(DESTDIR)$(mandir)/man6/sudoku.6"
133
134
135 uninstall:
136 $(RMDIR) "$(DESTDIR)$(docdir)"
137 $(RM) "$(DESTDIR)$(mandir)/cat1/fluid.$(CAT1EXT)"
138 $(RM) "$(DESTDIR)$(mandir)/man1/fluid.1"
139 $(RM) "$(DESTDIR)$(mandir)/cat1/fltk-config.$(CAT1EXT)"
140 $(RM) "$(DESTDIR)$(mandir)/man1/fltk-config.1"
141 $(RM) "$(DESTDIR)$(mandir)/cat1/fltk-options.$(CAT1EXT)"
142 $(RM) "$(DESTDIR)$(mandir)/man1/fltk-options.1"
143 $(RM) "$(DESTDIR)$(mandir)/cat3/fltk.$(CAT3EXT)"
144 $(RM) "$(DESTDIR)$(mandir)/man3/fltk.3"
145
146 uninstall-linux uninstall-osx:
147 $(RM) "$(DESTDIR)$(mandir)/cat6/blocks.$(CAT6EXT)"
148 $(RM) "$(DESTDIR)$(mandir)/cat6/checkers.$(CAT6EXT)"
149 $(RM) "$(DESTDIR)$(mandir)/cat6/sudoku.$(CAT6EXT)"
150 $(RM) "$(DESTDIR)$(mandir)/man6/blocks.6"
151 $(RM) "$(DESTDIR)$(mandir)/man6/checkers.6"
152 $(RM) "$(DESTDIR)$(mandir)/man6/sudoku.6"
153
154 # The documentation is generated using doxygen. There are two control files
155 # for doxygen: Doxyfile for html documentation and Doxybook for pdf docs.
156 # Both files are generated from the common source file Doxyfile.in.
157 # Note that Doxyfile.in is shared with CMake to configure these files.
158
159 # Note: There's no way to enable the "Driver Documentation" via configure+make,
160 # please use CMake 'FLTK_INCLUDE_DRIVER_DOCS' instead.
161 # Alternatively (if you really need it) edit this Makefile and
162 # replace the two lines below containing "@DRIVER_DOCS@" to read:
163 # -e's, @DRIVER_DOCS@, DriverDev,' \
164 # (w/o leading '#') to enable the "Driver Documentation" section.
165 # Please take care of copying tabs and spaces literally.
166 # Note: There's no intention to enable this via configure option (use CMake).
167
168 Doxyfile: Doxyfile.in generated.dox copyright.dox
169 echo "Generating Doxyfile ..."
170 ./convert_doxyfile "$(DOXYDOC)" $< $@ Doxyfile_error.log
171 sed -e's,@FLTK_VERSION@,$(FLTK_VERSION),' \
172 -e's,@GENERATE_HTML@,YES,' \
173 -e's,@GENERATE_LATEX@,NO,' \
174 -e's, @LATEX_HEADER@,,' \
175 -e's, @DRIVER_DOCS@,,' \
176 -e's,@CMAKE_CURRENT_SOURCE_DIR@,.,' \
177 -e's,@CMAKE_CURRENT_BINARY_DIR@,,' \
178 -e's,@FLTK_SOURCE_DIR@,..,' \
179 -i $@
180
181 Doxybook: Doxyfile.in generated.dox copyright.dox
182 echo "Generating Doxybook ..."
183 ./convert_doxyfile "$(DOXYDOC)" $< $@ Doxybook_error.log
184 sed -e's,@FLTK_VERSION@,$(FLTK_VERSION),' \
185 -e's,@GENERATE_HTML@,NO,' \
186 -e's,@GENERATE_LATEX@,YES,' \
187 -e's,@LATEX_HEADER@,src/fltk-book.tex,' \
188 -e's, @DRIVER_DOCS@,,' \
189 -e's,@CMAKE_CURRENT_SOURCE_DIR@,.,' \
190 -e's,@CMAKE_CURRENT_BINARY_DIR@,,' \
191 -e's,@FLTK_SOURCE_DIR@,..,' \
192 -i $@
193
194 # The HTML files are generated using doxygen, and this needs
195 # an installed doxygen version and may take some time, so this target
196 # is not made by default.
197 # Use `make html' or `make docs' to create the html docs.
198
199 html: $(HTMLFILES) Doxyfile
200 echo "Generating HTML documentation..."
201 -$(RMDIR) html
202 -$(INSTALL_DIR) html
203 -"$(DOXYDOC)"
204 if test "x$(DOXYDOC)" = "x" ; then \
205 echo "Sorry - doxygen not found. Please install doxygen and run configure."; \
206 fi
207
208 # The PDF documentation (fltk.pdf) is generated using doxygen and LaTeX, and
209 # this needs installed Doxygen and LaTeX programs and may take some time, so
210 # this target is not made by default.
211 # Use `make pdf' or `make docs' to create the PDF docs.
212
213 pdf: refman.pdf
214 cp -f latex/refman.pdf fltk.pdf
215
216 refman.pdf: $(HTMLFILES) Doxybook src/fltk-book.tex make_pdf
217 -$(RMDIR) latex
218 echo "Generating PDF documentation ..."
219 "$(DOXYDOC)" Doxybook
220 ./make_pdf
•221 MD5=`(echo $(DEB_DATE) && du -b $@) | md5sum | cut -c -32` && \
222 sed -i "s|^/ID \\[\\(<[0-9A-F]\\{32\\}>\\) \\1]$$|/ID [<$$MD5> <$$MD5>]|" $@
223
224 make_pdf: make_pdf.in
225 echo "Generating $@ ..."
226 PDF_DATE=`date +D:%Y%m%d%H%M%S`; \
227 sed -e"s/@PDF_DATE@/$$PDF_DATE/g" \
228 < $< > $@
229 chmod +x $@
230
231 src/fltk-title.tex: src/fltk-title.tex.in
232 echo "Generating $@ ..."
233 TODAY=`LC_ALL=C date '+%B %e, %Y'`; \
234 sed -e"s/@FLTK_GIT_REVISION@/$(FLTK_GIT_REVISION)/g" \
235 -e"s/@TODAY@/$$TODAY/g" \
236 < $< > $@
237
238 src/fltk-book.tex.in: src/fltk-title.tex
239 echo "Generating $@ ..."
240 ./make_header "$(DOXYDOC)" $< $@
241
242 src/fltk-book.tex: src/fltk-book.tex.in
243 echo "Generating $@ ..."
244 DOXY_VERSION=`"$(DOXYDOC)" --version|cut -f1 -d' '`; \
•245 YEAR=`date -ud'$(DEB_DATE)' +%Y`; \
246 TODAY=`LC_ALL=C date -ud'$(DEB_DATE)' +'%B %e, %Y'`; \
247 sed -e"s/@YEAR@/$$YEAR/g" \
248 -e"s/@FLTK_VERSION@/$(FLTK_VERSION)/g" \
249 -e"s/@DOXY_VERSION@/$$DOXY_VERSION/g" \
•250 -e"s/@TODAY@/$$TODAY/g" \
251 < $< > $@
252
253 generated.dox: generated.dox.in
254 echo "Generating $@ ..."
255 CURRENT_DATE=`LC_ALL=C date "+%b %d, %Y"`; \
256 DOXYGEN_VERSION_SHORT=`"$(DOXYDOC)" --version|cut -f1 -d' '`; \
257 sed -e"s/@CURRENT_DATE@/$$CURRENT_DATE/g" \
258 -e"s/@FLTK_GIT_REVISION@/$(FLTK_GIT_REVISION)/g" \
259 -e"s/@DOXYGEN_VERSION_SHORT@/$$DOXYGEN_VERSION_SHORT/g" \
260 < $< > $@
261
262 copyright.dox: copyright.dox.in
263 echo "Generating $@ ..."
264 YEAR=`date +%Y`; \
265 sed -e"s/@YEAR@/$$YEAR/g" \
266 < $< > $@