1 2# create a separate list of objects per source type 3MODULE_CSRCS := $(filter %.c,$(MODULE_SRCS)) 4MODULE_CPPSRCS := $(filter %.cpp,$(MODULE_SRCS)) 5MODULE_CCSRCS := $(filter %.cc,$(MODULE_SRCS)) 6MODULE_ASMSRCS := $(filter %.S,$(MODULE_SRCS)) 7 8MODULE_COBJS := $(call TOBUILDDIR,$(patsubst %.c,%.c.o,$(MODULE_CSRCS))) 9MODULE_CPPOBJS := $(call TOBUILDDIR,$(patsubst %.cpp,%.cpp.o,$(MODULE_CPPSRCS))) 10MODULE_CCOBJS := $(call TOBUILDDIR,$(patsubst %.cc,%.cc.o,$(MODULE_CCSRCS))) 11MODULE_ASMOBJS := $(call TOBUILDDIR,$(patsubst %.S,%.S.o,$(MODULE_ASMSRCS))) 12 13# do the same thing for files specified in arm override mode 14MODULE_ARM_CSRCS := $(filter %.c,$(MODULE_ARM_OVERRIDE_SRCS)) 15MODULE_ARM_CPPSRCS := $(filter %.cpp,$(MODULE_ARM_OVERRIDE_SRCS)) 16MODULE_ARM_CCSRCS := $(filter %.cc,$(MODULE_ARM_OVERRIDE_SRCS)) 17MODULE_ARM_ASMSRCS := $(filter %.S,$(MODULE_ARM_OVERRIDE_SRCS)) 18 19MODULE_ARM_COBJS := $(call TOBUILDDIR,$(patsubst %.c,%.c.o,$(MODULE_ARM_CSRCS))) 20MODULE_ARM_CPPOBJS := $(call TOBUILDDIR,$(patsubst %.cpp,%.cpp.o,$(MODULE_ARM_CPPSRCS))) 21MODULE_ARM_CCOBJS := $(call TOBUILDDIR,$(patsubst %.cc,%.cc.o,$(MODULE_ARM_CCSRCS))) 22MODULE_ARM_ASMOBJS := $(call TOBUILDDIR,$(patsubst %.S,%.S.o,$(MODULE_ARM_ASMSRCS))) 23 24MODULE_OBJS := $(MODULE_COBJS) $(MODULE_CPPOBJS) $(MODULE_CCOBJS) $(MODULE_ASMOBJS) $(MODULE_ARM_COBJS) $(MODULE_ARM_CPPOBJS) $(MODULE_ARM_CCOBJS) $(MODULE_ARM_ASMOBJS) 25 26#$(info MODULE_SRCS = $(MODULE_SRCS)) 27#$(info MODULE_CSRCS = $(MODULE_CSRCS)) 28#$(info MODULE_CPPSRCS = $(MODULE_CPPSRCS)) 29#$(info MODULE_ASMSRCS = $(MODULE_ASMSRCS)) 30 31#$(info MODULE_OBJS = $(MODULE_OBJS)) 32#$(info MODULE_COBJS = $(MODULE_COBJS)) 33#$(info MODULE_CPPOBJS = $(MODULE_CPPOBJS)) 34#$(info MODULE_ASMOBJS = $(MODULE_ASMOBJS)) 35 36$(MODULE_OBJS): MODULE_OPTFLAGS:=$(MODULE_OPTFLAGS) 37$(MODULE_OBJS): MODULE_COMPILEFLAGS:=$(MODULE_COMPILEFLAGS) 38$(MODULE_OBJS): MODULE_CFLAGS:=$(MODULE_CFLAGS) 39$(MODULE_OBJS): MODULE_CPPFLAGS:=$(MODULE_CPPFLAGS) 40$(MODULE_OBJS): MODULE_ASMFLAGS:=$(MODULE_ASMFLAGS) 41$(MODULE_OBJS): MODULE_SRCDEPS:=$(MODULE_SRCDEPS) 42$(MODULE_OBJS): MODULE_INCLUDES:=$(MODULE_INCLUDES) 43 44$(MODULE_COBJS): $(BUILDDIR)/%.c.o: %.c $(MODULE_SRCDEPS) 45 @$(MKDIR) 46 $(info compiling $<) 47 $(NOECHO)$(CC) $(GLOBAL_OPTFLAGS) $(MODULE_OPTFLAGS) $(GLOBAL_COMPILEFLAGS) $(ARCH_COMPILEFLAGS) $(MODULE_COMPILEFLAGS) $(GLOBAL_CFLAGS) $(ARCH_CFLAGS) $(MODULE_CFLAGS) $(THUMBCFLAGS) $(GLOBAL_INCLUDES) $(MODULE_INCLUDES) -c $< -MD -MP -MT $@ -MF $(@:%o=%d) -o $@ 48 49$(MODULE_CPPOBJS): $(BUILDDIR)/%.cpp.o: %.cpp $(MODULE_SRCDEPS) 50 @$(MKDIR) 51 $(info compiling $<) 52 $(NOECHO)$(CC) $(GLOBAL_OPTFLAGS) $(MODULE_OPTFLAGS) $(GLOBAL_COMPILEFLAGS) $(ARCH_COMPILEFLAGS) $(MODULE_COMPILEFLAGS) $(GLOBAL_CPPFLAGS) $(ARCH_CPPFLAGS) $(MODULE_CPPFLAGS) $(THUMBCFLAGS) $(GLOBAL_INCLUDES) $(MODULE_INCLUDES) -c $< -MD -MP -MT $@ -MF $(@:%o=%d) -o $@ 53 54$(MODULE_CCOBJS): $(BUILDDIR)/%.cc.o: %.cc $(MODULE_SRCDEPS) 55 @$(MKDIR) 56 $(info compiling $<) 57 $(NOECHO)$(CC) $(GLOBAL_OPTFLAGS) $(MODULE_OPTFLAGS) $(GLOBAL_COMPILEFLAGS) $(ARCH_COMPILEFLAGS) $(MODULE_COMPILEFLAGS) $(GLOBAL_CPPFLAGS) $(ARCH_CPPFLAGS) $(MODULE_CPPFLAGS) $(THUMBCFLAGS) $(GLOBAL_INCLUDES) $(MODULE_INCLUDES) -c $< -MD -MP -MT $@ -MF $(@:%o=%d) -o $@ 58 59$(MODULE_ASMOBJS): $(BUILDDIR)/%.S.o: %.S $(MODULE_SRCDEPS) 60 @$(MKDIR) 61 $(info compiling $<) 62 $(NOECHO)$(CC) $(GLOBAL_OPTFLAGS) $(MODULE_OPTFLAGS) $(GLOBAL_COMPILEFLAGS) $(ARCH_COMPILEFLAGS) $(MODULE_COMPILEFLAGS) $(GLOBAL_ASMFLAGS) $(ARCH_ASMFLAGS) $(MODULE_ASMFLAGS) $(THUMBCFLAGS) $(GLOBAL_INCLUDES) $(MODULE_INCLUDES) -c $< -MD -MP -MT $@ -MF $(@:%o=%d) -o $@ 63 64# overridden arm versions 65$(MODULE_ARM_COBJS): $(BUILDDIR)/%.c.o: %.c $(MODULE_SRCDEPS) 66 @$(MKDIR) 67 $(info compiling $<) 68 $(NOECHO)$(CC) $(GLOBAL_OPTFLAGS) $(MODULE_OPTFLAGS) $(GLOBAL_COMPILEFLAGS) $(ARCH_COMPILEFLAGS) $(MODULE_COMPILEFLAGS) $(GLOBAL_CFLAGS) $(ARCH_CFLAGS) $(MODULE_CFLAGS) $(GLOBAL_INCLUDES) $(MODULE_INCLUDES) -c $< -MD -MP -MT $@ -MF $(@:%o=%d) -o $@ 69 70$(MODULE_ARM_CPPOBJS): $(BUILDDIR)/%.cpp.o: %.cpp $(MODULE_SRCDEPS) 71 @$(MKDIR) 72 $(info compiling $<) 73 $(NOECHO)$(CC) $(GLOBAL_OPTFLAGS) $(MODULE_OPTFLAGS) $(GLOBAL_COMPILEFLAGS) $(ARCH_COMPILEFLAGS) $(MODULE_COMPILEFLAGS) $(GLOBAL_CPPFLAGS) $(ARCH_CPPFLAGS) $(MODULE_CPPFLAGS) $(GLOBAL_INCLUDES) $(MODULE_INCLUDES) -c $< -MD -MP -MT $@ -MF $(@:%o=%d) -o $@ 74 75$(MODULE_ARM_CCOBJS): $(BUILDDIR)/%.cc.o: %.cc $(MODULE_SRCDEPS) 76 @$(MKDIR) 77 $(info compiling $<) 78 $(CC) $(GLOBAL_OPTFLAGS) $(MODULE_OPTFLAGS) $(GLOBAL_COMPILEFLAGS) $(ARCH_COMPILEFLAGS) $(MODULE_COMPILEFLAGS) $(GLOBAL_CPPFLAGS) $(ARCH_CPPFLAGS) $(MODULE_CPPFLAGS) $(GLOBAL_INCLUDES) $(MODULE_INCLUDES) -c $< -MD -MP -MT $@ -MF $(@:%o=%d) -o $@ 79 80$(MODULE_ARM_ASMOBJS): $(BUILDDIR)/%.S.o: %.S $(MODULE_SRCDEPS) 81 @$(MKDIR) 82 $(info compiling $<) 83 $(NOECHO)$(CC) $(GLOBAL_OPTFLAGS) $(MODULE_OPTFLAGS) $(GLOBAL_COMPILEFLAGS) $(ARCH_COMPILEFLAGS) $(MODULE_COMPILEFLAGS) $(GLOBAL_ASMFLAGS) $(ARCH_ASMFLAGS) $(MODULE_ASMFLAGS) $(GLOBAL_INCLUDES) $(MODULE_INCLUDES) -c $< -MD -MP -MT $@ -MF $(@:%o=%d) -o $@ 84 85# clear some variables we set here 86MODULE_CSRCS := 87MODULE_CPPSRCS := 88MODULE_CCSRCS := 89MODULE_ASMSRCS := 90MODULE_COBJS := 91MODULE_CPPOBJS := 92MODULE_CCOBJS := 93MODULE_ASMOBJS := 94 95# MODULE_OBJS is passed back 96#MODULE_OBJS := 97 98