doc: Fix dependencies.
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 25 Oct 2020 06:17:48 +0000 (23:17 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 25 Oct 2020 06:51:00 +0000 (23:51 -0700)
These didn't cause a problem for me until I started using the autobuilder.
Build systems are so frustrating.

doc/automake.mk

index 8a9df0543a7e2f89a31ed4b84d8a08fc191df44e..29871f7fce79cc324a6d2601a979e43bb90ea623 100644 (file)
@@ -137,8 +137,8 @@ EXAMPLE_SYNTAX = \
 EXTRA_DIST += $(EXAMPLE_SYNTAX)
 
 EXAMPLE_SPVS = $(EXAMPLE_SYNTAX:.sps=.spv) doc/examples/tutorial7b.spv
-EXAMPLE_OUTPUTS = $(EXAMPLE_SYNTAX:.sps=.out)
-EXAMPLE_HTML = $(EXAMPLE_SYNTAX:.sps=.html)
+EXAMPLE_OUTPUTS = $(EXAMPLE_SPVS:.spv=.out)
+EXAMPLE_HTML = $(EXAMPLE_SPVS:.spv=.html)
 
 example-spv: $(EXAMPLE_SPVS)
 example-outputs: $(EXAMPLE_OUTPUTS)
@@ -152,19 +152,15 @@ $(top_builddir)/doc/pspp.html:  $(EXAMPLE_HTML)
 $(top_builddir)/doc/pspp.pdf:   $(EXAMPLE_OUTPUTS)
 $(top_builddir)/doc/pspp.xml:   $(EXAMPLE_OUTPUTS)
 
-# The examples cannot be built until the binary has been built
-pspp = $(abs_top_builddir)/src/ui/terminal/pspp
-$(EXAMPLE_OUTPUTS): $(pspp)
-$(EXAMPLE_HTML): $(pspp)
-
 CLEANFILES += $(EXAMPLE_OUTPUTS) $(EXAMPLE_SPVS)
-
-SUFFIXES: .sps
+SUFFIXES += .sps .spv
 
 # Use pspp to process a syntax file into an output file.
+pspp = src/ui/terminal/pspp
+$(EXAMPLE_SPVS): $(pspp)
 .sps.spv:
        $(AM_V_GEN)(cd $(top_srcdir)/examples \
-         && $(pspp) ../doc/examples/$(<F) -o - -O format=spv) > $@.tmp
+         && $(abs_top_builddir)/$(pspp) ../doc/examples/$(<F) -o - -O format=spv) > $@.tmp
        $(AM_V_at)mv $@.tmp $@
 
 # The tutorial only wants some parts of the output here.
@@ -175,6 +171,7 @@ doc/examples/tutorial7b.spv: doc/examples/tutorial7.spv $(pspp_output)
 # Convert an output file into a text file or HTML file.
 #
 # (For HTML, use sed to include only the contents of <body>.)
+$(EXAMPLE_OUTPUTS) $(EXAMPLE_HTML): $(pspp_output)
 .spv.out:
        $(AM_V_GEN)utilities/pspp-output convert $< $@
 .spv.html: