Debug swcsa
[SXSI/TextCollection.git] / Makefile
1 HIDE=@
2 CC = g++
3 LIBCDSPATH = ../libcds
4 CPPFLAGS = -Wall -ansi -g -I$(LIBCDSPATH)/includes/ -O3 -DNDEBUG -Wno-deprecated-declarations -flto
5 #CPPFLAGS = -Wall -ansi -g -I$(LIBCDSPATH)/includes/
6 LIBCDSA = $(LIBCDSPATH)/lib/libcds.a
7 LIBRLCSA = incbwt/rlcsa.a
8 LIBLZTRIE = lzindex/lztrie.a
9 LIBSWCSA = swcsa/swcsa.a
10 LIBS=  ${LIBRLCSA} ${LIBCDSA} ${LIBLZTRIE} ${LIBSWCSA}
11
12 dcover_obs = dcover/difference_cover.o
13
14 TextCollection_obs = TextCollection.o TextCollectionBuilder.o FMIndexBuilder.o RLCSABuilder.o FMIndex.o Tools.o \
15                      TextStorage.o Query.o EditDistance.o ResultSet.o
16 TCDebug_obs =  bittree.o rbtree.o dynFMI.o
17
18 TEXTCOLLECTION_A=libTextCollection.a
19
20 all: $(TEXTCOLLECTION_A)
21
22 testTextCollection: testTextCollection.o $(TextCollection_obs) $(LIBS) $(TCDebug_obs) HeapProfiler.o
23         $(CC) -o testTextCollection testTextCollection.o $(TextCollection_obs) $(LIBS) $(TCDebug_obs) HeapProfiler.o
24
25 timeTextCollection: timeTextCollection.o $(TextCollection_obs) $(LIBS) $(TCDebug_obs)
26         $(CC) -o timeTextCollection timeTextCollection.o $(TextCollection_obs) $(TCDebug_obs)
27
28 createIndex: createIndex.o $(TextCollection_obs) $(LIBS)
29         $(CC) -o createIndex createIndex.o $(TextCollection_obs) $(LIBS)
30
31 test2dRange: test2dRange.o ${LIBCDSA}
32         $(CC) -o test2dRange test2dRange.o ${LIBCDSA}
33
34 incbwt/rlcsa.a:
35         @make -C incbwt
36
37 lzindex/lztrie.a:
38         @make -C lzindex
39
40 swcsa/swcsa.a:
41         @make -C swcsa
42
43 %o: %c
44         @echo [C] $@
45         $(HIDE) (gcc -c $(CPPFLAGS) $< -o $@
46
47 %o: %cpp
48         @echo [C++] $@
49         $(HIDE) $(CC) -c $(CPPFLAGS)  $< -o $@
50
51
52 $(TEXTCOLLECTION_A): $(TextCollection_obs) $(LIBS)
53         @echo [Link] $@
54         $(HIDE) rm -rf .objs
55         $(HIDE) mkdir .objs
56         $(HIDE) (cd .objs; ar x ../${LIBRLCSA};ar x ../${LIBLZTRIE}; ar x ../${LIBSWCSA})
57         $(HIDE) ar rcs $@ $(TextCollection_obs) .objs/*.o
58 #       $(HIDE) rm -rf .objs
59
60
61 clean:
62         @make clean -C incbwt
63         @make clean -C lzindex
64         @make clean -C swcsa
65         rm -f core *.o *~ testTextCollection timeTextCollection dcover/*.o dcover/*~
66
67 shallow_clean:
68         rm -f core *.o *~ testTextCollection timeTextCollection
69
70 depend:
71         @make depend -C incbwt
72         $(CC) -MM *.cpp > dependencies.mk
73
74 include dependencies.mk