]> granicus.if.org Git - postgresql/blobdiff - src/backend/bootstrap/Makefile
Move Trigger and TriggerDesc structs out of rel.h into a new reltrigger.h
[postgresql] / src / backend / bootstrap / Makefile
index 66ed86f3c5259eeb9d06bd4447682c2a2276d89e..a77d8648008b52054859454712d69c80341544df 100644 (file)
@@ -1,71 +1,39 @@
 #-------------------------------------------------------------------------
 #
-# Makefile--
-#    Makefile for the bootstrap module
+# Makefile for the bootstrap module
 #
-# IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.1 1996/10/27 09:46:59 bryanh Exp $
-#
-#
-# We must build bootparse.c and bootscanner.c with yacc and lex and sed,
-# but bootstrap.c is part of the distribution.
-#
-# Another kinda weird Makefile cause we need two
-#  scanner/parsers in the backend and most yaccs and lexs
-#  don't have the prefix option.
-#
-#      sed files are HACK CITY! - redo...
+# src/backend/bootstrap/Makefile
 #
 #-------------------------------------------------------------------------
 
-SRCDIR = ../..
-include ../../Makefile.global
-
-INCLUDE_OPT = -I.. \
-              -I../port/$(PORTNAME) \
-              -I../include \
-              -I../../include
-
-CFLAGS += $(INCLUDE_OPT)
+subdir = src/backend/bootstrap
+top_builddir = ../../..
+include $(top_builddir)/src/Makefile.global
 
-BOOTYACCS = bootstrap_tokens.h bootparse.c
+override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS)
 
-OBJS = bootparse.o bootscanner.o bootstrap.o 
+OBJS= bootparse.o bootstrap.o
 
-all: SUBSYS.o
+include $(top_srcdir)/src/backend/common.mk
 
-SUBSYS.o: $(OBJS)
-       ld -r -o SUBSYS.o $(OBJS)
 
-# bootstrap.o's dependency on bootstrap_tokens.h is computed by the
-# make depend, but we state it here explicitly anyway because 
-# bootstrap_tokens.h doesn't even exist at first and if user fails to 
-# do make depend, we still want the build to succeed.
+# bootscanner is compiled as part of bootparse
+bootparse.o: bootscanner.c
 
-bootstrap.o: bootstrap_tokens.h
-
-bootstrap_tokens.h bootparse.c: bootparse.y
-       $(YACC) $(YFLAGS) $<
-       sed -f boot.sed < y.tab.c > bootparse.c
-       mv y.tab.h bootstrap_tokens.h
-       rm -f y.tab.c
+bootparse.c: bootparse.y
+ifdef BISON
+       $(BISON) $(BISONFLAGS) -o $@ $<
+else
+       @$(missing) bison $< $@
+endif
 
 bootscanner.c: bootscanner.l
-       $(LEX) $<
-       sed -f boot.sed < lex.yy.c > bootscanner.c
-       rm -f lex.yy.c
-
-clean:
-       rm -f SUBSYS.o $(OBJS) bootparse.c bootstrap_tokens.h bootscanner.c
-# And the garbage that might have been left behind by partial build:
-       rm -f y.tab.h y.tab.c y.output lex.yy.c
-
-# This is unusual:  We actually have to build some of the parts before
-# we know what the header file dependencies are.  
-dep: bootparse.c bootscanner.c bootstrap_tokens.h
-       $(CC) -MM $(INCLUDE_OPT) *.c >depend
-
-ifeq (depend,$(wildcard depend))
-include depend
+ifdef FLEX
+       $(FLEX) $(FLEXFLAGS) -o'$@' $<
+else
+       @$(missing) flex $< $@
 endif
 
+
+# bootparse.c and bootscanner.c are in the distribution tarball, so
+# they are not cleaned here.