Skip to content

Commit 0474dcb

Browse files
committed
Refactor backend makefiles to remove lots of duplicate code
1 parent a74e041 commit 0474dcb

File tree

53 files changed

+137
-443
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+137
-443
lines changed

src/backend/access/Makefile

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,13 @@
11
#
22
# Makefile for the access methods module
33
#
4-
# $PostgreSQL: pgsql/src/backend/access/Makefile,v 1.13 2007/02/09 15:55:58 petere Exp $
4+
# $PostgreSQL: pgsql/src/backend/access/Makefile,v 1.14 2008/02/19 10:30:06 petere Exp $
55
#
66

77
subdir = src/backend/access
88
top_builddir = ../../..
99
include $(top_builddir)/src/Makefile.global
1010

1111
SUBDIRS = common gist hash heap index nbtree transam gin
12-
SUBDIROBJS = $(SUBDIRS:%=%/SUBSYS.o)
1312

14-
all: SUBSYS.o
15-
16-
SUBSYS.o: $(SUBDIROBJS)
17-
$(LD) $(LDREL) $(LDOUT) $@ $^
18-
19-
$(SUBDIROBJS): $(SUBDIRS:%=%-recursive) ;
20-
21-
.PHONY: $(SUBDIRS:%=%-recursive)
22-
$(SUBDIRS:%=%-recursive):
23-
$(MAKE) -C $(subst -recursive,,$@) SUBSYS.o
24-
25-
clean:
26-
for dir in $(SUBDIRS); do $(MAKE) -C $$dir $@ || exit; done
27-
rm -f SUBSYS.o
13+
include $(top_srcdir)/src/backend/common.mk

src/backend/access/common/Makefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Makefile for access/common
55
#
66
# IDENTIFICATION
7-
# $PostgreSQL: pgsql/src/backend/access/common/Makefile,v 1.23 2007/01/20 17:16:10 petere Exp $
7+
# $PostgreSQL: pgsql/src/backend/access/common/Makefile,v 1.24 2008/02/19 10:30:06 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -16,8 +16,4 @@ OBJS = heaptuple.o indextuple.o printtup.o reloptions.o scankey.o tupdesc.o
1616

1717
all: SUBSYS.o
1818

19-
SUBSYS.o: $(OBJS)
20-
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
21-
22-
clean:
23-
rm -f SUBSYS.o $(OBJS)
19+
include $(top_srcdir)/src/backend/common.mk

src/backend/access/gin/Makefile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Makefile for access/gin
55
#
66
# IDENTIFICATION
7-
# $PostgreSQL: pgsql/src/backend/access/gin/Makefile,v 1.2 2007/01/20 17:16:10 petere Exp $
7+
# $PostgreSQL: pgsql/src/backend/access/gin/Makefile,v 1.3 2008/02/19 10:30:06 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -16,10 +16,4 @@ OBJS = ginutil.o gininsert.o ginxlog.o ginentrypage.o gindatapage.o \
1616
ginbtree.o ginscan.o ginget.o ginvacuum.o ginarrayproc.o \
1717
ginbulk.o
1818

19-
all: SUBSYS.o
20-
21-
SUBSYS.o: $(OBJS)
22-
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
23-
24-
clean:
25-
rm -f SUBSYS.o $(OBJS)
19+
include $(top_srcdir)/src/backend/common.mk

src/backend/access/gist/Makefile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Makefile for access/gist
55
#
66
# IDENTIFICATION
7-
# $PostgreSQL: pgsql/src/backend/access/gist/Makefile,v 1.17 2007/01/20 17:16:10 petere Exp $
7+
# $PostgreSQL: pgsql/src/backend/access/gist/Makefile,v 1.18 2008/02/19 10:30:06 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -15,10 +15,4 @@ include $(top_builddir)/src/Makefile.global
1515
OBJS = gist.o gistutil.o gistxlog.o gistvacuum.o gistget.o gistscan.o \
1616
gistproc.o gistsplit.o
1717

18-
all: SUBSYS.o
19-
20-
SUBSYS.o: $(OBJS)
21-
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
22-
23-
clean:
24-
rm -f SUBSYS.o $(OBJS)
18+
include $(top_srcdir)/src/backend/common.mk

src/backend/access/hash/Makefile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Makefile for access/hash
55
#
66
# IDENTIFICATION
7-
# $PostgreSQL: pgsql/src/backend/access/hash/Makefile,v 1.13 2007/01/20 17:16:10 petere Exp $
7+
# $PostgreSQL: pgsql/src/backend/access/hash/Makefile,v 1.14 2008/02/19 10:30:06 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -15,10 +15,4 @@ include $(top_builddir)/src/Makefile.global
1515
OBJS = hash.o hashfunc.o hashinsert.o hashovfl.o hashpage.o hashscan.o \
1616
hashsearch.o hashutil.o
1717

18-
all: SUBSYS.o
19-
20-
SUBSYS.o: $(OBJS)
21-
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
22-
23-
clean:
24-
rm -f SUBSYS.o $(OBJS)
18+
include $(top_srcdir)/src/backend/common.mk

src/backend/access/heap/Makefile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Makefile for access/heap
55
#
66
# IDENTIFICATION
7-
# $PostgreSQL: pgsql/src/backend/access/heap/Makefile,v 1.17 2007/09/20 17:56:30 tgl Exp $
7+
# $PostgreSQL: pgsql/src/backend/access/heap/Makefile,v 1.18 2008/02/19 10:30:06 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

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

1515
OBJS = heapam.o hio.o pruneheap.o rewriteheap.o syncscan.o tuptoaster.o
1616

17-
all: SUBSYS.o
18-
19-
SUBSYS.o: $(OBJS)
20-
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
21-
22-
clean:
23-
rm -f SUBSYS.o $(OBJS)
17+
include $(top_srcdir)/src/backend/common.mk

src/backend/access/index/Makefile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Makefile for access/index
55
#
66
# IDENTIFICATION
7-
# $PostgreSQL: pgsql/src/backend/access/index/Makefile,v 1.13 2007/01/20 17:16:10 petere Exp $
7+
# $PostgreSQL: pgsql/src/backend/access/index/Makefile,v 1.14 2008/02/19 10:30:06 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

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

1515
OBJS = genam.o indexam.o
1616

17-
all: SUBSYS.o
18-
19-
SUBSYS.o: $(OBJS)
20-
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
21-
22-
clean:
23-
rm -f SUBSYS.o $(OBJS)
17+
include $(top_srcdir)/src/backend/common.mk

src/backend/access/nbtree/Makefile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Makefile for access/nbtree
55
#
66
# IDENTIFICATION
7-
# $PostgreSQL: pgsql/src/backend/access/nbtree/Makefile,v 1.15 2007/01/20 17:16:10 petere Exp $
7+
# $PostgreSQL: pgsql/src/backend/access/nbtree/Makefile,v 1.16 2008/02/19 10:30:06 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -15,10 +15,4 @@ include $(top_builddir)/src/Makefile.global
1515
OBJS = nbtcompare.o nbtinsert.o nbtpage.o nbtree.o nbtsearch.o \
1616
nbtutils.o nbtsort.o nbtxlog.o
1717

18-
all: SUBSYS.o
19-
20-
SUBSYS.o: $(OBJS)
21-
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
22-
23-
clean:
24-
rm -f SUBSYS.o $(OBJS)
18+
include $(top_srcdir)/src/backend/common.mk

src/backend/access/transam/Makefile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Makefile for access/transam
55
#
66
# IDENTIFICATION
7-
# $PostgreSQL: pgsql/src/backend/access/transam/Makefile,v 1.21 2005/06/17 22:32:42 tgl Exp $
7+
# $PostgreSQL: pgsql/src/backend/access/transam/Makefile,v 1.22 2008/02/19 10:30:07 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

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

1515
OBJS = clog.o transam.o varsup.o xact.o xlog.o xlogutils.o rmgr.o slru.o subtrans.o multixact.o twophase.o twophase_rmgr.o
1616

17-
all: SUBSYS.o
18-
19-
SUBSYS.o: $(OBJS)
20-
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
21-
22-
clean:
23-
rm -f SUBSYS.o $(OBJS)
17+
include $(top_srcdir)/src/backend/common.mk
2418

2519
# ensure that version checks in xlog.c get recompiled when catversion.h changes
2620
xlog.o: xlog.c $(top_srcdir)/src/include/catalog/catversion.h

src/backend/bootstrap/Makefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Makefile for the bootstrap module
44
#
5-
# $PostgreSQL: pgsql/src/backend/bootstrap/Makefile,v 1.35 2007/01/20 17:16:11 petere Exp $
5+
# $PostgreSQL: pgsql/src/backend/bootstrap/Makefile,v 1.36 2008/02/19 10:30:07 petere Exp $
66
#
77
#-------------------------------------------------------------------------
88

@@ -14,10 +14,7 @@ override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
1414

1515
OBJS= bootparse.o bootstrap.o
1616

17-
all: SUBSYS.o
18-
19-
SUBSYS.o: $(OBJS)
20-
$(LD) $(LDREL) $(LDOUT) $@ $^
17+
include $(top_srcdir)/src/backend/common.mk
2118

2219

2320
# bootscanner is compiled as part of bootparse
@@ -50,6 +47,5 @@ bootstrap.o bootparse.o: $(srcdir)/bootstrap_tokens.h
5047
# bootparse.c, bootstrap_tokens.h, and bootscanner.c are in the distribution
5148
# tarball, so they are not cleaned here.
5249
clean:
53-
rm -f SUBSYS.o $(OBJS)
5450
# And the garbage that might have been left behind by partial build:
5551
@rm -f y.tab.h y.tab.c y.output lex.yy.c

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