34 lines
797 B
Makefile
34 lines
797 B
Makefile
include $(top_srcdir)/Makefile.decl
|
|
|
|
PARSER = $(top_builddir)/sql/sql-parser.c
|
|
|
|
DIR = $(top_srcdir)/sql/parser
|
|
TMPL = $(DIR)/lempar-tmpl.c
|
|
SCAN = scan.rl
|
|
GRAM = gram.y
|
|
|
|
all: $(PARSER)
|
|
$(PARSER): $(SCAN) gram.c gram.h
|
|
$(ragel_v)$(RAGEL) -C -G2 -o $(PARSER) $<
|
|
|
|
gram.h: gram.c
|
|
gram.c: $(GRAM) lemon $(TMPL)
|
|
ln -fs $(TMPL) $(top_builddir)/sql/parser/lempar.c
|
|
$(lemon_v)./lemon -q $<
|
|
|
|
lemon: $(DIR)/lemon.c
|
|
$(CC) -o lemon $<
|
|
|
|
EXTRA_DIST = gram.y scan.rl lemon.c lempar-tmpl.c
|
|
|
|
CLEANFILES = $(DIR)/gram.c $(DIR)/gram.h $(PARSER)
|
|
|
|
DISTCLEANFILES = lemon lempar.c
|
|
|
|
ragel_v = $(ragel_v_@AM_V@)
|
|
ragel_v_ = $(ragel_v_@AM_DEFAULT_V@)
|
|
ragel_v_0 = @echo " RAGEL $@";
|
|
|
|
lemon_v = $(lemon_v_@AM_V@)
|
|
lemon_v_ = $(lemon_v_@AM_DEFAULT_V@)
|
|
lemon_v_0 = @echo " LEMON $(subst y,c,$(GRAM)) $(subst y,h,$(GRAM))";
|