forked from asaidalaoui/cs371p
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
263 lines (249 loc) · 8.14 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
.DEFAULT_GOAL := test
ifeq ($(shell uname), Darwin) # Apple
CXX := g++
INCLUDE := /usr/local/include
CXXFLAGS := -pedantic -std=c++11 -I$(INCLUDE) -Wall -Weffc++
LIB := /usr/local/lib
LDFLAGS := -lboost_serialization -lgtest_main
CLANG-CHECK := clang-check
GCOV := gcov
GCOVFLAGS := -fprofile-arcs -ftest-coverage
VALGRIND := valgrind
DOXYGEN := doxygen
CLANG-FORMAT := clang-format
else ifeq ($(CI), true) # Travis CI
CXX := g++-5
INCLUDE := /usr/include
CXXFLAGS := -pedantic -std=c++11 -Wall -Weffc++
LIB := $(PWD)/gtest
LDFLAGS := -lboost_serialization -lgtest -lgtest_main -pthread
CLANG-CHECK := clang-check
GCOV := gcov-5
GCOVFLAGS := -fprofile-arcs -ftest-coverage
VALGRIND := valgrind
DOXYGEN := doxygen
CLANG-FORMAT := clang-format
else ifeq ($(shell uname -p), unknown) # Docker
CXX := g++
INCLUDE := /usr/include
CXXFLAGS := -pedantic -std=c++11 -Wall -Weffc++
LIB := /usr/lib
LDFLAGS := -lboost_serialization -lgtest -lgtest_main -pthread
CLANG-CHECK := clang-check
GCOV := gcov
GCOVFLAGS := -fprofile-arcs -ftest-coverage
VALGRIND := valgrind
DOXYGEN := doxygen
CLANG-FORMAT := clang-format-3.5
else # UTCS
CXX := g++-4.8
INCLUDE := /usr/include
CXXFLAGS := -pedantic -std=c++11 -Wall -Weffc++
LIB := /usr/lib
LDFLAGS := -lboost_serialization -lgtest -lgtest_main -pthread
CLANG-CHECK := clang-check-3.8
GCOV := gcov-4.8
GCOVFLAGS := -fprofile-arcs -ftest-coverage
VALGRIND := valgrind
DOXYGEN := doxygen
CLANG-FORMAT := clang-format-3.8
endif
clean:
cd examples; make clean
@echo
cd exercises; make clean
@echo
cd projects/collatz; make clean
@echo
cd projects/allocator; make clean
@echo
cd projects/darwin; make clean
config:
git config -l
docker-build:
docker build -t gpdowning/gcc .
docker-pull:
docker pull gpdowning/gcc
docker-push:
docker push gpdowning/gcc
docker-run:
docker run -it -v $(PWD):/usr/cs371p -w /usr/cs371p gpdowning/gcc
init:
touch README
git init
git add README
git commit -m 'first commit'
git remote add origin [email protected]:gpdowning/cs371p.git
git push -u origin master
pull:
make clean
@echo
git pull
git status
push:
make clean
@echo
git add .gitignore
git add .travis.yml
git add Dockerfile
git add examples
git add exercises
git add makefile
git add projects/collatz
git add projects/allocator
git add projects/darwin
git add projects/life
git commit -m "another commit"
git push
git status
status:
make clean
@echo
git branch
git remote -v
git status
sync:
@rsync -r -t -u -v --delete \
--include "Hello.c++" \
--include "Docker.sh" \
--include "Assertions.c++" \
--include "UnitTests1.c++" \
--include "UnitTests2.c++" \
--include "UnitTests3.c++" \
--include "Coverage1.c++" \
--include "Coverage2.c++" \
--include "Coverage3.c++" \
--include "Exceptions.c++" \
--include "Variables.c++" \
--include "Types.c++" \
--include "Operators.c++" \
--include "Arguments.c++" \
--include "BoostSerialization.c++" \
--include "Iterators.c++" \
--include "Cache.c++" \
--include "Returns.c++" \
--include "Consts.c++" \
--include "Arrays.c++" \
--include "FunctionOverloading.c++" \
--include "Move.c++" \
--include "MethodOverriding1.c++" \
--include "MethodOverriding2.c++" \
--exclude "*" \
../../examples/c++/ examples
@rsync -r -t -u -v --delete \
--include "IsPrime1.c++" \
--include "IsPrime1.h" \
--include "IsPrime2.c++" \
--include "IsPrime2.h" \
--include "Incr.c++" \
--include "Incr.h" \
--include "Equal.c++" \
--include "Equal.h" \
--include "Copy.c++" \
--include "Copy.h" \
--include "Fill.c++" \
--include "Fill.h" \
--include "RMSE.c++" \
--include "RMSE.h" \
--include "AllOf.c++" \
--include "AllOf.h" \
--include "RangeIterator.c++" \
--include "RangeIterator.h" \
--include "Range.c++" \
--include "Range.h" \
--include "Vector1.c++" \
--include "Vector1.h" \
--include "Vector2.c++" \
--include "Vector2.h" \
--include "Vector3.c++" \
--include "Vector3.h" \
--include "Memory.h" \
--include "Vector4.c++" \
--include "Vector4.h" \
--include "Shapes1.c++" \
--include "Shapes1.h" \
--include "Shapes2.c++" \
--include "Shapes3.c++" \
--exclude "*" \
../../exercises/c++/ exercises
@rsync -r -t -u -v --delete \
--include "Collatz.c++" \
--include "Collatz.h" \
--include "RunCollatz.c++" \
--include "RunCollatz.in" \
--include "RunCollatz.out" \
--include "TestCollatz.c++" \
--include "TestCollatz.out" \
--exclude "*" \
../../projects/c++/collatz/ projects/collatz
@rsync -r -t -u -v --delete \
--include "Allocator.h" \
--include "TestAllocator.c++" \
--include "TestAllocator.out" \
--exclude "*" \
../../projects/c++/allocator/ projects/allocator
@rsync -r -t -u -v --delete \
--include "Darwin.c++" \
--include "Darwin.h" \
--include "RunDarwin.c++" \
--include "RunDarwin.in" \
--include "RunDarwin.out" \
--include "TestDarwin.c++" \
--include "TestDarwin.out" \
--exclude "*" \
../../projects/c++/darwin/ projects/darwin
@rsync -r -t -u -v --delete \
--include "Life.h" \
--include "RunLife.c++" \
--include "RunLife.in" \
--include "RunLife.out" \
--include "TestLife.c++" \
--include "TestLife.out" \
--exclude "*" \
../../projects/c++/life/ projects/life
test:
make clean
@echo
cd examples; make test
@echo
cd exercises; make test
@echo
cd projects/collatz; make test
@echo
cd projects/allocator; make test
@echo
-cd projects/darwin; make test
@echo
-cd projects/life; make test
versions:
which make
make --version
@echo
which git
git --version
@echo
which $(CXX)
$(CXX) --version
@echo
ls -ald $(INCLUDE)/boost
@echo
ls -ald $(INCLUDE)/gtest
@echo
ls -al /usr/lib/*boost*.a
@echo
ls -al $(LIB)/*gtest*.a
@echo
which $(CLANG-CHECK)
-$(CLANG-CHECK) --version
@echo
which $(GCOV)
$(GCOV) --version
@echo
which $(VALGRIND)
$(VALGRIND) --version
@echo
which $(DOXYGEN)
$(DOXYGEN) --version
@echo
which $(CLANG-FORMAT)
-$(CLANG-FORMAT) --version