doc/automake.mk (html-local): Add dependency on the directory doc/pspp.html
[pspp] / doc / automake.mk
1 ## PSPP - a program for statistical analysis.
2 ## Copyright (C) 2019, 2020 Free Software Foundation, Inc.
3 ##
4 ## This program is free software: you can redistribute it and/or modify
5 ## it under the terms of the GNU General Public License as published by
6 ## the Free Software Foundation, either version 3 of the License, or
7 ## (at your option) any later version.
8 ##
9 ## This program is distributed in the hope that it will be useful,
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 ## GNU General Public License for more details.
13 ##
14 ## You should have received a copy of the GNU General Public License
15 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 ## Process this file with automake to produce Makefile.in  -*- makefile -*-
18
19 info_TEXINFOS = doc/pspp.texi doc/pspp-dev.texi
20
21 doc_pspp_TEXINFOS = doc/version.texi \
22         doc/bugs.texi \
23         doc/command-index.texi \
24         doc/concept-index.texi \
25         doc/data-io.texi \
26         doc/data-selection.texi \
27         doc/expressions.texi \
28         doc/files.texi \
29         doc/combining.texi \
30         doc/flow-control.texi \
31         doc/function-index.texi \
32         doc/installing.texi \
33         doc/introduction.texi \
34         doc/invoking.texi \
35         doc/language.texi \
36         doc/license.texi \
37         doc/pspp-convert.texi \
38         doc/pspp-output.texi \
39         doc/pspp-dump-sav.texi \
40         doc/ni.texi \
41         doc/not-implemented.texi \
42         doc/statistics.texi \
43         doc/transformation.texi \
44         doc/tutorial.texi \
45         doc/tut.texi \
46         doc/regression.texi \
47         doc/utilities.texi \
48         doc/variables.texi \
49         doc/fdl.texi
50
51 doc_pspp_dev_TEXINFOS = doc/version-dev.texi \
52         doc/dev/intro.texi \
53         doc/dev/concepts.texi \
54         doc/dev/syntax.texi \
55         doc/dev/data.texi \
56         doc/dev/i18n.texi \
57         doc/dev/output.texi \
58         doc/dev/system-file-format.texi \
59         doc/dev/pc+-file-format.texi \
60         doc/dev/portable-file-format.texi \
61         doc/dev/spv-file-format.texi \
62         doc/dev/tlo-file-format.texi \
63         doc/dev/encrypted-file-wrappers.texi \
64         doc/dev/q2c.texi
65
66 dist_man_MANS += doc/pspp.1 \
67                  doc/psppire.1
68
69 EXTRA_DIST += doc/get-commands.pl \
70               doc/help-pages-list \
71               doc/prepdoc.sh
72
73 $(srcdir)/doc/ni.texi: $(top_srcdir)/src/language/command.def doc/get-commands.pl
74         $(AM_V_GEN)$(PERL) $(top_srcdir)/doc/get-commands.pl $(top_srcdir)/src/language/command.def > $@
75
76 $(srcdir)/doc/tut.texi:
77         $(AM_V_GEN)echo "@set example-dir $(examplesdir)" > $@
78
79
80 doc/pspp.xml: doc/pspp.texi $(doc_pspp_TEXINFOS) doc/help-pages-list
81 if BROKEN_DOCBOOK_XML
82         touch $@
83 else
84         $(AM_V_GEN)$(MAKEINFO) --docbook $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
85                 -I doc -I $(srcdir)/doc $< -o $@
86 endif
87
88 docbookdir = $(docdir)
89 dist_docbook_DATA = doc/pspp.xml
90
91
92 CLEANFILES += pspp-dev.dvi $(docbook_DATA) doc/pspp.info* doc/pspp.xml
93
94
95 doc: $(INFO_DEPS) $(DVIS) $(PDFS) $(PSS) $(HTMLS) $(dist_docbook_DATA)
96 PHONY += doc
97
98 doc/help-pages-list: $(UI_FILES)
99          $(AM_V_GEN)cat $^ | grep '"help[-_]page"' | \
100    $(SED) -e 's% *<property name="help[-_]page">\([^<]*\)</property>%//*[@id='"'"'\1'"'"']%' \
101         -e 's%#%'"'"']/*[@id='"'"'%g' > $@,tmp
102         test -s $@,tmp
103         mv $@,tmp $@
104
105 EXTRA_DIST += \
106         doc/help-pages-list \
107         doc/pspp-manual.css
108
109 am__TEXINFO_TEX_DIR=:$(top_srcdir)/doc:$(top_builddir)/doc
110
111 ################# Example programs ##############################
112
113 FIGURE_SYNTAX = \
114  doc/pspp-figures/aggregate.sps \
115  doc/pspp-figures/autorecode.sps \
116  doc/pspp-figures/chisquare.sps \
117  doc/pspp-figures/compute.sps \
118  doc/pspp-figures/count.sps \
119  doc/pspp-figures/descriptives.sps \
120  doc/pspp-figures/flip.sps \
121  doc/pspp-figures/frequencies.sps \
122  doc/pspp-figures/means.sps \
123  doc/pspp-figures/one-sample-t.sps \
124  doc/pspp-figures/independent-samples-t.sps \
125  doc/pspp-figures/reliability.sps \
126  doc/pspp-figures/select-if.sps \
127  doc/pspp-figures/sort-cases.sps \
128  doc/pspp-figures/split.sps \
129  doc/pspp-figures/temporary.sps \
130  doc/pspp-figures/tutorial1.sps \
131  doc/pspp-figures/tutorial2.sps \
132  doc/pspp-figures/tutorial3.sps \
133  doc/pspp-figures/tutorial4.sps \
134  doc/pspp-figures/tutorial5.sps \
135  doc/pspp-figures/tutorial6.sps \
136  doc/pspp-figures/tutorial7.sps \
137  doc/pspp-figures/weight.sps
138
139
140 EXTRA_DIST += $(FIGURE_SYNTAX)
141
142 FIGURE_SPVS = $(FIGURE_SYNTAX:.sps=.spv) \
143         doc/pspp-figures/tutorial2a.spv \
144         doc/pspp-figures/tutorial2b.spv \
145         doc/pspp-figures/tutorial5a.spv \
146         doc/pspp-figures/tutorial5b.spv \
147         doc/pspp-figures/tutorial7a.spv \
148         doc/pspp-figures/tutorial7b.spv
149 FIGURE_TXTS = $(FIGURE_SPVS:.spv=.txt)
150 FIGURE_TEXIS = $(FIGURE_TXTS:.txt=.texi)
151 FIGURE_HTMLS = $(FIGURE_SPVS:.spv=.html)
152 FIGURE_PDFS = $(FIGURE_SPVS:.spv=.pdf)
153
154 figure-spvs: $(FIGURE_SPVS)
155 figure-txts: $(FIGURE_TXTS)
156 figure-texis: $(FIGURE_TEXIS)
157 figure-htmls: $(FIGURE_HTMLS)
158 figure-pdfs: $(FIGURE_PDFS)
159 PHONY += figure-spv figure-txts figure-texis figure-htmls figure-pdfs
160
161 $(top_builddir)/doc/pspp.info:  $(FIGURE_TEXIS)
162 $(top_builddir)/doc/pspp.ps:    $(FIGURE_TEXIS)
163 $(top_builddir)/doc/pspp.dvi:   $(FIGURE_TEXIS)
164 $(top_builddir)/doc/pspp.html:  $(FIGURE_HTMLS)
165 $(top_builddir)/doc/pspp.pdf:   $(FIGURE_TEXIS)
166 $(top_builddir)/doc/pspp.xml:   $(FIGURE_TEXIS)
167
168 CLEANFILES += $(FIGURE_TXTS) $(FIGURE_SPVS) $(FIGURE_TEXIS) $(FIGURE_HTMLS)
169 SUFFIXES += .sps .spv .txt .html .texi .pdf
170
171 # Use pspp to process a syntax file into an output file.
172 if cross_compiling
173 pspp = native/src/ui/terminal/pspp
174 pspp_output = native/utilities/pspp-output
175
176 native/Makefile:
177         $(MKDIR_P) native
178         (cd native && $(top_srcdir)/configure --without-gui)
179
180 native/gl/libgl.la: native/Makefile
181         (cd native && flock --verbose $(top_builddir)/native-lock $(MAKE) gl/libgl.la)
182
183 $(pspp): native/gl/libgl.la
184         (cd native && flock --verbose $(top_builddir)/native-lock $(MAKE) src/ui/terminal/pspp)
185
186 $(pspp_output): native/gl/libgl.la
187         (cd native && flock --verbose $(top_builddir)/native-lock $(MAKE) utilities/pspp-output)
188 else
189 pspp = src/ui/terminal/pspp$(EXEEXT)
190 pspp_output = utilities/pspp-output$(EXEEXT)
191 endif
192
193 $(FIGURE_SPVS): $(pspp)
194 .sps.spv:
195         $(AM_V_GEN)(cd $(top_srcdir)/examples \
196          && $(abs_top_builddir)/$(pspp) ../doc/pspp-figures/$(<F) -o - -O format=spv) > $@.tmp
197         $(AM_V_at)mv $@.tmp $@
198
199 # In some cases, the tutorial only wants some parts of the output.
200 convert = $(AM_V_GEN)$(pspp_output) convert $< $@
201 doc/pspp-figures/tutorial2a.spv: doc/pspp-figures/tutorial2.spv $(pspp_output)
202         $(convert) --command='Descriptives'
203 doc/pspp-figures/tutorial2b.spv: doc/pspp-figures/tutorial2.spv $(pspp_output)
204         $(convert) --label='Extreme Values'
205 doc/pspp-figures/tutorial5a.spv: doc/pspp-figures/tutorial5.spv $(pspp_output)
206         $(convert) --commands=examine --nth-command=1 --labels=descriptives
207 doc/pspp-figures/tutorial5b.spv: doc/pspp-figures/tutorial5.spv $(pspp_output)
208         $(convert) --commands=examine --nth-command=2 --labels=descriptives
209 doc/pspp-figures/tutorial7a.spv: doc/pspp-figures/tutorial7.spv $(pspp_output)
210         $(convert) --commands=regression --nth-command=1 --subtypes=coefficients
211 doc/pspp-figures/tutorial7b.spv: doc/pspp-figures/tutorial7.spv $(pspp_output)
212         $(convert) --commands=regression --nth-command=2 --subtypes=coefficients
213
214 # Convert an output file into a text file or HTML file.
215 $(FIGURE_TXTS) $(FIGURE_HTMLS): $(pspp_output)
216 .spv.txt:
217         $(convert)
218 .spv.pdf:
219         $(convert) -O left-margin=0pt -O right-margin=0pt -O top-margin=0pt -O bottom-margin=0pt -O paper-size=6x20in -O font-size=12000 --table-look=$(HOME)/pspp/spss15/Looks/report.tlo
220 .spv.html:
221         $(convert) -O format=html -O bare=true
222
223 # Convert a text file into a Texinfo file.
224 .txt.texi:
225         $(AM_V_GEN)$(SED) -e 's/@/@@/g' $< > $@
226
227 AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) --css-ref=pspp-manual.css
228 # Adjust the path for screenshot images.
229 # But make sure these operations are idempotent.
230 html-local: doc/pspp.html
231         test -d doc/pspp.html
232         for h in doc/pspp.html/*.html; do \
233                 if grep -Fq '<img src="screenshots/' $$h; then continue; fi ; \
234                 $(SED) -i -e 's|<img src="\([^"]*\)"|<img src="screenshots/\1"|' $$h; \
235         done
236
237 install-html-local: html-local $(HTML_SCREENSHOTS)
238         $(MKDIR_P) $(DESTDIR)$(prefix)/share/doc/pspp/pspp.html
239         $(INSTALL) -d $(DESTDIR)$(prefix)/share/doc/pspp/pspp.html/screenshots
240         for p in $(HTML_SCREENSHOTS); do \
241                 $(INSTALL_DATA) $$p $(DESTDIR)$(prefix)/share/doc/pspp/pspp.html/screenshots ;\
242         done
243         $(INSTALL_DATA) ${top_srcdir}/doc/pspp-manual.css $(DESTDIR)$(prefix)/share/doc/pspp/pspp.html
244
245 \f
246
247 desktopdir = $(datadir)/applications
248
249 doc/org.fsf.pspp.metainfo.xml: doc/org.fsf.pspp.metainfo.xml.in $(POFILES)
250         $(AM_V_GEN)$(MSGFMT) --xml --template $< -o $@ -d $(top_srcdir)/po || \
251           $(MSGFMT) -L appdata --xml --template $< -o $@ -d $(top_srcdir)/po
252
253 doc/org.fsf.pspp.desktop: doc/org.fsf.pspp.desktop.in $(POFILES)
254         $(AM_V_GEN)$(MSGFMT) --desktop --template $< -o $@ -d $(top_srcdir)/po
255
256 CLEANFILES+=doc/org.fsf.pspp.desktop \
257             doc/org.fsf.pspp.metainfo.xml
258
259 desktop_DATA = doc/org.fsf.pspp.desktop
260
261 appdatadir = $(datadir)/metainfo
262 dist_appdata_DATA = doc/org.fsf.pspp.metainfo.xml
263
264 EXTRA_DIST += doc/org.fsf.pspp.metainfo.xml.in \
265         doc/org.fsf.pspp.desktop.in
266
267 \f
268
269 SCREENSHOTS = \
270 $(top_srcdir)/doc/screenshots/autorecode.grab \
271 $(top_srcdir)/doc/screenshots/chisquare.grab \
272 $(top_srcdir)/doc/screenshots/count.grab \
273 $(top_srcdir)/doc/screenshots/count-define.grab \
274 $(top_srcdir)/doc/screenshots/compute.grab \
275 $(top_srcdir)/doc/screenshots/descriptives.grab \
276 $(top_srcdir)/doc/screenshots/one-sample-t.grab \
277 $(top_srcdir)/doc/screenshots/independent-samples-t.grab \
278 $(top_srcdir)/doc/screenshots/define-groups-t.grab \
279 $(top_srcdir)/doc/screenshots/frequencies.grab \
280 $(top_srcdir)/doc/screenshots/reliability.grab \
281 $(top_srcdir)/doc/screenshots/split-status-bar.grab \
282 $(top_srcdir)/doc/screenshots/sort-simple.grab \
283 $(top_srcdir)/doc/screenshots/sort.grab
284
285
286 PDF_SCREENSHOTS =  $(SCREENSHOTS:.grab=-hc.png)
287 EPS_SCREENSHOTS =  $(SCREENSHOTS:.grab=-hc.eps)
288 HTML_SCREENSHOTS = $(SCREENSHOTS:.grab=-ad.png)
289 INFO_SCREENSHOTS = $(SCREENSHOTS:.grab=-ad.png)
290
291 doc-make: doc/doc-make.in Makefile
292         $(SED) -e 's|%top_srcdir%|@top_srcdir@|g' \
293         -e 's|%abs_builddir%|@abs_builddir@|g' \
294         -e 's|%MKDIR_P%|@MKDIR_P@|g' \
295         -e 's|%src_ui_gui_psppiredir%|$(src_ui_gui_psppiredir)|g' \
296         -e 's|%UI_FILES%|$(UI_FILES)|g' \
297         -e 's|%IMAGES%|$(INFO_SCREENSHOTS) $(HTML_SCREENSHOTS) $(EPS_SCREENSHOTS) $(PDF_SCREENSHOTS)|g' \
298         $< > $@
299
300
301 # Install all the PNG files so that info readers can recognise them
302 install-info-local:
303         $(MKDIR_P) $(DESTDIR)$(prefix)/share/info/
304         for p in $(INFO_SCREENSHOTS); do \
305                 $(INSTALL_DATA) $$p $(DESTDIR)$(prefix)/share/info/ ;\
306         done
307
308 uninstall-local:
309         for p in $(INFO_SCREENSHOTS); do \
310                 f=`basename $$p ` ; \
311                 $(RM) $(DESTDIR)$(prefix)/share/info/$$f ; \
312         done
313
314 EXTRA_DIST+= $(SCREENSHOTS) doc/doc-make.in doc/screengrab
315
316 EXTRA_DIST+= $(EPS_SCREENSHOTS) $(PDF_SCREENSHOTS) $(INFO_SCREENSHOTS)