+
+$(FIGURE_SPVS): $(pspp)
+.sps.spv:
+ $(AM_V_GEN)(cd "$(top_srcdir)/examples" \
+ && "$(abs_top_builddir)/$(pspp)" ../doc/pspp-figures/$(<F) -o - -O format=spv) > $@.tmp
+ $(AM_V_at)mv $@.tmp $@
+
+# In some cases, the tutorial only wants some parts of the output.
+convert = $(AM_V_GEN)LSAN_OPTIONS="suppressions=$(abs_top_srcdir)/tests/lsan.supp:print_suppressions=0:$$LSAN_OPTIONS" $(pspp_output) convert $< $@
+doc/pspp-figures/tutorial2a.spv: doc/pspp-figures/tutorial2.spv $(pspp_output)
+ $(convert) --command='Descriptives'
+doc/pspp-figures/tutorial2b.spv: doc/pspp-figures/tutorial2.spv $(pspp_output)
+ $(convert) --label='Extreme Values'
+doc/pspp-figures/tutorial5a.spv: doc/pspp-figures/tutorial5.spv $(pspp_output)
+ $(convert) --commands=examine --nth-command=1 --labels=descriptives
+doc/pspp-figures/tutorial5b.spv: doc/pspp-figures/tutorial5.spv $(pspp_output)
+ $(convert) --commands=examine --nth-command=2 --labels=descriptives
+doc/pspp-figures/tutorial7a.spv: doc/pspp-figures/tutorial7.spv $(pspp_output)
+ $(convert) --commands=regression --nth-command=1 --subtypes=coefficients
+doc/pspp-figures/tutorial7b.spv: doc/pspp-figures/tutorial7.spv $(pspp_output)
+ $(convert) --commands=regression --nth-command=2 --subtypes=coefficients
+
+
+$(FIGURE_PNGS): $(pspp_output)
+$(FIGURE_TXTS): $(pspp_output)
+$(FIGURE_HTMLS): $(pspp_output)
+$(FIGURE_PDFS): $(pspp_output)
+
+# Convert an output file into a text file or HTML file.
+$(FIGURE_TXTS) $(FIGURE_HTMLS): $(pspp_output)
+.spv.txt:
+ $(convert)
+.spv.pdf:
+ $(convert) -O trim=true -O left-margin=0in -O right-margin=0in -O top-margin=0in -O bottom-margin=0in -O paper-size=7.5x99in --table-look=$(srcdir)/doc/tutorial.stt
+.spv.png:
+ $(convert) -O trim=true -O left-margin=0in -O right-margin=0in -O top-margin=0in -O bottom-margin=0in -O paper-size=7.5x99in --table-look=$(srcdir)/doc/tutorial.stt
+EXTRA_DIST += doc/tutorial.stt
+.spv.html:
+ $(convert) -O format=html -O bare=true
+
+# Make sure that tutorial.stt outputs all layers, because a few of the
+# examples in the manual rely on that and it would be easy to replace
+# it with a style that didn't.
+ALL_LOCAL += tutorial-stt-must-print-all-layers
+tutorial-stt-must-print-all-layers:
+ $(AM_V_GEN)grep 'printAllLayers="true"' $(srcdir)/doc/tutorial.stt >/dev/null 2>&1 && touch $@
+
+# Convert a text file into a Texinfo file.
+.txt.texi:
+ $(AM_V_GEN)$(SED) -e 's/@/@@/g' $< > $@
+
+AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) --css-ref=pspp-manual.css
+# Adjust the path for screenshot images.
+# But make sure these operations are idempotent.
+html-local: doc/pspp.html
+ test -d doc/pspp.html
+ for h in doc/pspp.html/*.html; do \
+ if grep -Fq '<img src="screenshots/' $$h; then continue; fi ; \
+ $(SED) -i -e 's|<img src="\([^"]*\)"|<img src="screenshots/\1"|' $$h; \
+ done
+
+install-html-local: html-local $(HTML_SCREENSHOTS)
+ $(MKDIR_P) $(DESTDIR)$(prefix)/share/doc/pspp/pspp.html
+ $(INSTALL) -d $(DESTDIR)$(prefix)/share/doc/pspp/pspp.html/screenshots
+ for p in $(HTML_SCREENSHOTS); do \
+ $(INSTALL_DATA) $$p $(DESTDIR)$(prefix)/share/doc/pspp/pspp.html/screenshots ;\
+ done
+ $(INSTALL_DATA) ${top_srcdir}/doc/pspp-manual.css $(DESTDIR)$(prefix)/share/doc/pspp/pspp.html
+
+\f
+
+desktopdir = $(datadir)/applications
+
+doc/org.gnu.pspp.metainfo.xml: doc/org.gnu.pspp.metainfo.xml.in $(POFILES)
+ $(AM_V_GEN)$(MSGFMT) --xml --template $< -o $@ -d $(top_srcdir)/po || \
+ $(MSGFMT) -L appdata --xml --template $< -o $@ -d $(top_srcdir)/po
+
+doc/org.gnu.pspp.desktop: doc/org.gnu.pspp.desktop.in $(POFILES)
+ $(AM_V_GEN)$(MSGFMT) --desktop --template $< -o $@ -d $(top_srcdir)/po
+
+CLEANFILES+=doc/org.gnu.pspp.desktop \
+ doc/org.gnu.pspp.metainfo.xml
+
+desktop_DATA = doc/org.gnu.pspp.desktop
+
+appdatadir = $(datadir)/metainfo
+dist_appdata_DATA = doc/org.gnu.pspp.metainfo.xml
+
+EXTRA_DIST += doc/org.gnu.pspp.metainfo.xml.in \
+ doc/org.gnu.pspp.desktop.in
+
+\f
+
+SCREENSHOTS = \
+$(top_srcdir)/doc/screenshots/autorecode.grab \
+$(top_srcdir)/doc/screenshots/chisquare.grab \
+$(top_srcdir)/doc/screenshots/count.grab \
+$(top_srcdir)/doc/screenshots/count-define.grab \
+$(top_srcdir)/doc/screenshots/compute.grab \
+$(top_srcdir)/doc/screenshots/crosstabs.grab \
+$(top_srcdir)/doc/screenshots/descriptives.grab \
+$(top_srcdir)/doc/screenshots/one-sample-t.grab \
+$(top_srcdir)/doc/screenshots/independent-samples-t.grab \
+$(top_srcdir)/doc/screenshots/define-groups-t.grab \
+$(top_srcdir)/doc/screenshots/frequencies.grab \
+$(top_srcdir)/doc/screenshots/reliability.grab \
+$(top_srcdir)/doc/screenshots/split-status-bar.grab \
+$(top_srcdir)/doc/screenshots/sort-simple.grab \
+$(top_srcdir)/doc/screenshots/sort.grab
+
+
+PDF_SCREENSHOTS = $(SCREENSHOTS:.grab=-hc.png)
+EPS_SCREENSHOTS = $(SCREENSHOTS:.grab=-hc.eps)
+HTML_SCREENSHOTS = $(SCREENSHOTS:.grab=-ad.png)
+INFO_SCREENSHOTS = $(SCREENSHOTS:.grab=-ad.png)
+
+doc-make: doc/doc-make.in Makefile
+ $(SED) -e 's|%top_srcdir%|@top_srcdir@|g' \
+ -e 's|%abs_builddir%|@abs_builddir@|g' \
+ -e 's|%MKDIR_P%|@MKDIR_P@|g' \
+ -e 's|%src_ui_gui_psppiredir%|$(src_ui_gui_psppiredir)|g' \
+ -e 's|%UI_FILES%|$(UI_FILES)|g' \
+ -e 's|%IMAGES%|$(INFO_SCREENSHOTS) $(HTML_SCREENSHOTS) $(EPS_SCREENSHOTS) $(PDF_SCREENSHOTS)|g' \
+ $< > $@
+
+
+# Install all the PNG files so that info readers can recognise them
+install-info-local: $(FIGURE_PNGS)
+ $(MKDIR_P) $(DESTDIR)$(infodir)/screenshots
+ for p in $(INFO_SCREENSHOTS); do \
+ $(INSTALL_DATA) $$p $(DESTDIR)$(infodir)/screenshots ;\
+ done
+ $(INSTALL) -d $(DESTDIR)$(infodir)/pspp-figures
+ for p in $(FIGURE_PNGS); do \
+ $(INSTALL_DATA) $$p $(DESTDIR)$(infodir)/pspp-figures ;\
+ done
+
+uninstall-local:
+ for p in $(INFO_SCREENSHOTS); do \
+ f=`basename $$p ` ; \
+ rm -f $(DESTDIR)$(infodir)/screenshots/$$f ; \
+ done
+ for p in $(FIGURE_PNGS); do \
+ f=`basename $$p ` ; \
+ rm -f $(DESTDIR)$(infodir)/pspp-figures/$$f ; \