1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-01 12:18:01 +03:00

Refactor backend makefiles to remove lots of duplicate code

This commit is contained in:
Peter Eisentraut
2008-02-19 10:30:09 +00:00
parent a74e0414a2
commit 0474dcb608
53 changed files with 137 additions and 443 deletions

View File

@@ -1,32 +1,24 @@
#
# Makefile for utils
#
# $PostgreSQL: pgsql/src/backend/utils/Makefile,v 1.25 2007/02/09 15:55:58 petere Exp $
# $PostgreSQL: pgsql/src/backend/utils/Makefile,v 1.26 2008/02/19 10:30:08 petere Exp $
#
subdir = src/backend/utils
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
OBJS = fmgrtab.o
SUBDIRS = adt cache error fmgr hash init mb misc mmgr resowner sort time
SUBDIROBJS = $(SUBDIRS:%=%/SUBSYS.o)
include $(top_srcdir)/src/backend/common.mk
all: SUBSYS.o fmgroids.h
all: fmgroids.h
SUBSYS.o: fmgrtab.o $(SUBDIROBJS)
$(LD) $(LDREL) $(LDOUT) $@ $^
$(SUBDIROBJS): $(SUBDIRS:%=%-recursive) ;
.PHONY: $(SUBDIRS:%=%-recursive)
$(SUBDIRS:%=%-recursive): fmgroids.h
$(MAKE) -C $(subst -recursive,,$@) SUBSYS.o
fmgroids.h fmgrtab.c: Gen_fmgrtab.sh $(top_srcdir)/src/include/catalog/pg_proc.h
AWK='$(AWK)' $(SHELL) $< $(top_srcdir)/src/include/catalog/pg_proc.h
clean:
for dir in $(SUBDIRS); do $(MAKE) -C $$dir $@ || exit; done
rm -f SUBSYS.o fmgrtab.o fmgroids.h fmgrtab.c
rm -f fmgroids.h fmgrtab.c

View File

@@ -1,7 +1,7 @@
#
# Makefile for utils/adt
#
# $PostgreSQL: pgsql/src/backend/utils/adt/Makefile,v 1.68 2007/10/13 23:06:26 tgl Exp $
# $PostgreSQL: pgsql/src/backend/utils/adt/Makefile,v 1.69 2008/02/19 10:30:08 petere Exp $
#
subdir = src/backend/utils/adt
@@ -33,10 +33,4 @@ OBJS = acl.o arrayfuncs.o array_userfuncs.o arrayutils.o bool.o \
like.o: like.c like_match.c
all: SUBSYS.o
SUBSYS.o: $(OBJS)
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
clean:
rm -f SUBSYS.o $(OBJS)
include $(top_srcdir)/src/backend/common.mk

View File

@@ -4,7 +4,7 @@
# Makefile for utils/cache
#
# IDENTIFICATION
# $PostgreSQL: pgsql/src/backend/utils/cache/Makefile,v 1.22 2007/08/21 01:11:19 tgl Exp $
# $PostgreSQL: pgsql/src/backend/utils/cache/Makefile,v 1.23 2008/02/19 10:30:08 petere Exp $
#
#-------------------------------------------------------------------------
@@ -15,10 +15,4 @@ include $(top_builddir)/src/Makefile.global
OBJS = catcache.o inval.o plancache.o relcache.o \
syscache.o lsyscache.o typcache.o ts_cache.o
all: SUBSYS.o
SUBSYS.o: $(OBJS)
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
clean:
rm -f SUBSYS.o $(OBJS)
include $(top_srcdir)/src/backend/common.mk

View File

@@ -4,7 +4,7 @@
# Makefile for utils/error
#
# IDENTIFICATION
# $PostgreSQL: pgsql/src/backend/utils/error/Makefile,v 1.12 2007/01/20 17:16:13 petere Exp $
# $PostgreSQL: pgsql/src/backend/utils/error/Makefile,v 1.13 2008/02/19 10:30:08 petere Exp $
#
#-------------------------------------------------------------------------
@@ -14,10 +14,4 @@ include $(top_builddir)/src/Makefile.global
OBJS = assert.o elog.o
all: SUBSYS.o
SUBSYS.o: $(OBJS)
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
clean:
rm -f SUBSYS.o $(OBJS)
include $(top_srcdir)/src/backend/common.mk

View File

@@ -4,7 +4,7 @@
# Makefile for utils/fmgr
#
# IDENTIFICATION
# $PostgreSQL: pgsql/src/backend/utils/fmgr/Makefile,v 1.17 2004/05/21 20:56:49 tgl Exp $
# $PostgreSQL: pgsql/src/backend/utils/fmgr/Makefile,v 1.18 2008/02/19 10:30:08 petere Exp $
#
#-------------------------------------------------------------------------
@@ -16,11 +16,4 @@ OBJS = dfmgr.o fmgr.o funcapi.o
override CPPFLAGS += -DDLSUFFIX=\"$(DLSUFFIX)\"
all: SUBSYS.o
SUBSYS.o: $(OBJS)
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
clean:
rm -f SUBSYS.o $(OBJS)
include $(top_srcdir)/src/backend/common.mk

View File

@@ -4,7 +4,7 @@
# Makefile for utils/hash
#
# IDENTIFICATION
# $PostgreSQL: pgsql/src/backend/utils/hash/Makefile,v 1.12 2007/01/20 17:16:13 petere Exp $
# $PostgreSQL: pgsql/src/backend/utils/hash/Makefile,v 1.13 2008/02/19 10:30:08 petere Exp $
#
#-------------------------------------------------------------------------
@@ -14,10 +14,4 @@ include $(top_builddir)/src/Makefile.global
OBJS = dynahash.o hashfn.o pg_crc.o
all: SUBSYS.o
SUBSYS.o: $(OBJS)
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
clean:
rm -f SUBSYS.o $(OBJS)
include $(top_srcdir)/src/backend/common.mk

View File

@@ -4,7 +4,7 @@
# Makefile for utils/init
#
# IDENTIFICATION
# $PostgreSQL: pgsql/src/backend/utils/init/Makefile,v 1.21 2007/01/20 17:16:13 petere Exp $
# $PostgreSQL: pgsql/src/backend/utils/init/Makefile,v 1.22 2008/02/19 10:30:08 petere Exp $
#
#-------------------------------------------------------------------------
@@ -14,10 +14,4 @@ include $(top_builddir)/src/Makefile.global
OBJS = flatfiles.o globals.o miscinit.o postinit.o
all: SUBSYS.o
SUBSYS.o: $(OBJS)
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
clean:
rm -f SUBSYS.o $(OBJS)
include $(top_srcdir)/src/backend/common.mk

View File

@@ -4,7 +4,7 @@
# Makefile for utils/mb
#
# IDENTIFICATION
# $PostgreSQL: pgsql/src/backend/utils/mb/Makefile,v 1.23 2007/01/20 17:16:13 petere Exp $
# $PostgreSQL: pgsql/src/backend/utils/mb/Makefile,v 1.24 2008/02/19 10:30:09 petere Exp $
#
#-------------------------------------------------------------------------
@@ -13,15 +13,8 @@ top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global
OBJS = encnames.o conv.o mbutils.o wchar.o wstrcmp.o wstrncmp.o
DIRS = conversion_procs
all install installdirs: SUBSYS.o
uninstall distprep:
include $(top_srcdir)/src/backend/common.mk
clean distclean maintainer-clean:
rm -f SUBSYS.o $(OBJS)
@for dir in $(DIRS); do $(MAKE) -C $$dir $@; done
SUBSYS.o: $(OBJS)
$(LD) $(LDREL) $(LDOUT) $@ $^
$(MAKE) -C conversion_procs $@

View File

@@ -4,7 +4,7 @@
# Makefile for utils/misc
#
# IDENTIFICATION
# $PostgreSQL: pgsql/src/backend/utils/misc/Makefile,v 1.27 2007/01/20 17:16:14 petere Exp $
# $PostgreSQL: pgsql/src/backend/utils/misc/Makefile,v 1.28 2008/02/19 10:30:09 petere Exp $
#
#-------------------------------------------------------------------------
@@ -22,11 +22,7 @@ ifdef krb_srvtab
override CPPFLAGS += -DPG_KRB_SRVTAB='"$(krb_srvtab)"'
endif
all: SUBSYS.o
SUBSYS.o: $(OBJS)
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
include $(top_srcdir)/src/backend/common.mk
# guc-file is compiled as part of guc
guc.o: $(srcdir)/guc-file.c
@@ -41,5 +37,4 @@ endif
# Note: guc-file.c is not deleted by 'make clean',
# since we want to ship it in distribution tarballs.
clean:
rm -f SUBSYS.o $(OBJS)
@rm -f lex.yy.c

View File

@@ -4,7 +4,7 @@
# Makefile for utils/mmgr
#
# IDENTIFICATION
# $PostgreSQL: pgsql/src/backend/utils/mmgr/Makefile,v 1.12 2007/01/20 17:16:14 petere Exp $
# $PostgreSQL: pgsql/src/backend/utils/mmgr/Makefile,v 1.13 2008/02/19 10:30:09 petere Exp $
#
#-------------------------------------------------------------------------
@@ -14,10 +14,4 @@ include $(top_builddir)/src/Makefile.global
OBJS = aset.o mcxt.o portalmem.o
all: SUBSYS.o
SUBSYS.o: $(OBJS)
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
clean:
rm -f SUBSYS.o $(OBJS)
include $(top_srcdir)/src/backend/common.mk

View File

@@ -4,7 +4,7 @@
# Makefile for utils/resowner
#
# IDENTIFICATION
# $PostgreSQL: pgsql/src/backend/utils/resowner/Makefile,v 1.2 2007/01/20 17:16:14 petere Exp $
# $PostgreSQL: pgsql/src/backend/utils/resowner/Makefile,v 1.3 2008/02/19 10:30:09 petere Exp $
#
#-------------------------------------------------------------------------
@@ -14,10 +14,4 @@ include $(top_builddir)/src/Makefile.global
OBJS = resowner.o
all: SUBSYS.o
SUBSYS.o: $(OBJS)
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
clean:
rm -f SUBSYS.o $(OBJS)
include $(top_srcdir)/src/backend/common.mk

View File

@@ -4,7 +4,7 @@
# Makefile for utils/sort
#
# IDENTIFICATION
# $PostgreSQL: pgsql/src/backend/utils/sort/Makefile,v 1.14 2007/01/20 17:16:14 petere Exp $
# $PostgreSQL: pgsql/src/backend/utils/sort/Makefile,v 1.15 2008/02/19 10:30:09 petere Exp $
#
#-------------------------------------------------------------------------
@@ -14,10 +14,4 @@ include $(top_builddir)/src/Makefile.global
OBJS = logtape.o tuplesort.o tuplestore.o
all: SUBSYS.o
SUBSYS.o: $(OBJS)
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
clean:
rm -f SUBSYS.o $(OBJS)
include $(top_srcdir)/src/backend/common.mk

View File

@@ -4,7 +4,7 @@
# Makefile for utils/time
#
# IDENTIFICATION
# $PostgreSQL: pgsql/src/backend/utils/time/Makefile,v 1.12 2007/02/09 03:35:34 tgl Exp $
# $PostgreSQL: pgsql/src/backend/utils/time/Makefile,v 1.13 2008/02/19 10:30:09 petere Exp $
#
#-------------------------------------------------------------------------
@@ -14,10 +14,4 @@ include $(top_builddir)/src/Makefile.global
OBJS = combocid.o tqual.o
all: SUBSYS.o
SUBSYS.o: $(OBJS)
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
clean:
rm -f SUBSYS.o $(OBJS)
include $(top_srcdir)/src/backend/common.mk