98 lines
2.7 KiB
Makefile
Executable File
98 lines
2.7 KiB
Makefile
Executable File
|
|
include ../../Makefile.param
|
|
|
|
|
|
##-------------------------------------------------------------------------------------
|
|
## compiler command
|
|
|
|
# flags required for dependency generation; passed to compilers
|
|
DEPFLAGS = -MT $@ -MD -MP -MF $(DEPDIR)/$*.Td
|
|
NNP_LIBS := -L$(MEDIA_PATH)/lib/npu
|
|
NNP_LIBS += "-Wl,--start-group"
|
|
NNP_LIBS += -ldcl_ioctl -ldcl_memory -ldcl_runtime -ldcl_utils -ldrv_dp2000 -lmdl_parse -lstream_sched
|
|
NNP_LIBS += -lhcp_cv -lhcp_ive -lhcp_model -lhcp_npu -lhcp_sys
|
|
NNP_LIBS += "-Wl,--end-group"
|
|
|
|
# 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 := ipon_test
|
|
# sources
|
|
SRCS := common.c main.c vpu.c vou.c demo_isp_common.c jpege.c thpool.c npu_com.c npu.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 -DUSEFULLHAN -I$(MEDIA_PATH)/include/fhhcp
|
|
|
|
|
|
# libs
|
|
|
|
|
|
# linker flags
|
|
LDLIBS := -Wl,-Bstatic -lisp -lispcore -ldummy_sensor -lsensor -lmpi -lxconfig $(NNP_LIBS) -lstdc++ -Wl,-Bdynamic -lpthread -lm -ldl
|
|
LDFLAGS := $(LIBS_LD_CFLAGS) -L$(REL_LIB) -L$(MEDIA_PATH)/isp/isp_main/lib -L.
|
|
|
|
##-------------------------------------------------------------------------------------
|
|
## rules
|
|
.PHONY : clean all
|
|
|
|
all: $(TARGET)
|
|
|
|
clean:
|
|
$(RM) -r $(TARGET) $(OBJDIR) $(DEPDIR)
|
|
|
|
$(TARGET): $(OBJS)
|
|
$(LINK.auto)
|
|
mv $(TARGET) $(REL_TEST)
|
|
|
|
|
|
$(OBJDIR)/%.o: %.c
|
|
$(OBJDIR)/%.o: %.c $(DEPDIR)/%.d
|
|
$(PRECOMPILE)
|
|
$(COMPILE.c) $<
|
|
$(POSTCOMPILE)
|
|
|
|
|
|
.PRECIOUS = $(DEPDIR)/%.d
|
|
$(DEPDIR)/%.d: ;
|
|
|
|
-include $(DEPS)
|