Skip to content

Commit 234c7ce

Browse files
committed
Derived files that are shipped in the distribution used to be built in the
source directory even for out-of-tree builds. They are now alsl built in the build tree. This should be more convenient for certain developers' workflows, and shouldn't really break anything else.
1 parent 0a00c9a commit 234c7ce

File tree

13 files changed

+95
-109
lines changed

13 files changed

+95
-109
lines changed

contrib/cube/Makefile

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $PostgreSQL: pgsql/contrib/cube/Makefile,v 1.22 2008/08/29 13:02:32 petere Exp $
1+
# $PostgreSQL: pgsql/contrib/cube/Makefile,v 1.23 2009/08/28 20:26:18 petere Exp $
22

33
MODULE_big = cube
44
OBJS= cube.o cubeparse.o
@@ -24,23 +24,23 @@ endif
2424

2525

2626
# cubescan is compiled as part of cubeparse
27-
cubeparse.o: $(srcdir)/cubescan.c
27+
cubeparse.o: cubescan.c
2828

29-
$(srcdir)/cubeparse.c: cubeparse.y
29+
cubeparse.c: cubeparse.y
3030
ifdef BISON
3131
$(BISON) $(BISONFLAGS) -o $@ $<
3232
else
3333
@$(missing) bison $< $@
3434
endif
3535

36-
$(srcdir)/cubescan.c: cubescan.l
36+
cubescan.c: cubescan.l
3737
ifdef FLEX
3838
$(FLEX) $(FLEXFLAGS) -o'$@' $<
3939
else
4040
@$(missing) flex $< $@
4141
endif
4242

43-
distprep: $(srcdir)/cubeparse.c $(srcdir)/cubescan.c
43+
distprep: cubeparse.c cubescan.c
4444

4545
maintainer-clean:
46-
rm -f $(srcdir)/cubeparse.c $(srcdir)/cubescan.c
46+
rm -f cubeparse.c cubescan.c

contrib/seg/Makefile

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $PostgreSQL: pgsql/contrib/seg/Makefile,v 1.21 2008/08/29 13:02:32 petere Exp $
1+
# $PostgreSQL: pgsql/contrib/seg/Makefile,v 1.22 2009/08/28 20:26:18 petere Exp $
22

33
MODULE_big = seg
44
OBJS = seg.o segparse.o
@@ -21,23 +21,23 @@ endif
2121

2222

2323
# segscan is compiled as part of segparse
24-
segparse.o: $(srcdir)/segscan.c
24+
segparse.o: segscan.c
2525

26-
$(srcdir)/segparse.c: segparse.y
26+
segparse.c: segparse.y
2727
ifdef BISON
2828
$(BISON) $(BISONFLAGS) -o $@ $<
2929
else
3030
@$(missing) bison $< $@
3131
endif
3232

33-
$(srcdir)/segscan.c: segscan.l
33+
segscan.c: segscan.l
3434
ifdef FLEX
3535
$(FLEX) $(FLEXFLAGS) -o'$@' $<
3636
else
3737
@$(missing) flex $< $@
3838
endif
3939

40-
distprep: $(srcdir)/segparse.c $(srcdir)/segscan.c
40+
distprep: segparse.c segscan.c
4141

4242
maintainer-clean:
43-
rm -f $(srcdir)/segparse.c $(srcdir)/segscan.c
43+
rm -f segparse.c segscan.c

doc/src/sgml/Makefile

+21-31
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.128 2009/08/26 22:24:42 petere Exp $
5+
# $PostgreSQL: pgsql/doc/src/sgml/Makefile,v 1.129 2009/08/28 20:26:18 petere Exp $
66
#
77
#----------------------------------------------------------------------------
88

@@ -32,7 +32,7 @@ endif
3232
ifndef JADE
3333
JADE = jade
3434
endif
35-
SGMLINCLUDE = -D $(srcdir)
35+
SGMLINCLUDE = -D . -D $(srcdir)
3636

3737
ifndef NSGMLS
3838
NSGMLS = nsgmls
@@ -75,13 +75,9 @@ override SPFLAGS += -wall -wno-unused-param -wno-empty -wfully-tagged
7575

7676
man: man-stamp
7777

78-
ifeq ($(vpath_build),yes)
79-
XSLTPROC_MAN_FLAGS = --stringparam man.output.base.dir '$(srcdir)/'
80-
endif
81-
82-
$(srcdir)/man-stamp: stylesheet-man.xsl postgres.xml
78+
man-stamp: stylesheet-man.xsl postgres.xml
8379
$(XSLTPROC) $(XSLTPROCFLAGS) $(XSLTPROC_MAN_FLAGS) $^
84-
rm $(srcdir)/man1/dblink*
80+
rm man1/dblink*
8581
touch $@
8682

8783

@@ -92,47 +88,43 @@ $(srcdir)/man-stamp: stylesheet-man.xsl postgres.xml
9288
.PHONY: draft
9389

9490
JADE.html.call = $(JADE) $(JADEFLAGS) $(SPFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t sgml -i output-html
95-
ifeq ($(vpath_build),yes)
96-
# This only works with openjade, not with the older jade.
97-
JADE.html.call += -V '(define %output-dir% "$(srcdir)/html")'
98-
endif
9991

10092
# The draft target creates HTML output in draft mode, without index (for faster build).
10193
draft: postgres.sgml $(ALMOSTALLSGML) stylesheet.dsl
102-
$(MKDIR_P) $(srcdir)/html
94+
$(MKDIR_P) html
10395
$(JADE.html.call) -V draft-mode $<
104-
cp $(srcdir)/stylesheet.css $(srcdir)/html/
96+
cp $(srcdir)/stylesheet.css html/
10597

10698
html: html-stamp
10799

108-
$(srcdir)/html-stamp: postgres.sgml $(ALLSGML) stylesheet.dsl
109-
$(MKDIR_P) $(srcdir)/html
100+
html-stamp: postgres.sgml $(ALLSGML) stylesheet.dsl
101+
$(MKDIR_P) html
110102
$(JADE.html.call) -i include-index $<
111-
cp $(srcdir)/stylesheet.css $(srcdir)/html/
103+
cp $(srcdir)/stylesheet.css html/
112104
touch $@
113105

114-
$(srcdir)/HTML.index: postgres.sgml $(ALMOSTALLSGML) stylesheet.dsl
115-
@$(MKDIR_P) $(srcdir)/html
106+
HTML.index: postgres.sgml $(ALMOSTALLSGML) stylesheet.dsl
107+
@$(MKDIR_P) html
116108
$(JADE.html.call) -V html-index $<
117109

118-
$(srcdir)/bookindex.sgml: HTML.index
110+
bookindex.sgml: HTML.index
119111
LC_ALL=C $(PERL) $(COLLATEINDEX) -f -g -i 'bookindex' -o $@ $<
120112

121113
# Technically, this should depend on Makefile.global, but then
122114
# version.sgml would need to be rebuilt after every configure run,
123115
# even in distribution tarballs. So this is cheating a bit, but it
124116
# will achieve the goal of updating the version number when it
125117
# changes.
126-
$(srcdir)/version.sgml: $(top_srcdir)/configure
118+
version.sgml: $(top_srcdir)/configure
127119
{ \
128120
echo "<!entity version \"$(VERSION)\">"; \
129121
echo "<!entity majorversion \"$(MAJORVERSION)\">"; \
130122
} >$@
131123

132-
$(srcdir)/features-supported.sgml: $(top_srcdir)/src/backend/catalog/sql_feature_packages.txt $(top_srcdir)/src/backend/catalog/sql_features.txt
124+
features-supported.sgml: $(top_srcdir)/src/backend/catalog/sql_feature_packages.txt $(top_srcdir)/src/backend/catalog/sql_features.txt
133125
$(PERL) $(srcdir)/mk_feature_tables.pl YES $^ > $@
134126

135-
$(srcdir)/features-unsupported.sgml: $(top_srcdir)/src/backend/catalog/sql_feature_packages.txt $(top_srcdir)/src/backend/catalog/sql_features.txt
127+
features-unsupported.sgml: $(top_srcdir)/src/backend/catalog/sql_feature_packages.txt $(top_srcdir)/src/backend/catalog/sql_features.txt
136128
$(PERL) $(srcdir)/mk_feature_tables.pl NO $^ > $@
137129

138130

@@ -232,10 +224,6 @@ postgres.xml: postgres.sgml $(ALMOSTALLSGML)
232224
>$@
233225
# ' hello Emacs
234226

235-
ifeq ($(vpath_build),yes)
236-
XSLTPROC_HTML_FLAGS = --stringparam base.dir '$(srcdir)/html'
237-
endif
238-
239227
xslthtml: stylesheet.xsl postgres.xml
240228
$(XSLTPROC) $(XSLTPROCFLAGS) $(XSLTPROC_HTML_FLAGS) $^
241229

@@ -280,9 +268,11 @@ check: postgres.sgml $(ALMOSTALLSGML)
280268
## Install
281269
##
282270

283-
found_html = $(wildcard $(srcdir)/html-stamp)
271+
vpathsearch = $(firstword $(wildcard $(addsuffix /$(1),$(subst :, ,. $(VPATH)))))
272+
273+
found_html = $(wildcard html-stamp $(srcdir)/html-stamp)
284274

285-
ifneq ($(wildcard $(srcdir)/man-stamp),)
275+
ifneq ($(wildcard man-stamp $(srcdir)/man-stamp),)
286276
# SCO OpenServer's man system is sufficiently different to not bother.
287277
ifneq ($(PORTNAME), sco)
288278
found_man = yes
@@ -301,7 +291,7 @@ uninstall:
301291
## Install html
302292

303293
install-html: html installdirs
304-
cp -R $(srcdir)/html '$(DESTDIR)$(htmldir)'
294+
cp -R $(call vpathsearch,html) '$(DESTDIR)$(htmldir)'
305295

306296

307297
## Install man
@@ -316,7 +306,7 @@ sqlmansectnum = $(shell expr X'$(sqlmansect)' : X'\([0-9]\)')
316306
#
317307
ifeq ($(sqlmansectnum),7)
318308
install-man:
319-
cp -R $(addprefix $(srcdir)/,man1 man3 man7) '$(DESTDIR)$(mandir)'
309+
cp -R $(foreach dir,man1 man3 man7,$(call vpathsearch,$(dir))) '$(DESTDIR)$(mandir)'
320310

321311
else # sqlmansectnum != 7
322312
fix_sqlmansectnum = sed -e '/^\.TH/s/"7"/"$(sqlmansect)"/' \

src/Makefile.shlib

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Copyright (c) 1998, Regents of the University of California
77
#
88
# IDENTIFICATION
9-
# $PostgreSQL: pgsql/src/Makefile.shlib,v 1.122 2009/08/27 17:55:53 tgl Exp $
9+
# $PostgreSQL: pgsql/src/Makefile.shlib,v 1.123 2009/08/28 20:26:18 petere Exp $
1010
#
1111
#-------------------------------------------------------------------------
1212

@@ -415,7 +415,7 @@ exports_file = $(DLL_DEFFILE)
415415
$(exports_file): $(OBJS)
416416
$(DLLTOOL) --export-all $(DLLTOOL_DEFFLAGS) --output-def $@ $^
417417
else
418-
DLL_DEFFILE = $(srcdir)/lib$(NAME)dll.def
418+
DLL_DEFFILE = lib$(NAME)dll.def
419419
endif
420420

421421
$(shlib): $(OBJS) $(DLL_DEFFILE)
@@ -436,23 +436,23 @@ endif # enable_shared
436436
# tarballs.
437437

438438
ifneq (,$(SHLIB_EXPORTS))
439-
distprep: $(srcdir)/lib$(NAME)dll.def $(srcdir)/lib$(NAME)ddll.def $(srcdir)/blib$(NAME)dll.def
439+
distprep: lib$(NAME)dll.def lib$(NAME)ddll.def blib$(NAME)dll.def
440440

441441
UC_NAME = $(shell echo $(NAME) | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')
442442

443-
$(srcdir)/lib$(NAME)dll.def: $(SHLIB_EXPORTS)
443+
lib$(NAME)dll.def: $(SHLIB_EXPORTS)
444444
echo '; DEF file for MS VC++' >$@
445445
echo 'LIBRARY LIB$(UC_NAME)' >>$@
446446
echo 'EXPORTS' >>$@
447447
sed -e '/^#/d' -e 's/^\(.*[ ]\)\([0-9][0-9]*\)/ \1@ \2/' $< >>$@
448448

449-
$(srcdir)/lib$(NAME)ddll.def: $(SHLIB_EXPORTS)
449+
lib$(NAME)ddll.def: $(SHLIB_EXPORTS)
450450
echo '; DEF file for MS VC++' >$@
451451
echo 'LIBRARY LIB$(UC_NAME)D' >>$@
452452
echo 'EXPORTS' >>$@
453453
sed -e '/^#/d' -e 's/^\(.*[ ]\)\([0-9][0-9]*\)/ \1@ \2/' $< >>$@
454454

455-
$(srcdir)/blib$(NAME)dll.def: $(SHLIB_EXPORTS)
455+
blib$(NAME)dll.def: $(SHLIB_EXPORTS)
456456
echo '; DEF file for Borland C++ Builder' >$@
457457
echo 'LIBRARY BLIB$(UC_NAME)' >>$@
458458
echo 'EXPORTS' >>$@
@@ -551,5 +551,5 @@ clean-lib:
551551

552552
ifneq (,$(SHLIB_EXPORTS))
553553
maintainer-clean-lib:
554-
rm -f $(srcdir)/lib$(NAME)dll.def $(srcdir)/lib$(NAME)ddll.def $(srcdir)/blib$(NAME)dll.def
554+
rm -f lib$(NAME)dll.def lib$(NAME)ddll.def blib$(NAME)dll.def
555555
endif

src/backend/Makefile

+9-9
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
66
# Portions Copyright (c) 1994, Regents of the University of California
77
#
8-
# $PostgreSQL: pgsql/src/backend/Makefile,v 1.133 2009/08/26 22:24:43 petere Exp $
8+
# $PostgreSQL: pgsql/src/backend/Makefile,v 1.134 2009/08/28 20:26:18 petere Exp $
99
#
1010
#-------------------------------------------------------------------------
1111

@@ -118,7 +118,7 @@ postgres.o: $(OBJS)
118118
# the make files in our subdirectories. Note that it's important we
119119
# match the dependencies shown in the subdirectory makefiles!
120120

121-
$(srcdir)/parser/gram.h: parser/gram.y
121+
parser/gram.h: parser/gram.y
122122
$(MAKE) -C parser gram.h
123123

124124
utils/fmgroids.h: utils/Gen_fmgrtab.sh $(top_srcdir)/src/include/catalog/pg_proc.h
@@ -131,7 +131,7 @@ utils/probes.h: utils/probes.d
131131
# we can cut down on the -I options. Also, a symlink is automatically
132132
# up to date when we update the base file.
133133

134-
$(top_builddir)/src/include/parser/gram.h: $(srcdir)/parser/gram.h
134+
$(top_builddir)/src/include/parser/gram.h: parser/gram.h
135135
prereqdir=`cd $(dir $<) >/dev/null && pwd` && \
136136
cd $(dir $@) && rm -f $(notdir $@) && \
137137
$(LN_S) "$$prereqdir/$(notdir $<)" .
@@ -252,12 +252,12 @@ distclean: clean
252252
rm -f port/tas.s port/dynloader.c port/pg_sema.c port/pg_shmem.c
253253

254254
maintainer-clean: distclean
255-
rm -f $(srcdir)/bootstrap/bootparse.c \
256-
$(srcdir)/bootstrap/bootscanner.c \
257-
$(srcdir)/parser/gram.c \
258-
$(srcdir)/parser/scan.c \
259-
$(srcdir)/parser/gram.h \
260-
$(srcdir)/utils/misc/guc-file.c
255+
rm -f bootstrap/bootparse.c \
256+
bootstrap/bootscanner.c \
257+
parser/gram.c \
258+
parser/scan.c \
259+
parser/gram.h \
260+
utils/misc/guc-file.c
261261

262262

263263
##########################################################################

src/backend/bootstrap/Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Makefile for the bootstrap module
44
#
5-
# $PostgreSQL: pgsql/src/backend/bootstrap/Makefile,v 1.37 2008/08/29 13:02:32 petere Exp $
5+
# $PostgreSQL: pgsql/src/backend/bootstrap/Makefile,v 1.38 2009/08/28 20:26:18 petere Exp $
66
#
77
#-------------------------------------------------------------------------
88

@@ -18,16 +18,16 @@ include $(top_srcdir)/src/backend/common.mk
1818

1919

2020
# bootscanner is compiled as part of bootparse
21-
bootparse.o: $(srcdir)/bootscanner.c
21+
bootparse.o: bootscanner.c
2222

23-
$(srcdir)/bootparse.c: bootparse.y
23+
bootparse.c: bootparse.y
2424
ifdef BISON
2525
$(BISON) $(BISONFLAGS) -o $@ $<
2626
else
2727
@$(missing) bison $< $@
2828
endif
2929

30-
$(srcdir)/bootscanner.c: bootscanner.l
30+
bootscanner.c: bootscanner.l
3131
ifdef FLEX
3232
$(FLEX) $(FLEXFLAGS) -o'$@' $<
3333
else

src/backend/parser/Makefile

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Makefile for parser
44
#
5-
# $PostgreSQL: pgsql/src/backend/parser/Makefile,v 1.50 2009/08/26 22:15:59 petere Exp $
5+
# $PostgreSQL: pgsql/src/backend/parser/Makefile,v 1.51 2009/08/28 20:26:19 petere Exp $
66
#
77
#-------------------------------------------------------------------------
88

@@ -22,7 +22,7 @@ include $(top_srcdir)/src/backend/common.mk
2222

2323

2424
# scan is compiled as part of gram
25-
gram.o: $(srcdir)/scan.c
25+
gram.o: scan.c
2626

2727
# Latest flex causes warnings in this file.
2828
ifeq ($(GCC),yes)
@@ -37,17 +37,17 @@ endif
3737
# important, otherwise make will choose the built-in rule for
3838
# gram.y=>gram.c.
3939

40-
$(srcdir)/gram.h: $(srcdir)/gram.c ;
40+
gram.h: gram.c ;
4141

42-
$(srcdir)/gram.c: gram.y
42+
gram.c: gram.y
4343
ifdef BISON
4444
$(BISON) -d $(BISONFLAGS) -o $@ $<
4545
else
4646
@$(missing) bison $< $@
4747
endif
4848

4949

50-
$(srcdir)/scan.c: scan.l
50+
scan.c: scan.l
5151
ifdef FLEX
5252
$(FLEX) $(FLEXFLAGS) -o'$@' $<
5353
else
@@ -56,7 +56,7 @@ endif
5656

5757

5858
# Force these dependencies to be known even without dependency info built:
59-
gram.o keywords.o parser.o: $(srcdir)/gram.h
59+
gram.o keywords.o parser.o: gram.h
6060

6161

6262
# gram.c, gram.h, and scan.c are in the distribution tarball, so they

0 commit comments

Comments
 (0)