Cleanup makefile
authorkim <kim@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Fri, 18 Feb 2011 12:59:04 +0000 (12:59 +0000)
committerkim <kim@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Fri, 18 Feb 2011 12:59:04 +0000 (12:59 +0000)
git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/XMLTree@1008 3cdefd35-fc62-479d-8e8d-bae585ffb9ca

Makefile [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..99fc78c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,62 @@
+OPT_FLAGS=-O6 -DPOPCOUNT_TABLE -DHAS_NATIVE_POPCOUNT 
+INC_FLAGS=-I./libcds/includes/ -I.
+CFLAGS= $(INC_FLAGS) $(OPT_FLAGS)
+CXXFLAGS= -std=c++0x $(INC_FLAGS) $(OPT_FLAGS)
+CC=g++
+
+LIBCDS_A=libcds/lib/libcds.a 
+OBJECTS_TCO= TextCollection/TextCollection.o \
+             TextCollection/TextCollectionBuilder.o \
+             TextCollection/RLCSABuilder.o \
+             TextCollection/FMIndex.o \
+             TextCollection/FMIndexBuilder.o \
+             TextCollection/Tools.o \
+             TextCollection/TextStorage.o \
+             TextCollection/Query.o \
+             TextCollection/EditDistance.o \
+             TextCollection/ResultSet.o
+
+OBJECTS_XMLTREE=XMLTree.o XMLTreeBuilder.o bp.o darray.o bpcore.o bit_utils.o
+
+LIBRLCSA_TCA=TextCollection/incbwt/rlcsa.a
+LIBLZTRIE_TCA=TextCollection/lzindex/lztrie.a
+LIBSWCSA_TCA=TextCollection/swcsa/swcsa.a
+
+all: depend libcds text_collection XMLTree
+
+XMLTree: $(OBJECTS_XMLTREE) $(LIBCDS_A) $(OBJECTS_TCO) \
+         $(LIBRLCSA_TCA) $(LIBLZTRIE_TCA) $(LIBSWCSA_TCA)
+       @echo [XMLTree]
+       @cp libcds/lib/libcds.a XMLTree.a
+       @rm -rf .objs
+       @mkdir .objs
+       @cd .objs; ar x ../$(LIBRLCSA_TCA); ar x ../$(LIBLZTRIE_TCA); ar x ../$(LIBSWCSA_TCA)
+       @ar rcs XMLTree.a XMLTree.o XMLTreeBuilder.o  bp.o darray.o bpcore.o bit_utils.o $(OBJECTS_TCO) .objs/*.o
+       @rm -rf .objs
+
+%o: %c
+       @echo [C] $@
+       @$(CC) -c $(CFLAGS) $< -o $@
+
+%o: %cpp
+       @echo [C++] $@
+       @$(CC) -c $(CXXFLAGS)  $< -o $@
+
+text_collection:
+       @echo [DEPENDENCY] $@
+       @make -s -C TextCollection/
+
+libcds:
+       @echo [DEPENDENCY] $@
+       @make -s -C libcds/
+
+depend:
+       @echo [DEPEND]
+       @(gcc -MM *.c; g++ -MM -std=c++0x *.cpp) > $@
+
+clean:
+       @echo [CLEAN]
+       @rm -f *.[oa] depend
+
+-include depend
+