-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (40 loc) · 940 Bytes
/
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
TARGET = ei
CPP_FILES = \
src/main.cpp \
src/narrator.cpp \
src/narrator_script.cpp \
src/lib/camera_somagic.cpp \
src/lib/jpge.cpp \
src/lib/lodepng.cpp
UNAME := $(shell uname)
# Important optimization options
CPPFLAGS = -O3
# Libraries
LDFLAGS = -lm -lstdc++ -lusb-1.0
LDFLAGS += -lopencv_core -lopencv_imgproc -lopencv_video -lopencv_highgui
# Debugging
CPPFLAGS += -g -Wall
LDFLAGS += -g
# Dependency generation
CPPFLAGS += -MMD
# C++11 code, needed for constexpr
CPPFLAGS += -std=c++11
ifeq ($(UNAME), Linux)
# Use a recent toolchain (Linux)
CXX := gcc-4.8
CPPFLAGS += -march=native
LDFLAGS += -march=native
CPPFLAGS += -pthread
LDFLAGS += -pthread
endif
ifeq ($(UNAME), Darwin)
CPPFLAGS += -Wno-gnu-static-float-init
endif
OBJS := $(CPP_FILES:.cpp=.o)
all: $(TARGET)
$(TARGET): $(OBJS)
$(CXX) $(OBJS) -o $@ $(LDFLAGS)
-include $(OBJS:.o=.d)
.PHONY: clean all
clean:
rm -f $(TARGET) $(OBJS) $(OBJS:.o=.d)