summaryrefslogtreecommitdiff
path: root/src/backend/Makefile
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-01-05 01:06:57 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2010-01-05 01:06:57 +0000
commit64737e93132b036006ca16e793c634e5939d42db (patch)
tree3736a437c24809767c4c875493f4849865df1efe /src/backend/Makefile
parentfc09fb7bcf0ec3320331744c9523b71349d55fb6 (diff)
downloadpostgresql-64737e93132b036006ca16e793c634e5939d42db.tar.gz
Get rid of the need for manual maintenance of the initial contents of
pg_attribute, by having genbki.pl derive the information from the various catalog header files. This greatly simplifies modification of the "bootstrapped" catalogs. This patch finally kills genbki.sh and Gen_fmgrtab.sh; we now rely entirely on Perl scripts for those build steps. To avoid creating a Perl build dependency where there was not one before, the output files generated by these scripts are now treated as distprep targets, ie, they will be built and shipped in tarballs. But you will need a reasonably modern Perl (probably at least 5.6) if you want to build from a CVS pull. The changes to the MSVC build process are untested, and may well break --- we'll soon find out from the buildfarm. John Naylor, based on ideas from Robert Haas and others
Diffstat (limited to 'src/backend/Makefile')
-rw-r--r--src/backend/Makefile45
1 files changed, 37 insertions, 8 deletions
diff --git a/src/backend/Makefile b/src/backend/Makefile
index 352357bee8..ac46d50836 100644
--- a/src/backend/Makefile
+++ b/src/backend/Makefile
@@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
-# $PostgreSQL: pgsql/src/backend/Makefile,v 1.137 2010/01/02 16:57:33 momjian Exp $
+# $PostgreSQL: pgsql/src/backend/Makefile,v 1.138 2010/01/05 01:06:56 tgl Exp $
#
#-------------------------------------------------------------------------
@@ -42,7 +42,7 @@ LIBS := $(filter-out -lz -lreadline -ledit -ltermcap -lncurses -lcurses, $(LIBS)
##########################################################################
-all: submake-libpgport postgres $(POSTGRES_IMP)
+all: submake-libpgport submake-schemapg postgres $(POSTGRES_IMP)
ifneq ($(PORTNAME), cygwin)
ifneq ($(PORTNAME), win32)
@@ -111,7 +111,13 @@ endif
endif # aix
# Update the commonly used headers before building the subdirectories
-$(SUBDIRS:%=%-recursive): $(top_builddir)/src/include/parser/gram.h $(top_builddir)/src/include/utils/fmgroids.h $(top_builddir)/src/include/utils/probes.h
+$(SUBDIRS:%=%-recursive): $(top_builddir)/src/include/parser/gram.h $(top_builddir)/src/include/catalog/schemapg.h $(top_builddir)/src/include/utils/fmgroids.h $(top_builddir)/src/include/utils/probes.h
+
+# run this unconditionally to avoid needing to know its dependencies here:
+submake-schemapg:
+ $(MAKE) -C catalog schemapg.h
+
+.PHONY: submake-schemapg
# The postgres.o target is needed by the rule in Makefile.global that
@@ -127,7 +133,7 @@ postgres.o: $(OBJS)
parser/gram.h: parser/gram.y
$(MAKE) -C parser gram.h
-utils/fmgroids.h: utils/Gen_fmgrtab.sh $(top_srcdir)/src/include/catalog/pg_proc.h
+utils/fmgroids.h: utils/Gen_fmgrtab.pl catalog/Catalog.pm $(top_srcdir)/src/include/catalog/pg_proc.h
$(MAKE) -C utils fmgroids.h
utils/probes.h: utils/probes.d
@@ -136,15 +142,28 @@ utils/probes.h: utils/probes.d
# Make symlinks for these headers in the include directory. That way
# we can cut down on the -I options. Also, a symlink is automatically
# up to date when we update the base file.
+#
+# The point of the prereqdir incantation in some of the rules below is to
+# force the symlink to use an absolute path rather than a relative path.
+# For headers which are generated by make distprep, the actual header within
+# src/backend will be in the source tree, while the symlink in src/include
+# will be in the build tree, so a simple ../.. reference won't work.
+# For headers generated during regular builds, we prefer a relative symlink.
$(top_builddir)/src/include/parser/gram.h: parser/gram.h
prereqdir=`cd $(dir $<) >/dev/null && pwd` && \
cd $(dir $@) && rm -f $(notdir $@) && \
$(LN_S) "$$prereqdir/$(notdir $<)" .
+$(top_builddir)/src/include/catalog/schemapg.h: catalog/schemapg.h
+ prereqdir=`cd $(dir $<) >/dev/null && pwd` && \
+ cd $(dir $@) && rm -f $(notdir $@) && \
+ $(LN_S) "$$prereqdir/$(notdir $<)" .
+
$(top_builddir)/src/include/utils/fmgroids.h: utils/fmgroids.h
- cd $(dir $@) && rm -f $(notdir $@) && \
- $(LN_S) ../../../$(subdir)/utils/fmgroids.h .
+ prereqdir=`cd $(dir $<) >/dev/null && pwd` && \
+ cd $(dir $@) && rm -f $(notdir $@) && \
+ $(LN_S) "$$prereqdir/$(notdir $<)" .
$(top_builddir)/src/include/utils/probes.h: utils/probes.h
cd $(dir $@) && rm -f $(notdir $@) && \
@@ -160,6 +179,8 @@ utils/probes.o: utils/probes.d $(SUBDIROBJS)
distprep:
$(MAKE) -C parser gram.c gram.h scan.c
$(MAKE) -C bootstrap bootparse.c bootscanner.c
+ $(MAKE) -C catalog schemapg.h postgres.bki postgres.description postgres.shdescription
+ $(MAKE) -C utils fmgrtab.c fmgroids.h
$(MAKE) -C utils/misc guc-file.c
@@ -243,8 +264,10 @@ endif
clean:
rm -f $(LOCALOBJS) postgres$(X) $(POSTGRES_IMP) \
- $(top_srcdir)/src/include/parser/gram.h \
- $(top_builddir)/src/include/utils/fmgroids.h
+ $(top_builddir)/src/include/parser/gram.h \
+ $(top_builddir)/src/include/catalog/schemapg.h \
+ $(top_builddir)/src/include/utils/fmgroids.h \
+ $(top_builddir)/src/include/utils/probes.h
ifeq ($(PORTNAME), cygwin)
rm -f postgres.dll postgres.def libpostgres.a
endif
@@ -261,6 +284,12 @@ maintainer-clean: distclean
parser/gram.c \
parser/scan.c \
parser/gram.h \
+ catalog/schemapg.h \
+ catalog/postgres.bki \
+ catalog/postgres.description \
+ catalog/postgres.shdescription \
+ utils/fmgroids.h \
+ utils/fmgrtab.c \
utils/misc/guc-file.c