96 lines
2.5 KiB
Makefile
96 lines
2.5 KiB
Makefile
|
|
|
||
|
|
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 := isp460_test
|
||
|
|
# sources
|
||
|
|
SRCS := linux_test_isp.c linux_isp_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 += -I$(MEDIA_PATH)/isp/isp460/include/isp -I$(MEDIA_PATH)/isp/isp460/include/isp_ext
|
||
|
|
CFLAGS += -I$(MEDIA_PATH)/mpp/drv_include -I$(MEDIA_PATH)/mpp/include/dsp
|
||
|
|
|
||
|
|
# libs
|
||
|
|
|
||
|
|
|
||
|
|
# linker flags
|
||
|
|
LDLIBS := -Wl,-Bstatic -lisp -lispcore -lmipi -lmpi -lk351p_dvp -ljxf23_dvp -lae -lawb -Wl,-Bdynamic -lpthread
|
||
|
|
# -lisp -lispcore -lmpi -lxconfig -Wl,-Bdynamic -lpthread -lm -ldl
|
||
|
|
LDFLAGS := -L$(MEDIA_PATH)/isp/isp460/lib -L$(MEDIA_PATH)/../output/$(TARGET_OUTPUT_DIR)/media/lib
|
||
|
|
|
||
|
|
##-------------------------------------------------------------------------------------
|
||
|
|
## 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)
|