Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e5ba2fc

Browse files
committed
Make all commands that link a program look like
$(CC) $(CFLAGS) $(LDFLAGS) <object files> <extra-libraries> $(LIBS) -o $@ This form seemed to be the most portable, readable, and logical, but in any case it's better than having a dozen different ones in the tree.
1 parent 3091122 commit e5ba2fc

File tree

16 files changed

+47
-43
lines changed

16 files changed

+47
-43
lines changed

contrib/pg_dumplo/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/Makefile,v 1.7 2000/10/20 21:03:25 petere Exp $
2+
# $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/Makefile,v 1.8 2000/11/30 20:36:09 petere Exp $
33
#
44

55
subdir = contrib/pg_dumplo
@@ -12,7 +12,7 @@ override CPPFLAGS += -I$(libpq_srcdir)
1212
all: pg_dumplo
1313

1414
pg_dumplo: $(OBJS) $(libpq_builddir)/libpq.a
15-
$(CC) -o $@ $(OBJS) $(libpq) $(CFLAGS) $(LDFLAGS)
15+
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(libpq) $(LIBS) -o $@
1616

1717
install: all installdirs
1818
$(INSTALL_PROGRAM) pg_dumplo$(X) $(bindir)

src/Makefile.global.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*-makefile-*-
2-
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.113 2000/11/20 16:52:54 petere Exp $
2+
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.114 2000/11/30 20:36:10 petere Exp $
33

44
#------------------------------------------------------------------------------
55
# All PostgreSQL makefiles include this file and use the variables it sets,
@@ -166,7 +166,7 @@ LIBS = @LIBS@
166166
LD = @LD@
167167
with_gnu_ld = @with_gnu_ld@
168168
ld_R_works = @ld_R_works@
169-
LDFLAGS = @LDFLAGS@ $(LIBS)
169+
LDFLAGS = @LDFLAGS@
170170
LDREL = -r
171171
LDOUT = -o
172172
RANLIB = @RANLIB@

src/Makefile.shlib

Lines changed: 3 additions & 3 deletions
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-
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.35 2000/11/14 21:11:59 petere Exp $
9+
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.36 2000/11/30 20:36:10 petere Exp $
1010
#
1111
#-------------------------------------------------------------------------
1212

@@ -221,7 +221,7 @@ ifeq ($(PORTNAME), beos)
221221
endif
222222

223223
# Pull in any extra -L options that the user might have specified.
224-
SHLIB_LINK := $(filter -L%, $(LDFLAGS)) $(SHLIB_LINK)
224+
SHLIB_LINK := $(filter -L%, $(LIBS)) $(SHLIB_LINK)
225225

226226
ifeq ($(enable_rpath), yes)
227227
SHLIB_LINK += $(rpath)
@@ -262,7 +262,7 @@ ifneq ($(PORTNAME), aix)
262262

263263
# Normal case
264264
$(shlib): $(OBJS)
265-
$(LINK.shared) -o $@ $(OBJS) $(SHLIB_LINK)
265+
$(LINK.shared) $(OBJS) $(SHLIB_LINK) -o $@
266266
# If we're using major and minor versions, then make a symlink to major-version-only.
267267
ifneq ($(shlib), lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION))
268268
rm -f lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)

src/backend/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.67 2000/10/20 21:03:39 petere Exp $
7+
# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.68 2000/11/30 20:36:10 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -37,7 +37,7 @@ all: postgres $(POSTGRES_IMP)
3737
ifneq ($(PORTNAME), win)
3838

3939
postgres: $(OBJS)
40-
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(export_dynamic)
40+
$(CC) $(CFLAGS) $(LDFLAGS) $(export_dynamic) $^ $(LIBS) -o $@
4141

4242
else # win
4343

@@ -80,7 +80,7 @@ $(top_builddir)/src/utils/dllinit.o: $(top_srcdir)/src/utils/dllinit.c
8080
# The postgres.o target is needed by the rule in Makefile.global that
8181
# creates the exports file when MAKE_EXPORTS = true.
8282
postgres.o: $(OBJS)
83-
$(CC) $(LDREL) $(LDOUT) $@ $^ $(LDFLAGS)
83+
$(CC) $(LDREL) $(LDFLAGS) $^ $(LIBS) -o $@
8484

8585

8686
# The following targets are specified in make commands that appear in
@@ -193,7 +193,7 @@ maintainer-clean: distclean
193193
# are up to date. It saves the time of doing all the submakes.
194194
.PHONY: quick
195195
quick: $(OBJS)
196-
$(CC) -o postgres $(OBJS) $(LDFLAGS) $(export_dynamic)
196+
$(CC) $(CFLAGS) $(LDFLAGS) $(export_dynamic) $^ $(LIBS) -o postgres
197197

198198
depend dep: $(top_srcdir)/src/include/parser/parse.h $(top_builddir)/src/include/utils/fmgroids.h
199199
for i in $(DIRS); do $(MAKE) -C $$i $@; done

src/backend/regex/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Makefile for regex
55
#
66
# IDENTIFICATION
7-
# $Header: /cvsroot/pgsql/src/backend/regex/Makefile,v 1.15 2000/10/20 21:03:46 petere Exp $
7+
# $Header: /cvsroot/pgsql/src/backend/regex/Makefile,v 1.16 2000/11/30 20:36:10 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -28,7 +28,7 @@ SUBSYS.o: $(OBJS)
2828
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
2929

3030
retest: retest.o SUBSYS.o $(DEBUGOBJ)
31-
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
31+
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
3232

3333
depend dep:
3434
$(CC) -MM $(CFLAGS) *.c >depend

src/backend/utils/mb/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Makefile for utils/mb
55
#
66
# IDENTIFICATION
7-
# $Header: /cvsroot/pgsql/src/backend/utils/mb/Makefile,v 1.14 2000/10/30 10:40:28 ishii Exp $
7+
# $Header: /cvsroot/pgsql/src/backend/utils/mb/Makefile,v 1.15 2000/11/30 20:36:11 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -22,13 +22,13 @@ SUBSYS.o: $(OBJS)
2222
utftest.o: utftest.c conv.c wchar.c mbutils.c
2323

2424
sjistest: sjistest.o palloc.o common.o mbutils.o wchar.o wstrcmp.o wstrncmp.o big5.o
25-
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
25+
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
2626

2727
liketest: liketest.o palloc.o $(OBJS)
28-
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
28+
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
2929

3030
utftest: utftest.o palloc.o common.o wstrcmp.o wstrncmp.o big5.o
31-
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
31+
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
3232

3333
depend dep:
3434
$(CC) -MM $(CFLAGS) *.c >depend

src/bin/pg_dump/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.26 2000/10/20 21:03:56 petere Exp $
7+
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.27 2000/11/30 20:36:11 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -20,10 +20,10 @@ override CPPFLAGS+= -I$(libpq_srcdir)
2020
all: submake pg_dump pg_restore pg_dumpall
2121

2222
pg_dump: pg_dump.o common.o $(OBJS) $(libpq_builddir)/libpq.a
23-
$(CC) $(CFLAGS) -o $@ pg_dump.o common.o $(OBJS) $(libpq) $(LDFLAGS)
23+
$(CC) $(CFLAGS) $(LDFLAGS) pg_dump.o common.o $(OBJS) $(libpq) $(LIBS) -o $@
2424

2525
pg_restore: pg_restore.o $(OBJS) $(libpq_builddir)/libpq.a
26-
$(CC) $(CFLAGS) -o $@ pg_restore.o $(OBJS) $(libpq) $(LDFLAGS)
26+
$(CC) $(CFLAGS) $(LDFLAGS) pg_restore.o $(OBJS) $(libpq) $(LIBS) -o $@
2727

2828
../../utils/strdup.o:
2929
$(MAKE) -C ../../utils strdup.o

src/bin/pg_encoding/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1998, PostgreSQL Global Development Group
66
#
7-
# $Header: /cvsroot/pgsql/src/bin/pg_encoding/Attic/Makefile,v 1.11 2000/09/17 13:02:37 petere Exp $
7+
# $Header: /cvsroot/pgsql/src/bin/pg_encoding/Attic/Makefile,v 1.12 2000/11/30 20:36:11 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -14,10 +14,10 @@ include $(top_builddir)/src/Makefile.global
1414

1515
OBJS= pg_encoding.o
1616

17-
all: submake pg_encoding$(X)
17+
all: submake pg_encoding
1818

19-
pg_encoding$(X): $(OBJS)
20-
$(CC) -o $@ $(OBJS) $(libpq) $(LDFLAGS) $(CFLAGS)
19+
pg_encoding: $(OBJS)
20+
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(libpq) $(LIBS) -o $@
2121

2222
.PHONY: submake
2323

src/bin/pg_id/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
#
55
# Copyright (C) 2000 by PostgreSQL Global Development Team
66
#
7-
# $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/Makefile,v 1.19 2000/09/17 13:02:39 petere Exp $
7+
# $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/Makefile,v 1.20 2000/11/30 20:36:11 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

1111
subdir = src/bin/pg_id
1212
top_builddir = ../../..
1313
include $(top_builddir)/src/Makefile.global
1414

15-
all: pg_id$(X)
15+
all: pg_id
1616

17-
pg_id$(X): pg_id.o
18-
$(CC) -o $@ $^ $(LDFLAGS)
17+
pg_id: pg_id.o
18+
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
1919

2020
install: all installdirs
2121
$(INSTALL_PROGRAM) pg_id$(X) $(DESTDIR)$(bindir)/pg_id$(X)

src/bin/pg_passwd/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
# $Header: /cvsroot/pgsql/src/bin/pg_passwd/Attic/Makefile,v 1.12 2000/11/18 19:00:23 petere Exp $
1+
# $Header: /cvsroot/pgsql/src/bin/pg_passwd/Attic/Makefile,v 1.13 2000/11/30 20:36:12 petere Exp $
22

33
subdir = src/bin/pg_passwd
44
top_builddir = ../../..
55
include $(top_builddir)/src/Makefile.global
66

77
all: pg_passwd
88

9+
pg_passwd: pg_passwd.o
10+
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
11+
912
install: all installdirs
1013
$(INSTALL_PROGRAM) pg_passwd$(X) $(DESTDIR)$(bindir)/pg_passwd$(X)
1114

src/bin/pgtclsh/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# Copyright (c) 1994, Regents of the University of California
77
#
8-
# $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.34 2000/10/20 21:04:00 petere Exp $
8+
# $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.35 2000/11/30 20:36:12 petere Exp $
99
#
1010
#-------------------------------------------------------------------------
1111

@@ -39,10 +39,10 @@ endif
3939
all: submake $(PROGRAMS)
4040

4141
pgtclsh: pgtclAppInit.o
42-
$(CC) $(CFLAGS) -o $@ $< $(libpgtcl) $(libpq) $(TCL_LIB_SPEC) $(TCL_LIBS) $(LDFLAGS)
42+
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(libpgtcl) $(libpq) $(TCL_LIB_SPEC) $(TCL_LIBS) $(LIBS) -o $@
4343

4444
pgtksh: pgtkAppInit.o
45-
$(CC) $(CFLAGS) -o $@ $< $(libpgtcl) $(libpq) $(TK_LIB_SPEC) $(TK_LIBS) $(TCL_LIB_SPEC) $(LDFLAGS)
45+
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(libpgtcl) $(libpq) $(TK_LIB_SPEC) $(TK_LIBS) $(TCL_LIB_SPEC) $(LIBS) -o $@
4646

4747
.PHONY: submake
4848
submake:

src/bin/psql/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.26 2000/10/20 21:04:01 petere Exp $
7+
# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.27 2000/11/30 20:36:12 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -20,7 +20,7 @@ OBJS=command.o common.o help.o input.o stringutils.o mainloop.o \
2020
copy.o startup.o prompt.o variables.o large_obj.o print.o describe.o \
2121
tab-complete.o
2222

23-
all: submake psql$(X)
23+
all: submake psql
2424

2525
ifdef STRDUP
2626
OBJS+=$(top_builddir)/src/utils/strdup.o
@@ -47,8 +47,8 @@ endif
4747

4848
# End of hacks for picking up backend 'port' modules
4949

50-
psql$(X): $(OBJS) $(libpq_builddir)/libpq.a
51-
$(CC) $(CFLAGS) -o $@ $(OBJS) $(libpq) $(LDFLAGS)
50+
psql: $(OBJS) $(libpq_builddir)/libpq.a
51+
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(libpq) $(LIBS) -o $@
5252

5353
help.o: $(srcdir)/sql_help.h
5454

src/interfaces/ecpg/preproc/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.72 2000/11/30 20:36:13 petere Exp $
2+
13
subdir = src/interfaces/ecpg/preproc
24
top_builddir = ../../../..
35
include $(top_builddir)/src/Makefile.global
@@ -9,7 +11,6 @@ PATCHLEVEL=0
911
override CPPFLAGS+=-I$(srcdir)/../include -DMAJOR_VERSION=$(MAJOR_VERSION) \
1012
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \
1113
-DINCLUDE_PATH=\"$(includedir)\"
12-
# -DYYDEBUG -g
1314

1415
OBJS=preproc.o pgc.o type.o ecpg.o ecpg_keywords.o output.o\
1516
keywords.o c_keywords.o ../lib/typename.o descriptor.o variable.o
@@ -25,7 +26,7 @@ endif
2526

2627

2728
ecpg: $(OBJS)
28-
$(CC) -o $@ $^ $(LDFLAGS)
29+
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
2930

3031
$(srcdir)/preproc.c $(srcdir)/preproc.h: preproc.y
3132
$(YACC) -d $(YFLAGS) $<

src/makefiles/Makefile.aix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ else
3535
$(MKLDEXPORT) postgres . > $@
3636
endif
3737
endif
38-
$(CC) -Wl,-bE:$(top_builddir)/src/backend/$@ -o postgres $(OBJS) $(LDFLAGS)
38+
$(CC) -Wl,-bE:$(top_builddir)/src/backend/$@ -o postgres $(OBJS) $(LDFLAGS) $(LIBS)
3939

4040
%$(EXPSUFF): %.o
4141
$(MKLDEXPORT) $*.o > $*$(EXPSUFF)
4242

4343
%$(DLSUFFIX): %.o %$(EXPSUFF)
4444
@echo Making shared library $@ from $*.o, $*$(EXPSUFF) and postgres.imp
45-
$(CC) -Wl,-H512 -Wl,-bM:SRE -Wl,-bI:$(top_builddir)/src/backend/$(POSTGRES_IMP) -Wl,-bE:$*$(EXPSUFF) -o $@ $*.o $(LDFLAGS) $(LDFLAGS_SL)
45+
$(CC) -Wl,-H512 -Wl,-bM:SRE -Wl,-bI:$(top_builddir)/src/backend/$(POSTGRES_IMP) -Wl,-bE:$*$(EXPSUFF) -o $@ $*.o $(LDFLAGS) $(LIBS) $(LDFLAGS_SL)

src/makefiles/Makefile.qnx4

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
MK_NO_LORDER= true
2-
CXXFLAGS+= -I/usr/local/lib/gcc-lib/i386-pc-qnx4/egcs-2.91.60/include/g++
32
AR= ar
43
AROPT = cr
54
LD= $(AR)
65
LDREL= $(AROPT)
76
LDOUT=
87
LIBS= -lunix
9-
LDFLAGS= $(LIBS)
8+
LDFLAGS=
109

1110
enable_shared = no
1211
DLSUFFIX = .so

src/makefiles/Makefile.svr4

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# symbol names to tell them what to export/import.
33
#MAKE_EXPORTS= true
44

5-
LDFLAGS+= -lc /usr/ucblib/libucb.a -LD-Blargedynsym
5+
LIBS += -lc /usr/ucblib/libucb.a
6+
LDFLAGS += -LD-Blargedynsym
67

78
DLSUFFIX = .so
89
CFLAGS_SL =

0 commit comments

Comments
 (0)