Add expressions
[tedtools.git] / Makefile
1 topbuilddir=.
2
3 PROGRAM=sfxtest hextest inftest kilter psortex flatdbtest \
4                 tbtreetest gendata memtest glisttest prstest \
5                 tmpltest
6
7 LIBRARY=libtedtools.a
8 LIBOBJ=tlog.o tmalloc.o tools.o prs_hmap.o sfxstr.o \
9         regis.o prs_inf.o shmem.o tcp.o udp.o connpool.o \
10         psort.o flatdb.o tbtree.o glist.o \
11         tmpl_gram.o tmpl_scan.o template.o
12
13
14 BISON=bison -y -d
15 FLEX=flex -CF
16
17 include $(topbuilddir)/Makefile.global
18
19 clean: clean-test clean-gram
20
21 clean-test:
22         rm -rf sfxtest.log sfxtest.dump BTREE
23         rm -rf results diffs temp
24
25 test: all
26         @[ -d results ] || mkdir results
27         @[ -d diffs ] || mkdir diffs
28         @[ -d temp ] || mkdir temp
29         @for FILE in btree flatdb hex inf mem psort sfxmem glist prsqs tmpl ; do \
30                 echo -n $$FILE "        ........ " ; \
31                 if sh tests/$$FILE > results/$$FILE 2>results/$$FILE.errout && diff -c expected/$$FILE results/$$FILE > diffs/$$FILE ; then \
32                         echo ok ; \
33                 else \
34                         echo FAILED ; \
35                 fi ; \
36         done
37
38 clean-gram:
39         rm -f y.tab.c y.tab.h tmpl_gram.c tmpl_gram.h 
40         rm -f tmpl_scan.c
41
42 tmpl_gram.c: tmpl_gram.y
43         $(BISON) -p tmpl_yy tmpl_gram.y
44         mv -f y.tab.c tmpl_gram.c
45         mv -f y.tab.h tmpl_gram.h
46
47 tmpl_scan.c: tmpl_scan.l tmpl_gram.c
48         $(FLEX) -P tmpl_yy -o'tmpl_scan.c' tmpl_scan.l