From: Ben Pfaff Date: Sun, 25 Oct 2020 05:45:28 +0000 (-0700) Subject: doc: Improve rules for generating output from examples. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5987926fc7ef9f1ded52a8513d1b1be03d040c7f;p=pspp doc: Improve rules for generating output from examples. This adds support for --enable-silent-rules, avoids the need for $PWD, and behaves better if there is a failure (by not creating the output file). --- diff --git a/doc/automake.mk b/doc/automake.mk index a928c621f3..5e09c6cbfb 100644 --- a/doc/automake.mk +++ b/doc/automake.mk @@ -144,8 +144,9 @@ $(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 -$(EXAMPLE_OUTPUTS): $(top_builddir)/src/ui/terminal/pspp -$(EXAMPLE_HTML): $(top_builddir)/src/ui/terminal/pspp +pspp = $(abs_top_builddir)/src/ui/terminal/pspp +$(EXAMPLE_OUTPUTS): $(pspp) +$(EXAMPLE_HTML): $(pspp) CLEANFILES += $(EXAMPLE_OUTPUTS) @@ -153,16 +154,16 @@ SUFFIXES: .sps # use pspp to process a syntax file and reap the output into a text file .sps.out: - where=$$PWD ; \ - (cd $(top_srcdir)/examples; ${abs_builddir}/src/ui/terminal/pspp $(abs_srcdir)/doc/examples/$( $@.tmp && mv $@.tmp $@ # Use pspp to process a syntax file and reap the output into a html file # Then, use sed to delete everything up to and including and # everything after and including .sps.html: - where=$$PWD ; \ - (cd $(top_srcdir)/examples; ${abs_builddir}/src/ui/terminal/pspp $(abs_srcdir)/doc/examples/$( $@ + $(AM_V_GEN)(cd $(top_srcdir)/examples \ + && $(pspp) ../doc/examples/$( $@.tmp && mv $@.tmp $@ # Insert the link tag for the cascading style sheet. # But make sure these operations are idempotent.