Remove spurious printfs.
[SXSI/XMLTree.git] / Makefile
index a3b0e61..feb8ae0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,28 +1,57 @@
-FLAGS = -O9 -I./libcds/includes/\r
-\r
-OBJECTS=libcds/lib/libcds.a\r
-\r
-all: text_collection XMLTree\r
-\r
-XMLTree: XMLTree.o bp.o darray.o bpcore.o libcds/lib/libcds.a\r
-       cp libcds/lib/libcds.a XMLTree.a\r
-       ar vrcs XMLTree.a XMLTree.o bp.o darray.o bpcore.o\r
-\r
-\r
-XMLTree.o: bp.c bp.h bpcore.c XMLTree.cpp XMLTree.h\r
-       g++ $(FLAGS) -c XMLTree.cpp\r
-\r
-bp.o: bp.c bpcore.c darray.c bp.h darray.h\r
-       g++ $(FLAGS) -c bp.c\r
-\r
-darray.o: darray.c darray.h bpcore.c\r
-       g++ $(FLAGS) -c darray.c\r
-\r
-bpcore.o: bpcore.c\r
-       g++ $(FLAGS) -c bpcore.c\r
-\r
-text_collection:\r
-       make -C TextCollection/\r
-\r
-clean:\r
-       rm -f *.o 
\ No newline at end of file
+INC_FLAGS=-I.. -I../libcds/includes/ -I.
+
+ifeq ($(POPCOUNT), 1)
+       POPCOUNT_FLAG=-DHAS_NATIVE_POPCOUNT -mpopcnt
+else
+       POPCOUNT_FLAG=
+endif
+
+ifeq ($(VERBOSE), true)
+       HIDE=
+else
+       HIDE=@
+endif
+
+ifeq ($(DEBUG), true)
+       OPT_FLAGS=-O0 -g $(POPCOUNT_FLAG) -static
+else
+       OPT_FLAGS=-O3 $(POPCOUNT_FLAG) -static
+endif
+
+ifeq ($(PROFILE), true)
+       PROF_FLAGS=-pg -g
+else
+       PROF_FLAGS=
+endif
+
+
+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 $(XMLTREE_A)
+
+$(XMLTREE_A): $(OBJECTS_XMLTREE)
+       @echo [Link] $@
+       $(HIDE) ar rcs $@ $(OBJECTS_XMLTREE)
+
+%o: %cpp
+       @echo [C++] $@
+       $(HIDE) $(CXX) -c $(CXXFLAGS)  $< -o $@
+
+
+depend:
+       @echo [DEPEND]
+       $(HIDE) ($(CXX) -MM $(CXXFLAGS) *.cpp) > $@
+
+clean:
+       @echo [CLEAN]
+       $(HIDE) rm -f *.[oa] depend
+
+-include depend