-
Notifications
You must be signed in to change notification settings - Fork 131
/
Makefile.env
134 lines (113 loc) · 3.08 KB
/
Makefile.env
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
TARGET_ENV ?= x11
#TARGET_ENV = xcb
#TARGET_ENV = jetson_nano
#TARGET_ENV = raspi4
#TARGET_ENV = raspi
#TARGET_ENV = edgetpu_devboard
#TARGET_ENV = headless
TFLITE_DELEGATE ?= disalbe
#TFLITE_DELEGATE = GL_DELEGATE
#TFLITE_DELEGATE = GPU_DELEGATEV2
#TFLITE_DELEGATE = XNNPACK
ENABLE_VDEC ?= false
#ENABLE_VDEC = true
# ---------------------------------------
# for X11
# ---------------------------------------
ifeq ($(TARGET_ENV), x11)
WINSYS_SRC = winsys_x11
INCLUDES +=
LDFLAGS +=
LIBS += -lm -lEGL -lGLESv2
LIBS += -lX11
CFLAGS += -march=native
CFLAGS += $(shell pkg-config --cflags libdrm)
CXXFLAGS += -std=c++17
endif
# ---------------------------------------
# for XCB
# ---------------------------------------
ifeq ($(TARGET_ENV), xcb)
WINSYS_SRC = winsys_xcb
INCLUDES +=
LDFLAGS +=
LIBS += -lm -lEGL -lGLESv2
LIBS += -lX11 -lX11-xcb -lxcb
CFLAGS += -march=native
CFLAGS += $(shell pkg-config --cflags libdrm)
CXXFLAGS += -std=c++17
endif
# ---------------------------------------
# for Jetson Nano
# ---------------------------------------
ifeq ($(TARGET_ENV), jetson_nano)
WINSYS_SRC = winsys_x11
INCLUDES +=
LDFLAGS +=
LIBS += -lm -lEGL -lGLESv2
LIBS += -lX11
CFLAGS += $(shell pkg-config --cflags libdrm)
CXXFLAGS += -std=c++17
endif
# ---------------------------------------
# for Raspberry Pi 4
# ---------------------------------------
ifeq ($(TARGET_ENV), raspi4)
WINSYS_SRC = winsys_x11
INCLUDES +=
LDFLAGS +=
LIBS += -lm -lEGL -lGLESv2
LIBS += -lX11
CFLAGS += $(shell pkg-config --cflags libdrm)
CXXFLAGS += -std=c++11
endif
# ---------------------------------------
# for Raspberry Pi 3
# ---------------------------------------
ifeq ($(TARGET_ENV), raspi)
WINSYS_SRC = winsys_raspi
INCLUDES += -I$(SDKSTAGE)/opt/vc/include/
LDFLAGS += -L$(SDKSTAGE)/opt/vc/lib/
LIBS += -lm -lbrcmEGL -lbrcmGLESv2
LIBS += -lopenmaxil -lbcm_host
CFLAGS +=
CXXFLAGS += -std=c++11
endif
# ---------------------------------------
# for Coral EdgeTPU Dev Board
# ---------------------------------------
ifeq ($(TARGET_ENV), edgetpu_devboard)
WINSYS_SRC = winsys_wayland
INCLUDES +=
LDFLAGS +=
LIBS += -lm -lEGL -lGLESv2
LIBS += -lwayland-egl -lwayland-client
CFLAGS += $(shell pkg-config --cflags libdrm)
CXXFLAGS += -std=c++11
endif
# ---------------------------------------
# for Headless (using GLX instead of GLES)
# ---------------------------------------
ifeq ($(TARGET_ENV), headless)
WINSYS_SRC = winsys_glx
INCLUDES +=
LDFLAGS +=
LIBS += -lm -lEGL -lGLESv2
LIBS += -lGL -lXext -lX11
CFLAGS += -DUSE_GLX
CFLAGS += -march=native
CFLAGS += $(shell pkg-config --cflags libdrm)
CXXFLAGS += -std=c++11
endif
# ----------------------------------------
# for TFLite delegate
# ----------------------------------------
ifeq ($(TFLITE_DELEGATE), GL_DELEGATE)
CFLAGS += -DUSE_GL_DELEGATE
endif
ifeq ($(TFLITE_DELEGATE), GPU_DELEGATEV2)
CFLAGS += -DUSE_GPU_DELEGATEV2
endif
ifeq ($(TFLITE_DELEGATE), XNNPACK)
CFLAGS += -DUSE_XNNPACK_DELEGATE
endif