diff options
Diffstat (limited to 'src/backend/Makefile')
-rw-r--r-- | src/backend/Makefile | 45 |
1 files changed, 37 insertions, 8 deletions
diff --git a/src/backend/Makefile b/src/backend/Makefile index 352357bee8e..ac46d508366 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 |