]> granicus.if.org Git - postgresql/blob - src/backend/bootstrap/Makefile
Fix up the -Wno-error problem for non-gcc compilers
[postgresql] / src / backend / bootstrap / Makefile
1 #-------------------------------------------------------------------------
2 #
3 # Makefile--
4 #    Makefile for the bootstrap module
5 #
6 # IDENTIFICATION
7 #    $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.7 1997/04/15 17:24:07 scrappy Exp $
8 #
9 #
10 # We must build bootparse.c and bootscanner.c with yacc and lex and sed,
11 # but bootstrap.c is part of the distribution.
12 #
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.
16 #
17 #       sed files are HACK CITY! - redo...
18 #
19 #-------------------------------------------------------------------------
20
21 SRCDIR= ../..
22 include ../../Makefile.global
23
24 INCLUDE_OPT= -I.. \
25              -I../port/$(PORTNAME) \
26              -I../../include
27
28 CFLAGS+= $(INCLUDE_OPT)  
29
30 ifeq ($CC), gcc)
31 CFLAGS+= -Wno-error
32 endif
33
34 BOOTYACCS= bootstrap_tokens.h bootparse.c
35
36 OBJS= bootparse.o bootscanner.o bootstrap.o 
37
38 all: SUBSYS.o
39
40 SUBSYS.o: $(OBJS)
41         ld -r -o SUBSYS.o $(OBJS)
42
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.
47
48 bootstrap.o: bootstrap_tokens.h
49
50 bootstrap_tokens.h bootparse.c: bootparse.y
51         $(YACC) $(YFLAGS) $<
52         sed -f boot.sed < y.tab.c > bootparse.c
53         mv y.tab.h bootstrap_tokens.h
54         rm -f y.tab.c
55
56 bootscanner.c: bootscanner.l
57         $(LEX) $<
58         sed -f boot.sed < lex.yy.c > bootscanner.c
59         rm -f lex.yy.c
60
61 clean:
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
65
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
70
71 ifeq (depend,$(wildcard depend))
72 include depend
73 endif
74