]> granicus.if.org Git - postgresql/blob - contrib/cube/Makefile
Tweak bison build rules so that we get the same error messages from
[postgresql] / contrib / cube / Makefile
1 # $Header: /cvsroot/pgsql/contrib/cube/Makefile,v 1.8 2003/01/31 20:58:00 tgl Exp $
2
3 subdir = contrib/cube
4 top_builddir = ../..
5 include $(top_builddir)/src/Makefile.global
6
7 MODULE_big = cube
8 OBJS= cube.o cubeparse.o buffer.o
9
10 DATA_built = cube.sql
11 DOCS = README.cube
12 REGRESS = cube
13
14
15 # cubescan is compiled as part of cubeparse
16 cubeparse.o: cubescan.c
17
18 cubeparse.c: cubeparse.h ;
19
20 # The sed hack is so that we can get the same error messages with
21 # bison 1.875 and later as we did with earlier bisons.  Eventually,
22 # I suppose, we should re-standardize on "syntax error" --- in which
23 # case flip the sed translation, but don't remove it.
24
25 cubeparse.h: cubeparse.y
26 ifdef YACC
27         $(YACC) -d $(YFLAGS) -p cube_yy $<
28         sed -e 's/"syntax error/"parse error/' < y.tab.c > cubeparse.c
29         mv -f y.tab.h cubeparse.h
30         rm -f y.tab.c
31 else
32         @$(missing) bison $< $@
33 endif
34
35 cubescan.c: cubescan.l
36 ifdef FLEX
37         $(FLEX) $(FLEXFLAGS) -Pcube_yy -o'$@' $<
38 else
39         @$(missing) flex $< $@
40 endif
41
42 EXTRA_CLEAN = cubeparse.c cubeparse.h cubescan.c y.tab.c y.tab.h
43
44
45 include $(top_srcdir)/contrib/contrib-global.mk