1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-21 00:42:43 +03:00

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.
This commit is contained in:
Peter Eisentraut
2000-10-20 21:04:27 +00:00
parent 039f3f1b05
commit 805e431a38
57 changed files with 664 additions and 608 deletions

View File

@@ -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 \

View File

@@ -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)\"

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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