topbuilddir=.
PROGRAM=sfxtest hextest inftest kilter psortex flatdbtest \
- tbtreetest gendata memtest glisttest
+ tbtreetest gendata memtest glisttest prstest \
+ tmpltest
LIBRARY=libtedtools.a
LIBOBJ=tlog.o tmalloc.o tools.o prs_hmap.o sfxstr.o \
regis.o prs_inf.o shmem.o tcp.o udp.o connpool.o \
- psort.o flatdb.o tbtree.o glist.o
+ psort.o flatdb.o tbtree.o glist.o \
+ tmpl_gram.o tmpl_scan.o template.o
+
+
+BISON=bison -y -d
+FLEX=flex -CF
include $(topbuilddir)/Makefile.global
-clean: clean-test
+clean: clean-test clean-gram
clean-test:
- rm -rf sfxtest.log BTREE
+ rm -rf sfxtest.log sfxtest.dump BTREE
rm -rf results diffs temp
test: all
@[ -d results ] || mkdir results
@[ -d diffs ] || mkdir diffs
@[ -d temp ] || mkdir temp
- @for FILE in btree flatdb hex inf mem psort sfxmem glist ; do \
+ @for FILE in btree flatdb hex inf mem psort sfxmem glist prsqs tmpl ; do \
echo -n $$FILE " ........ " ; \
if sh tests/$$FILE > results/$$FILE 2>results/$$FILE.errout && diff -c expected/$$FILE results/$$FILE > diffs/$$FILE ; then \
echo ok ; \
echo FAILED ; \
fi ; \
done
+
+clean-gram:
+ rm -f y.tab.c y.tab.h tmpl_gram.c tmpl_gram.h
+ rm -f tmpl_scan.c
+
+tmpl_gram.c: tmpl_gram.y
+ $(BISON) -p tmpl_yy tmpl_gram.y
+ mv -f y.tab.c tmpl_gram.c
+ mv -f y.tab.h tmpl_gram.h
+
+tmpl_scan.c: tmpl_scan.l tmpl_gram.c
+ $(FLEX) -P tmpl_yy -o'tmpl_scan.c' tmpl_scan.l