-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
86 lines (69 loc) · 1.42 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
UNAME = $(shell uname)
ifdef RELEASE
CXXFLAGS += -O2
CXXFLAGS += -DNDEBUG
endif
CXXFLAGS += -Wunused -Wall
CXXFLAGS += -g -fno-omit-frame-pointer
CXXFLAGS += -std=c++0x
# CXXFLAGS += -stdlib=libc++
CXXFLAGS += $(shell pkg-config --cflags libxml-2.0)
ifdef LTO
CXXFLAGS += -Os
CXXFLAGS += -flto
LDFLAGS += -flto
endif
LDFLAGS += -lz
LDFLAGS += -lxml2
LDFLAGS += $(shell pkg-config --libs libxml-2.0)
all: targets
TARGETS += test_main
test_main: \
test_main.cpp \
test_attrib.o \
test_element.o \
test_feed.o \
test_nullable.o \
test_parse.o \
test_qname.o \
test_xpath.o \
element.o \
feed.o \
feed-util.o
TARGETS += convert_feed
convert_feed: \
convert_feed.cpp \
element.o \
feed.o \
feed-util.o
TARGETS += sanitize
sanitize: \
sanitize.cpp \
element.o \
feed.o \
feed-util.o
element.cpp: element.hpp
feed.cpp: feed.hpp
coverage:
$(MAKE) clean
CXXFLAGS=--coverage $(MAKE) test_main
./test_main
lcov --directory . --base-directory . --gcov-tool ./llvm-gcov.sh --capture -o cov.info
genhtml cov.info -o output
open output/index.html
noexist:
docs: noexist
rm -rf docs
doxygen
pushdocs: noexist
rm -rf docs
mkdir docs
cp -a .git docs/.git
( cd docs; git checkout gh-pages; )
doxygen
( cd docs; git add -A .; git ci -am "Update documentation"; )
( cd docs; git push origin gh-pages; )
git pull
clean:
rm -rf $(TARGETS) *.o *.a output *.gcda *.gcno cov.info docs *.dSYM
targets: $(TARGETS)