-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/
+
+
+ifeq ($(VERBOSE), true)
+ HIDE=
+else
+ HIDE=@
+endif
+
+ifeq ($(DEBUG), true)
+ OPT_FLAGS=-O0 -g $(POPCOUNT_FLAG) -fno-PIC -static
+else
+ OPT_FLAGS=-O4 $(POPCOUNT_FLAG) -fno-PIC -static
+endif
+
+CXXFLAGS=-std=c++0x $(INC_FLAGS) $(OPT_FLAGS)
+CXX=g++
+
+OBJECTS_XMLTREE=XMLTree.o XMLTreeBuilder.o
+XMLTREE_A=libXMLTree.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