X-Git-Url: http://www.sigaev.ru/git/gitweb.cgi?a=blobdiff_plain;f=Makefile;h=ba4ced9416f4b9a12988f8cb1413d932bd189ef4;hb=97949d6c025ec892ff5ae21e32014b2f23218571;hp=df63daf8826224c2e9d10c533190c7d1283faa76;hpb=ba7e1d079124ac7e5685a0cf918229d1a9a26735;p=tedtools.git diff --git a/Makefile b/Makefile index df63daf..ba4ced9 100644 --- a/Makefile +++ b/Makefile @@ -1,40 +1,32 @@ -CC=gcc -AR=ar rcv -RANLIB=ranlib -LD=ld -x -shared +topbuilddir=. -INCLUDE=-I. -#LINUX_CFLAGS=-D_GNU_SOURCE -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 -CFLAGS=-Wall -g -O2 -pedantic -ansi -DASSERT_CORE -DHAVE_POLL_H -DHAVE_SYS_POLL_H -DHAVE_HSTRERROR $(LINUX_CFLAGS) -LIB=-g -L. -ltedtools -lm +PROGRAM=sfxtest hextest inftest kilter psortex flatdbtest \ + tbtreetest gendata memtest glisttest prstest \ + tmpltest -OBJS=tlog.o tmalloc.o tools.o prs_hmap.o sfxstr.o \ +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 -PROGS=sfxtest hextest inftest kilter psortex flatdbtest tbtreetest gendata memtest + psort.o flatdb.o tbtree.o glist.o \ + tmpl_gram.o tmpl_scan.o template.o -.SUFFIXES: .o.c -all: libtedtools.a $(PROGS) +BISON=bison -y -d +FLEX=flex -CF -$(PROGS): %: %.o - $(CC) -o $@ $< $(LIB) +include $(topbuilddir)/Makefile.global -$(PROGS): libtedtools.a - -libtedtools.a: $(OBJS) - $(AR) $@ $? - $(RANLIB) $@ - -.c.o: - $(CC) $(CFLAGS) $(INCLUDE) -c $< +clean: clean-test clean-gram +clean-test: + 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 ; do \ + @[ -d results ] || mkdir results + @[ -d diffs ] || mkdir diffs + @[ -d temp ] || mkdir temp + @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 ; \ @@ -43,11 +35,14 @@ test: all fi ; \ done -clean: - rm -rf $(OBJS) - rm -rf $(PROGS) *.o - rm -rf libtedtools.a - rm -rf *core *gmon* nohup.out - rm -rf sfxtest.log BTREE - rm -rf results diffs temp +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