X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=Makefile;h=feb8ae01eae7fe776fb4a3965a7f77d001ee3ee7;hb=HEAD;hp=0727f78fda9b3c04a5f6a61841c4730471313940;hpb=aad0ef1d1e05d23d3466e263160cda0a8fdf6866;p=SXSI%2FXMLTree.git diff --git a/Makefile b/Makefile index 0727f78..feb8ae0 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ -POPCOUNT=$(shell grep -q popcnt /proc/cpuinfo && echo 1) +INC_FLAGS=-I.. -I../libcds/includes/ -I. ifeq ($(POPCOUNT), 1) - POPCOUNT_FLAG=-DHAS_NATIVE_POPCOUNT + POPCOUNT_FLAG=-DHAS_NATIVE_POPCOUNT -mpopcnt else - POPCOUNT_FLAG=-DPOPCOUNT_TABLE + POPCOUNT_FLAG= endif ifeq ($(VERBOSE), true) @@ -13,74 +13,45 @@ else endif ifeq ($(DEBUG), true) - OPT_FLAGS=-O0 -g $(POPCOUNT_FLAG) -fno-PIC -static + OPT_FLAGS=-O0 -g $(POPCOUNT_FLAG) -static else - OPT_FLAGS=-O4 $(POPCOUNT_FLAG) -fno-PIC -static + OPT_FLAGS=-O3 $(POPCOUNT_FLAG) -static endif +ifeq ($(PROFILE), true) + PROF_FLAGS=-pg -g +else + PROF_FLAGS= +endif -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 - -LIBRLCSA_TCA=TextCollection/incbwt/rlcsa.a -LIBLZTRIE_TCA=TextCollection/lzindex/lztrie.a -LIBSWCSA_TCA=TextCollection/swcsa/swcsa.a - +CXXFLAGS=-std=c++0x $(INC_FLAGS) $(OPT_FLAGS) $(PROF_FLAGS) +CXX=g++ +#OBJECTS_XMLTREE=XMLTree.o XMLTreeBuilder.o +#XMLTREE_A=libXMLTree.a +OBJECTS_XMLTREE=bit-vector.o xml-tree.o xml-tree-builder.o +XMLTREE_A=libxml-tree.a -all: depend libcds text_collection XMLTree -XMLTree: $(OBJECTS_XMLTREE) $(LIBCDS_A) $(OBJECTS_TCO) \ - $(LIBRLCSA_TCA) $(LIBLZTRIE_TCA) $(LIBSWCSA_TCA) - @echo [XMLTree] - $(HIDE) cp libcds/lib/libcds.a libXMLTree.a - $(HIDE) rm -rf .objs - $(HIDE) mkdir .objs - $(HIDE) (cd .objs; ar x ../$(LIBRLCSA_TCA); ar x ../$(LIBLZTRIE_TCA); ar x ../$(LIBSWCSA_TCA)) - $(HIDE) ar rcs libXMLTree.a $(OBJECTS_XMLTREE) $(OBJECTS_TCO) .objs/*.o - $(HIDE) rm -rf .objs +all: depend $(XMLTREE_A) -%o: %c - @echo [C] $@ - $(HIDE) $(CC) -c $(CFLAGS) $< -o $@ +$(XMLTREE_A): $(OBJECTS_XMLTREE) + @echo [Link] $@ + $(HIDE) ar rcs $@ $(OBJECTS_XMLTREE) %o: %cpp @echo [C++] $@ - $(HIDE) $(CC) -c $(CXXFLAGS) $< -o $@ + $(HIDE) $(CXX) -c $(CXXFLAGS) $< -o $@ -text_collection: - @echo [DEPENDENCY] $@ - $(HIDE) make -s -C TextCollection/ - -libcds: - @echo [DEPENDENCY] $@ - $(HIDE) make -s -C libcds/ depend: @echo [DEPEND] - $(HIDE) (gcc -MM *.c; g++ -MM -std=c++0x *.cpp) > $@ + $(HIDE) ($(CXX) -MM $(CXXFLAGS) *.cpp) > $@ clean: @echo [CLEAN] $(HIDE) rm -f *.[oa] depend -include depend -