Skip to content

Commit a5c317c

Browse files
committed
Fix the build and install rules for man pages with SQL section != 7
The previous coding failed in various scenarios possibly including vpath builds and doing make install without preceding make all.
1 parent 31f00d1 commit a5c317c

File tree

1 file changed

+10
-20
lines changed

1 file changed

+10
-20
lines changed

doc/src/sgml/Makefile

Lines changed: 10 additions & 20 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.139 2010/03/30 00:10:46 petere Exp $
5+
# $PostgreSQL: pgsql/doc/src/sgml/Makefile,v 1.140 2010/04/02 14:02:49 petere Exp $
66
#
77
#----------------------------------------------------------------------------
88

@@ -313,31 +313,21 @@ fix_sqlmansectnum = sed -e '/^\.TH/s/"7"/"$(sqlmansect)"/' \
313313
-e 's/\\fR(7)/\\fR($(sqlmansectnum))/g' \
314314
-e '1s/^\.so man7/.so man$(sqlmansectnum)/g;1s/^\(\.so.*\)\.7$$/\1.$(sqlmansect)/g'
315315

316-
nonsql_manpage_files := $(wildcard $(srcdir)/man1/*.1 $(srcdir)/man3/*.3)
317-
sql_manpage_files := $(wildcard $(srcdir)/man7/*.7)
316+
man: fixed-man-stamp
318317

319-
fixed_nonsql_manpage_files = $(patsubst $(srcdir)/%,fixedman/%,$(nonsql_manpage_files))
320-
fixed_sql_manpage_files = $(patsubst $(srcdir)/man7/%.7,fixedman/man$(sqlmansectnum)/%.$(sqlmansect),$(sql_manpage_files))
318+
fixed-man-stamp: man-stamp
319+
@$(MKDIR_P) $(addprefix fixedman/,man1 man3 man$(sqlmansectnum))
320+
for file in $(call vpathsearch,man1)/*.1; do $(fix_sqlmansectnum) $$file >fixedman/man1/`basename $$file` || exit; done
321+
for file in $(call vpathsearch,man3)/*.3; do $(fix_sqlmansectnum) $$file >fixedman/man3/`basename $$file` || exit; done
322+
for file in $(call vpathsearch,man7)/*.7; do $(fix_sqlmansectnum) $$file >fixedman/man$(sqlmansectnum)/`basename $$file | sed s/\.7$$/.$(sqlmansect)/` || exit; done
321323

322-
fixed_manpage_files = $(fixed_nonsql_manpage_files) $(fixed_sql_manpage_files)
323-
324-
man: $(fixed_manpage_files)
325-
326-
$(fixed_nonsql_manpage_files): fixedman/%: %
327-
@$(MKDIR_P) $(dir $@)
328-
$(fix_sqlmansectnum) $< >$@
329-
330-
$(fixed_sql_manpage_files): fixedman/man$(sqlmansectnum)/%.$(sqlmansect): man7/%.7
331-
@$(MKDIR_P) $(dir $@)
332-
$(fix_sqlmansectnum) $< >$@
333-
334-
install-man: man
335-
cp -R $(sort $(dir $(fixed_manpage_files))) '$(DESTDIR)$(mandir)'
324+
install-man:
325+
cp -R $(foreach dir,man1 man3 man$(sqlmansectnum),fixedman/$(dir)) '$(DESTDIR)$(mandir)'
336326

337327
clean: clean-man
338328
.PHONY: clean-man
339329
clean-man:
340-
rm -rf fixedman/
330+
rm -rf fixedman/ fixed-man-stamp
341331

342332
endif # sqlmansectnum != 7
343333

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