include ../../Makefile.param ##------------------------------------------------------------------------------------- ## compiler command # flags required for dependency generation; passed to compilers DEPFLAGS = -MT $@ -MD -MP -MF $(DEPDIR)/$*.Td # compile C source files COMPILE.c = $(CC) $(DEPFLAGS) $(CFLAGS) $(CPPFLAGS) -g -c -o $@ # compile C++ source files COMPILE.cc = $(CXX) $(DEPFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ # link object files to binary LINK.share = $(CC) -shared $(LDFLAGS) $^ -o $@ $(LDLIBS) LINK.static = $(CC) -static $(LDFLAGS) $^ -o $@ $(LDLIBS) LINK.auto = $(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) # archieve object files to static library AR.o = $(AR) rcs $@ # strip the object STRIP.o = $(STRIP) $@ # precompile step PRECOMPILE = # postcompile step POSTCOMPILE = @mv -f $(DEPDIR)/$*.Td $(DEPDIR)/$*.d ##------------------------------------------------------------------------------------- ## sub functions here ##------------------------------------------------------------------------------------- ## project defines # target TARGET := slt_test # sources SRCS := $(wildcard *.c) ../../modules/npu/common.c # intermediate directory for generated object files OBJDIR := .o # intermediate directory for generated dependency files DEPDIR := .d # object files, auto generated from source files OBJS := $(patsubst %,$(OBJDIR)/%.o,$(basename $(SRCS))) # dependency files, auto generated from source files DEPS := $(patsubst %,$(DEPDIR)/%.d,$(basename $(SRCS))) # compilers (at least gcc and clang) don't create the subdirectories automatically $(shell mkdir -p $(dir $(OBJS)) >/dev/null) $(shell mkdir -p $(dir $(DEPS)) >/dev/null) # flags CFLAGS += -std=gnu99 -I$(MEDIA_PATH)/isp/include/isp -I$(MEDIA_PATH)/mpp/drv_include -I$(MEDIA_PATH)/include/fhhcp -DDP2000 -DUSEFULLHAN # libs NPU_LIBS = -ldcl_ioctl -ldcl_memory -ldcl_runtime -ldcl_utils -ldrv_dp2000 -lmdl_parse -lstream_sched -lhcp_cv -lhcp_ive -lhcp_model -lhcp_npu -lhcp_sys ISP_LIBS = -lisp -lispcore -lovos02k_mipi -lsensor # linker flags LDLIBS := -Wl,-Bstatic -Wl,--start-group $(NPU_LIBS) $(ISP_LIBS) -l elogger -lmpi -lxconfig -Wl,--end-group -Wl,-Bdynamic -lstdc++ -lpthread -lm -ldl LDFLAGS := $(LIBS_LD_CFLAGS) -L$(REL_LIB) -L$(MEDIA_PATH)/isp/isp_main/lib -L$(MEDIA_PATH)/lib/npu -Llogger -L. ##------------------------------------------------------------------------------------- ## rules .PHONY : clean all all: $(TARGET) clean: $(RM) -r $(TARGET) $(OBJDIR) $(DEPDIR) $(TARGET): $(OBJS) $(LINK.auto) cp $(TARGET) $(REL_TEST) $(OBJDIR)/%.o: %.c $(OBJDIR)/%.o: %.c $(DEPDIR)/%.d $(PRECOMPILE) $(COMPILE.c) $< $(POSTCOMPILE) .PRECIOUS = $(DEPDIR)/%.d $(DEPDIR)/%.d: ; -include $(DEPS)