diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2000-10-20 21:04:27 +0000 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2000-10-20 21:04:27 +0000 |
commit | 805e431a3868ac71681316927403d1ba389e113b (patch) | |
tree | e20ff81ccb4be79cbd43e87cf76f33ee5fb1887d /src | |
parent | 039f3f1b051b189e7ccf0c28d86d415e693ee8d6 (diff) | |
download | postgresql-805e431a3868ac71681316927403d1ba389e113b.tar.gz postgresql-805e431a3868ac71681316927403d1ba389e113b.zip |
Add support for VPATH builds, that is, building somewhere else than in the
source directory. This involves mostly makefiles using $(srcdir) when they
might have used ".". (Regression tests don't work with this, yet.)
Sort out usage of CPPFLAGS, CFLAGS (and CXXFLAGS). Add "override" keyword
in most places, to preserve necessary flags even when the user overrode the
flags.
Diffstat (limited to 'src')
38 files changed, 186 insertions, 201 deletions
diff --git a/src/Makefile.global.in b/src/Makefile.global.in index 38db13d0694..dac5cf0aa58 100644 --- a/src/Makefile.global.in +++ b/src/Makefile.global.in @@ -1,5 +1,5 @@ # -*-makefile-*- -# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.100 2000/10/10 21:22:21 petere Exp $ +# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.101 2000/10/20 21:03:38 petere Exp $ #------------------------------------------------------------------------------ # All PostgreSQL makefiles include this file and use the variables it sets, @@ -18,7 +18,7 @@ # # Meta configuration -.PHONY: all install installdirs uninstall dep depend clean distclean maintainer-clean distprep check installcheck +.PHONY: all install installdirs uninstall clean distclean maintainer-clean distprep check installcheck .SILENT: installdirs # make `all' the default target @@ -31,15 +31,18 @@ all: # PostgreSQL version number VERSION = @VERSION@ -# This should be changed once we have separate build dirs. -top_srcdir = $(top_builddir) +# Support for VPATH builds +abs_top_srcdir = @abs_top_srcdir@ +abs_top_builddir = @abs_top_builddir@ -ifeq ($(top_builddir), $(top_srcdir)) +ifeq ($(abs_top_builddir), $(abs_top_srcdir)) +top_srcdir = $(top_builddir) srcdir = . else +top_srcdir = $(abs_top_srcdir) srcdir = $(top_srcdir)/$(subdir) -endif VPATH = $(srcdir) +endif ########################################################################## @@ -127,19 +130,25 @@ TK_CONFIG_SH = @TK_CONFIG_SH@ # Compilers -CC = @CC@ CPP = @CPP@ -GCC = @GCC@ CPPFLAGS = @CPPFLAGS@ -CFLAGS = -I$(top_srcdir)/src/include $(CPPFLAGS) @CFLAGS@ -CFLAGS_SL = @SHARED_LIB@ -CXX = @CXX@ -CXXFLAGS = @CXXFLAGS@ @INCLUDES@ +override CPPFLAGS += $(sort -I$(top_srcdir)/src/include -I$(top_builddir)/src/include) +CC = @CC@ +GCC = @GCC@ +CFLAGS = @CFLAGS@ +CFLAGS_SL = @SHARED_LIB@ ifeq ($(GCC), yes) CFLAGS += -Wall -Wmissing-prototypes -Wmissing-declarations endif +CXX = @CXX@ +GXX = @GXX@ +CXXFLAGS = @CXXFLAGS@ +ifeq ($(GXX), yes) + CXXFLAGS += -Wall +endif + # Kind-of compilers YACC = @YACC@ @@ -220,7 +229,7 @@ libpq_builddir = $(top_builddir)/src/interfaces/libpq libpq = -L$(libpq_builddir) -lpq libpgeasy_srcdir = $(top_srcdir)/src/interfaces/libpgeasy -libpgeasy_builddir = $(top_builddir/src/interfaces/libpgeasy +libpgeasy_builddir = $(top_builddir)/src/interfaces/libpgeasy libpgeasy = -L$(libpgeasy_builddir) -lpgeasy diff --git a/src/Makefile.shlib b/src/Makefile.shlib index 1a050aaa481..049069a3306 100644 --- a/src/Makefile.shlib +++ b/src/Makefile.shlib @@ -6,7 +6,7 @@ # Copyright (c) 1998, Regents of the University of California # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.25 2000/10/10 21:22:21 petere Exp $ +# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.26 2000/10/20 21:03:38 petere Exp $ # #------------------------------------------------------------------------- @@ -78,7 +78,7 @@ ifeq ($(PORTNAME), openbsd) else LDFLAGS_SL := -x -Bshareable -Bforcearchive endif - CFLAGS += $(CFLAGS_SL) + override CFLAGS += $(CFLAGS_SL) endif endif @@ -87,13 +87,13 @@ ifeq ($(PORTNAME), bsdi) ifeq ($(DLSUFFIX), .so) shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION) LDFLAGS_SL += -shared -soname $(shlib) - CFLAGS += $(CFLAGS_SL) + override CFLAGS += $(CFLAGS_SL) endif ifeq ($(DLSUFFIX), .o) shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION) LD := shlicc LDFLAGS_SL += -O $(LDREL) - CFLAGS += $(CFLAGS_SL) + override CFLAGS += $(CFLAGS_SL) endif endif endif @@ -107,7 +107,7 @@ ifeq ($(PORTNAME), freebsd) shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION) LDFLAGS_SL := -x -Bshareable -Bforcearchive endif - CFLAGS += $(CFLAGS_SL) + override CFLAGS += $(CFLAGS_SL) endif endif @@ -124,7 +124,7 @@ ifeq ($(PORTNAME), netbsd) else LDFLAGS_SL := -x -Bshareable -Bforcearchive endif - CFLAGS += $(CFLAGS_SL) + override CFLAGS += $(CFLAGS_SL) endif endif @@ -132,13 +132,13 @@ ifeq ($(PORTNAME), hpux) # HPUX doesn't believe in version numbers for shlibs shlib := lib$(NAME)$(DLSUFFIX) LDFLAGS_SL := -b - CFLAGS += $(CFLAGS_SL) + override CFLAGS += $(CFLAGS_SL) endif ifeq ($(PORTNAME), irix5) shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) LDFLAGS_SL := -shared -rpath $(libdir) -set_version sgi$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION) - CFLAGS += $(CFLAGS_SL) + override CFLAGS += $(CFLAGS_SL) endif ifeq ($(PORTNAME), linux) @@ -146,14 +146,14 @@ ifeq ($(PORTNAME), linux) LD := $(CC) LDFLAGS_SL := -shared -Wl,-soname,$(shlib) LDFLAGS_ODBC := -lm - CFLAGS += $(CFLAGS_SL) + override CFLAGS += $(CFLAGS_SL) endif ifeq ($(PORTNAME), solaris) shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION) LDFLAGS_SL := -G SHLIB_LINK += -ldl -lsocket -lresolv -lnsl -lm -lc - CFLAGS += $(CFLAGS_SL) + override CFLAGS += $(CFLAGS_SL) endif ifeq ($(PORTNAME), osf) @@ -164,15 +164,15 @@ endif ifeq ($(PORTNAME), svr4) shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION) LDFLAGS_SL := -G - CFLAGS += $(CFLAGS_SL) + override CFLAGS += $(CFLAGS_SL) endif ifeq ($(PORTNAME), univel) shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION) LDFLAGS_SL := -G -z text - CFLAGS += $(CFLAGS_SL) + override CFLAGS += $(CFLAGS_SL) ifeq ($(CXX), CC) - CXXFLAGS += -Xw + override CXXFLAGS += -Xw COMPILE.cc = $(CXX) $(CXXFLAGS:ll,alloca=ll) $(CPPFLAGS) $(TARGET_ARCH) -c endif endif @@ -180,9 +180,9 @@ endif ifeq ($(PORTNAME), unixware) shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION) LDFLAGS_SL := -G -z text - CFLAGS += $(CFLAGS_SL) + override CFLAGS += $(CFLAGS_SL) ifeq ($(CXX), CC) - CXXFLAGS += -Xw + override CXXFLAGS += -Xw COMPILE.cc = $(CXX) $(CXXFLAGS:ll,alloca=ll) $(CPPFLAGS) $(TARGET_ARCH) -c endif endif diff --git a/src/backend/Makefile b/src/backend/Makefile index 3b29f52307b..07c18427bf9 100644 --- a/src/backend/Makefile +++ b/src/backend/Makefile @@ -4,7 +4,7 @@ # # Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.66 2000/10/07 18:43:22 petere Exp $ +# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.67 2000/10/20 21:03:39 petere Exp $ # #------------------------------------------------------------------------- @@ -58,7 +58,7 @@ $(OBJS): $(DIRS:%=%-recursive) .PHONY: $(DIRS:%=%-recursive) # Update the commonly used headers before building the subdirectories -$(DIRS:%=%-recursive): $(top_srcdir)/src/include/parser/parse.h $(top_builddir)/src/include/utils/fmgroids.h +$(DIRS:%=%-recursive): $(top_builddir)/src/include/parser/parse.h $(top_builddir)/src/include/utils/fmgroids.h $(MAKE) -C $(subst -recursive,,$@) all @@ -98,8 +98,9 @@ utils/fmgroids.h: utils/Gen_fmgrtab.sh $(top_srcdir)/src/include/catalog/pg_proc # up to date when we update the base file. $(top_builddir)/src/include/parser/parse.h: $(srcdir)/parser/parse.h - cd $(dir $@) && rm -f $(notdir $@) && \ - $(LN_S) ../../../$(subdir)/parser/parse.h . + prereqdir=`cd $(dir $<) && pwd` && \ + cd $(dir $@) && rm -f $(notdir $@) && \ + $(LN_S) $$prereqdir/$(notdir $<) . $(top_builddir)/src/include/utils/fmgroids.h: utils/fmgroids.h cd $(dir $@) && rm -f $(notdir $@) && \ @@ -123,9 +124,9 @@ ifeq ($(MAKE_DLL), true) endif endif $(MAKE) -C catalog install-bki - $(INSTALL_DATA) libpq/pg_hba.conf.sample $(DESTDIR)$(datadir)/pg_hba.conf.sample - $(INSTALL_DATA) libpq/pg_ident.conf.sample $(DESTDIR)$(datadir)/pg_ident.conf.sample - $(INSTALL_DATA) utils/misc/postgresql.conf.sample $(DESTDIR)$(datadir)/postgresql.conf.sample + $(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample $(DESTDIR)$(datadir)/pg_hba.conf.sample + $(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample $(DESTDIR)$(datadir)/pg_ident.conf.sample + $(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample $(DESTDIR)$(datadir)/postgresql.conf.sample installdirs: $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(DESTDIR)$(datadir) diff --git a/src/backend/bootstrap/Makefile b/src/backend/bootstrap/Makefile index cf3b29477e0..681043ca52f 100644 --- a/src/backend/bootstrap/Makefile +++ b/src/backend/bootstrap/Makefile @@ -2,7 +2,7 @@ # # Makefile for the bootstrap module # -# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.25 2000/08/28 11:53:17 petere Exp $ +# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.26 2000/10/20 21:03:41 petere Exp $ # #------------------------------------------------------------------------- @@ -11,7 +11,7 @@ top_builddir = ../../.. include $(top_builddir)/src/Makefile.global ifeq ($(GCC), yes) -CFLAGS+= -Wno-error +override CFLAGS+= -Wno-error endif # qnx4's wlink currently crashes with bootstrap.o diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile index c158ed4fcd2..022e41b30ca 100644 --- a/src/backend/catalog/Makefile +++ b/src/backend/catalog/Makefile @@ -2,7 +2,7 @@ # # Makefile for catalog # -# $Header: /cvsroot/pgsql/src/backend/catalog/Makefile,v 1.27 2000/10/08 03:53:13 momjian Exp $ +# $Header: /cvsroot/pgsql/src/backend/catalog/Makefile,v 1.28 2000/10/20 21:03:42 petere Exp $ # #------------------------------------------------------------------------- @@ -34,12 +34,15 @@ TEMPLATE1_BKI_SRCS := $(addprefix $(top_srcdir)/src/include/catalog/,\ pg_rewrite.h pg_listener.h pg_description.h indexing.h \ ) +pg_includes := $(sort -I$(top_srcdir)/src/include -I$(top_builddir)/src/include) -global.bki global.description: genbki.sh $(GLOBAL_BKI_SRCS) $(top_srcdir)/src/include/catalog/indexing.h - CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $< $(BKIOPTS) -o global -I$(top_srcdir)/src/include $(GLOBAL_BKI_SRCS) +global.bki global.description: genbki.sh $(GLOBAL_BKI_SRCS) $(top_srcdir)/src/include/catalog/indexing.h \ + $(top_srcdir)/src/include/postgres_ext.h $(top_builddir)/src/include/config.h + CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $< $(BKIOPTS) -o global $(pg_includes) $(GLOBAL_BKI_SRCS) -template1.bki template1.description: genbki.sh $(TEMPLATE1_BKI_SRCS) - CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $< $(BKIOPTS) -o template1 -I$(top_srcdir)/src/include $(TEMPLATE1_BKI_SRCS) +template1.bki template1.description: genbki.sh $(TEMPLATE1_BKI_SRCS) \ + $(top_srcdir)/src/include/postgres_ext.h $(top_builddir)/src/include/config.h + CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $< $(BKIOPTS) -o template1 $(pg_includes) $(TEMPLATE1_BKI_SRCS) .PHONY: install-bki install-bki: $(BKIFILES) installdirs diff --git a/src/backend/catalog/genbki.sh b/src/backend/catalog/genbki.sh index d0a81c21112..bcd62ba0aff 100644 --- a/src/backend/catalog/genbki.sh +++ b/src/backend/catalog/genbki.sh @@ -10,7 +10,7 @@ # # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/backend/catalog/Attic/genbki.sh,v 1.16 2000/07/09 13:16:12 petere Exp $ +# $Header: /cvsroot/pgsql/src/backend/catalog/Attic/genbki.sh,v 1.17 2000/10/20 21:03:42 petere Exp $ # # NOTES # non-essential whitespace is removed from the generated file. @@ -25,7 +25,7 @@ CMDNAME=`basename $0` BKIOPTS= -INCLUDE_DIR= +INCLUDE_DIRS= OUTPUT_PREFIX= INFILES= @@ -42,10 +42,11 @@ do BKIOPTS="$BKIOPTS $1" ;; -I) - INCLUDE_DIR="$2" + INCLUDE_DIRS="$INCLUDE_DIRS $2" shift;; -I*) - INCLUDE_DIR=`echo $1 | sed -e 's/^-I//'` + arg=`echo $1 | sed -e 's/^-I//'` + INCLUDE_DIRS="$INCLUDE_DIRS $arg" ;; -o) OUTPUT_PREFIX="$2" @@ -91,7 +92,7 @@ if [ x"$OUTPUT_PREFIX" = x"" ] ; then exit 1 fi -if [ x"$INCLUDE_DIR" = x"" ] ; then +if [ x"$INCLUDE_DIRS" = x"" ] ; then echo "$CMDNAME: path to include directory unknown" 1>&2 exit 1 fi @@ -113,17 +114,27 @@ trap "rm -f $TMPFILE" 0 1 2 3 15 # Get NAMEDATALEN from postgres_ext.h -NAMEDATALEN=`grep '#define[ ]*NAMEDATALEN' $INCLUDE_DIR/postgres_ext.h | awk '{ print $3 }'` +for dir in $INCLUDE_DIRS; do + if [ -f "$dir/postgres_ext.h" ]; then + NAMEDATALEN=`grep '#define[ ]*NAMEDATALEN' $dir/postgres_ext.h | $AWK '{ print $3 }'` + break + fi +done # Get INDEX_MAX_KEYS from config.h (who needs consistency?) -INDEXMAXKEYS=`grep '#define[ ]*INDEX_MAX_KEYS' $INCLUDE_DIR/config.h | awk '{ print $3 }'` +for dir in $INCLUDE_DIRS; do + if [ -f "$dir/config.h" ]; then + INDEXMAXKEYS=`grep '#define[ ]*INDEX_MAX_KEYS' $dir/config.h | $AWK '{ print $3 }'` + break + fi +done # NOTE: we assume here that FUNC_MAX_ARGS has the same value as INDEX_MAX_KEYS, # and don't read it separately from config.h. This is OK because both of them # must be equal to the length of oidvector. -INDEXMAXKEYS2=`expr $INDEXMAXKEYS '*' 2` -INDEXMAXKEYS4=`expr $INDEXMAXKEYS '*' 4` +INDEXMAXKEYS2=`expr $INDEXMAXKEYS '*' 2` || exit +INDEXMAXKEYS4=`expr $INDEXMAXKEYS '*' 4` || exit # ---------------- # strip comments and trash from .h before we generate diff --git a/src/backend/parser/Makefile b/src/backend/parser/Makefile index 68fed79d382..dca40de519f 100644 --- a/src/backend/parser/Makefile +++ b/src/backend/parser/Makefile @@ -2,7 +2,7 @@ # # Makefile for parser # -# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.30 2000/09/12 21:07:00 tgl Exp $ +# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.31 2000/10/20 21:03:44 petere Exp $ # #------------------------------------------------------------------------- @@ -11,7 +11,7 @@ top_builddir = ../../.. include $(top_builddir)/src/Makefile.global ifeq ($(GCC), yes) -CFLAGS+= -Wno-error +override CFLAGS+= -Wno-error endif OBJS= analyze.o gram.o keywords.o parser.o parse_agg.o parse_clause.o \ diff --git a/src/backend/port/Makefile.in b/src/backend/port/Makefile.in index 44b0a7ee9b0..2b3430a05a0 100644 --- a/src/backend/port/Makefile.in +++ b/src/backend/port/Makefile.in @@ -13,7 +13,7 @@ # be converted to Method 2. # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/backend/port/Attic/Makefile.in,v 1.26 2000/10/09 16:42:53 petere Exp $ +# $Header: /cvsroot/pgsql/src/backend/port/Attic/Makefile.in,v 1.27 2000/10/20 21:03:45 petere Exp $ # #------------------------------------------------------------------------- @@ -46,7 +46,7 @@ beos.dir: $(MAKE) -C beos all tas.o: tas.s - $(CC) $(CFLAGS) -c tas.s + $(CC) $(CFLAGS) -c $< distclean clean: rm -f SUBSYS.o $(OBJS) diff --git a/src/backend/regex/Makefile b/src/backend/regex/Makefile index 6b7ba34a15a..9d2d929b689 100644 --- a/src/backend/regex/Makefile +++ b/src/backend/regex/Makefile @@ -4,7 +4,7 @@ # Makefile for regex # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/backend/regex/Makefile,v 1.14 2000/08/31 16:10:25 petere Exp $ +# $Header: /cvsroot/pgsql/src/backend/regex/Makefile,v 1.15 2000/10/20 21:03:46 petere Exp $ # #------------------------------------------------------------------------- @@ -12,7 +12,7 @@ subdir = src/backend/regex top_builddir = ../../.. include $(top_builddir)/src/Makefile.global -CPPFLAGS += -DPOSIX_MISTAKE +override CPPFLAGS += -DPOSIX_MISTAKE DEBUGOBJ = @@ -28,7 +28,7 @@ SUBSYS.o: $(OBJS) $(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS) retest: retest.o SUBSYS.o $(DEBUGOBJ) - $(CC) $(CFLAGS) -o retest retest.o SUBSYS.o $(DEBUGOBJ) + $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) depend dep: $(CC) -MM $(CFLAGS) *.c >depend diff --git a/src/backend/storage/ipc/Makefile b/src/backend/storage/ipc/Makefile index 51b3ed5c46c..44c9744b587 100644 --- a/src/backend/storage/ipc/Makefile +++ b/src/backend/storage/ipc/Makefile @@ -1,7 +1,7 @@ # # Makefile for storage/ipc # -# $Header: /cvsroot/pgsql/src/backend/storage/ipc/Makefile,v 1.14 2000/09/29 17:17:33 petere Exp $ +# $Header: /cvsroot/pgsql/src/backend/storage/ipc/Makefile,v 1.15 2000/10/20 21:03:47 petere Exp $ # subdir = src/backend/storage/ipc @@ -11,7 +11,7 @@ include $(top_builddir)/src/Makefile.global # seems to be required 1999/07/22 bjm ifeq "$(findstring alpha,$(host_cpu))" "alpha" ifeq "$(GCC)" "yes" -CFLAGS+= -fno-inline +override CFLAGS+= -fno-inline endif endif diff --git a/src/backend/tioga/Makefile b/src/backend/tioga/Makefile index e8a3d8b4600..c4460896f76 100644 --- a/src/backend/tioga/Makefile +++ b/src/backend/tioga/Makefile @@ -4,7 +4,7 @@ # Makefile for tioga # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/backend/tioga/Attic/Makefile,v 1.8 2000/08/31 16:10:41 petere Exp $ +# $Header: /cvsroot/pgsql/src/backend/tioga/Attic/Makefile,v 1.9 2000/10/20 21:03:50 petere Exp $ # #------------------------------------------------------------------------- @@ -13,7 +13,7 @@ top_builddir = ../../.. include $(top_builddir)/src/Makefile.global OBJS = tgRecipe.o Varray.o -CPPFLAGS += -I$(srcdir) +override CPPFLAGS += -I$(srcdir) all: SUBSYS.o diff --git a/src/backend/utils/adt/Makefile b/src/backend/utils/adt/Makefile index 1504430477a..75ba6448beb 100644 --- a/src/backend/utils/adt/Makefile +++ b/src/backend/utils/adt/Makefile @@ -1,7 +1,7 @@ # # Makefile for utils/adt # -# $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.47 2000/09/29 17:17:33 petere Exp $ +# $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.48 2000/10/20 21:03:52 petere Exp $ # subdir = src/backend/utils/adt @@ -11,7 +11,7 @@ include $(top_builddir)/src/Makefile.global # seems to be required for some date/time stuff 1999/07/22 bjm ifeq "$(findstring alpha,$(host_cpu))" "alpha" ifeq "$(GCC)" "yes" -CFLAGS+= -mieee +override CFLAGS+= -mieee endif endif diff --git a/src/backend/utils/mb/Makefile b/src/backend/utils/mb/Makefile index b371bee40e7..ecbb151b682 100644 --- a/src/backend/utils/mb/Makefile +++ b/src/backend/utils/mb/Makefile @@ -4,7 +4,7 @@ # Makefile for utils/mb # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/backend/utils/mb/Makefile,v 1.11 2000/10/12 06:06:49 ishii Exp $ +# $Header: /cvsroot/pgsql/src/backend/utils/mb/Makefile,v 1.12 2000/10/20 21:03:53 petere Exp $ # #------------------------------------------------------------------------- @@ -20,48 +20,22 @@ all: SUBSYS.o SUBSYS.o: $(OBJS) $(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS) -palloc.o: palloc.c - $(CC) -c $(CFLAGS) palloc.c - -sjistest.o: sjistest.c - $(CC) -c $(CFLAGS) sjistest.c - -liketest.o: liketest.c - $(CC) -c $(CFLAGS) liketest.c - -uconv.o: uconv.c - $(CC) -c $(CFLAGS) uconv.c - -uconv2.o: uconv2.c - $(CC) -c $(CFLAGS) uconv2.c - utftest.o: utftest.c conv.c wchar.c mbutils.c - $(CC) -c $(CFLAGS) utftest.c -sjistest: $(OBJS) sjistest.o palloc.o - $(CC) -o sjistest sjistest.o palloc.o \ - common.o mbutils.o wchar.o wstrcmp.o wstrncmp.o variable.o \ - big5.o $(LDFLAGS) +sjistest: sjistest.o palloc.o common.o mbutils.o wchar.o wstrcmp.o wstrncmp.o variable.o big5.o + $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) -liketest: $(OBJS) liketest.o palloc.o - $(CC) -o liketest liketest.o palloc.o conv.o \ - common.o mbutils.o wchar.o wstrcmp.o wstrncmp.o variable.o \ - big5.o $(LDFLAGS) +liketest: liketest.o palloc.o $(OBJS) + $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) -utftest: $(OBJS) utftest.o palloc.o - $(CC) -o utftest utftest.o palloc.o \ - common.o wstrcmp.o wstrncmp.o variable.o \ - big5.o $(LDFLAGS) +utftest: utftest.o palloc.o common.o wstrcmp.o wstrncmp.o variable.o big5.o + $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) -uconv: uconv.o palloc.o - $(CC) -o uconv uconv.o palloc.o \ - common.o conv.o wchar.o \ - big5.o mbutils.o $(LDFLAGS) +uconv: uconv.o palloc.o common.o conv.o wchar.o big5.o mbutils.o + $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) -uconv2: uconv2.o palloc.o - $(CC) -o uconv2 uconv2.o palloc.o \ - common.o conv.o wchar.o \ - big5.o mbutils.o $(LDFLAGS) +uconv2: uconv2.o palloc.o common.o conv.o wchar.o big5.o mbutils.o + $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) depend dep: $(CC) -MM $(CFLAGS) *.c >depend diff --git a/src/backend/utils/misc/Makefile b/src/backend/utils/misc/Makefile index 140ce9df17c..10b759dae8e 100644 --- a/src/backend/utils/misc/Makefile +++ b/src/backend/utils/misc/Makefile @@ -1,4 +1,4 @@ -# $Header: /cvsroot/pgsql/src/backend/utils/misc/Makefile,v 1.18 2000/08/28 11:53:20 petere Exp $ +# $Header: /cvsroot/pgsql/src/backend/utils/misc/Makefile,v 1.19 2000/10/20 21:03:55 petere Exp $ subdir = src/backend/utils/misc top_builddir = ../../../.. @@ -9,7 +9,7 @@ OBJS = database.o superuser.o guc.o guc-file.o ps_status.o # This location might depend on the installation directories. Therefore # we can't subsitute it into config.h. ifdef krb_srvtab -CPPFLAGS += -DPG_KRB_SRVTAB='"$(krb_srvtab)"' +override CPPFLAGS += -DPG_KRB_SRVTAB='"$(krb_srvtab)"' endif @@ -18,7 +18,7 @@ all: SUBSYS.o SUBSYS.o: $(OBJS) $(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS) -guc-file.c: guc-file.l +$(srcdir)/guc-file.c: guc-file.l ifdef FLEX $(FLEX) $(FLEXFLAGS) $< sed -e 's/^yy/GUC_yy/g' -e 's/\([^a-zA-Z0-9_]\)yy/\1GUC_yy/g' lex.yy.c > $@ diff --git a/src/bin/pg_dump/Makefile b/src/bin/pg_dump/Makefile index 11424b11c40..ba9a08900b2 100644 --- a/src/bin/pg_dump/Makefile +++ b/src/bin/pg_dump/Makefile @@ -4,7 +4,7 @@ # # Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.25 2000/09/17 13:02:36 petere Exp $ +# $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.26 2000/10/20 21:03:56 petere Exp $ # #------------------------------------------------------------------------- @@ -15,8 +15,7 @@ include $(top_builddir)/src/Makefile.global OBJS= pg_backup_archiver.o pg_backup_db.o pg_backup_custom.o pg_backup_files.o \ pg_backup_null.o pg_backup_tar.o $(STRDUP) -CPPFLAGS+= -I$(libpq_srcdir) -LIBS+= -lz +override CPPFLAGS+= -I$(libpq_srcdir) all: submake pg_dump pg_restore pg_dumpall @@ -44,7 +43,7 @@ install: all installdirs $(INSTALL_PROGRAM) pg_dump$(X) $(DESTDIR)$(bindir)/pg_dump$(X) $(INSTALL_PROGRAM) pg_restore$(X) $(DESTDIR)$(bindir)/pg_restore$(X) $(INSTALL_SCRIPT) pg_dumpall $(DESTDIR)$(bindir)/pg_dumpall - $(INSTALL_SCRIPT) pg_upgrade $(DESTDIR)$(bindir)/pg_upgrade + $(INSTALL_SCRIPT) $(srcdir)/pg_upgrade $(DESTDIR)$(bindir)/pg_upgrade installdirs: $(mkinstalldirs) $(DESTDIR)$(bindir) diff --git a/src/bin/pgaccess/Makefile b/src/bin/pgaccess/Makefile index 8360973208a..224d5dc1d68 100644 --- a/src/bin/pgaccess/Makefile +++ b/src/bin/pgaccess/Makefile @@ -4,7 +4,7 @@ # # Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/bin/pgaccess/Attic/Makefile,v 1.13 2000/09/25 22:22:56 petere Exp $ +# $Header: /cvsroot/pgsql/src/bin/pgaccess/Attic/Makefile,v 1.14 2000/10/20 21:03:58 petere Exp $ # #------------------------------------------------------------------------- @@ -24,11 +24,11 @@ pgaccess: pgaccess.sh $(top_builddir)/src/Makefile.global install: all installdirs $(INSTALL_SCRIPT) pgaccess $(DESTDIR)$(bindir)/pgaccess - $(INSTALL_SCRIPT) main.tcl $(DESTDIR)$(pgaccessdir) - for i in lib/*.tcl; do $(INSTALL_DATA) $$i $(DESTDIR)$(pgaccessdir)/lib || exit 1; done - for i in lib/help/*.hlp; do $(INSTALL_DATA) $$i $(DESTDIR)$(pgaccessdir)/lib/help || exit 1; done - for i in lib/languages/[a-z]*; do $(INSTALL_DATA) $$i $(DESTDIR)$(pgaccessdir)/lib/languages || exit 1; done - for i in images/*.gif; do $(INSTALL_DATA) $$i $(DESTDIR)$(pgaccessdir)/images || exit 1; done + $(INSTALL_SCRIPT) $(srcdir)/main.tcl $(DESTDIR)$(pgaccessdir) + for i in $(srcdir)/lib/*.tcl; do $(INSTALL_DATA) $$i $(DESTDIR)$(pgaccessdir)/lib || exit 1; done + for i in $(srcdir)/lib/help/*.hlp; do $(INSTALL_DATA) $$i $(DESTDIR)$(pgaccessdir)/lib/help || exit 1; done + for i in $(srcdir)/lib/languages/[a-z]*; do $(INSTALL_DATA) $$i $(DESTDIR)$(pgaccessdir)/lib/languages || exit 1; done + for i in $(srcdir)/images/*.gif; do $(INSTALL_DATA) $$i $(DESTDIR)$(pgaccessdir)/images || exit 1; done installdirs: $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(pgaccessdir)/lib/help $(DESTDIR)$(pgaccessdir)/lib/languages $(DESTDIR)$(pgaccessdir)/images diff --git a/src/bin/pgtclsh/Makefile b/src/bin/pgtclsh/Makefile index 053b50a6f09..02b19c8b269 100644 --- a/src/bin/pgtclsh/Makefile +++ b/src/bin/pgtclsh/Makefile @@ -5,7 +5,7 @@ # # Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.33 2000/09/25 22:22:58 petere Exp $ +# $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.34 2000/10/20 21:04:00 petere Exp $ # #------------------------------------------------------------------------- @@ -25,7 +25,7 @@ libpgtcl_srcdir = $(top_srcdir)/src/interfaces/libpgtcl libpgtcl_builddir = $(top_builddir)/src/interfaces/libpgtcl libpgtcl = -L$(libpgtcl_builddir) -lpgtcl -CPPFLAGS += -I$(libpgtcl_srcdir) $(TK_XINCLUDES) +override CPPFLAGS += -I$(libpgtcl_srcdir) $(TK_XINCLUDES) # If we are here then Tcl is available diff --git a/src/bin/psql/Makefile b/src/bin/psql/Makefile index fe84492ed36..bd38be47b4e 100644 --- a/src/bin/psql/Makefile +++ b/src/bin/psql/Makefile @@ -4,7 +4,7 @@ # # Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.25 2000/09/17 13:02:43 petere Exp $ +# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.26 2000/10/20 21:04:01 petere Exp $ # #------------------------------------------------------------------------- @@ -14,7 +14,7 @@ include $(top_builddir)/src/Makefile.global REFDOCDIR= $(top_srcdir)/doc/src/sgml/ref -CPPFLAGS+= -I$(libpq_srcdir) +override CPPFLAGS+= -I$(libpq_srcdir) OBJS=command.o common.o help.o input.o stringutils.o mainloop.o \ copy.o startup.o prompt.o variables.o large_obj.o print.o describe.o \ @@ -83,7 +83,7 @@ clean distclean: rm -f psql$(X) $(OBJS) maintainer-clean: distclean - rm -f sql_help.h + rm -f $(srcdir)/sql_help.h ifeq (depend,$(wildcard depend)) include depend diff --git a/src/bin/scripts/Makefile b/src/bin/scripts/Makefile index 829dc136bdc..a891c1bcda6 100644 --- a/src/bin/scripts/Makefile +++ b/src/bin/scripts/Makefile @@ -4,7 +4,7 @@ # # Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/bin/scripts/Makefile,v 1.10 2000/09/17 13:02:44 petere Exp $ +# $Header: /cvsroot/pgsql/src/bin/scripts/Makefile,v 1.11 2000/10/20 21:04:03 petere Exp $ # #------------------------------------------------------------------------- @@ -23,7 +23,10 @@ createlang: createlang.sh chmod a+x $@ install: all installdirs - for i in $(SCRIPTS); do $(INSTALL_SCRIPT) $$i $(DESTDIR)$(bindir)/$$i || exit; done + for i in $(filter-out createlang, $(SCRIPTS)); do \ + $(INSTALL_SCRIPT) $(srcdir)/$$i $(DESTDIR)$(bindir)/$$i || exit; \ + done + $(INSTALL_SCRIPT) createlang $(DESTDIR)$(bindir)/createlang installdirs: $(mkinstalldirs) $(DESTDIR)$(bindir) diff --git a/src/include/Makefile b/src/include/Makefile index a238c1114b6..2b78e9ef627 100644 --- a/src/include/Makefile +++ b/src/include/Makefile @@ -5,7 +5,7 @@ # Install exported headers to the include directory (these headers are # the minimal ones needed to build loadable backend extensions). # -# $Header: /cvsroot/pgsql/src/include/Makefile,v 1.4 2000/09/17 13:02:44 petere Exp $ +# $Header: /cvsroot/pgsql/src/include/Makefile,v 1.5 2000/10/20 21:04:03 petere Exp $ # #------------------------------------------------------------------------- @@ -14,11 +14,15 @@ top_builddir = ../.. include $(top_builddir)/src/Makefile.global -HEADERS := os.h config.h c.h postgres.h postgres_ext.h fmgr.h \ +srcdir_headers := c.h postgres.h postgres_ext.h fmgr.h \ libpq/pqcomm.h libpq/libpq-fs.h lib/dllist.h \ - utils/geo_decls.h utils/elog.h utils/fmgroids.h utils/palloc.h \ + utils/geo_decls.h utils/elog.h utils/palloc.h \ access/attnum.h executor/spi.h commands/trigger.h +builddir_headers := os.h config.h utils/fmgroids.h + +HEADERS = $(srcdir_headers) $(builddir_headers) + all: $(HEADERS) @@ -35,8 +39,11 @@ $(top_builddir)/src/backend/utils/fmgroids.h: $(top_srcdir)/src/backend/utils/Ge install: all installdirs - for i in $(HEADERS); do \ - $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir)/$$i || exit; \ + for file in $(srcdir_headers); do \ + $(INSTALL_DATA) $(srcdir)/$$file $(DESTDIR)$(includedir)/$$file || exit; \ + done + for file in $(builddir_headers); do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/$$file || exit; \ done # Automatically pick out the needed subdirectories for the include diff --git a/src/interfaces/ecpg/lib/Makefile b/src/interfaces/ecpg/lib/Makefile index 591a286f0e9..9d150abb4e8 100644 --- a/src/interfaces/ecpg/lib/Makefile +++ b/src/interfaces/ecpg/lib/Makefile @@ -4,7 +4,7 @@ # # Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile,v 1.9 2000/09/19 11:47:13 meskes Exp $ +# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile,v 1.10 2000/10/20 21:04:05 petere Exp $ # #------------------------------------------------------------------------- @@ -16,7 +16,7 @@ NAME= ecpg SO_MAJOR_VERSION= 3 SO_MINOR_VERSION= 2.0 -CPPFLAGS += -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) +override CPPFLAGS += -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) OBJS= execute.o typename.o descriptor.o data.o error.o prepare.o memory.o \ diff --git a/src/interfaces/ecpg/preproc/Makefile b/src/interfaces/ecpg/preproc/Makefile index b2ab66ef342..048a13080cf 100644 --- a/src/interfaces/ecpg/preproc/Makefile +++ b/src/interfaces/ecpg/preproc/Makefile @@ -6,7 +6,7 @@ MAJOR_VERSION=2 MINOR_VERSION=8 PATCHLEVEL=0 -CPPFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \ +override CPPFLAGS+=-I$(srcdir)/../include -DMAJOR_VERSION=$(MAJOR_VERSION) \ -DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \ -DINCLUDE_PATH=\"$(includedir)\" diff --git a/src/interfaces/libpgeasy/Makefile b/src/interfaces/libpgeasy/Makefile index 02a04cdb9b4..ae0e7ff78e6 100644 --- a/src/interfaces/libpgeasy/Makefile +++ b/src/interfaces/libpgeasy/Makefile @@ -2,7 +2,7 @@ # # Makefile for src/interfaces/libpgeasy # -# $Header: /cvsroot/pgsql/src/interfaces/libpgeasy/Attic/Makefile,v 1.3 2000/09/17 13:02:48 petere Exp $ +# $Header: /cvsroot/pgsql/src/interfaces/libpgeasy/Attic/Makefile,v 1.4 2000/10/20 21:04:07 petere Exp $ # #------------------------------------------------------------------------- @@ -16,7 +16,7 @@ NAME= pgeasy SO_MAJOR_VERSION= 2 SO_MINOR_VERSION= 1 -CPPFLAGS += -I$(libpq_srcdir) +override CPPFLAGS += -I$(libpq_srcdir) OBJS= libpgeasy.o halt.o diff --git a/src/interfaces/libpgtcl/Makefile b/src/interfaces/libpgtcl/Makefile index a20970c098a..95894cc65d3 100644 --- a/src/interfaces/libpgtcl/Makefile +++ b/src/interfaces/libpgtcl/Makefile @@ -4,7 +4,7 @@ # # Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile,v 1.22 2000/09/25 22:23:00 petere Exp $ +# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile,v 1.23 2000/10/20 21:04:10 petere Exp $ # #------------------------------------------------------------------------- @@ -16,7 +16,7 @@ NAME= pgtcl SO_MAJOR_VERSION= 2 SO_MINOR_VERSION= 1 -CPPFLAGS += -I$(libpq_srcdir) +override CPPFLAGS += -I$(libpq_srcdir) OBJS= pgtcl.o pgtclCmds.o pgtclId.o diff --git a/src/interfaces/libpq++/Makefile b/src/interfaces/libpq++/Makefile index 8c4afddad56..1d5b82e174d 100644 --- a/src/interfaces/libpq++/Makefile +++ b/src/interfaces/libpq++/Makefile @@ -4,7 +4,7 @@ # # Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/Makefile,v 1.25 2000/09/17 13:02:50 petere Exp $ +# $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/Makefile,v 1.26 2000/10/20 21:04:12 petere Exp $ # #------------------------------------------------------------------------- @@ -16,8 +16,7 @@ NAME= pq++ SO_MAJOR_VERSION= 3 SO_MINOR_VERSION= 1 -SRCHEADERDIR = $(top_srcdir)/src/include -CXXFLAGS+= -I$(SRCHEADERDIR) -I$(libpq_srcdir) +override CPPFLAGS += -I$(libpq_srcdir) OBJS = pgconnection.o pgdatabase.o pgtransdb.o pgcursordb.o pglobject.o @@ -29,35 +28,29 @@ endif # For CC on IRIX, must use CC as linker/archiver of C++ libraries ifeq ($(PORTNAME), irix5) - ifeq ($(CXX), CC) + ifneq ($(GXX), yes) AR := CC AROPT := -ar -o LD := CC endif endif # Same for Solaris with native compiler -ifeq ($(PORTNAME), solaris_sparc) - ifeq ($(CXX), CC) - AR := CC - AROPT := -xar -o - LD := CC - endif -endif -ifeq ($(PORTNAME), solaris_i386) - ifeq ($(CXX), CC) +ifeq ($(PORTNAME), solaris) + ifneq ($(GXX), yes) AR := CC AROPT := -xar -o LD := CC endif endif + all: all-lib # Shared library stuff -include $(top_builddir)/src/Makefile.shlib +include $(top_srcdir)/src/Makefile.shlib # Pull shared-lib CFLAGS into CXXFLAGS -CXXFLAGS+= $(CFLAGS_SL) +override CXXFLAGS+= $(CFLAGS_SL) .PHONY: examples @@ -88,7 +81,7 @@ clean distclean maintainer-clean: clean-lib dep depend: - $(CXX) -MM $(CXXFLAGS) *.cc >depend + $(CXX) -MM $(CPPFLAGS) $(CXXFLAGS) *.cc >depend ifeq (depend,$(wildcard depend)) include depend diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile index 66bf3af1069..a34b22746e6 100644 --- a/src/interfaces/libpq/Makefile +++ b/src/interfaces/libpq/Makefile @@ -4,7 +4,7 @@ # # Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.44 2000/10/20 03:45:35 tgl Exp $ +# $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.45 2000/10/20 21:04:11 petere Exp $ # #------------------------------------------------------------------------- @@ -17,7 +17,7 @@ NAME= pq SO_MAJOR_VERSION= 2 SO_MINOR_VERSION= 1 -CFLAGS += -DFRONTEND -I$(srcdir) -DSYSCONFDIR='"$(sysconfdir)"' +override CPPFLAGS += -DFRONTEND -I$(srcdir) -DSYSCONFDIR='"$(sysconfdir)"' OBJS= fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-print.o fe-lobj.o \ pqexpbuffer.o dllist.o pqsignal.o $(SNPRINTF) $(INET_ATON) @@ -77,7 +77,7 @@ installdirs: $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) uninstall: uninstall-lib - rm -f $(addprefix ($DESTDIR)$(includedir)/, libpq-fe.h libpq-int.h pqexpbuffer.h) + rm -f $(addprefix $(DESTDIR)$(includedir)/, libpq-fe.h libpq-int.h pqexpbuffer.h) clean distclean maintainer-clean: clean-lib rm -f $(OBJS) dllist.c snprintf.c inet_aton.c common.c wchar.c conv.c big5.c diff --git a/src/interfaces/odbc/GNUmakefile b/src/interfaces/odbc/GNUmakefile index a51f71899ac..ab849fbbc7a 100644 --- a/src/interfaces/odbc/GNUmakefile +++ b/src/interfaces/odbc/GNUmakefile @@ -2,7 +2,7 @@ # # GNUMakefile for psqlodbc (Postgres ODBC driver) # -# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile,v 1.4 2000/09/18 20:11:37 petere Exp $ +# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile,v 1.5 2000/10/20 21:04:13 petere Exp $ # #------------------------------------------------------------------------- @@ -15,7 +15,7 @@ NAME = psqlodbc SO_MAJOR_VERSION = 0 SO_MINOR_VERSION = 26 -CPPFLAGS += -I$(srcdir) -DHAVE_CONFIG_H -DODBCINSTDIR='"$(odbcinst_ini_dir)"' +override CPPFLAGS += -I$(srcdir) -DHAVE_CONFIG_H -DODBCINSTDIR='"$(odbcinst_ini_dir)"' OBJS = info.o bind.o columninfo.o connection.o convert.o drvconn.o \ @@ -35,23 +35,15 @@ LDFLAGS_SL+= $(LDFLAGS_ODBC) odbc_headers = isql.h isqlext.h iodbc.h odbc_includedir = $(includedir)/iodbc -install: all installdirs install-headers install-ini install-lib install-data +install: all installdirs + for i in $(odbc_headers); do $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(odbc_includedir)/$$i || exit 1; done + $(INSTALL_DATA) $(srcdir)/odbcinst.ini $(DESTDIR)$(odbcinst_ini_dir)/odbcinst.ini + $(INSTALL_DATA) $(srcdir)/odbc.sql $(DESTDIR)$(datadir)/odbc.sql + $(MAKE) install-lib installdirs: $(mkinstalldirs) $(DESTDIR)$(odbc_includedir) $(DESTDIR)$(libdir) $(DESTDIR)$(odbcinst_ini_dir) $(DESTDIR)$(datadir) -.PHONY: install-headers -install-headers: $(odbc_headers) - for i in $^; do $(INSTALL_DATA) $$i $(DESTDIR)$(odbc_includedir)/$$i || exit 1; done - -.PHONY: install-ini -install-ini: odbcinst.ini - $(INSTALL_DATA) $< $(DESTDIR)$(odbcinst_ini_dir)/$< - -.PHONY: install-data -install-data: odbc.sql - $(INSTALL_DATA) $< $(DESTDIR)$(datadir)/$< - uninstall: uninstall-lib rm -f $(addprefix $(DESTDIR)$(odbc_includedir)/, $(odbc_headers)) rm -f $(DESTDIR)$(datadir)/odbc.sql diff --git a/src/makefiles/Makefile.irix5 b/src/makefiles/Makefile.irix5 index 2dec27246b3..fcc72602e7d 100644 --- a/src/makefiles/Makefile.irix5 +++ b/src/makefiles/Makefile.irix5 @@ -6,4 +6,5 @@ MK_NO_LORDER= true %.so: %.o $(LD) -G -Bdynamic -shared -o $@ $< -CFLAGS+= -U_NO_XOPEN4 -woff 1164,1171,1185,1195,1552 -Wl,-woff,15 -Wl,-woff,84 +override CPPFLAGS += -U_NO_XOPEN4 +override CFLAGS += -woff 1164,1171,1185,1195,1552 -Wl,-woff,15 -Wl,-woff,84 diff --git a/src/makefiles/Makefile.sco b/src/makefiles/Makefile.sco index f2e6108a082..0cc90f9fd9d 100644 --- a/src/makefiles/Makefile.sco +++ b/src/makefiles/Makefile.sco @@ -1,4 +1,4 @@ -CFLAGS += -dy +override CFLAGS += -dy export_dynamic = -W l,-Bexport %.so: %.o diff --git a/src/makefiles/Makefile.ultrix4 b/src/makefiles/Makefile.ultrix4 index b56aee6c686..d71b474a245 100644 --- a/src/makefiles/Makefile.ultrix4 +++ b/src/makefiles/Makefile.ultrix4 @@ -1,9 +1,7 @@ -# install creates intermediate directories -NO_BEFOREINSTL= true SHELL=/bin/sh5 # # "-G 0" works for both DEC cc and GNU cc. # %.so: %.c - $(CC) -c -G 0 $(CFLAGS) -o $@ $< + $(CC) -c -G 0 $(CPPFLAGS) $(CFLAGS) -o $@ $< diff --git a/src/makefiles/Makefile.win b/src/makefiles/Makefile.win index ddc442d491f..02456dff98c 100644 --- a/src/makefiles/Makefile.win +++ b/src/makefiles/Makefile.win @@ -1,4 +1,4 @@ -# $Header: /cvsroot/pgsql/src/makefiles/Attic/Makefile.win,v 1.5 2000/09/29 13:36:50 petere Exp $ +# $Header: /cvsroot/pgsql/src/makefiles/Attic/Makefile.win,v 1.6 2000/10/20 21:04:13 petere Exp $ LDFLAGS+= -g DLLTOOL= dlltool DLLWRAP= dllwrap @@ -18,5 +18,5 @@ LIBS:=$(filter-out -lm -lc, $(LIBS)) curdir:=$(shell pwd) ifeq ($(findstring backend,$(curdir)), backend) -CPPFLAGS+= -DBUILDING_DLL=1 +override CPPFLAGS+= -DBUILDING_DLL=1 endif diff --git a/src/pl/plpgsql/src/Makefile b/src/pl/plpgsql/src/Makefile index 015f4a8ec4e..95848d13ebb 100644 --- a/src/pl/plpgsql/src/Makefile +++ b/src/pl/plpgsql/src/Makefile @@ -2,7 +2,7 @@ # # Makefile for the plpgsql shared object # -# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Makefile,v 1.7 2000/09/17 13:02:52 petere Exp $ +# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Makefile,v 1.8 2000/10/20 21:04:16 petere Exp $ # #------------------------------------------------------------------------- @@ -15,7 +15,7 @@ NAME= plpgsql SO_MAJOR_VERSION= 1 SO_MINOR_VERSION= 0 -CPPFLAGS += -I$(srcdir) +override CPPFLAGS += -I$(srcdir) OBJS = pl_parse.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o diff --git a/src/pl/tcl/Makefile b/src/pl/tcl/Makefile index 010367c23a5..62a11f74f56 100644 --- a/src/pl/tcl/Makefile +++ b/src/pl/tcl/Makefile @@ -2,7 +2,7 @@ # # Makefile for the pltcl shared object # -# $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.23 2000/09/17 13:02:52 petere Exp $ +# $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.24 2000/10/20 21:04:17 petere Exp $ # #------------------------------------------------------------------------- @@ -62,18 +62,15 @@ CC = $(TCL_CC) # Can choose either TCL_CFLAGS_OPTIMIZE or TCL_CFLAGS_DEBUG here, as # needed -CFLAGS= $(TCL_CFLAGS_OPTIMIZE) - -CFLAGS+= $(TCL_SHLIB_CFLAGS) $(TCL_DEFS) - -CFLAGS+= -I$(top_srcdir)/src/include $(INCLUDES) +override CPPFLAGS += $(TCL_DEFS) +override CFLAGS = $(TCL_CFLAGS_OPTIMIZE) $(TCL_SHLIB_CFLAGS) # Uncomment the following to enable the unknown command lookup on the # first of all calls to the call handler. See the doc in the modules # directory about details. -#CFLAGS+= -DPLTCL_UNKNOWN_SUPPORT +#override CPPFLAGS+= -DPLTCL_UNKNOWN_SUPPORT # @@ -90,6 +87,10 @@ ifdef EXPSUFF INFILES+= $(DLOBJS:.o=$(EXPSUFF)) endif +# Prevent removal of pltcl.o, being an intermediate file. This would +# not be wrong in general, but for some reason the next make run will +# not realize this and rebuild it. +.SECONDARY: pltcl.o # Provide dummy targets for the case where we can't build the shared library. diff --git a/src/test/bench/Makefile b/src/test/bench/Makefile index 04218870d45..97ab8247092 100644 --- a/src/test/bench/Makefile +++ b/src/test/bench/Makefile @@ -7,7 +7,7 @@ # # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/test/bench/Attic/Makefile,v 1.7 2000/08/31 16:12:20 petere Exp $ +# $Header: /cvsroot/pgsql/src/test/bench/Attic/Makefile,v 1.8 2000/10/20 21:04:19 petere Exp $ # #------------------------------------------------------------------------- @@ -18,7 +18,8 @@ include $(top_builddir)/src/Makefile.global CREATEFILES= create.sql bench.sql OUTFILES= bench.out bench.out.perquery -CFLAGS+= -I$(libpq_srcdir) $(CFLAGS_SL) +override CPPFLAGS += -I$(libpq_srcdir) +override CFLAGS += $(CFLAGS_SL) all: $(CREATEFILES) diff --git a/src/test/examples/Makefile b/src/test/examples/Makefile index 9dd159e2f2e..b07c84efe5b 100644 --- a/src/test/examples/Makefile +++ b/src/test/examples/Makefile @@ -6,9 +6,8 @@ subdir = src/test/examples top_builddir = ../../.. include $(top_builddir)/src/Makefile.global -CPPFLAGS+= -I$(libpq_srcdir) - -LDFLAGS+= $(libpq) +override CPPFLAGS+= -I$(libpq_srcdir) +LIBS += $(libpq) # PROGS= testlibpq0 testlibpq1 testlibpq2 testlibpq3 testlibpq4 testlo @@ -16,8 +15,5 @@ PROGS = testlibpq testlibpq2 testlibpq3 testlibpq4 testlo testlo2 all: $(PROGS) -$(PROGS): % : %.c - $(CC) $(CFLAGS) -o $@ $@.c $(LDFLAGS) - clean: rm -f $(PROGS) diff --git a/src/test/locale/Makefile b/src/test/locale/Makefile index 33eaa02c540..6ecf6cdb90d 100644 --- a/src/test/locale/Makefile +++ b/src/test/locale/Makefile @@ -1,4 +1,4 @@ -# $Header: /cvsroot/pgsql/src/test/locale/Makefile,v 1.5 2000/08/31 16:12:25 petere Exp $ +# $Header: /cvsroot/pgsql/src/test/locale/Makefile,v 1.6 2000/10/20 21:04:24 petere Exp $ subdir = src/test/locale top_builddir = ../../.. @@ -10,9 +10,6 @@ DIRS = koi8-r ISO8859-7 koi8-to-win1251 all: $(PROGS) -$(PROGS): % : %.c - $(CC) $(CFLAGS) -o $@ $@.c $(LDFLAGS) - clean: rm -f $(PROGS) *.out for d in $(DIRS); do \ diff --git a/src/test/regress/GNUmakefile b/src/test/regress/GNUmakefile index a721b0ac6d8..6c26e96cee9 100644 --- a/src/test/regress/GNUmakefile +++ b/src/test/regress/GNUmakefile @@ -7,7 +7,7 @@ # # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/test/regress/GNUmakefile,v 1.27 2000/10/18 16:16:14 momjian Exp $ +# $Header: /cvsroot/pgsql/src/test/regress/GNUmakefile,v 1.28 2000/10/20 21:04:25 petere Exp $ # #------------------------------------------------------------------------- @@ -17,9 +17,8 @@ include $(top_builddir)/src/Makefile.global contribdir := $(top_builddir)/contrib -CFLAGS+= -I$(libpq_srcdir) $(CFLAGS_SL) - -LDADD+= $(libpq) +override CPPFLAGS += -I$(libpq_srcdir) +override CFLAGS += $(CFLAGS_SL) ## diff --git a/src/tutorial/Makefile b/src/tutorial/Makefile index 80e28025f3e..b734db13be6 100644 --- a/src/tutorial/Makefile +++ b/src/tutorial/Makefile @@ -4,7 +4,7 @@ # Makefile for tutorial # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/tutorial/Makefile,v 1.11 2000/08/31 16:12:33 petere Exp $ +# $Header: /cvsroot/pgsql/src/tutorial/Makefile,v 1.12 2000/10/20 21:04:27 petere Exp $ # #------------------------------------------------------------------------- @@ -12,7 +12,7 @@ subdir = src/tutorial top_builddir = ../.. include $(top_builddir)/src/Makefile.global -CFLAGS+= $(CFLAGS_SL) +override CFLAGS+= $(CFLAGS_SL) # # DLOBJS is the dynamically-loaded object files. The "funcs" queries |