...
This is an example Makefile that just needs to be placed in ~/c3v/Models/yolov5s/wksp/yolov5s_uint8_nbg_unify Folder. And set the relevant VIVIANTE_ SDK_ DIR and TOOLCHAIN can complete the compilation of the app:
Code Block |
---|
#V1.0.1 BIN=sampleApp sample # 1.cross compile # NN_SDK_DIR=Path to NN SDK directory # TOOLCHAIN=Path to toolchain directory NN_SDK_INC=$(NN_SDK_DIR)/include NN_SDK_LIB=$(NN_SDK_DIR)/lib # 1.cross compile #CROSS# CROSS_COMPILE=$(TOOLCHAIN)/aarch64-none-linux-gnu- # #CCCC=$(CROSS_COMPILE)gcc #CXX# CXX=$(CROSS_COMPILE)g++ # 2.build in c3v #CC # NN_SDK_DIR=/usr # CC=gcc # #CXXCXX=g++ NN_SDK_INC=$(NN_SDK_DIR)/include NN_SDK_LIB=$(NN_SDK_DIR)/lib CFLAGS=-Wall -O3 INCLUDE += -I$(NN_SDK_INC) -I$(NN_SDK_INC)/HAL -I$(NN_SDK_INC)/ovxlib -I$(NN_SDK_INC)/jpeg LIBS += -L$(NN_SDK_LIB) -L./ -L$(STD_LOG_INC) LIBS += -lOpenVX -lOpenVXU -lOpenVX -lCLC -lVSC -lGAL -ljpeg -lovxlib -lm LIBS += -lNNArchPerf -lArchModelSw LIBS += -lstdc++ -ldl -lpthread -lgcc_s CFLAGS += $(INCLUDE) -fPIC CFLAGS += -Wno-unused-variable -Wno-unused-function -Wno-unused-but-set-variable SRCS=${wildcard *.c} SRCS+=${wildcard *.cpp} OBJS=$(addsuffix .o, $(basename $(SRCS))) .SUFFIXES: .hpp .cpp .c .cpp.o: $(CXX) $(CFLAGS) -std=c++11 -c $< .c.o: $(CC) $(CFLAGS) -c $< all: $(BIN) $(BIN): $(OBJS) $(CC) $(CFLAGS) $(LFLAGS) $(OBJS) -o $@ $(LIBS) rm -rf *.o clean: rm -rf *.o rm -rf $(BIN) $(LIB) rm -rf *~ |
...