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 := ipo_test # sources SRCS := common.c main.c vpu.c vou.c demo_isp_common.c jpege.c thpool.c libhttp_mjpeg.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 # libs # linker flags LDLIBS := -Wl,-Bstatic -lisp -lispcore -ldummy_sensor -lsensor -lmpi -lxconfig -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) cp $(TARGET) $(REL_TEST) $(OBJDIR)/%.o: %.c $(OBJDIR)/%.o: %.c $(DEPDIR)/%.d $(PRECOMPILE) $(COMPILE.c) $< $(POSTCOMPILE) .PRECIOUS = $(DEPDIR)/%.d $(DEPDIR)/%.d: ; -include $(DEPS)