1 #-------------------------------------------------------------------------
4 # Makefile for the bootstrap module
7 # $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.7 1997/04/15 17:24:07 scrappy Exp $
10 # We must build bootparse.c and bootscanner.c with yacc and lex and sed,
11 # but bootstrap.c is part of the distribution.
13 # Another kinda weird Makefile cause we need two
14 # scanner/parsers in the backend and most yaccs and lexs
15 # don't have the prefix option.
17 # sed files are HACK CITY! - redo...
19 #-------------------------------------------------------------------------
22 include ../../Makefile.global
25 -I../port/$(PORTNAME) \
28 CFLAGS+= $(INCLUDE_OPT)
34 BOOTYACCS= bootstrap_tokens.h bootparse.c
36 OBJS= bootparse.o bootscanner.o bootstrap.o
41 ld -r -o SUBSYS.o $(OBJS)
43 # bootstrap.o's dependency on bootstrap_tokens.h is computed by the
44 # make depend, but we state it here explicitly anyway because
45 # bootstrap_tokens.h doesn't even exist at first and if user fails to
46 # do make depend, we still want the build to succeed.
48 bootstrap.o: bootstrap_tokens.h
50 bootstrap_tokens.h bootparse.c: bootparse.y
52 sed -f boot.sed < y.tab.c > bootparse.c
53 mv y.tab.h bootstrap_tokens.h
56 bootscanner.c: bootscanner.l
58 sed -f boot.sed < lex.yy.c > bootscanner.c
62 rm -f SUBSYS.o $(OBJS) bootparse.c bootstrap_tokens.h bootscanner.c
63 # And the garbage that might have been left behind by partial build:
64 rm -f y.tab.h y.tab.c y.output lex.yy.c
66 # This is unusual: We actually have to build some of the parts before
67 # we know what the header file dependencies are.
68 dep: bootparse.c bootscanner.c bootstrap_tokens.h
69 $(CC) -MM $(INCLUDE_OPT) *.c >depend
71 ifeq (depend,$(wildcard depend))