1 POPCOUNT=$(shell grep -q popcnt /proc/cpuinfo && echo 1)
4 POPCOUNT_FLAG=-DHAS_NATIVE_POPCOUNT
6 POPCOUNT_FLAG=-DPOPCOUNT_TABLE
9 ifeq ($(VERBOSE), true)
16 OPT_FLAGS=-O0 -g $(POPCOUNT_FLAG) -fno-PIC -static
18 OPT_FLAGS=-O4 $(POPCOUNT_FLAG) -fno-PIC -static
23 INC_FLAGS=-I./libcds/includes/ -I.
24 CFLAGS= $(INC_FLAGS) $(OPT_FLAGS)
25 CXXFLAGS= -std=c++0x $(INC_FLAGS) $(OPT_FLAGS)
28 LIBCDS_A=libcds/lib/libcds.a
29 OBJECTS_TCO= TextCollection/TextCollection.o \
30 TextCollection/TextCollectionBuilder.o \
31 TextCollection/RLCSABuilder.o \
32 TextCollection/FMIndex.o \
33 TextCollection/FMIndexBuilder.o \
34 TextCollection/Tools.o \
35 TextCollection/TextStorage.o \
36 TextCollection/Query.o \
37 TextCollection/EditDistance.o \
38 TextCollection/ResultSet.o
40 OBJECTS_XMLTREE=XMLTree.o XMLTreeBuilder.o bp.o darray.o bpcore.o
42 LIBRLCSA_TCA=TextCollection/incbwt/rlcsa.a
43 LIBLZTRIE_TCA=TextCollection/lzindex/lztrie.a
44 LIBSWCSA_TCA=TextCollection/swcsa/swcsa.a
49 all: depend libcds text_collection XMLTree
51 XMLTree: $(OBJECTS_XMLTREE) $(LIBCDS_A) $(OBJECTS_TCO) \
52 $(LIBRLCSA_TCA) $(LIBLZTRIE_TCA) $(LIBSWCSA_TCA)
54 $(HIDE) cp libcds/lib/libcds.a libXMLTree.a
57 $(HIDE) (cd .objs; ar x ../$(LIBRLCSA_TCA); ar x ../$(LIBLZTRIE_TCA); ar x ../$(LIBSWCSA_TCA))
58 $(HIDE) ar rcs libXMLTree.a $(OBJECTS_XMLTREE) $(OBJECTS_TCO) .objs/*.o
63 $(HIDE) $(CC) -c $(CFLAGS) $< -o $@
67 $(HIDE) $(CC) -c $(CXXFLAGS) $< -o $@
71 $(HIDE) make -s -C TextCollection/
75 $(HIDE) make -s -C libcds/
79 $(HIDE) (gcc -MM *.c; g++ -MM -std=c++0x *.cpp) > $@
83 $(HIDE) rm -f *.[oa] depend