-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
86 lines (78 loc) · 1.89 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
ifeq ($(shell uname), Darwin)
CXX := g++
CXXVER := --version 2>&1 | grep c++
GTESTVER := head -1 /usr/local/src/gtest-1.7.0/CHANGES
GCOV := gcov
GCOVFLAGS := -fprofile-arcs -ftest-coverage
GCOVVER := -version | grep version
BOOST := /usr/local/src/boost_1_57_0/boost
LDFLAGS := -lgtest_main
VALGRIND :=
else ifeq ($(CXX), clang++)
CXXVER := --version 2>&1 | grep clang
GTESTVER := dpkg -l libgtest-dev | grep libgtest
GCOV := gcov-4.6
GCOVFLAGS := --coverage
GCOVVER := -v | grep gcov
BOOST := /usr/include/boost
LDFLAGS := -lgtest -lgtest_main -pthread
VALGRIND := valgrind
else
CXX := g++-4.8
CXXVER := --version 2>&1 | grep g++
GTESTVER := dpkg -l libgtest-dev | grep libgtest
GCOV := gcov-4.8
GCOVFLAGS := -fprofile-arcs -ftest-coverage
GCOVVER := -v | grep gcov
BOOST := /usr/include/boost
LDFLAGS := -lgtest -lgtest_main -pthread
VALGRIND := valgrind
endif
CXXFLAGS := -pedantic -std=c++11 -Wall
.PRECIOUS: %.app
clean:
rm -f *.gcda
rm -f *.gcno
rm -f *.gcov
rm -f RunInteger
sync:
make clean
@echo `pwd`
@rsync -r -t -u -v --delete \
--include "Integer.h" \
--include "makefile" \
--include "RunInteger.c++" \
--exclude "*" \
. downing@$(CS):cs/cs378/github/c++/integer/
test: RunInteger.out
versions:
uname -a
@echo
printenv
@echo
which $(CXX)
@echo hi
$(CXX) $(CXXVER)
@echo hi
$(GTESTVER)
@echo
which $(GCOV)
@echo
$(GCOV) $(GCOVVER)
@echo
grep "#define BOOST_VERSION " $(BOOST)/version.hpp
ifdef VALGRIND
@echo
which $(VALGRIND)
@echo
$(VALGRIND) --version
endif
@echo
which doxygen
@echo
doxygen --version
RunInteger: Integer.h RunInteger.c++
$(CXX) $(CXXFLAGS) RunInteger.c++ -o RunInteger
RunInteger.out: RunInteger
./RunInteger > RunInteger.out
cat RunInteger.out