[make] add options to add extra .o files to the link line at the module and global scope
This commit is contained in:
@@ -6,10 +6,10 @@ $(OUTBIN): $(OUTELF)
|
||||
$(NOECHO)$(SIZE) $<
|
||||
$(NOCOPY)$(OBJCOPY) -O binary $< $@
|
||||
|
||||
$(OUTELF): $(ALLMODULE_OBJS) $(LINKER_SCRIPT)
|
||||
$(OUTELF): $(ALLMODULE_OBJS) $(EXTRA_OBJS) $(LINKER_SCRIPT)
|
||||
@echo linking $@
|
||||
$(NOECHO)$(SIZE) -t $(ALLMODULE_OBJS)
|
||||
$(NOECHO)$(LD) $(GLOBAL_LDFLAGS) -T $(LINKER_SCRIPT) $(ALLMODULE_OBJS) $(LIBGCC) -o $@
|
||||
$(NOECHO)$(LD) $(GLOBAL_LDFLAGS) -T $(LINKER_SCRIPT) $(ALLMODULE_OBJS) $(EXTRA_OBJS) $(LIBGCC) -o $@
|
||||
|
||||
$(OUTELF).sym: $(OUTELF)
|
||||
@echo generating symbols: $@
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
# MODULE_CPPFLAGS : CPPFLAGS local to this module
|
||||
# MODULE_ASMFLAGS : ASMFLAGS local to this module
|
||||
# MODULE_SRCDEPS : extra dependencies that all of this module's files depend on
|
||||
# MODULE_EXTRA_OBJS : extra .o files that should be linked with the module
|
||||
|
||||
# MODULE_ARM_OVERRIDE_SRCS : list of source files, local path that should be force compiled with ARM (if applicable)
|
||||
|
||||
@@ -67,7 +68,7 @@ include make/compile.mk
|
||||
|
||||
# build a ld -r style combined object
|
||||
MODULE_OBJECT := $(call TOBUILDDIR,$(MODULE_SRCDIR).mod.o)
|
||||
$(MODULE_OBJECT): $(MODULE_OBJS)
|
||||
$(MODULE_OBJECT): $(MODULE_OBJS) $(MODULE_EXTRA_OBJS)
|
||||
@$(MKDIR)
|
||||
@echo linking $@
|
||||
$(NOECHO)$(LD) -r $^ -o $@
|
||||
@@ -95,6 +96,7 @@ MODULE_CFLAGS :=
|
||||
MODULE_CPPFLAGS :=
|
||||
MODULE_ASMFLAGS :=
|
||||
MODULE_SRCDEPS :=
|
||||
MODULE_EXTRA_OBJS :=
|
||||
MODULE_CONFIG :=
|
||||
MODULE_OBJECT :=
|
||||
MODULE_ARM_OVERRIDE_SRCS :=
|
||||
|
||||
3
makefile
3
makefile
@@ -82,6 +82,9 @@ EXTRA_BUILDDEPS :=
|
||||
# any rules you put here will be depended on in clean builds
|
||||
EXTRA_CLEANDEPS :=
|
||||
|
||||
# any objects you put here get linked with the final image
|
||||
EXTRA_OBJS :=
|
||||
|
||||
include project/$(PROJECT).mk
|
||||
include target/$(TARGET)/rules.mk
|
||||
include platform/$(PLATFORM)/rules.mk
|
||||
|
||||
Reference in New Issue
Block a user