|
2 | 2 | # |
3 | 3 | # PostgreSQL documentation makefile |
4 | 4 | # |
5 | | -# $PostgreSQL: pgsql/doc/src/sgml/Makefile,v 1.89 2007/01/1001:57:15 momjian Exp $ |
| 5 | +# $PostgreSQL: pgsql/doc/src/sgml/Makefile,v 1.90 2007/01/1019:06:04 momjian Exp $ |
6 | 6 | # |
7 | 7 | #---------------------------------------------------------------------------- |
8 | 8 |
|
@@ -89,42 +89,44 @@ all: html |
89 | 89 |
|
90 | 90 | .PHONY: html |
91 | 91 |
|
| 92 | +# This is run for all output formats because we need bookindex.sgml |
92 | 93 | html: postgres.sgml$(ALLSGML) stylesheet.dsl |
93 | 94 | @rm -f*.html |
94 | 95 | $(JADE)$(JADEFLAGS)$(SPFLAGS)$(SGMLINCLUDE)$(CATALOG) -d stylesheet.dsl -i output-html -t sgml$< |
95 | 96 | ifeq ($(vpath_build), yes) |
96 | 97 | @cp $(srcdir)/stylesheet.css . |
97 | 98 | endif |
98 | 99 | ifndefDRAFT |
99 | | -@cmp -s HTML.index.start HTML.index || $(MAKE) $(MAKECMDGOALS) |
| 100 | +@cmp -s HTML.index.start HTML.index || $(MAKE) $@ |
100 | 101 | endif |
101 | 102 |
|
102 | 103 |
|
103 | 104 | COLLATEINDEX := LC_ALL=C$(PERL)$(COLLATEINDEX) -f -g |
104 | 105 |
|
| 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. |
105 | 108 | draft: |
106 | 109 | ifndefDRAFT |
107 | 110 | 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. |
110 | 111 | @$(MAKE) DRAFT="Y" $(MAKECMDGOALS) |
111 | 112 | else |
112 | | -#run default 'all' rule |
| 113 | +#simulate $(MAKE) with no arguments |
113 | 114 | @$(MAKE) DRAFT="Y" all |
114 | 115 | endif |
115 | 116 | endif |
116 | 117 |
|
| 118 | +# bookindex.sgml is required so there is a proper index for all output formats |
117 | 119 | bookindex.sgml: HTML.index |
118 | 120 | # create a dummy bookindex.html |
119 | 121 | 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. |
122 | 123 | test ! -s HTML.index || $(COLLATEINDEX) -i 'bookindex' -o $@ $< |
123 | 124 | # save copy of HTML.index for later comparison |
124 | 125 | @cp HTML.index HTML.index.start |
125 | 126 |
|
| 127 | +# HTML.index is used to create bookindex.sgml |
126 | 128 | HTML.index: |
127 | | -# create HTML.index if it does not exist |
| 129 | +# createan emptyHTML.index if it does not exist |
128 | 130 | @$(if $(wildcard HTML.index), , touch HTML.index) |
129 | 131 |
|
130 | 132 | version.sgml:$(top_builddir)/src/Makefile.global |
@@ -156,29 +158,17 @@ features-unsupported.sgml: $(top_srcdir)/src/backend/catalog/sql_feature_package |
156 | 158 |
|
157 | 159 | JADE.tex.call =$(JADE)$(JADEFLAGS)$(SGMLINCLUDE)$(CATALOG) -d$(srcdir)/stylesheet.dsl -t tex -V tex-backend -i output-print |
158 | 160 |
|
159 | | -%-A4.tex-ps:%.sgml$(ALLSGML)stylesheet.dsl bookindex.sgml |
| 161 | +%-A4.tex-ps:%.sgml$(ALLSGML)html |
160 | 162 | $(JADE.tex.call) -V texdvi-output -V'%paper-type%'=A4 -o$@$< |
161 | | -ifndefDRAFT |
162 | | -@cmp -s HTML.index.start HTML.index || $(MAKE) $@ |
163 | | -endif |
164 | 163 |
|
165 | | -%-US.tex-ps:%.sgml$(ALLSGML)stylesheet.dsl bookindex.sgml |
| 164 | +%-US.tex-ps:%.sgml$(ALLSGML)html |
166 | 165 | $(JADE.tex.call) -V texdvi-output -V'%paper-type%'=USletter -o$@$< |
167 | | -ifndefDRAFT |
168 | | -@cmp -s HTML.index.start HTML.index || $(MAKE) $@ |
169 | | -endif |
170 | 166 |
|
171 | | -%-A4.tex-pdf:%.sgml$(ALLSGML)stylesheet.dsl bookindex.sgml |
| 167 | +%-A4.tex-pdf:%.sgml$(ALLSGML)html |
172 | 168 | $(JADE.tex.call) -V texpdf-output -V'%paper-type%'=A4 -o$@$< |
173 | | -ifndefDRAFT |
174 | | -@cmp -s HTML.index.start HTML.index || $(MAKE) $@ |
175 | | -endif |
176 | 169 |
|
177 | | -%-US.tex-pdf:%.sgml$(ALLSGML)stylesheet.dsl bookindex.sgml |
| 170 | +%-US.tex-pdf:%.sgml$(ALLSGML)html |
178 | 171 | $(JADE.tex.call) -V texpdf-output -V'%paper-type%'=USletter -o$@$< |
179 | | -ifndefDRAFT |
180 | | -@cmp -s HTML.index.start HTML.index || $(MAKE) $@ |
181 | | -endif |
182 | 172 |
|
183 | 173 | %.dvi:%.tex-ps |
184 | 174 | @rm -f$*.aux$*.log |
|