Android/BluetoothServerPort: add missing "@Override" annotations
[xcsoar.git] / build / manual.mk
blobd73d44ae1e9f226158db10b8a154cfae4e403270
1 MANUAL_OUTPUT_DIR = $(OUT)/manual
2 TEX_INCLUDES = $(wildcard $(DOC)/manual/*.tex) $(wildcard $(DOC)/manual/*.sty)
3 TEX_FILES_EN = $(wildcard $(DOC)/manual/en/*.tex)
4 TEX_INCLUDES_EN = $(wildcard $(DOC)/manual/en/*.sty)
5 FIGURES_EN = $(DOC)/manual/en/figures/*.png $(DOC)/manual/en/figures/*.pdf
7 SVG_ICON_LIST = \
8 alt2_landable_airport \
9 alt2_landable_field \
10 alt2_marginal_airport \
11 alt2_marginal_field \
12 alt_landable_airport \
13 alt_landable_field \
14 alt_marginal_airport \
15 alt_marginal_field \
16 alt_reachable_airport \
17 alt_reachable_field \
18 winpilot_landable \
19 winpilot_marginal \
20 winpilot_reachable \
21 map_turnpoint \
22 map_mountain_top \
23 map_obstacle \
24 map_pass \
25 map_power_plant \
26 map_tower \
27 map_tunnel \
28 map_weather_station \
29 map_bridge \
30 mode_abort \
31 mode_climb \
32 mode_cruise \
33 mode_finalglide \
34 map_flag \
35 gps_acquiring \
36 gps_disconnected
37 SVG_ICONS = $(patsubst %,$(MANUAL_OUTPUT_DIR)/icons/%.pdf,$(SVG_ICON_LIST))
39 SVG_FIGURES_SHARED = $(wildcard $(DOC)/manual/figures/*.svg)
40 SVG_FIGURES = $(patsubst $(DOC)/manual/figures/%.svg,$(MANUAL_OUTPUT_DIR)/figures/%.pdf,$(SVG_FIGURES_SHARED))
42 SVG_GRAPHICS_DATA = $(wildcard $(topdir)/Data/graphics/*.svg)
43 SVG_GRAPHICS = $(patsubst $(topdir)/Data/graphics/%.svg,$(MANUAL_OUTPUT_DIR)/graphics/%.pdf,$(SVG_GRAPHICS_DATA))
45 SVG_LOGOS_DATA = $(wildcard $(topdir)/Data/graphics/logo*.svg)
46 SVG_LOGOS = $(patsubst $(topdir)/Data/graphics/%.svg,$(MANUAL_OUTPUT_DIR)/graphics/%.png,$(SVG_LOGOS_DATA))
48 TEX_INCLUDES_BLITZ_DE = $(wildcard $(DOC)/manual/de/Blitz/*.sty)
49 FIGURES_BLITZ_DE = $(DOC)/manual/de/Blitz/Bilder/*.png $(DOC)/manual/de/Blitz/Bilder/*.jpg
51 TEX_FILES_DE = $(wildcard $(DOC)/manual/de/*.tex)
52 TEX_INCLUDES_DE = $(wildcard $(DOC)/manual/de/*.sty)
53 FIGURES_DE = $(DOC)/manual/de/figures/*.png
55 TEX_FILES_FR = $(wildcard $(DOC)/manual/fr/*.tex)
56 TEX_INCLUDES_FR = $(wildcard $(DOC)/manual/fr/*.sty)
57 FIGURES_FR = $(DOC)/manual/fr/figures/*.png
59 TEX_VARS = TEXINPUTS="$(<D):$(DOC)/manual:$(MANUAL_OUTPUT_DIR):.:$(DOC)/manual/en:"
60 TEX_FLAGS = -halt-on-error -interaction=nonstopmode
61 TEX_RUN = $(TEX_VARS) pdflatex $(TEX_FLAGS) -output-directory $(@D)
62 XETEX_RUN = $(TEX_VARS) xetex $(TEX_FLAGS) -no-pdf -output-directory $(@D)
64 MANUAL_PDF = \
65 $(MANUAL_OUTPUT_DIR)/XCSoar-manual.pdf \
66 $(MANUAL_OUTPUT_DIR)/XCSoar-developer-manual.pdf \
67 $(MANUAL_OUTPUT_DIR)/XCSoar-Blitzeinstieg.pdf \
68 $(MANUAL_OUTPUT_DIR)/XCSoar-manual-de.pdf \
69 $(MANUAL_OUTPUT_DIR)/XCSoar-Prise-en-main.pdf \
70 $(MANUAL_OUTPUT_DIR)/XCSoar-manual-fr.pdf
72 .PHONY: manual
73 manual: $(MANUAL_PDF)
75 Handbuch: \
76 $(MANUAL_OUTPUT_DIR)/XCSoar-manual-de.pdf
78 # Generate a redistributable ZIP file that allows manual editors
79 # without the full XCSoar development chain to compile the XCSoar
80 # manual. It contains all generated files.
81 manual-dev-dist: $(MANUAL_OUTPUT_DIR)/XCSoar-manual-dev.zip
83 $(MANUAL_OUTPUT_DIR)/XCSoar-manual.pdf: $(DOC)/manual/en/XCSoar-manual.tex \
84 $(TEX_FILES_EN) $(TEX_INCLUDES_EN) $(TEX_INCLUDES) \
85 $(FIGURES_EN) $(SVG_ICONS) $(SVG_FIGURES) $(SVG_GRAPHICS) $(SVG_LOGOS) | $(MANUAL_OUTPUT_DIR)/dirstamp
86 # run TeX twice to make sure that all references are resolved
87 $(TEX_RUN) $<
88 $(TEX_RUN) $<
90 # Generate a HTML version of the manual with latex2html
91 $(MANUAL_OUTPUT_DIR)/html/index.html: $(DOC)/manual/en/XCSoar-manual.tex \
92 $(TEX_FILES_EN) $(TEX_INCLUDES_EN) $(TEX_INCLUDES) \
93 $(FIGURES_EN) $(SVG_ICONS) $(SVG_FIGURES) $(SVG_GRAPHICS) $(SVG_LOGOS) | $(MANUAL_OUTPUT_DIR)/html/dirstamp
94 $(TEX_VARS) latex2html -dir $(@D) $<
96 $(MANUAL_OUTPUT_DIR)/XCSoar-developer-manual.pdf: $(DOC)/manual/en/XCSoar-developer-manual.tex $(TEX_INCLUDES_EN) $(TEX_INCLUDES) \
97 $(FIGURES_EN) $(SVG_ICONS) $(SVG_FIGURES) $(SVG_GRAPHICS) $(SVG_LOGOS) | $(MANUAL_OUTPUT_DIR)/dirstamp
98 # run TeX twice to make sure that all references are resolved
99 $(TEX_RUN) $<
100 $(TEX_RUN) $<
102 $(MANUAL_OUTPUT_DIR)/XCSoar-Blitzeinstieg.pdf: $(DOC)/manual/de/Blitz/XCSoar-Blitzeinstieg.tex $(DOC)/manual/de/Blitz/Blitzeinstieg.tex \
103 $(TEX_INCLUDES_BLITZ_DE) $(FIGURES_BLITZ_DE) $(SVG_ICONS) $(SVG_FIGURES) $(SVG_GRAPHICS) $(SVG_LOGOS) | $(MANUAL_OUTPUT_DIR)/dirstamp
104 # run TeX twice to make sure that all references are resolved
105 $(TEX_RUN) $<
106 $(TEX_RUN) $<
108 $(MANUAL_OUTPUT_DIR)/XCSoar-manual-de.pdf: $(DOC)/manual/de/XCSoar-manual-de.tex \
109 $(TEX_FILES_DE) $(TEX_INCLUDES_DE) $(TEX_INCLUDES) \
110 $(FIGURES_DE) $(SVG_ICONS) $(SVG_FIGURES) $(SVG_GRAPHICS) $(SVG_LOGOS) | $(MANUAL_OUTPUT_DIR)/dirstamp
111 # run TeX twice to make sure that all references are resolved
112 $(TEX_RUN) $<
113 $(TEX_RUN) $<
115 $(MANUAL_OUTPUT_DIR)/XCSoar-Prise-en-main.pdf: $(DOC)/manual/fr/XCSoar-Prise-en-main.tex $(TEX_INCLUDES_FR) $(TEX_INCLUDES) \
116 $(FIGURES_FR) $(SVG_ICONS) $(SVG_FIGURES) $(SVG_GRAPHICS) $(SVG_LOGOS) | $(MANUAL_OUTPUT_DIR)/dirstamp
117 # run TeX twice to make sure that all references are resolved
118 $(TEX_RUN) $<
119 $(TEX_RUN) $<
121 $(MANUAL_OUTPUT_DIR)/XCSoar-manual-fr.pdf: $(DOC)/manual/fr/XCSoar-manual-fr.tex \
122 $(TEX_FILES_FR) $(TEX_INCLUDES_FR) $(TEX_INCLUDES) \
123 $(FIGURES_FR) $(SVG_ICONS) $(SVG_FIGURES) $(SVG_GRAPHICS) $(SVG_LOGOS)| $(MANUAL_OUTPUT_DIR)/dirstamp
124 # run TeX twice to make sure that all references are resolved
125 $(TEX_RUN) $<
126 $(TEX_RUN) $<
128 $(SVG_ICONS): $(MANUAL_OUTPUT_DIR)/icons/%.pdf: $(topdir)/Data/icons/%.svg | $(MANUAL_OUTPUT_DIR)/icons/dirstamp
129 rsvg-convert -a -f pdf -w 32 $< -o $@
131 $(SVG_FIGURES): $(MANUAL_OUTPUT_DIR)/figures/%.pdf: $(topdir)/doc/manual/figures/%.svg | $(MANUAL_OUTPUT_DIR)/figures/dirstamp
132 rsvg-convert -a -f pdf $< -o $@
134 $(SVG_GRAPHICS): $(MANUAL_OUTPUT_DIR)/graphics/%.pdf: $(topdir)/Data/graphics/%.svg | $(MANUAL_OUTPUT_DIR)/graphics/dirstamp
135 rsvg-convert -a -f pdf $< -o $@
137 $(SVG_LOGOS): $(MANUAL_OUTPUT_DIR)/graphics/%.png: $(topdir)/Data/graphics/%.svg | $(MANUAL_OUTPUT_DIR)/graphics/dirstamp
138 rsvg-convert -a -z 1.5 -f png $< -o $@
140 $(MANUAL_OUTPUT_DIR)/XCSoar-manual-dev.zip: T=$(MANUAL_OUTPUT_DIR)/XCSoar-manual-dev
141 $(MANUAL_OUTPUT_DIR)/XCSoar-manual-dev.zip: VERSION.txt \
142 $(TEX_FILES_EN) $(TEX_INCLUDES_EN) $(TEX_INCLUDES) \
143 $(FIGURES_EN) $(SVG_ICONS) $(SVG_FIGURES) $(SVG_GRAPHICS) $(SVG_LOGOS) \
144 $(TEX_FILES_FR) $(TEX_INCLUDES_FR) $(FIGURES_FR)
145 rm -rf $(T)
146 mkdir -p $(T)/figures $(T)/en/figures
147 echo $(GIT_COMMIT_ID) >$(T)/git.txt
148 cp VERSION.txt $(TEX_INCLUDES) $(T)/.
149 cp $(SVG_FIGURES) $(SVG_LOGOS) $(T)/figures/.
150 cp -r $(MANUAL_OUTPUT_DIR)/graphics $(MANUAL_OUTPUT_DIR)/icons $(T)/.
151 # Incl. the English original
152 cp $(TEX_FILES_EN) $(TEX_INCLUDES_EN) $(T)/en/.
153 cp $(FIGURES_EN) $(T)/en/figures/.
154 # Incl. the French translation
155 mkdir -p $(T)/fr/figures
156 cp $(TEX_FILES_FR) $(TEX_INCLUDES_FR) $(T)/fr/.
157 cp $(FIGURES_FR) $(T)/fr/figures/.
158 # Incl. both German translation
159 mkdir -p $(T)/de/figures $(T)/de/Blitz/Bilder
160 cp $(DOC)/manual/de/Blitz/*.tex $(T)/de/Blitz/.
161 cp $(TEX_INCLUDES_BLITZ_DE) $(T)/de/Blitz/.
162 cp $(FIGURES_BLITZ_DE) $(T)/de/Blitz/Bilder/.
163 cp $(TEX_FILES_DE) $(TEX_INCLUDES_DE) $(T)/de/.
164 cp $(FIGURES_DE) $(T)/de/figures/.
165 # Create an example bash to generate the manuals
166 echo "#!/bin/bash\n\n# This is an example how the manuals get generated\n\nmkdir -p output" > $(T)/generate_manuals.sh
167 make manual -ns|grep -v mkdir|grep -v touch|sed s#doc/manual#.#g|sed s#output/manual#output#g >> $(T)/generate_manuals.sh
168 chmod +x $(T)/generate_manuals.sh
169 # Copy an example bat file to generate the manuals with MikTex on Windows
170 cp $(DOC)/manual/generate_manuals.bat $(T)/.
171 cd $(@D) && zip -r XCSoar-manual-dev.zip XCSoar-manual-dev