36637decd6e539c9ebfa78e477017ed68d169089
[SXSI/XMLTree.git] / Makefile
1 INC_FLAGS=-I.. -I../libcds/includes/
2
3
4 ifeq ($(VERBOSE), true)
5         HIDE=
6 else
7         HIDE=@
8 endif
9
10 ifeq ($(DEBUG), true)
11         OPT_FLAGS=-O0 -g $(POPCOUNT_FLAG) -static
12 else
13         OPT_FLAGS=-O4 $(POPCOUNT_FLAG) -static -flto
14 endif
15
16 ifeq ($(PROFILE), true)
17         PROF_FLAGS=-pg -g
18 else
19         PROF_FLAGS=
20 endif
21
22
23 CXXFLAGS=-std=c++0x $(INC_FLAGS) $(OPT_FLAGS) $(PROF_FLAGS)
24 CXX=g++
25
26 OBJECTS_XMLTREE=XMLTree.o XMLTreeBuilder.o
27 XMLTREE_A=libXMLTree.a
28
29
30
31 all: depend $(XMLTREE_A)
32
33 $(XMLTREE_A): $(OBJECTS_XMLTREE)
34         @echo [Link] $@
35         $(HIDE) ar rcs $@ $(OBJECTS_XMLTREE)
36
37 %o: %cpp
38         @echo [C++] $@
39         $(HIDE) $(CXX) -c $(CXXFLAGS)  $< -o $@
40
41
42 depend:
43         @echo [DEPEND]
44         $(HIDE) ($(CXX) -MM $(CXXFLAGS) *.cpp) > $@
45
46 clean:
47         @echo [CLEAN]
48         $(HIDE) rm -f *.[oa] depend
49
50 -include depend