Add optional length to SFSFindData
[tedtools.git] / Makefile
index 8fbb763..a387934 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,39 +1,26 @@
-CC=gcc
-AR=ar rcv
-RANLIB=ranlib
-LD=ld -x -shared 
+topbuilddir=.
 
-INCLUDE=-I.
-CFLAGS=-Wall -g -O2 -pedantic -ansi -DASSERT_CORE -D_GNU_SOURCE -DHAVE_POLL_H -DHAVE_SYS_POLL_H -DHAVE_HSTRERROR
-LIB=-g -L. -ltedtools -lm
+PROGRAM=sfxtest hextest inftest kilter psortex flatdbtest \
+               tbtreetest gendata memtest glisttest prstest
 
-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
+       psort.o flatdb.o tbtree.o glist.o
 
-.SUFFIXES: .o.c
+include $(topbuilddir)/Makefile.global
 
-all: libtedtools.a $(PROGS)
-
-$(PROGS): %: %.o
-       $(CC) -o $@ $< $(LIB)
-
-$(PROGS): libtedtools.a
-
-libtedtools.a: $(OBJS)
-       $(AR) $@ $?
-       $(RANLIB) $@
-
-.c.o:
-       $(CC) $(CFLAGS) $(INCLUDE) -c $<
+clean: clean-test
 
+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 `ls  tests/* | sed -e 's#^tests/##'` ; 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 ; 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 ; \
@@ -41,12 +28,3 @@ test: all
                        echo FAILED ; \
                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
-