Documentation: Add some screenshots to the user manual.
[pspp] / doc / automake.mk
index 801f278ce653a1fb8956a6c362b227befdd9d390..3d2377c258fcdb4e96a42ff82c488dcdcb71ea5a 100644 (file)
@@ -59,6 +59,7 @@ doc_pspp_dev_TEXINFOS = doc/version-dev.texi \
        doc/dev/pc+-file-format.texi \
        doc/dev/portable-file-format.texi \
        doc/dev/spv-file-format.texi \
+       doc/dev/tlo-file-format.texi \
        doc/dev/encrypted-file-wrappers.texi \
        doc/dev/q2c.texi
 
@@ -80,8 +81,8 @@ doc/pspp.xml: doc/pspp.texi $(doc_pspp_TEXINFOS) doc/help-pages-list
 if BROKEN_DOCBOOK_XML
        touch $@
 else
-       $(AM_V_GEN)$(MAKEINFO) $(AM_MAKEINFOFLAGS) --docbook -I $(top_srcdir) \
-               $< -o $@
+       $(AM_V_GEN)$(MAKEINFO) --docbook $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
+               -I doc -I $(srcdir)/doc $< -o $@
 endif
 
 docbookdir = $(docdir)
@@ -105,118 +106,122 @@ EXTRA_DIST += \
        doc/help-pages-list \
        doc/pspp-manual.css
 
-
-AM_MAKEINFOFLAGS=-I $(top_srcdir)/doc/examples -I $(top_builddir)/doc/examples
-am__TEXINFO_TEX_DIR=:$(top_srcdir)/doc/examples:$(top_builddir)/doc/examples
+am__TEXINFO_TEX_DIR=:$(top_srcdir)/doc:$(top_builddir)/doc
 
 ################# Example programs ##############################
 
-EXAMPLE_SYNTAX = \
- doc/examples/autorecode.sps \
- doc/examples/chisquare.sps \
- doc/examples/compute.sps \
- doc/examples/count.sps \
- doc/examples/descriptives.sps \
- doc/examples/flip.sps \
- doc/examples/frequencies.sps \
- doc/examples/means.sps \
- doc/examples/one-sample-t.sps \
- doc/examples/independent-samples-t.sps \
- doc/examples/reliability.sps \
- doc/examples/split.sps \
- doc/examples/tutorial1.sps \
- doc/examples/tutorial2.sps \
- doc/examples/tutorial3.sps \
- doc/examples/tutorial4.sps \
- doc/examples/tutorial5.sps \
- doc/examples/tutorial6.sps \
- doc/examples/tutorial7.sps \
- doc/examples/weight.sps
-
-
-EXTRA_DIST += $(EXAMPLE_SYNTAX)
-
-EXAMPLE_SPVS = $(EXAMPLE_SYNTAX:.sps=.spv) \
-       doc/examples/tutorial2a.spv \
-       doc/examples/tutorial2b.spv \
-       doc/examples/tutorial5a.spv \
-       doc/examples/tutorial5b.spv \
-       doc/examples/tutorial7a.spv \
-       doc/examples/tutorial7b.spv
-EXAMPLE_TXTS = $(EXAMPLE_SPVS:.spv=.txt)
-EXAMPLE_TEXIS = $(EXAMPLE_TXTS:.txt=.texi)
-EXAMPLE_HTML = $(EXAMPLE_SPVS:.spv=.html)
-
-example-spv: $(EXAMPLE_SPVS)
-example-txts: $(EXAMPLE_TXTS)
-example-texis: $(EXAMPLE_TEXIS)
-example-html: $(EXAMPLE_HTML)
-PHONY += example-spv example-txts example-texis example-html
-
-$(top_builddir)/doc/pspp.info:  $(EXAMPLE_TEXIS)
-$(top_builddir)/doc/pspp.ps:    $(EXAMPLE_TEXIS)
-$(top_builddir)/doc/pspp.dvi:   $(EXAMPLE_TEXIS)
-$(top_builddir)/doc/pspp.html:  $(EXAMPLE_HTML)
-$(top_builddir)/doc/pspp.pdf:   $(EXAMPLE_TEXIS)
-$(top_builddir)/doc/pspp.xml:   $(EXAMPLE_TEXIS)
-
-CLEANFILES += $(EXAMPLE_TXTS) $(EXAMPLE_SPVS) $(EXAMPLE_TEXIS) $(EXAMPLE_HTML)
-SUFFIXES += .sps .spv .txt .html .texi
+FIGURE_SYNTAX = \
+ doc/pspp-figures/aggregate.sps \
+ doc/pspp-figures/autorecode.sps \
+ doc/pspp-figures/chisquare.sps \
+ doc/pspp-figures/compute.sps \
+ doc/pspp-figures/count.sps \
+ doc/pspp-figures/descriptives.sps \
+ doc/pspp-figures/flip.sps \
+ doc/pspp-figures/frequencies.sps \
+ doc/pspp-figures/means.sps \
+ doc/pspp-figures/one-sample-t.sps \
+ doc/pspp-figures/independent-samples-t.sps \
+ doc/pspp-figures/reliability.sps \
+ doc/pspp-figures/select-if.sps \
+ doc/pspp-figures/sort-cases.sps \
+ doc/pspp-figures/split.sps \
+ doc/pspp-figures/temporary.sps \
+ doc/pspp-figures/tutorial1.sps \
+ doc/pspp-figures/tutorial2.sps \
+ doc/pspp-figures/tutorial3.sps \
+ doc/pspp-figures/tutorial4.sps \
+ doc/pspp-figures/tutorial5.sps \
+ doc/pspp-figures/tutorial6.sps \
+ doc/pspp-figures/tutorial7.sps \
+ doc/pspp-figures/weight.sps
+
+
+EXTRA_DIST += $(FIGURE_SYNTAX)
+
+FIGURE_SPVS = $(FIGURE_SYNTAX:.sps=.spv) \
+       doc/pspp-figures/tutorial2a.spv \
+       doc/pspp-figures/tutorial2b.spv \
+       doc/pspp-figures/tutorial5a.spv \
+       doc/pspp-figures/tutorial5b.spv \
+       doc/pspp-figures/tutorial7a.spv \
+       doc/pspp-figures/tutorial7b.spv
+FIGURE_TXTS = $(FIGURE_SPVS:.spv=.txt)
+FIGURE_TEXIS = $(FIGURE_TXTS:.txt=.texi)
+FIGURE_HTMLS = $(FIGURE_SPVS:.spv=.html)
+FIGURE_PDFS = $(FIGURE_SPVS:.spv=.pdf)
+
+figure-spvs: $(FIGURE_SPVS)
+figure-txts: $(FIGURE_TXTS)
+figure-texis: $(FIGURE_TEXIS)
+figure-htmls: $(FIGURE_HTMLS)
+figure-pdfs: $(FIGURE_PDFS)
+PHONY += figure-spv figure-txts figure-texis figure-htmls figure-pdfs
+
+$(top_builddir)/doc/pspp.info:  $(FIGURE_TEXIS)
+$(top_builddir)/doc/pspp.ps:    $(FIGURE_TEXIS)
+$(top_builddir)/doc/pspp.dvi:   $(FIGURE_TEXIS)
+$(top_builddir)/doc/pspp.html:  $(FIGURE_HTMLS)
+$(top_builddir)/doc/pspp.pdf:   $(FIGURE_TEXIS)
+$(top_builddir)/doc/pspp.xml:   $(FIGURE_TEXIS)
+
+CLEANFILES += $(FIGURE_TXTS) $(FIGURE_SPVS) $(FIGURE_TEXIS) $(FIGURE_HTMLS)
+SUFFIXES += .sps .spv .txt .html .texi .pdf
 
 # Use pspp to process a syntax file into an output file.
 pspp = src/ui/terminal/pspp
-$(EXAMPLE_SPVS): $(pspp)
+$(FIGURE_SPVS): $(pspp)$(EXEEXT)
 .sps.spv:
        $(AM_V_GEN)(cd $(top_srcdir)/examples \
-         && $(abs_top_builddir)/$(pspp) ../doc/examples/$(<F) -o - -O format=spv) > $@.tmp
+         && $(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.
 pspp_output = utilities/pspp-output
 convert = $(AM_V_GEN)$(pspp_output) convert $< $@
-doc/examples/tutorial2a.spv: doc/examples/tutorial2.spv $(pspp_output)
+doc/pspp-figures/tutorial2a.spv: doc/pspp-figures/tutorial2.spv $(pspp_output)
        $(convert) --command='Descriptives'
-doc/examples/tutorial2b.spv: doc/examples/tutorial2.spv $(pspp_output)
+doc/pspp-figures/tutorial2b.spv: doc/pspp-figures/tutorial2.spv $(pspp_output)
        $(convert) --label='Extreme Values'
-doc/examples/tutorial5a.spv: doc/examples/tutorial5.spv $(pspp_output)
+doc/pspp-figures/tutorial5a.spv: doc/pspp-figures/tutorial5.spv $(pspp_output)
        $(convert) --commands=examine --nth-command=1 --labels=descriptives
-doc/examples/tutorial5b.spv: doc/examples/tutorial5.spv $(pspp_output)
+doc/pspp-figures/tutorial5b.spv: doc/pspp-figures/tutorial5.spv $(pspp_output)
        $(convert) --commands=examine --nth-command=2 --labels=descriptives
-doc/examples/tutorial7a.spv: doc/examples/tutorial7.spv $(pspp_output)
+doc/pspp-figures/tutorial7a.spv: doc/pspp-figures/tutorial7.spv $(pspp_output)
        $(convert) --commands=regression --nth-command=1 --subtypes=coefficients
-doc/examples/tutorial7b.spv: doc/examples/tutorial7.spv $(pspp_output)
+doc/pspp-figures/tutorial7b.spv: doc/pspp-figures/tutorial7.spv $(pspp_output)
        $(convert) --commands=regression --nth-command=2 --subtypes=coefficients
 
 # Convert an output file into a text file or HTML file.
-#
-# (For HTML, use sed to include only the contents of <body>.)
-$(EXAMPLE_TXTS) $(EXAMPLE_HTML): $(pspp_output)
+$(FIGURE_TXTS) $(FIGURE_HTMLS): $(pspp_output)
 .spv.txt:
-       $(AM_V_GEN)utilities/pspp-output convert $< $@
+       $(convert)
+.spv.pdf:
+       $(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
 .spv.html:
-       $(AM_V_GEN)utilities/pspp-output convert $< - -O format=html \
-       | $(SED) -e '\%</body%,$$d' -e '0,/<body/d' > $@.tmp
-       $(AM_V_at)mv $@.tmp $@
+       $(convert) -O format=html -O bare=true
 
 # Convert a text file into a Texinfo file.
 .txt.texi:
-       $(AM_V_GEN)sed 's/@/@@/g' < $< > $@.tmp
-       $(AM_V_at)mv $@.tmp $@
+       $(AM_V_GEN)$(SED) -e 's/@/@@/g' $< > $@
 
-# Insert the link tag for the cascading style sheet.
+AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) --css-ref=pspp-manual.css
+# Adjust the path for screenshot images.
 # But make sure these operations are idempotent.
 html-local:
        for h in doc/pspp.html/*.html; do \
-               if grep -Fq '<link rel="stylesheet"' $$h; then continue; fi ; \
-               $(SED) -i -e '/^<\/head>/i \\\
-<link rel="stylesheet" href="pspp-manual.css">' $$h; \
+               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
+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
@@ -238,3 +243,54 @@ dist_appdata_DATA = doc/org.fsf.pspp.metainfo.xml
 
 EXTRA_DIST += doc/org.fsf.pspp.metainfo.xml.in \
        doc/org.fsf.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/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:
+       $(MKDIR_P) $(DESTDIR)$(prefix)/share/info/
+       for p in $(INFO_SCREENSHOTS); do \
+               $(INSTALL_DATA) $$p $(DESTDIR)$(prefix)/share/info/ ;\
+       done
+
+uninstall-local:
+       for p in $(INFO_SCREENSHOTS); do \
+               f=`basename $$p ` ; \
+               $(RM) $(DESTDIR)$(prefix)/share/info/$$f ; \
+       done
+
+EXTRA_DIST+= $(SCREENSHOTS) doc/doc-make.in doc/screengrab
+
+EXTRA_DIST+= $(EPS_SCREENSHOTS) $(PDF_SCREENSHOTS) $(INFO_SCREENSHOTS)