summaryrefslogtreecommitdiff
path: root/tools/root.make
diff options
context:
space:
mode:
Diffstat (limited to 'tools/root.make')
-rw-r--r--tools/root.make28
1 files changed, 21 insertions, 7 deletions
diff --git a/tools/root.make b/tools/root.make
index c2d061b..6d62359 100644
--- a/tools/root.make
+++ b/tools/root.make
@@ -17,6 +17,7 @@ INCLUDES = -I$(BUILDDIR) -I$(BUILDDIR)/lang $(TARGET_INC)
CFLAGS = $(INCLUDES) $(DEFINES) $(GCCOPTS)
PPCFLAGS = $(filter-out -g -Dmain=SDL_main,$(CFLAGS)) # cygwin sdl-config fix
ASMFLAGS = -D__ASSEMBLER__ # work around gcc 3.4.x bug with -std=gnu99, only meant for .S files
+CORE_LDOPTS = $(GLOBAL_LDOPTS) # linker ops specifically for core build
TOOLS = $(TOOLSDIR)/rdf2binary $(TOOLSDIR)/convbdf \
$(TOOLSDIR)/codepages $(TOOLSDIR)/scramble $(TOOLSDIR)/bmp2rb \
@@ -90,10 +91,15 @@ ifndef APP_TYPE
endif
endif
+ifeq (,$(findstring bootloader,$(APPSDIR)))
+ ifeq (,$(findstring checkwps,$(APP_TYPE)))
+ include $(ROOTDIR)/lib/fixedpoint/fixedpoint.make
+ endif
+endif
+
ifneq (,$(findstring bootloader,$(APPSDIR)))
include $(APPSDIR)/bootloader.make
else ifneq (,$(findstring bootbox,$(APPSDIR)))
- BOOTBOXLDOPTS = -Wl,--gc-sections
include $(APPSDIR)/bootbox.make
else ifneq (,$(findstring checkwps,$(APP_TYPE)))
include $(APPSDIR)/checkwps.make
@@ -104,10 +110,10 @@ else ifneq (,$(findstring warble,$(APP_TYPE)))
include $(ROOTDIR)/lib/rbcodec/test/warble.make
include $(ROOTDIR)/lib/tlsf/libtlsf.make
include $(ROOTDIR)/lib/rbcodec/rbcodec.make
-else
+else # core
include $(APPSDIR)/apps.make
- include $(ROOTDIR)/lib/rbcodec/rbcodec.make
include $(APPSDIR)/lang/lang.make
+ include $(ROOTDIR)/lib/rbcodec/rbcodec.make
ifdef ENABLEDPLUGINS
include $(APPSDIR)/plugins/bitmaps/pluginbitmaps.make
@@ -132,6 +138,14 @@ else
endif # bootloader
+# One or more subdir makefiles requested --gc-sections?
+ifdef CORE_GCSECTIONS
+ # Do not use '--gc-sections' when compiling sdl-sim
+ ifneq ($(findstring sdl-sim, $(APP_TYPE)), sdl-sim)
+ CORE_LDOPTS += -Wl,--gc-sections
+ endif
+endif # CORE_GCSECTIONS
+
OBJ := $(SRC:.c=.o)
OBJ := $(OBJ:.S=.o)
OBJ += $(BMP:.bmp=.o)
@@ -205,16 +219,16 @@ $(BUILDDIR)/rockbox.elf : $$(OBJ) $(FIRMLIB) $(VOICESPEEXLIB) $(CORE_LIBS) $$(LI
-L$(BUILDDIR)/firmware -lfirmware \
-L$(RBCODEC_BLD)/codecs $(call a2lnk, $(VOICESPEEXLIB)) \
-L$(BUILDDIR)/lib $(call a2lnk, $(CORE_LIBS)) \
- -lgcc $(BOOTBOXLDOPTS) $(GLOBAL_LDOPTS) \
- -T$(LINKRAM) -Wl,-Map,$(BUILDDIR)/rockbox.map
+ -lgcc -T$(LINKRAM) \
+ $(CORE_LDOPTS) -Wl,-Map,$(BUILDDIR)/rockbox.map
$(BUILDDIR)/rombox.elf : $$(OBJ) $(FIRMLIB) $(VOICESPEEXLIB) $(CORE_LIBS) $$(LINKROM)
$(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJ) \
-L$(BUILDDIR)/firmware -lfirmware \
-L$(RBCODEC_BLD)/codecs $(call a2lnk, $(VOICESPEEXLIB)) \
-L$(BUILDDIR)/lib $(call a2lnk, $(CORE_LIBS)) \
- -lgcc $(BOOTBOXLDOPTS) $(GLOBAL_LDOPTS) \
- -T$(LINKROM) -Wl,-Map,$(BUILDDIR)/rombox.map
+ -lgcc -T$(LINKROM) \
+ $(CORE_LDOPTS) -Wl,-Map,$(BUILDDIR)/rombox.map
$(BUILDDIR)/rockbox.bin : $(BUILDDIR)/rockbox.elf
$(call PRINTS,OC $(@F))$(call objcopy,$<,$@)