1 #-------------------------------------------------------------------------
4 # Makefile for the bootstrap module
7 # $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.14 1998/07/24 03:31:06 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
33 BOOTYACCS= bootstrap_tokens.h bootparse.c
35 OBJS= bootparse.o bootscanner.o bootstrap.o
40 $(LD) -r -o SUBSYS.o $(OBJS)
42 # bootstrap.o's dependency on bootstrap_tokens.h is computed by the
43 # make depend, but we state it here explicitly anyway because
44 # bootstrap_tokens.h doesn't even exist at first and if user fails to
45 # do make depend, we still want the build to succeed.
47 bootstrap.o: bootstrap_tokens.h
49 bootstrap_tokens.h bootparse.c: bootparse.y
51 grep -v "^#" boot.sed > sedfile
52 sed -f sedfile < y.tab.c > bootparse.c
53 mv y.tab.h bootstrap_tokens.h
56 bootscanner.c: bootscanner.l
58 grep -v "^#" boot.sed > sedfile
59 sed -f sedfile < lex.yy.c > bootscanner.c
60 rm -f lex.yy.c sedfile
63 rm -f SUBSYS.o $(OBJS) bootparse.c bootstrap_tokens.h bootscanner.c
64 # And the garbage that might have been left behind by partial build:
65 rm -f y.tab.h y.tab.c y.output lex.yy.c
67 # This is unusual: We actually have to build some of the parts before
68 # we know what the header file dependencies are.
69 dep depend: bootparse.c bootscanner.c bootstrap_tokens.h
70 $(CC) -MM $(CFLAGS) *.c >depend
72 ifeq (depend,$(wildcard depend))