-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathMakefile
47 lines (35 loc) · 891 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
# tool macros
CROSS_COMPILE ?=
#CPP := $(CROSS_COMPILE)clang++ #clang++ is better for debug but slower on compile
CPP := $(CROSS_COMPILE)g++
DBGFLAGS := -g
CPPFLAGS := -std=c++11 -Wall -Wextra `pkg-config --cflags opencv gtk+-3.0`
CPPOBJFLAGS := $(CPPFLAGS) -c
LDLIBS = $(shell pkg-config --libs gtk+-3.0)
LDLIBCV = $(shell pkg-config --libs opencv)
LDFLAGS += \
-fopenmp \
-lv4l2 \
-ludev \
-ljson-c \
-lm \
$(LDLIBS) \
$(LDLIBCV)
# path marcros
SRC_PATH := src
APP := leopard_cam
SRCS := \
test/main.cpp \
$(foreach x, $(SRC_PATH), $(wildcard $(addprefix $(x)/*,.c*)))
OBJS := $(SRCS:.cpp=.o)
all: $(APP)
# dependencies
%.o: %.c*
@echo -e "\t" $(CPP) $(CPPOBJFLAGS) $< -o $@
$(CPP) $(CPPOBJFLAGS) $(DBGFLAG) -o $@ $< -fopenmp -O3
$(APP): $(OBJS)
$(CPP) -o $@ $(OBJS) $(CPPFLAGS) $(LDFLAGS)
clean:
-rm -f *.o
-rm -f $(OBJS)
-rm -f $(APP)