Allow gcc link-time optimizations.
[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
14 endif
15
16 CXXFLAGS=-std=c++0x $(INC_FLAGS) $(OPT_FLAGS)
17 CXX=g++
18
19 OBJECTS_XMLTREE=XMLTree.o XMLTreeBuilder.o
20 XMLTREE_A=libXMLTree.a
21
22
23
24 all: depend $(XMLTREE_A)
25
26 $(XMLTREE_A): $(OBJECTS_XMLTREE)
27         @echo [Link] $@
28         $(HIDE) ar rcs $@ $(OBJECTS_XMLTREE)
29
30 %o: %cpp
31         @echo [C++] $@
32         $(HIDE) $(CXX) -c $(CXXFLAGS)  $< -o $@
33
34
35 depend:
36         @echo [DEPEND]
37         $(HIDE) ($(CXX) -MM $(CXXFLAGS) *.cpp) > $@
38
39 clean:
40         @echo [CLEAN]
41         $(HIDE) rm -f *.[oa] depend
42
43 -include depend