You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
3.0 KiB

#===============================================================================
# export variable
#===============================================================================
ifeq ($(CFG_SOCT_EXPORT_FLAG),)
SDK_DIR ?= $(shell cd $(CURDIR)/../../.. && /bin/pwd)
include $(SDK_DIR)/base.mak
endif
include $(SAMPLE_DIR)/base.mak
SOCT_USER_SPACE_LIB ?= y
SOCT_USER_SPACE_LIB64 ?= y
BUILD_DIR ?= $(SDK_DIR)/build
DRV_DIR ?= $(SDK_DIR)/vendor/huanglong/linux/
MEM_DIR ?= $(SDK_DIR)/vendor/huanglong/uapi/memory/
PLATFORM_DIR ?= $(SDK_DIR)/vendor/platform
SOCT_OUT_DIR ?= $(SDK_DIR)/out/reserved13/pc_uos_cs_tee
SOCT_USER_SPACE_LIB64 ?= y
SOCT_LIB64_DIR ?= $(SOCT_OUT_DIR)/lib64
SOCT_SHARED_LIB64_DIR ?= $(SOCT_LIB64_DIR)/share
SOCT_STATIC_LIB64_DIR ?= $(SOCT_LIB64_DIR)/static
CFG_SOCT_AARCH64_TOOLCHAINS_NAME ?= aarch64-v100-linux
UAPI_NPU_DIR ?= $(SDK_DIR)/vendor/huanglong/uapi/npu
AT ?= @
CURRENT_DIR = $(shell pwd)
#===============================================================================
# local variable
#===============================================================================
#compile file
SRCS := sample_npu_main.c \
sample_svp_npu/sample_npu_model.c \
sample_svp_npu/sample_npu_process.c
#include head file
CFLAGS := -I$(CURRENT_DIR)/include \
-I$(MEM_DIR)/include \
-I$(PLATFORM_DIR)/secure/include \
-I$(SDK_DIR)/vendor/huanglong/linux/drv/include \
-I$(SDK_DIR)/vendor/platform/secure/include \
-I$(UAPI_NPU_DIR)/include \
-I$(UAPI_NPU_DIR)/source/include \
-I$(UAPI_NPU_DIR)/source/include/acl \
-I$(UAPI_NPU_DIR)/source/include/acl/error_codes
LIBPATH64 := -L$(SOCT_SHARED_LIB64_DIR) \
-L$(CURRENT_DIR)/acl/lib/device
CFLAGS += -Wl,-z,now -luapi_securec -lstdc++
CFLAGS += -lascendcl -lge_executor -lge_common -lgraph -lregister -lascend_protobuf -lmmpa -lruntime -laicpu_scheduler -laicpu_processer -laicpu_prof -lerror_manager
CFLAGS += -ldrv_dfx
CFLAGS += -ladump
CFLAGS += -lc_sec
CFLAGS += -lmsprofiler
CFLAGS += -lalog
CFLAGS += -lmsprof
CFLAGS += -lslog
CFLAGS += -ldrvdevdrv
#===============================================================================
# build command
#===============================================================================
#build time
ifndef ($(BUILD_TIME))
BUILD_TIME = $(shell date +"%H:%M:%S")
endif
BUILD_DATE = $(shell date +"%b-%d-%Y")
CFLAGS += -DBUILD_DATE="\"$(BUILD_DATE)\"" -DBUILD_TIME="\"$(BUILD_TIME)\"" -fPIE
CFLAGS += -Wno-error=unused-parameter -pie -O3
include $(BUILD_DIR)/soc_rules.mak
SOCT_CPU_ARCH ?= arm64
#===============================================================================
# rules
#===============================================================================
all: prepare sample_npu
prepare:
$(AT)mkdir -p $(OBJ_DIR64)
sample_npu: $(SRCS)
$(AT)$(COMPILE_CC64) $(SRCS) $(CFLAGS) $(LIBPATH64) -o ./sample_npu