Clean-up makefile
[SXSI/XMLTree.git] / makefile
1 CFLAGS= -O3 -DNDEBUG -I./libcds/includes/ -fno-PIC -I.\r
2 FLAGS= -std=c++0x $(CFLAGS)\r
3 \r
4 \r
5 LIBCDS_A=libcds/lib/libcds.a \r
6 OBJECTS_TCO= TextCollection/TextCollection.o TextCollection/TextCollectionBuilder.o TextCollection/RLCSABuilder.o \\r
7              TextCollection/FMIndex.o TextCollection/FMIndexBuilder.o TextCollection/Tools.o \\r
8              TextCollection/TextStorage.o TextCollection/Query.o TextCollection/EditDistance.o TextCollection/ResultSet.o\r
9 \r
10 LIBRLCSA_TCA=TextCollection/incbwt/rlcsa.a\r
11 LIBLZTRIE_TCA=TextCollection/lzindex/lztrie.a\r
12 LIBSWCSA_TCA=TextCollection/swcsa/swcsa.a\r
13 \r
14 all: libcds text_collection XMLTree\r
15 \r
16 XMLTree: XMLTree.o XMLTreeBuilder.o bp.o darray.o bpcore.o\\r
17  $(LIBCDS_A) $(OBJECTS_TCO) $(LIBRLCSA_TCA) $(LIBLZTRIE_TCA) $(LIBSWCSA_TCA)\r
18         cp libcds/lib/libcds.a XMLTree.a\r
19         rm -rf .objs\r
20         mkdir .objs\r
21         cd .objs; ar x ../$(LIBRLCSA_TCA); ar x ../$(LIBLZTRIE_TCA); ar x ../$(LIBSWCSA_TCA)\r
22         ar rvcs XMLTree.a XMLTree.o XMLTreeBuilder.o  bp.o darray.o bpcore.o $(OBJECTS_TCO) .objs/*.o\r
23         rm -rf .objs\r
24 \r
25 XMLTree.o: bp.c bp.h bpcore.c XMLTree.cpp XMLTree.h basics.h\r
26         g++ $(FLAGS) -c XMLTree.cpp\r
27 \r
28 bp.o: bp.c bpcore.c darray.c bp.h darray.h\r
29         g++ $(FLAGS) -c bp.c\r
30 \r
31 darray.o: darray.c darray.h bpcore.c\r
32         g++ $(FLAGS) -c darray.c\r
33 \r
34 bpcore.o: bpcore.c\r
35         g++ $(FLAGS) -c bpcore.c\r
36 \r
37 XMLTreeBuilder.o: XMLTree.h XMLTreeBuilder.h XMLTreeBuilder.cpp basics.h\r
38         g++ $(FLAGS) -c XMLTreeBuilder.cpp\r
39 \r
40 text_collection:\r
41         make -C TextCollection/\r
42 \r
43 libcds:\r
44         make -C libcds/\r
45 \r
46 clean:\r
47         rm -f *.[oa]\r