summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/database/SOURCES1
-rw-r--r--tools/database/database.make9
-rw-r--r--tools/root.make28
3 files changed, 27 insertions, 11 deletions
diff --git a/tools/database/SOURCES b/tools/database/SOURCES
index 9c60fb1..5c9b971 100644
--- a/tools/database/SOURCES
+++ b/tools/database/SOURCES
@@ -1,5 +1,4 @@
database.c
-../../apps/fixedpoint.c
../../apps/misc.c
../../apps/tagcache.c
../../firmware/common/crc32.c
diff --git a/tools/database/database.make b/tools/database/database.make
index 89a4aa7..8eae492 100644
--- a/tools/database/database.make
+++ b/tools/database/database.make
@@ -35,10 +35,13 @@ INCLUDES += -I$(ROOTDIR)/apps/gui \
-I$(ROOTDIR)/lib/rbcodec/dsp \
-I$(APPSDIR) \
-I$(BUILDDIR)
-
+
+ifdef SOFTWARECODECS
+OTHERLIBS := $(FIXEDPOINTLIB)
+endif
.SECONDEXPANSION: # $$(OBJ) is not populated until after this
-$(BUILDDIR)/$(BINARY): $$(DATABASE_OBJ)
+$(BUILDDIR)/$(BINARY): $$(DATABASE_OBJ) $(OTHERLIBS)
$(call PRINTS,LD $(BINARY))
- $(SILENT)$(HOSTCC) -o $@ $+
+ $(SILENT)$(HOSTCC) $(call a2lnk $(OTHERLIBS)) -o $@ $+
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,$<,$@)