-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathmakefile.mk
83 lines (61 loc) · 1.58 KB
/
makefile.mk
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
PREFIX = aarch64-linux-gnu-
CC = $(PREFIX)gcc
CXX = $(PREFIX)g++
AR = $(PREFIX)ar
CP = cp
# ARMv8 (arm64) enable, comment it if on arm32
ONARM64 = 1
#FRAME supports 720P or 480P
#FRAME_720P = 1
INCDIR = $(TOPDIR)/include
LIBFCVDIR = $(TOPDIR)/libfcv
MLIBDIR = $(TOPDIR)/middle
3RDLIBS = $(TOPDIR)/3rdlibs
GTK-VERSION = gtk+-3.0
FCVLIB = $(LIBFCVDIR)/liboal.a
linksyslibs = -lm -lpthread `pkg-config --libs $(GTK-VERSION)`
linkfcvlibs = -L$(LIBFCVDIR) -loal
linkaaidlibs = -L$(MLIBDIR) -laaid
ifeq ($(ONARM64), 1)
linkysqfdlibs = -L$(3RDLIBS) -lysqfd64
else
linkysqfdlibs = -L$(3RDLIBS) -lysqfd32
endif
ifeq ($(FRAME_720P), 1)
CFLAGS += -DCAM_FRAME_720P
CXXFLAGS += -DCAM_FRAME_720P
else
CFLAGS += -DCAM_FRAME_480P
CXXFLAGS += -DCAM_FRAME_480P
endif
CFLAGS += `pkg-config --cflags $(GTK-VERSION)`
CFLAGS += -Wall -O2
CFLAGS += -I$(INCDIR)
CXXFLAGS += `pkg-config --cflags $(GTK-VERSION)`
CXXFLAGS += -Wall -O2
CXXFLAGS += -I$(INCDIR)
#CFLAGS +=-DDEBUG
#CXXFLAGS +=-DDEBUG
#CFLAGS += -DPERF_STATISTICS
#CXXFLAGS += -DPERF_STATISTICS
CFLAGS += -D__linux__
CXXFLAGS += -D_linux__
ARFLAGS = -rcv
LDFLAGS += $(linksyslibs)
%.i : %.c
$(CC) $(CFLAGS) -E $< -o $@
%.o : %.c
$(CC) $(CFLAGS) -c $< -o $@
%.d : %.c
@$(CC) -MM $(CFLAGS) $< > $@.$$$$; \
sed -e 's/\($(@F)\.o\)[ :]*/$(<D)\/\1 $(@D)\/$(@F) : /g' $@.$$$$ > $@ ; \
$(RM) $@.$$$$;
%.i : %.cpp
$(CXX) $(CXXFLAGS) -E $< -o $@
%.o : %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
%.d : %.cpp
@$(CXX) -MM $(CXXFLAGS) $< > $@.$$$$; \
sed -e 's/\($(@F)\.o\)[ :]*/$(<D)\/\1 $(@D)\/$(@F) : /g' $@.$$$$ > $@ ; \
$(RM) $@.$$$$;
sinclude $(.depens)