-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (32 loc) · 975 Bytes
/
Copy pathMakefile
File metadata and controls
48 lines (32 loc) · 975 Bytes
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
ARCH=$(shell uname -m | grep -q arm && echo -march=armv5)
OPT_MODE=$(shell if [ "$(MODE)" = "Release" ]; then echo "-O2 -DNDEBUG"; else echo "-g"; fi)
CXXFLAGS=$(ARCH) -std=c++1y -D_GLIBCXX_USE_NANOSLEEP $(OPT_MODE) -pthread
WFLAGS=-Wall -Wextra -Wold-style-cast
DEPS=ev3dev.h
OBJ=ev3dev.o
all: $(OBJ) bot2
%.o: %.cpp $(DEPS)
$(CXX) -c -o $@ $< $(CXXFLAGS) $(WFLAGS)
ev3dev.o : ev3dev.cpp
$(CXX) -c -o $@ $< $(CXXFLAGS)
line: ${OBJ} line.o
$(CXX) -o $@ $^ $(CXXFLAGS)
line2: ${OBJ} line2.o
$(CXX) -o $@ $^ $(CXXFLAGS)
bot: ${OBJ} bot.o
$(CXX) -o $@ $^ $(CXXFLAGS)
bot2: ${OBJ} bot2.o
$(CXX) -o $@ $^ $(CXXFLAGS)
test : buffer-test
./buffer-test
buffer-test : buffer-test.cpp buffer.h
$(CXX) -o $@ $< $(CXXFLAGS)
job-test : job-test.cpp job.h
$(CXX) -o $@ $< $(CXXFLAGS)
archive :
mkdir -p _sources
cp bot2.cpp README.md Makefile buffer.h job.h ev3dev.cpp ev3dev.h _sources
zip -r sources.zip _sources
.PHONY: all clean
clean:
rm -f bot2.o bot2