Files
MilkV-Duo/middleware/v2/sample/scene_auto/Makefile
LevitatingBusinessMan (Rein Fernhout) 4a097910e5 Add -latomic to linker flags for scene_auto sample
2024-06-17 17:21:34 +02:00

58 lines
1.6 KiB
Makefile

SHELL = /bin/bash
ifeq ($(PARAM_FILE), )
PARAM_FILE:=../../Makefile.param
include $(PARAM_FILE)
endif
include ../sample.mk
SDIR = $(PWD)
SRCS = $(wildcard $(SDIR)/src/core/*.c)
SRCS += $(wildcard $(SDIR)/src/sample/*.c)
SRCS += $(wildcard $(SDIR)/tools/iniparser/src/*.c)
INCS = -I$(MW_INC) -I$(ISP_INC) -I../common/ -I$(KERNEL_INC)
INCS += -I./include/core
INCS += -I./include/sample
INCS += -I./tools/iniparser/src
OBJS = $(SRCS:.c=.o)
DEPS = $(SRCS:.c=.d)
TARGET = sample_scene_auto
ifeq ($(CONFIG_ENABLE_SDK_ASAN), y)
TARGET = sample_scene_auto_asan
endif
PKG_CONFIG_PATH = $(MW_PATH)/pkgconfig
REQUIRES = cvi_common cvi_sample cvi_vdec cvi_misc
MW_LIBS = $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --libs --define-variable=mw_dir=$(MW_PATH) $(REQUIRES))
LIBS = $(MW_LIBS)
ifeq ($(MULTI_PROCESS_SUPPORT), 1)
DEFS += -DRPC_MULTI_PROCESS
LIBS += -lnanomsg
endif
EXTRA_CFLAGS = $(INCS) $(DEFS)
EXTRA_LDFLAGS = $(LIBS) -lpthread -lm -lini -latomic
.PHONY : clean all
all: $(TARGET)
$(COMMON_DIR)/%.o: $(COMMON_DIR)/%.c
@$(CC) $(DEPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ -c $<
@echo [$(notdir $(CC))] $(notdir $@)
$(SDIR)/%.o: $(SDIR)/%.c
@$(CC) $(DEPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ -c $<
@echo [$(notdir $(CC))] $(notdir $@)
$(TARGET): $(COMM_OBJ) $(OBJS) $(ISP_OBJ) $(MW_LIB)/libvpu.a $(MW_LIB)/libsys.a
@$(CXX) -o $@ -Wl,--start-group $(OBJS) $(COMM_OBJS) $(MW_LIB)/libsys.a -Wl,--end-group $(ELFFLAGS) $(EXTRA_LDFLAGS)
@echo -e $(BLUE)[LINK]$(END)[$(notdir $(CXX))] $(notdir $@)
clean:
@rm -f $(OBJS) $(DEPS) $(COMM_OBJ) $(COMM_DEPS) $(TARGET)
-include $(DEPS)