Create branch new-trunk to track developpement of trunk and allow to make non compati...
[SXSI/TextCollection.git] / makefile
index 04c5f64..92d83d8 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,24 +1,71 @@
+HIDE=@
 CC = g++
 LIBCDSPATH = ../libcds
-CPPFLAGS = -Wall -ansi -g -O2 -I$(LIBCDSPATH)/includes/ -DNDEBUG
+CPPFLAGS = -Wall -ansi -g -I$(LIBCDSPATH)/includes/ -O3 -DNDEBUG -Wno-deprecated-declarations
+#CPPFLAGS = -Wall -ansi -g -I$(LIBCDSPATH)/includes/
 LIBCDSA = $(LIBCDSPATH)/lib/libcds.a
+LIBRLCSA = incbwt/rlcsa.a
+LIBLZTRIE = lzindex/lztrie.a
+LIBSWCSA = swcsa/swcsa.a
+LIBS=  ${LIBRLCSA} ${LIBCDSA} ${LIBLZTRIE} ${LIBSWCSA}
 
-testTextCollection_obs = testTextCollection.o TextCollection.o CSA.o Tools.o BitRank.o bittree.o rbtree.o dynFMI.o RLWaveletTree.o GapEncode.o BSGAP.o ${LIBCDSA}
+dcover_obs = dcover/difference_cover.o
 
-timeTextCollection_obs = timeTextCollection.o TextCollection.o CSA.o Tools.o BitRank.o bittree.o rbtree.o dynFMI.o RLWaveletTree.o GapEncode.o BSGAP.o ${LIBCDSA}
+TextCollection_obs = TextCollection.o TextCollectionBuilder.o FMIndexBuilder.o RLCSABuilder.o FMIndex.o Tools.o \
+                     TextStorage.o Query.o EditDistance.o ResultSet.o
+TCDebug_obs =  bittree.o rbtree.o dynFMI.o 
 
+TEXTCOLLECTION_A=libTextCollection.a
 
-all: $(testTextCollection_obs)
+all: testTextCollection
+
+testTextCollection: testTextCollection.o $(TextCollection_obs) $(LIBS) $(TCDebug_obs) HeapProfiler.o
+       $(CC) -o testTextCollection testTextCollection.o $(TextCollection_obs) $(LIBS) $(TCDebug_obs) HeapProfiler.o
+
+timeTextCollection: timeTextCollection.o $(TextCollection_obs) $(LIBS) $(TCDebug_obs)
+       $(CC) -o timeTextCollection timeTextCollection.o $(TextCollection_obs) $(TCDebug_obs)
+
+test2dRange: test2dRange.o ${LIBCDSA}
+       $(CC) -o test2dRange test2dRange.o ${LIBCDSA}
+
+incbwt/rlcsa.a:
+       @make -C incbwt
+
+lzindex/lztrie.a:
+       @make -C lzindex
+
+swcsa/swcsa.a:
+       @make -C swcsa
+
+%o: %c
+       @echo [C] $@
+       $(HIDE) (gcc -c $(CPPFLAGS) $< -o $@
+
+%o: %cpp
+       @echo [C++] $@
+       $(HIDE) $(CC) -c $(CPPFLAGS)  $< -o $@
+
+
+$(TEXTCOLLECTION_A): $(TextCollection_obs) $(LIBS)
+       @echo [Link] $@
+       $(HIDE) rm -rf .objs
+       $(HIDE) mkdir .objs
+       $(HIDE) (cd .objs; ar x ../${LIBRLCSA};ar x ../${LIBLZTRIE}; ar x ../${LIBSWCSA})
+       $(HIDE) ar rcs $@ $(TextCollection_obs) .objs/*.o
+#      $(HIDE) rm -rf .objs
 
-testTextCollection: $(testTextCollection_obs) HeapProfiler.o
-       $(CC) -o testTextCollection $(testTextCollection_obs) HeapProfiler.o
 
-timeTextCollection: $(timeTextCollection_obs)
-       $(CC) -o timeTextCollection $(timeTextCollection_obs)
 clean:
-       rm -f core *.o *~ testTextCollection
+       @make clean -C incbwt
+       @make clean -C lzindex
+       @make clean -C swcsa
+       rm -f core *.o *~ testTextCollection timeTextCollection dcover/*.o dcover/*~
+
+shallow_clean:
+       rm -f core *.o *~ testTextCollection timeTextCollection
 
 depend:
-       $(CC) -MM *.cpp *.c > dependencies.mk
+       @make depend -C incbwt
+       $(CC) -MM *.cpp > dependencies.mk
 
 include dependencies.mk