Commit f21d5b61 authored by Bruce Momjian's avatar Bruce Momjian

Improve SGML build rules for non-HTML output, per Peter.

parent c4e7e675
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# PostgreSQL documentation makefile # PostgreSQL documentation makefile
# #
# $PostgreSQL: pgsql/doc/src/sgml/Makefile,v 1.89 2007/01/10 01:57:15 momjian Exp $ # $PostgreSQL: pgsql/doc/src/sgml/Makefile,v 1.90 2007/01/10 19:06:04 momjian Exp $
# #
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
...@@ -89,6 +89,7 @@ all: html ...@@ -89,6 +89,7 @@ all: html
.PHONY: html .PHONY: html
# This is run for all output formats because we need bookindex.sgml
html: postgres.sgml $(ALLSGML) stylesheet.dsl html: postgres.sgml $(ALLSGML) stylesheet.dsl
@rm -f *.html @rm -f *.html
$(JADE) $(JADEFLAGS) $(SPFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -i output-html -t sgml $< $(JADE) $(JADEFLAGS) $(SPFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -i output-html -t sgml $<
...@@ -96,35 +97,36 @@ ifeq ($(vpath_build), yes) ...@@ -96,35 +97,36 @@ ifeq ($(vpath_build), yes)
@cp $(srcdir)/stylesheet.css . @cp $(srcdir)/stylesheet.css .
endif endif
ifndef DRAFT ifndef DRAFT
@cmp -s HTML.index.start HTML.index || $(MAKE) $(MAKECMDGOALS) @cmp -s HTML.index.start HTML.index || $(MAKE) $@
endif endif
COLLATEINDEX := LC_ALL=C $(PERL) $(COLLATEINDEX) -f -g COLLATEINDEX := LC_ALL=C $(PERL) $(COLLATEINDEX) -f -g
# The draft rule calls $(MAKE) again and sets the DRAFT variable.
# This seems to be the only way to set gmake variables in a rule.
draft: draft:
ifndef DRAFT ifndef DRAFT
ifneq ($(MAKECMDGOALS), draft) ifneq ($(MAKECMDGOALS), draft)
# Call ourselves with the DRAFT value set. This seems to be the only
# way to set gmake variables in a rule.
@$(MAKE) DRAFT="Y" $(MAKECMDGOALS) @$(MAKE) DRAFT="Y" $(MAKECMDGOALS)
else else
# run default 'all' rule # simulate $(MAKE) with no arguments
@$(MAKE) DRAFT="Y" all @$(MAKE) DRAFT="Y" all
endif endif
endif endif
# bookindex.sgml is required so there is a proper index for all output formats
bookindex.sgml: HTML.index bookindex.sgml: HTML.index
# create a dummy bookindex.html # create a dummy bookindex.html
test -s HTML.index || $(COLLATEINDEX) -o $@ -N test -s HTML.index || $(COLLATEINDEX) -o $@ -N
# If HTML.index is valid, create a valid bookindex.sgml. This # If HTML.index is valid, create a valid bookindex.sgml.
# is required so the output has a proper index.
test ! -s HTML.index || $(COLLATEINDEX) -i 'bookindex' -o $@ $< test ! -s HTML.index || $(COLLATEINDEX) -i 'bookindex' -o $@ $<
# save copy of HTML.index for later comparison # save copy of HTML.index for later comparison
@cp HTML.index HTML.index.start @cp HTML.index HTML.index.start
# HTML.index is used to create bookindex.sgml
HTML.index: HTML.index:
# create HTML.index if it does not exist # create an empty HTML.index if it does not exist
@$(if $(wildcard HTML.index), , touch HTML.index) @$(if $(wildcard HTML.index), , touch HTML.index)
version.sgml: $(top_builddir)/src/Makefile.global version.sgml: $(top_builddir)/src/Makefile.global
...@@ -156,29 +158,17 @@ features-unsupported.sgml: $(top_srcdir)/src/backend/catalog/sql_feature_package ...@@ -156,29 +158,17 @@ features-unsupported.sgml: $(top_srcdir)/src/backend/catalog/sql_feature_package
JADE.tex.call = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d $(srcdir)/stylesheet.dsl -t tex -V tex-backend -i output-print JADE.tex.call = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d $(srcdir)/stylesheet.dsl -t tex -V tex-backend -i output-print
%-A4.tex-ps: %.sgml $(ALLSGML) stylesheet.dsl bookindex.sgml %-A4.tex-ps: %.sgml $(ALLSGML) html
$(JADE.tex.call) -V texdvi-output -V '%paper-type%'=A4 -o $@ $< $(JADE.tex.call) -V texdvi-output -V '%paper-type%'=A4 -o $@ $<
ifndef DRAFT
@cmp -s HTML.index.start HTML.index || $(MAKE) $@
endif
%-US.tex-ps: %.sgml $(ALLSGML) stylesheet.dsl bookindex.sgml %-US.tex-ps: %.sgml $(ALLSGML) html
$(JADE.tex.call) -V texdvi-output -V '%paper-type%'=USletter -o $@ $< $(JADE.tex.call) -V texdvi-output -V '%paper-type%'=USletter -o $@ $<
ifndef DRAFT
@cmp -s HTML.index.start HTML.index || $(MAKE) $@
endif
%-A4.tex-pdf: %.sgml $(ALLSGML) stylesheet.dsl bookindex.sgml %-A4.tex-pdf: %.sgml $(ALLSGML) html
$(JADE.tex.call) -V texpdf-output -V '%paper-type%'=A4 -o $@ $< $(JADE.tex.call) -V texpdf-output -V '%paper-type%'=A4 -o $@ $<
ifndef DRAFT
@cmp -s HTML.index.start HTML.index || $(MAKE) $@
endif
%-US.tex-pdf: %.sgml $(ALLSGML) stylesheet.dsl bookindex.sgml %-US.tex-pdf: %.sgml $(ALLSGML) html
$(JADE.tex.call) -V texpdf-output -V '%paper-type%'=USletter -o $@ $< $(JADE.tex.call) -V texpdf-output -V '%paper-type%'=USletter -o $@ $<
ifndef DRAFT
@cmp -s HTML.index.start HTML.index || $(MAKE) $@
endif
%.dvi: %.tex-ps %.dvi: %.tex-ps
@rm -f $*.aux $*.log @rm -f $*.aux $*.log
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment