-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (37 loc) · 1.02 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
ifeq ($(shell pkg-config --cflags --libs opencv4 2>/dev/null),)
$(error Unable to locate OpenCV 4)
endif
CXXFLAGS += -std=c++11
ifneq ($(shell which nvcc 2>/dev/null),)
CXXFLAGS += -DCUDA
endif
ifeq ($(OPTIMIZE), 1)
CFLAGS += -O2
CXXFLAGS += -O2
else
CFLAGS += -g -Og
CXXFLAGS += -g -Og
endif
CXXFLAGS += $(shell pkg-config --cflags opencv4)
LDFLAGS += $(shell pkg-config --libs opencv4)
.PHONY: clean all
all: trial calibration picker
picker: picker.cpp
$(CXX) $(CXXFLAGS) picker.cpp -o picker $(LDFLAGS)
trial: ng.o crc.o protocol.o main.o
$(CXX) ng.o crc.o protocol.o main.o -o trial -pthread $(LDFLAGS)
calibration: calibration.cpp
$(CXX) $(CXXFLAGS) calibration.cpp -o calibration $(LDFLAGS)
ng.o: ng.cpp
$(CXX) $(CXXFLAGS) -c ng.cpp
main.o: main.cpp
$(CXX) $(CXXFLAGS) -c main.cpp
protocol.o: protocol.cpp
$(CXX) $(CXXFLAGS) -c protocol.cpp
crc.o: crc.c
$(CC) $(CFLAGS) -c crc.c
main.cpp: ng.h protocol.h
ng.cpp: ng.h
protocol.cpp: protocol.h
clean:
rm -rf calibration trial picker *.o *.dSYM