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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy