forked from joto/osmium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
69 lines (54 loc) · 2.62 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
#------------------------------------------------------------------------------
#
# Osmium main makefile
#
#------------------------------------------------------------------------------
CXX=g++
all:
.PHONY: clean install check check-includes test indent
clean:
rm -fr check-includes-report doc/html test/tests
install: doc
install -m 755 -g root -o root -d $(DESTDIR)/usr/include
install -m 755 -g root -o root -d $(DESTDIR)/usr/share/doc/libosmium-dev
install -m 644 -g root -o root README $(DESTDIR)/usr/share/doc/libosmium-dev/README
install -m 644 -g root -o root include/osmium.hpp $(DESTDIR)/usr/include
cp --recursive include/osmium $(DESTDIR)/usr/include
cp --recursive doc/html $(DESTDIR)/usr/share/doc/libosmium-dev
check:
cppcheck --enable=all -I include */*.cpp test/t/*/test_*.cpp
WARNINGFLAGS = -Wall -Wextra -Wredundant-decls -Wdisabled-optimization -pedantic -Wctor-dtor-privacy -Wnon-virtual-dtor -Woverloaded-virtual -Wsign-promo -Wno-long-long -Winline -Weffc++ -Wold-style-cast
# This will try to compile each include file on its own to detect missing
# #include directives. Note that if this reports [OK], it is not enough
# to be sure it will compile in production code. But if it reports an error
# we know we are missing something.
check-includes:
echo "CHECK INCLUDES REPORT:" >check-includes-report; \
allok=yes; \
for FILE in include/*.hpp include/*/*.hpp include/*/*/*.hpp include/*/*/*/*.hpp; do \
flags=`./get_options.sh --cflags $${FILE}`; \
eval eflags=$${flags}; \
compile="$(CXX) $(WARNINGFLAGS) -I include $${eflags} $${FILE}"; \
echo "\n======== $${FILE}\n$${compile}" >>check-includes-report; \
if `$${compile} 2>>check-includes-report`; then \
echo "[OK] $${FILE}"; \
else \
echo "[ ] $${FILE}"; \
allok=no; \
fi; \
rm -f $${FILE}.gch; \
done; \
if test $${allok} = "yes"; then echo "All files OK"; else echo "There were errors"; fi; \
echo "\nDONE" >>check-includes-report
test:
(cd test && ./run_tests.sh)
indent:
astyle --style=java --indent-namespaces --indent-switches --pad-header --lineend=linux --suffix=none --recursive include/\*.hpp examples/\*.cpp examples/\*.hpp osmjs/\*.cpp test/\*.cpp
# astyle --style=java --indent-namespaces --indent-switches --pad-header --unpad-paren --align-pointer=type --lineend=linux --suffix=none --recursive include/\*.hpp examples/\*.cpp examples/\*.hpp osmjs/\*.cpp test/\*.cpp
doc: doc/html/files.html Doxyfile
doc/html/files.html: include/*.hpp include/*/*.hpp include/*/*/*.hpp
doxygen >/dev/null
deb:
debuild -I -us -uc
deb-clean:
debuild clean