-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
38 lines (26 loc) · 962 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
# Define the compiler
CXX = g++
# Define the source file
SRC = example.cpp
# Define the include directories
RKNPU_INC_DIR = -I/usr/local/include/rknpu/
OPENCV_INC_DIR = -I/usr/local/include/opencv4/
CURRENT_INC_DIR = -I./include
LIB_DIR = -L/usr/local/lib
# Define the libraries to link against
LIBS = -lrknnrt -fopenmp -lopencv_core
# Define the compilation flags
CXX_INCLUDE_FLAGS = $(RKNPU_INC_DIR) $(OPENCV_INC_DIR) $(CURRENT_INC_DIR)
CXX_LIB_FLAGS = $(LIB_DIR) $(LIBS)
CXXFLAGS = -Wall -O3
# Define the rule to build the target
example: example.cpp
$(CXX) example.cpp -o example $(CXX_INCLUDE_FLAGS) $(CXX_LIB_FLAGS) $(CXXFLAGS)
test: test.cpp
$(CXX) test.cpp -o test $(CXX_INCLUDE_FLAGS) $(CXX_LIB_FLAGS) $(CXXFLAGS)
opencv: example_opencv.cpp
$(CXX) example_opencv.cpp -o example_opencv $(CXX_INCLUDE_FLAGS) $(CXX_LIB_FLAGS) $(CXXFLAGS)
# Define the rule to clean up generated files
.PHONY: clean
clean:
rm -f example test example_opencv