Skip to content

Commit f21d5b6

Browse files
committed
Improve SGML build rules for non-HTML output, per Peter.
1 parent c4e7e67 commit f21d5b6

File tree

1 file changed

+14
-24
lines changed

1 file changed

+14
-24
lines changed

doc/src/sgml/Makefile

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# PostgreSQL documentation makefile
44
#
5-
# $PostgreSQL: pgsql/doc/src/sgml/Makefile,v 1.89 2007/01/10 01:57:15 momjian Exp $
5+
# $PostgreSQL: pgsql/doc/src/sgml/Makefile,v 1.90 2007/01/10 19:06:04 momjian Exp $
66
#
77
#----------------------------------------------------------------------------
88

@@ -89,42 +89,44 @@ all: html
8989

9090
.PHONY: html
9191

92+
# This is run for all output formats because we need bookindex.sgml
9293
html: postgres.sgml $(ALLSGML) stylesheet.dsl
9394
@rm -f *.html
9495
$(JADE) $(JADEFLAGS) $(SPFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -i output-html -t sgml $<
9596
ifeq ($(vpath_build), yes)
9697
@cp $(srcdir)/stylesheet.css .
9798
endif
9899
ifndef DRAFT
99-
@cmp -s HTML.index.start HTML.index || $(MAKE) $(MAKECMDGOALS)
100+
@cmp -s HTML.index.start HTML.index || $(MAKE) $@
100101
endif
101102

102103

103104
COLLATEINDEX := LC_ALL=C $(PERL) $(COLLATEINDEX) -f -g
104105

106+
# The draft rule calls $(MAKE) again and sets the DRAFT variable.
107+
# This seems to be the only way to set gmake variables in a rule.
105108
draft:
106109
ifndef DRAFT
107110
ifneq ($(MAKECMDGOALS), draft)
108-
# Call ourselves with the DRAFT value set. This seems to be the only
109-
# way to set gmake variables in a rule.
110111
@$(MAKE) DRAFT="Y" $(MAKECMDGOALS)
111112
else
112-
# run default 'all' rule
113+
# simulate $(MAKE) with no arguments
113114
@$(MAKE) DRAFT="Y" all
114115
endif
115116
endif
116117

118+
# bookindex.sgml is required so there is a proper index for all output formats
117119
bookindex.sgml: HTML.index
118120
# create a dummy bookindex.html
119121
test -s HTML.index || $(COLLATEINDEX) -o $@ -N
120-
# If HTML.index is valid, create a valid bookindex.sgml. This
121-
# is required so the output has a proper index.
122+
# If HTML.index is valid, create a valid bookindex.sgml.
122123
test ! -s HTML.index || $(COLLATEINDEX) -i 'bookindex' -o $@ $<
123124
# save copy of HTML.index for later comparison
124125
@cp HTML.index HTML.index.start
125126

127+
# HTML.index is used to create bookindex.sgml
126128
HTML.index:
127-
# create HTML.index if it does not exist
129+
# create an empty HTML.index if it does not exist
128130
@$(if $(wildcard HTML.index), , touch HTML.index)
129131

130132
version.sgml: $(top_builddir)/src/Makefile.global
@@ -156,29 +158,17 @@ features-unsupported.sgml: $(top_srcdir)/src/backend/catalog/sql_feature_package
156158

157159
JADE.tex.call = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d $(srcdir)/stylesheet.dsl -t tex -V tex-backend -i output-print
158160

159-
%-A4.tex-ps: %.sgml $(ALLSGML) stylesheet.dsl bookindex.sgml
161+
%-A4.tex-ps: %.sgml $(ALLSGML) html
160162
$(JADE.tex.call) -V texdvi-output -V '%paper-type%'=A4 -o $@ $<
161-
ifndef DRAFT
162-
@cmp -s HTML.index.start HTML.index || $(MAKE) $@
163-
endif
164163

165-
%-US.tex-ps: %.sgml $(ALLSGML) stylesheet.dsl bookindex.sgml
164+
%-US.tex-ps: %.sgml $(ALLSGML) html
166165
$(JADE.tex.call) -V texdvi-output -V '%paper-type%'=USletter -o $@ $<
167-
ifndef DRAFT
168-
@cmp -s HTML.index.start HTML.index || $(MAKE) $@
169-
endif
170166

171-
%-A4.tex-pdf: %.sgml $(ALLSGML) stylesheet.dsl bookindex.sgml
167+
%-A4.tex-pdf: %.sgml $(ALLSGML) html
172168
$(JADE.tex.call) -V texpdf-output -V '%paper-type%'=A4 -o $@ $<
173-
ifndef DRAFT
174-
@cmp -s HTML.index.start HTML.index || $(MAKE) $@
175-
endif
176169

177-
%-US.tex-pdf: %.sgml $(ALLSGML) stylesheet.dsl bookindex.sgml
170+
%-US.tex-pdf: %.sgml $(ALLSGML) html
178171
$(JADE.tex.call) -V texpdf-output -V '%paper-type%'=USletter -o $@ $<
179-
ifndef DRAFT
180-
@cmp -s HTML.index.start HTML.index || $(MAKE) $@
181-
endif
182172

183173
%.dvi: %.tex-ps
184174
@rm -f $*.aux $*.log

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy