diff --git a/contrib/pg_dumplo/Makefile b/contrib/pg_dumplo/Makefile index f8900b17c7982a98536506f40eac6c6ebf82393b..2342ea20be5e099abe9f078570e6f090e87770eb 100644 --- a/contrib/pg_dumplo/Makefile +++ b/contrib/pg_dumplo/Makefile @@ -1,5 +1,5 @@ # -# $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/Makefile,v 1.7 2000/10/20 21:03:25 petere Exp $ +# $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/Makefile,v 1.8 2000/11/30 20:36:09 petere Exp $ # subdir = contrib/pg_dumplo @@ -12,7 +12,7 @@ override CPPFLAGS += -I$(libpq_srcdir) all: pg_dumplo pg_dumplo: $(OBJS) $(libpq_builddir)/libpq.a - $(CC) -o $@ $(OBJS) $(libpq) $(CFLAGS) $(LDFLAGS) + $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(libpq) $(LIBS) -o $@ install: all installdirs $(INSTALL_PROGRAM) pg_dumplo$(X) $(bindir) diff --git a/src/Makefile.global.in b/src/Makefile.global.in index 72d489d38d531c0550182ed5cb6549342ab73ed7..a09651f348a876174098e66f3071a858f234a09c 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.113 2000/11/20 16:52:54 petere Exp $ +# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.114 2000/11/30 20:36:10 petere Exp $ #------------------------------------------------------------------------------ # All PostgreSQL makefiles include this file and use the variables it sets, @@ -166,7 +166,7 @@ LIBS = @LIBS@ LD = @LD@ with_gnu_ld = @with_gnu_ld@ ld_R_works = @ld_R_works@ -LDFLAGS = @LDFLAGS@ $(LIBS) +LDFLAGS = @LDFLAGS@ LDREL = -r LDOUT = -o RANLIB = @RANLIB@ diff --git a/src/Makefile.shlib b/src/Makefile.shlib index 6c543f61fea4d2c1705769c866bc06f159d11078..a5decfaa49634b4f6c987ef50436e403ef8e9650 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.35 2000/11/14 21:11:59 petere Exp $ +# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.36 2000/11/30 20:36:10 petere Exp $ # #------------------------------------------------------------------------- @@ -221,7 +221,7 @@ ifeq ($(PORTNAME), beos) endif # Pull in any extra -L options that the user might have specified. -SHLIB_LINK := $(filter -L%, $(LDFLAGS)) $(SHLIB_LINK) +SHLIB_LINK := $(filter -L%, $(LIBS)) $(SHLIB_LINK) ifeq ($(enable_rpath), yes) SHLIB_LINK += $(rpath) @@ -262,7 +262,7 @@ ifneq ($(PORTNAME), aix) # Normal case $(shlib): $(OBJS) - $(LINK.shared) -o $@ $(OBJS) $(SHLIB_LINK) + $(LINK.shared) $(OBJS) $(SHLIB_LINK) -o $@ # If we're using major and minor versions, then make a symlink to major-version-only. ifneq ($(shlib), lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)) rm -f lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) diff --git a/src/backend/Makefile b/src/backend/Makefile index 07c18427bf9b9183be2c29080eed36f420aff06a..701db4265a58d5d038a55ab84e5cae81c6967a25 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.67 2000/10/20 21:03:39 petere Exp $ +# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.68 2000/11/30 20:36:10 petere Exp $ # #------------------------------------------------------------------------- @@ -37,7 +37,7 @@ all: postgres $(POSTGRES_IMP) ifneq ($(PORTNAME), win) postgres: $(OBJS) - $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(export_dynamic) + $(CC) $(CFLAGS) $(LDFLAGS) $(export_dynamic) $^ $(LIBS) -o $@ else # win @@ -80,7 +80,7 @@ $(top_builddir)/src/utils/dllinit.o: $(top_srcdir)/src/utils/dllinit.c # The postgres.o target is needed by the rule in Makefile.global that # creates the exports file when MAKE_EXPORTS = true. postgres.o: $(OBJS) - $(CC) $(LDREL) $(LDOUT) $@ $^ $(LDFLAGS) + $(CC) $(LDREL) $(LDFLAGS) $^ $(LIBS) -o $@ # The following targets are specified in make commands that appear in @@ -193,7 +193,7 @@ maintainer-clean: distclean # are up to date. It saves the time of doing all the submakes. .PHONY: quick quick: $(OBJS) - $(CC) -o postgres $(OBJS) $(LDFLAGS) $(export_dynamic) + $(CC) $(CFLAGS) $(LDFLAGS) $(export_dynamic) $^ $(LIBS) -o postgres depend dep: $(top_srcdir)/src/include/parser/parse.h $(top_builddir)/src/include/utils/fmgroids.h for i in $(DIRS); do $(MAKE) -C $$i $@; done diff --git a/src/backend/regex/Makefile b/src/backend/regex/Makefile index 9d2d929b689847e5062a4fec21b30faab2a13e60..d6d62d2f81cada4804759a04eb75806931a42e6a 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.15 2000/10/20 21:03:46 petere Exp $ +# $Header: /cvsroot/pgsql/src/backend/regex/Makefile,v 1.16 2000/11/30 20:36:10 petere Exp $ # #------------------------------------------------------------------------- @@ -28,7 +28,7 @@ SUBSYS.o: $(OBJS) $(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS) retest: retest.o SUBSYS.o $(DEBUGOBJ) - $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) + $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@ depend dep: $(CC) -MM $(CFLAGS) *.c >depend diff --git a/src/backend/utils/mb/Makefile b/src/backend/utils/mb/Makefile index 229a5fc2425cb1a4fcdb5b5aaaa7acec93dabdf3..952ba8789d87c6ba66137a7b41ce882360eb2255 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.14 2000/10/30 10:40:28 ishii Exp $ +# $Header: /cvsroot/pgsql/src/backend/utils/mb/Makefile,v 1.15 2000/11/30 20:36:11 petere Exp $ # #------------------------------------------------------------------------- @@ -22,13 +22,13 @@ SUBSYS.o: $(OBJS) utftest.o: utftest.c conv.c wchar.c mbutils.c sjistest: sjistest.o palloc.o common.o mbutils.o wchar.o wstrcmp.o wstrncmp.o big5.o - $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) + $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@ liketest: liketest.o palloc.o $(OBJS) - $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) + $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@ utftest: utftest.o palloc.o common.o wstrcmp.o wstrncmp.o big5.o - $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) + $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@ depend dep: $(CC) -MM $(CFLAGS) *.c >depend diff --git a/src/bin/pg_dump/Makefile b/src/bin/pg_dump/Makefile index ba9a08900b24680a5eff7883d9ed310c947f27c7..38a2cf29469f46222bedd84dedf0aa227e85d63c 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.26 2000/10/20 21:03:56 petere Exp $ +# $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.27 2000/11/30 20:36:11 petere Exp $ # #------------------------------------------------------------------------- @@ -20,10 +20,10 @@ override CPPFLAGS+= -I$(libpq_srcdir) all: submake pg_dump pg_restore pg_dumpall pg_dump: pg_dump.o common.o $(OBJS) $(libpq_builddir)/libpq.a - $(CC) $(CFLAGS) -o $@ pg_dump.o common.o $(OBJS) $(libpq) $(LDFLAGS) + $(CC) $(CFLAGS) $(LDFLAGS) pg_dump.o common.o $(OBJS) $(libpq) $(LIBS) -o $@ pg_restore: pg_restore.o $(OBJS) $(libpq_builddir)/libpq.a - $(CC) $(CFLAGS) -o $@ pg_restore.o $(OBJS) $(libpq) $(LDFLAGS) + $(CC) $(CFLAGS) $(LDFLAGS) pg_restore.o $(OBJS) $(libpq) $(LIBS) -o $@ ../../utils/strdup.o: $(MAKE) -C ../../utils strdup.o diff --git a/src/bin/pg_encoding/Makefile b/src/bin/pg_encoding/Makefile index e4c4e4c65cac115a179905c901218d3737ab3bef..784d78d4bc8b8421375d0bc6e3f3ff9cd55c64f3 100644 --- a/src/bin/pg_encoding/Makefile +++ b/src/bin/pg_encoding/Makefile @@ -4,7 +4,7 @@ # # Copyright (c) 1998, PostgreSQL Global Development Group # -# $Header: /cvsroot/pgsql/src/bin/pg_encoding/Attic/Makefile,v 1.11 2000/09/17 13:02:37 petere Exp $ +# $Header: /cvsroot/pgsql/src/bin/pg_encoding/Attic/Makefile,v 1.12 2000/11/30 20:36:11 petere Exp $ # #------------------------------------------------------------------------- @@ -14,10 +14,10 @@ include $(top_builddir)/src/Makefile.global OBJS= pg_encoding.o -all: submake pg_encoding$(X) +all: submake pg_encoding -pg_encoding$(X): $(OBJS) - $(CC) -o $@ $(OBJS) $(libpq) $(LDFLAGS) $(CFLAGS) +pg_encoding: $(OBJS) + $(CC) $(CFLAGS) $(LDFLAGS) $^ $(libpq) $(LIBS) -o $@ .PHONY: submake diff --git a/src/bin/pg_id/Makefile b/src/bin/pg_id/Makefile index ed9ec2ce06922eb99b0d32afa50f89a4de752c0d..e9577b4f671963707c4ac328b00372f5abd2718a 100644 --- a/src/bin/pg_id/Makefile +++ b/src/bin/pg_id/Makefile @@ -4,7 +4,7 @@ # # Copyright (C) 2000 by PostgreSQL Global Development Team # -# $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/Makefile,v 1.19 2000/09/17 13:02:39 petere Exp $ +# $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/Makefile,v 1.20 2000/11/30 20:36:11 petere Exp $ # #------------------------------------------------------------------------- @@ -12,10 +12,10 @@ subdir = src/bin/pg_id top_builddir = ../../.. include $(top_builddir)/src/Makefile.global -all: pg_id$(X) +all: pg_id -pg_id$(X): pg_id.o - $(CC) -o $@ $^ $(LDFLAGS) +pg_id: pg_id.o + $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@ install: all installdirs $(INSTALL_PROGRAM) pg_id$(X) $(DESTDIR)$(bindir)/pg_id$(X) diff --git a/src/bin/pg_passwd/Makefile b/src/bin/pg_passwd/Makefile index d96b102dfa218a2ea804b2b9cc3c9d8f8cd19559..e14690c06012eb1abd7d377289313c6d00b7fb27 100644 --- a/src/bin/pg_passwd/Makefile +++ b/src/bin/pg_passwd/Makefile @@ -1,4 +1,4 @@ -# $Header: /cvsroot/pgsql/src/bin/pg_passwd/Attic/Makefile,v 1.12 2000/11/18 19:00:23 petere Exp $ +# $Header: /cvsroot/pgsql/src/bin/pg_passwd/Attic/Makefile,v 1.13 2000/11/30 20:36:12 petere Exp $ subdir = src/bin/pg_passwd top_builddir = ../../.. @@ -6,6 +6,9 @@ include $(top_builddir)/src/Makefile.global all: pg_passwd +pg_passwd: pg_passwd.o + $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@ + install: all installdirs $(INSTALL_PROGRAM) pg_passwd$(X) $(DESTDIR)$(bindir)/pg_passwd$(X) diff --git a/src/bin/pgtclsh/Makefile b/src/bin/pgtclsh/Makefile index 02b19c8b269ddb5f65042ef3307da73d628e58ec..7891eab4f23d95b29fd1105b021691e97d662489 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.34 2000/10/20 21:04:00 petere Exp $ +# $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.35 2000/11/30 20:36:12 petere Exp $ # #------------------------------------------------------------------------- @@ -39,10 +39,10 @@ endif all: submake $(PROGRAMS) pgtclsh: pgtclAppInit.o - $(CC) $(CFLAGS) -o $@ $< $(libpgtcl) $(libpq) $(TCL_LIB_SPEC) $(TCL_LIBS) $(LDFLAGS) + $(CC) $(CFLAGS) $(LDFLAGS) $^ $(libpgtcl) $(libpq) $(TCL_LIB_SPEC) $(TCL_LIBS) $(LIBS) -o $@ pgtksh: pgtkAppInit.o - $(CC) $(CFLAGS) -o $@ $< $(libpgtcl) $(libpq) $(TK_LIB_SPEC) $(TK_LIBS) $(TCL_LIB_SPEC) $(LDFLAGS) + $(CC) $(CFLAGS) $(LDFLAGS) $^ $(libpgtcl) $(libpq) $(TK_LIB_SPEC) $(TK_LIBS) $(TCL_LIB_SPEC) $(LIBS) -o $@ .PHONY: submake submake: diff --git a/src/bin/psql/Makefile b/src/bin/psql/Makefile index bd38be47b4e928bdaeded36313de9a9bb9892898..3b54c44da8e35321dd90ae7a8b4a0c90a1ddbe57 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.26 2000/10/20 21:04:01 petere Exp $ +# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.27 2000/11/30 20:36:12 petere Exp $ # #------------------------------------------------------------------------- @@ -20,7 +20,7 @@ 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 \ tab-complete.o -all: submake psql$(X) +all: submake psql ifdef STRDUP OBJS+=$(top_builddir)/src/utils/strdup.o @@ -47,8 +47,8 @@ endif # End of hacks for picking up backend 'port' modules -psql$(X): $(OBJS) $(libpq_builddir)/libpq.a - $(CC) $(CFLAGS) -o $@ $(OBJS) $(libpq) $(LDFLAGS) +psql: $(OBJS) $(libpq_builddir)/libpq.a + $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(libpq) $(LIBS) -o $@ help.o: $(srcdir)/sql_help.h diff --git a/src/interfaces/ecpg/preproc/Makefile b/src/interfaces/ecpg/preproc/Makefile index 1948eb9208f3245fd12a7e839cb264bf67b72c08..5db47e4366c5d2cbe59df9734000583a95118c7f 100644 --- a/src/interfaces/ecpg/preproc/Makefile +++ b/src/interfaces/ecpg/preproc/Makefile @@ -1,3 +1,5 @@ +# $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.72 2000/11/30 20:36:13 petere Exp $ + subdir = src/interfaces/ecpg/preproc top_builddir = ../../../.. include $(top_builddir)/src/Makefile.global @@ -9,7 +11,6 @@ PATCHLEVEL=0 override CPPFLAGS+=-I$(srcdir)/../include -DMAJOR_VERSION=$(MAJOR_VERSION) \ -DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \ -DINCLUDE_PATH=\"$(includedir)\" -# -DYYDEBUG -g OBJS=preproc.o pgc.o type.o ecpg.o ecpg_keywords.o output.o\ keywords.o c_keywords.o ../lib/typename.o descriptor.o variable.o @@ -25,7 +26,7 @@ endif ecpg: $(OBJS) - $(CC) -o $@ $^ $(LDFLAGS) + $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@ $(srcdir)/preproc.c $(srcdir)/preproc.h: preproc.y $(YACC) -d $(YFLAGS) $< diff --git a/src/makefiles/Makefile.aix b/src/makefiles/Makefile.aix index d3ee2fab357b9f3910f59b43c9135dff4cf745a4..c33c7a546c0ffd85371c5540d441b3f6b9791c78 100644 --- a/src/makefiles/Makefile.aix +++ b/src/makefiles/Makefile.aix @@ -35,11 +35,11 @@ else $(MKLDEXPORT) postgres . > $@ endif endif - $(CC) -Wl,-bE:$(top_builddir)/src/backend/$@ -o postgres $(OBJS) $(LDFLAGS) + $(CC) -Wl,-bE:$(top_builddir)/src/backend/$@ -o postgres $(OBJS) $(LDFLAGS) $(LIBS) %$(EXPSUFF): %.o $(MKLDEXPORT) $*.o > $*$(EXPSUFF) %$(DLSUFFIX): %.o %$(EXPSUFF) @echo Making shared library $@ from $*.o, $*$(EXPSUFF) and postgres.imp - $(CC) -Wl,-H512 -Wl,-bM:SRE -Wl,-bI:$(top_builddir)/src/backend/$(POSTGRES_IMP) -Wl,-bE:$*$(EXPSUFF) -o $@ $*.o $(LDFLAGS) $(LDFLAGS_SL) + $(CC) -Wl,-H512 -Wl,-bM:SRE -Wl,-bI:$(top_builddir)/src/backend/$(POSTGRES_IMP) -Wl,-bE:$*$(EXPSUFF) -o $@ $*.o $(LDFLAGS) $(LIBS) $(LDFLAGS_SL) diff --git a/src/makefiles/Makefile.qnx4 b/src/makefiles/Makefile.qnx4 index 2cf15be5f5f7ef8714076243aeab7f57da96c245..5a74d84c7cce8f109b69d12f930db23c4cc8a4f0 100644 --- a/src/makefiles/Makefile.qnx4 +++ b/src/makefiles/Makefile.qnx4 @@ -1,12 +1,11 @@ MK_NO_LORDER= true -CXXFLAGS+= -I/usr/local/lib/gcc-lib/i386-pc-qnx4/egcs-2.91.60/include/g++ AR= ar AROPT = cr LD= $(AR) LDREL= $(AROPT) LDOUT= LIBS= -lunix -LDFLAGS= $(LIBS) +LDFLAGS= enable_shared = no DLSUFFIX = .so diff --git a/src/makefiles/Makefile.svr4 b/src/makefiles/Makefile.svr4 index dd1fdec4fa9a1d8adfcd9c6c4b44f9be632fab0f..9704f1a1d647550c5cdeb3b4d71beb873f8b41ea 100644 --- a/src/makefiles/Makefile.svr4 +++ b/src/makefiles/Makefile.svr4 @@ -2,7 +2,8 @@ # symbol names to tell them what to export/import. #MAKE_EXPORTS= true -LDFLAGS+= -lc /usr/ucblib/libucb.a -LD-Blargedynsym +LIBS += -lc /usr/ucblib/libucb.a +LDFLAGS += -LD-Blargedynsym DLSUFFIX = .so CFLAGS_SL =