Skip to content

Commit 5bb8b62

Browse files
committed
Makefile cleanup for bin and pl subtrees. They should now support
all the standard semantics. Also get rid of Makefile.in's on the way and instead declare all variables in Makefile.global.
1 parent ecef326 commit 5bb8b62

31 files changed

+601
-644
lines changed

configure

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8875,11 +8875,8 @@ trap 'rm -fr `echo "GNUmakefile
88758875
src/backend/port/Makefile
88768876
src/backend/catalog/genbki.sh
88778877
src/backend/utils/Gen_fmgrtab.sh
8878-
src/bin/pg_dump/Makefile
8879-
src/bin/pg_version/Makefile
88808878
src/bin/pgtclsh/mkMakefile.tcldefs.sh
88818879
src/bin/pgtclsh/mkMakefile.tkdefs.sh
8882-
src/bin/psql/Makefile
88838880
src/include/version.h
88848881
src/interfaces/Makefile
88858882
src/interfaces/libpq/Makefile
@@ -8891,11 +8888,7 @@ trap 'rm -fr `echo "GNUmakefile
88918888
src/interfaces/libpgtcl/Makefile
88928889
src/interfaces/odbc/GNUmakefile
88938890
src/interfaces/python/GNUmakefile
8894-
src/pl/Makefile
8895-
src/pl/plpgsql/Makefile
8896-
src/pl/plpgsql/src/Makefile
88978891
src/pl/tcl/mkMakefile.tcldefs.sh
8898-
src/pl/plperl/GNUmakefile
88998892
src/test/regress/GNUmakefile
89008893
src/include/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
89018894
EOF
@@ -9066,11 +9059,8 @@ CONFIG_FILES=\${CONFIG_FILES-"GNUmakefile
90669059
src/backend/port/Makefile
90679060
src/backend/catalog/genbki.sh
90689061
src/backend/utils/Gen_fmgrtab.sh
9069-
src/bin/pg_dump/Makefile
9070-
src/bin/pg_version/Makefile
90719062
src/bin/pgtclsh/mkMakefile.tcldefs.sh
90729063
src/bin/pgtclsh/mkMakefile.tkdefs.sh
9073-
src/bin/psql/Makefile
90749064
src/include/version.h
90759065
src/interfaces/Makefile
90769066
src/interfaces/libpq/Makefile
@@ -9082,11 +9072,7 @@ CONFIG_FILES=\${CONFIG_FILES-"GNUmakefile
90829072
src/interfaces/libpgtcl/Makefile
90839073
src/interfaces/odbc/GNUmakefile
90849074
src/interfaces/python/GNUmakefile
9085-
src/pl/Makefile
9086-
src/pl/plpgsql/Makefile
9087-
src/pl/plpgsql/src/Makefile
90889075
src/pl/tcl/mkMakefile.tcldefs.sh
9089-
src/pl/plperl/GNUmakefile
90909076
src/test/regress/GNUmakefile
90919077
"}
90929078
EOF

configure.in

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,11 +1193,8 @@ AC_OUTPUT(
11931193
src/backend/port/Makefile
11941194
src/backend/catalog/genbki.sh
11951195
src/backend/utils/Gen_fmgrtab.sh
1196-
src/bin/pg_dump/Makefile
1197-
src/bin/pg_version/Makefile
11981196
src/bin/pgtclsh/mkMakefile.tcldefs.sh
11991197
src/bin/pgtclsh/mkMakefile.tkdefs.sh
1200-
src/bin/psql/Makefile
12011198
src/include/version.h
12021199
src/interfaces/Makefile
12031200
src/interfaces/libpq/Makefile
@@ -1209,10 +1206,6 @@ AC_OUTPUT(
12091206
src/interfaces/libpgtcl/Makefile
12101207
src/interfaces/odbc/GNUmakefile
12111208
src/interfaces/python/GNUmakefile
1212-
src/pl/Makefile
1213-
src/pl/plpgsql/Makefile
1214-
src/pl/plpgsql/src/Makefile
12151209
src/pl/tcl/mkMakefile.tcldefs.sh
1216-
src/pl/plperl/GNUmakefile
12171210
src/test/regress/GNUmakefile
12181211
)

src/GNUmakefile.in

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/Attic/GNUmakefile.in,v 1.52 2000/06/10 18:01:36 petere Exp $
10+
# $Header: /cvsroot/pgsql/src/Attic/GNUmakefile.in,v 1.53 2000/06/27 00:30:48 petere Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

@@ -50,18 +50,15 @@ clean:
5050
$(MAKE) -C ../contrib/spi clean
5151

5252
# Not all subdirectories have a make distclean target yet
53-
distclean:
53+
distclean maintainer-clean:
5454
-$(MAKE) -C utils clean
5555
-$(MAKE) -C backend clean
5656
rm -f backend/port/Makefile backend/catalog/genbki.sh \
5757
backend/utils/Gen_fmgrtab.sh \
5858
backend/port/tas.s backend/port/dynloader.c
5959
-$(MAKE) -C interfaces distclean
60-
-$(MAKE) -C bin clean
61-
rm -f bin/pg_dump/Makefile bin/pg_version/Makefile \
62-
bin/psql/Makefile bin/pgtclsh/mkMakefile.tcldefs.sh \
63-
bin/pgtclsh/mkMakefile.tkdefs.sh
64-
-$(MAKE) -C pl distclean
60+
-$(MAKE) -C bin $@
61+
-$(MAKE) -C pl $@
6562
-$(MAKE) -C test clean
6663
rm -f test/regress/GNUmakefile
6764
-$(MAKE) -C ../contrib/spi clean

src/Makefile.global.in

Lines changed: 56 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.80 2000/06/19 16:58:35 petere Exp $
10+
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.81 2000/06/27 00:30:48 petere Exp $
1111
#
1212
# NOTES
1313
# Essentially all Postgres make files include this file and use the
@@ -35,6 +35,17 @@
3535
#
3636
#-------------------------------------------------------------------------
3737

38+
ifndef SRCDIR
39+
# This should be changed once we have separate build dirs.
40+
top_srcdir = $(top_builddir)
41+
ifeq ($(top_builddir), $(top_srcdir))
42+
srcdir = .
43+
else
44+
srcdir = $(top_srcdir)/$(subdir)
45+
endif
46+
VPATH = $(srcdir)
47+
SRCDIR = $(top_builddir)/src
48+
endif
3849

3950
##############################################################################
4051
#
@@ -61,33 +72,29 @@ LIBPQ= -L$(LIBPQDIR) -lpq
6172
LIBPGTCL= -L$(LIBPGTCLDIR) -lpgtcl
6273
LIBPGEASY= -L$(LIBPGEASYDIR) -lpgeasy
6374

64-
# For convenience, POSTGRESDIR is where BINDIR, and LIBDIR
65-
# and other target destinations are rooted. Of course, each of these is
66-
# changable separately.
67-
POSTGRESDIR= @prefix@
68-
69-
# Where the postgres executables live (changeable by just putting them
70-
# somewhere else and putting that directory in your shell PATH)
71-
BINDIR= $(POSTGRESDIR)/bin
72-
73-
# Where libpq.a gets installed. You must put it where your loader will
74-
# look for it if you wish to use the -lpq convention. Otherwise you
75-
# can just put the absolute pathname to the library at the end of your
76-
# command line.
77-
LIBDIR= $(POSTGRESDIR)/lib
78-
79-
# Where the database templates are stored
80-
#
81-
TEMPLATEDIR= $(POSTGRESDIR)/lib
82-
83-
# Where the man pages (suitable for use with "man") get installed.
75+
# installation directories
76+
77+
prefix = @prefix@
78+
exec_prefix = @exec_prefix@
79+
bindir = @bindir@
80+
sbindir = @sbindir@
81+
libexecdir = @libexecdir@
82+
datadir = @datadir@
83+
sysconfdir = @sysconfdir@
84+
sharedstatedir = @sharedstatedir@
85+
localstatedir = @localstatedir@
86+
libdir = @libdir@
87+
includedir = @includedir@
88+
89+
# old variable names for installation directories
90+
91+
POSTGRESDIR= $(prefix)
92+
BINDIR= $(bindir)
93+
LIBDIR= $(libdir)
94+
TEMPLATEDIR= $(libdir)
8495
POSTMANDIR= $(POSTGRESDIR)/man
85-
86-
# Where the formatted documents (e.g., the reference manual) get installed.
8796
POSTDOCDIR= $(POSTGRESDIR)/doc
88-
89-
# Where the header files necessary to build frontend programs get installed.
90-
HEADERDIR= $(POSTGRESDIR)/include
97+
HEADERDIR= $(includedir)
9198

9299

93100
##############################################################################
@@ -105,6 +112,8 @@ ENFORCE_ALIGNMENT= true
105112
#PROFILE= -p -non_shared
106113

107114

115+
with_perl = @with_perl@
116+
108117
#
109118
# Please do not edit USE_TCL and USE_TK by hand.
110119
#
@@ -125,13 +134,21 @@ MULTIBYTE=@MULTIBYTE@
125134
#
126135
# For many ports, INSTALL is overridden below.
127136
INSTALL= @INSTALL@
128-
RANLIB= @RANLIB@
129137

138+
INSTALL_PROGRAM = @INSTALL_PROGRAM@
139+
INSTALL_SCRIPT = @INSTALL_SCRIPT@
140+
INSTALL_DATA = @INSTALL_DATA@
141+
INSTALL_SHLIB = @INSTALL_SHLIB@
142+
143+
mkinstalldirs = @mkinstalldirs@
144+
145+
# don't use these any more
130146
INSTLOPTS= @INSTLOPTS@
131147
INSTL_EXE_OPTS= @INSTL_EXE_OPTS@
132148
INSTL_LIB_OPTS= @INSTL_LIB_OPTS@
133149
INSTL_SHLIB_OPTS= @INSTL_SHLIB_OPTS@
134150

151+
RANLIB= @RANLIB@
135152

136153
#-------------------------------------------------------------
137154
# See the subdirectory template for default settings for these
@@ -154,6 +171,8 @@ DLSUFFIX= @DLSUFFIX@
154171
LN_S= @LN_S@
155172
TAR= @tar@
156173
GZCAT= @GZCAT@
174+
PERL = @PERL@
175+
157176

158177
##############################################################################
159178
#
@@ -238,3 +257,13 @@ ifdef PROFILE
238257
CFLAGS+= $(PROFILE)
239258
LDFLAGS+= $(PROFILE)
240259
endif
260+
261+
262+
# substitute implementations of the C library
263+
STRERROR = @STRERROR@
264+
STRERROR2 = @STRERROR2@
265+
SNPRINTF = @SNPRINTF@
266+
STRDUP = @STRDUP@
267+
268+
.DEFAULT: all
269+
.PHONY: all install installdirs uninstall dep depend clean distclean maintainer-clean

src/bin/Makefile

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,39 @@
11
#-------------------------------------------------------------------------
22
#
3-
# Makefile
4-
# Makefile for src/bin (client programs)
3+
# Makefile for src/bin (client programs)
54
#
65
# Copyright (c) 1994, Regents of the University of California
76
#
8-
#
9-
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.25 2000/01/20 21:51:02 petere Exp $
7+
# $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.26 2000/06/27 00:30:49 petere Exp $
118
#
129
#-------------------------------------------------------------------------
1310

14-
SRCDIR= ..
11+
subdir = src/bin
12+
top_builddir = ../..
1513
include ../Makefile.global
1614

17-
DIRS = pg_id pg_version psql pg_dump pg_passwd \
18-
scripts initdb initlocation ipcclean \
19-
pg_ctl
15+
DIRS := initdb initlocation ipcclean pg_ctl pg_dump pg_id \
16+
pg_passwd pg_version psql scripts
17+
18+
ALLDIRS := $(DIRS) pg_encoding pgaccess pgtclsh
2019

2120
ifdef MULTIBYTE
2221
DIRS += pg_encoding
2322
endif
2423

25-
#
2624
# TCL/TK programs
27-
#
2825
ifeq ($(USE_TCL), true)
2926
ifeq ($(USE_TK), true)
3027
DIRS += pgaccess
3128
endif
3229
DIRS += pgtclsh
3330
endif
3431

35-
.DEFAULT all:
36-
for i in $(DIRS); do $(MAKE) -C $$i $@; done
32+
all install installdirs uninstall depend:
33+
@for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit 1; done
34+
35+
clean:
36+
@for dir in $(DIRS); do $(MAKE) -C $$dir $@; done
37+
38+
distclean maintainer-clean:
39+
@for dir in $(ALLDIRS); do $(MAKE) -C $$dir $@; done

src/bin/initdb/Makefile

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
#-------------------------------------------------------------------------
22
#
3-
# Makefile.inc--
4-
# Makefile for bin/initdb
3+
# Makefile for src/bin/initdb
54
#
65
# Copyright (c) 1994, Regents of the University of California
76
#
8-
#
9-
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/bin/initdb/Makefile,v 1.17 2000/02/16 21:25:59 momjian Exp $
7+
# $Header: /cvsroot/pgsql/src/bin/initdb/Makefile,v 1.18 2000/06/27 00:30:53 petere Exp $
118
#
129
#-------------------------------------------------------------------------
1310

14-
SRCDIR= ../..
11+
subdir = src/bin/initdb
12+
top_builddir = ../../..
1513
include ../../Makefile.global
1614

1715
all: initdb
1816

1917
initdb: initdb.sh
20-
sed -e 's/__MULTIBYTE__/$(MULTIBYTE)/g' < initdb.sh > initdb
18+
sed -e 's/__MULTIBYTE__/$(MULTIBYTE)/g' < $< > $@
2119

22-
install: initdb
23-
$(INSTALL) $(INSTL_EXE_OPTS) $+ $(BINDIR)/$+
20+
install: all installdirs
21+
$(INSTALL_SCRIPT) initdb $(bindir)/initdb
2422

25-
clean:
26-
rm -f initdb
23+
installdirs:
24+
$(mkinstalldirs) $(bindir)
2725

28-
dep depend:
26+
uninstall:
27+
rm -f $(bindir)/initdb
28+
29+
clean distclean maintainer-clean:
30+
rm -f initdb

src/bin/initlocation/Makefile

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
#-------------------------------------------------------------------------
22
#
3-
# Makefile.inc--
4-
# Makefile for bin/initlocation
3+
# Makefile for src/bin/initlocation
54
#
65
# Copyright (c) 1994, Regents of the University of California
76
#
8-
#
9-
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/Makefile,v 1.8 1999/12/08 10:29:43 momjian Exp $
7+
# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/Makefile,v 1.9 2000/06/27 00:31:00 petere Exp $
118
#
129
#-------------------------------------------------------------------------
1310

14-
SRCDIR= ../..
11+
subdir = src/bin/initlocation
12+
top_builddir = ../../..
1513
include ../../Makefile.global
1614

1715
all: initlocation
1816

1917
initlocation: initlocation.sh
20-
cp -p initlocation.sh initlocation
18+
cp $< $@
2119

22-
install: initlocation
23-
$(INSTALL) $(INSTL_EXE_OPTS) $+ $(BINDIR)
20+
install: all installdirs
21+
$(INSTALL_SCRIPT) initlocation $(bindir)/initlocation
2422

25-
clean:
26-
rm -f initlocation
23+
installdirs:
24+
$(mkinstalldirs) $(bindir)
2725

28-
dep depend:
26+
uninstall:
27+
rm -f $(bindir)/initlocation
28+
29+
clean distclean maintainer-clean:
30+
rm -f initlocation

0 commit comments

Comments
 (0)