]> granicus.if.org Git - postgresql/blob - src/backend/bootstrap/Makefile
Make all our flex and bison files use %option prefix or %name-prefix
[postgresql] / src / backend / bootstrap / Makefile
1 #-------------------------------------------------------------------------
2 #
3 # Makefile for the bootstrap module
4 #
5 # $PostgreSQL: pgsql/src/backend/bootstrap/Makefile,v 1.34 2006/03/07 01:03:12 tgl Exp $
6 #
7 #-------------------------------------------------------------------------
8
9 subdir = src/backend/bootstrap
10 top_builddir = ../../..
11 include $(top_builddir)/src/Makefile.global
12
13 override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
14
15 OBJS= bootparse.o bootstrap.o 
16
17 all: SUBSYS.o
18
19 SUBSYS.o: $(OBJS)
20         $(LD) $(LDREL) $(LDOUT) $@ $^
21
22
23 # bootscanner is compiled as part of bootparse
24 bootparse.o: $(srcdir)/bootscanner.c
25
26 # See notes in src/backend/parser/Makefile about the following two rules
27
28 $(srcdir)/bootparse.c: $(srcdir)/bootstrap_tokens.h ;
29
30 $(srcdir)/bootstrap_tokens.h: bootparse.y
31 ifdef YACC
32         $(YACC) -d $(YFLAGS) $<
33         mv -f y.tab.c $(srcdir)/bootparse.c
34         mv -f y.tab.h $(srcdir)/bootstrap_tokens.h
35 else
36         @$(missing) bison $< $@
37 endif
38
39 $(srcdir)/bootscanner.c: bootscanner.l
40 ifdef FLEX
41         $(FLEX) $(FLEXFLAGS) -o'$@' $<
42 else
43         @$(missing) flex $< $@
44 endif
45
46 # Force these dependencies to be known even without dependency info built:
47 bootstrap.o bootparse.o: $(srcdir)/bootstrap_tokens.h
48
49
50 # bootparse.c, bootstrap_tokens.h, and bootscanner.c are in the distribution
51 # tarball, so they are not cleaned here.
52 clean:
53         rm -f SUBSYS.o $(OBJS)
54 # And the garbage that might have been left behind by partial build:
55         @rm -f y.tab.h y.tab.c y.output lex.yy.c
56
57
58 # This is unusual:  We actually have to build some of the parts before
59 # we know what the header file dependencies are.  
60 dep depend: bootparse.c bootscanner.c bootstrap_tokens.h
61         $(CC) -MM $(CFLAGS) *.c >depend
62
63 ifeq (depend,$(wildcard depend))
64 include depend
65 endif