forked from fuzhou-utexas/oopl-sarc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
199 lines (185 loc) · 5.51 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
.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 patterns; 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/oopl-sarc -w /usr/oopl-sarc gpdowning/gcc
init:
touch README
git init
git add README
git commit -m 'first commit'
git remote add origin [email protected]:gpdowning/oopl-sarc.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 patterns
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 "Docker.sh" \
--include "InitializerList.c++" \
--include "Auto.c++" \
--include "Initializations.c++" \
--include "SharedPtr.c++" \
--include "Iterators.c++" \
--include "FunctionOverloading.c++" \
--exclude "*" \
../../examples/c++/ examples
@rsync -r -t -u -v --delete \
--include "Count.c++" \
--include "Count.h" \
--include "Reverse.c++" \
--include "Reverse.h" \
--include "Distance.c++" \
--include "Distance.h" \
--include "Stack.c++" \
--include "Stack.h" \
--include "Queue.c++" \
--include "Queue.h" \
--include "PriorityQueue.c++" \
--include "PriorityQueue.h" \
--include "Vector1.c++" \
--include "Vector1.h" \
--include "Vector2.c++" \
--include "Vector2.h" \
--include "Vector3.c++" \
--include "Vector3.h" \
--include "Memory.h" \
--include "Allocator.c++" \
--include "Allocator.h" \
--include "Move.c++" \
--include "Vector4.c++" \
--include "Vector4.h" \
--exclude "*" \
../../exercises/c++/ exercises
@rsync -r -t -u -v --delete \
--include "StrategyPattern1.c++" \
--include "StrategyPattern2.c++" \
--include "StrategyPattern3.c++" \
--include "StrategyPattern4.c++" \
--include "StrategyPattern5.c++" \
--include "SingletonPattern.c++" \
--include "StrategyPattern6.c++" \
--exclude "*" \
../../patterns/c++/ patterns
test:
make clean
@echo
cd examples; make test
@echo
cd exercises; make test
@echo
cd patterns; 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