summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2012-01-17 07:36:08 +0100
committerThomas Martitz <kugel@rockbox.org>2012-01-21 18:39:19 +0100
commitcf333a61c7861361b4025cb0f67c8f75b0b07eef (patch)
treececb037f3c38ecb035ff79de75dafa6b135bb595
parent4343011955bffaf61b002a89b0137d48e873d9d0 (diff)
downloadrockbox-cf333a61c7861361b4025cb0f67c8f75b0b07eef.zip
rockbox-cf333a61c7861361b4025cb0f67c8f75b0b07eef.tar.gz
rockbox-cf333a61c7861361b4025cb0f67c8f75b0b07eef.tar.bz2
rockbox-cf333a61c7861361b4025cb0f67c8f75b0b07eef.tar.xz
Move supprt-arm.S to separate library.
Core, codecs and plugins link it separately so this gets rid of SOURCES trickery. Don't build it for hosted targets. Change-Id: If15ef90e93cd218a4352ae8e89eea95d3122452f
-rw-r--r--apps/codecs/codecs.make2
-rw-r--r--apps/codecs/lib/SOURCES4
-rw-r--r--apps/plugins/imageviewer/imageviewer.make2
-rw-r--r--apps/plugins/lib/SOURCES1
-rw-r--r--apps/plugins/plugins.make4
-rw-r--r--firmware/SOURCES1
-rw-r--r--lib/arm_support/arm_support.make17
-rw-r--r--lib/arm_support/support-arm.S (renamed from firmware/target/arm/support-arm.S)0
-rw-r--r--tools/root.make26
9 files changed, 40 insertions, 17 deletions
diff --git a/apps/codecs/codecs.make b/apps/codecs/codecs.make
index d352579..e18b92c 100644
--- a/apps/codecs/codecs.make
+++ b/apps/codecs/codecs.make
@@ -201,7 +201,7 @@ $(CODECDIR)/%-pre.map: $(CODEC_CRT0) $(CODECLINK_LDS) $(CODECDIR)/%.o $(CODECLIB
$(CODECLIB) \
-lgcc $(subst .map,-pre.map,$(CODECLDFLAGS))
-$(CODECDIR)/%.codec: $(CODECDIR)/%.o $(LIBSETJMP)
+$(CODECDIR)/%.codec: $(CODECDIR)/%.o $(LIBSETJMP) $(LIBARMSUPPORT)
$(call PRINTS,LD $(@F))$(CC) $(CODECFLAGS) -o $(CODECDIR)/$*.elf \
$(filter %.o, $^) \
$(filter %.a, $+) \
diff --git a/apps/codecs/lib/SOURCES b/apps/codecs/lib/SOURCES
index cd38dc1..257dcb5 100644
--- a/apps/codecs/lib/SOURCES
+++ b/apps/codecs/lib/SOURCES
@@ -7,10 +7,6 @@ mdct_lookup.c
fft-ffmpeg.c
mdct.c
-#ifdef CPU_ARM
-../../../firmware/target/arm/support-arm.S
-#endif
-
#elif (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__)
osx.dummy.c
#endif
diff --git a/apps/plugins/imageviewer/imageviewer.make b/apps/plugins/imageviewer/imageviewer.make
index d06bbfd..8f933e3 100644
--- a/apps/plugins/imageviewer/imageviewer.make
+++ b/apps/plugins/imageviewer/imageviewer.make
@@ -47,7 +47,7 @@ else
endif
# rule to create reference map for image decoder
-$(IMGVBUILDDIR)/%.refmap: $(APPSDIR)/plugin.h $(IMGVSRCDIR)/imageviewer.h $(PLUGINLINK_LDS) $(PLUGINLIB) $(PLUGINBITMAPLIB)
+$(IMGVBUILDDIR)/%.refmap: $(APPSDIR)/plugin.h $(IMGVSRCDIR)/imageviewer.h $(PLUGINLINK_LDS) $(PLUGINLIB) $(LIBARMSUPPORT) $(PLUGINBITMAPLIB)
$(call PRINTS,LD $(@F))$(CC) $(IMGDECFLAGS) -o /dev/null \
$(filter %.o, $^) \
$(filter %.a, $+) \
diff --git a/apps/plugins/lib/SOURCES b/apps/plugins/lib/SOURCES
index 2c0fc2a..4b33901 100644
--- a/apps/plugins/lib/SOURCES
+++ b/apps/plugins/lib/SOURCES
@@ -41,7 +41,6 @@ playergfx.c
#ifdef HAVE_LCD_BITMAP
#ifdef CPU_ARM
-../../../firmware/target/arm/support-arm.S
pluginlib_jpeg_idct_arm.S
#endif
diff --git a/apps/plugins/plugins.make b/apps/plugins/plugins.make
index fca37aa..1bf78d8 100644
--- a/apps/plugins/plugins.make
+++ b/apps/plugins/plugins.make
@@ -65,7 +65,7 @@ PLUGINFLAGS = -I$(APPSDIR)/plugins -DPLUGIN $(CFLAGS)
$(ROCKS1): $(BUILDDIR)/%.rock: $(BUILDDIR)/%.o
# dependency for all plugins
-$(ROCKS): $(APPSDIR)/plugin.h $(PLUGINLINK_LDS) $(PLUGINLIB) $(PLUGINBITMAPLIB) $(PLUGIN_CRT0) $(LIBSETJMP)
+$(ROCKS): $(APPSDIR)/plugin.h $(PLUGINLINK_LDS) $(PLUGINLIB) $(PLUGINBITMAPLIB) $(PLUGIN_CRT0) $(LIBSETJMP) $(LIBARMSUPPORT)
$(PLUGINLIB): $(PLUGINLIB_OBJ)
$(SILENT)$(shell rm -f $@)
@@ -129,7 +129,7 @@ endif
$(BUILDDIR)/apps/plugins/%.lua: $(ROOTDIR)/apps/plugins/%.lua
$(call PRINTS,CP $(subst $(ROOTDIR)/,,$<))cp $< $(BUILDDIR)/apps/plugins/
-$(BUILDDIR)/%.refmap: $(APPSDIR)/plugin.h $(OVERLAYREF_LDS) $(PLUGINLIB) $(PLUGINBITMAPLIB) $(LIBSETJMP) $(PLUGIN_CRT0)
+$(BUILDDIR)/%.refmap: $(APPSDIR)/plugin.h $(OVERLAYREF_LDS) $(PLUGINLIB) $(PLUGINBITMAPLIB) $(LIBSETJMP) $(LIBARMSUPPORT) $(PLUGIN_CRT0)
$(call PRINTS,LD $(@F))$(CC) $(PLUGINFLAGS) -o /dev/null \
$(filter %.o, $^) \
$(filter %.a, $+) \
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 438c9e6..f203673 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -454,7 +454,6 @@ target/coldfire/ata-as-coldfire.S
#elif defined(CPU_PP) || defined(CPU_ARM)
/* CPU_PP => CPU_ARM, CPU_ARM !=> CPU_PP */
-target/arm/support-arm.S
target/arm/memcpy-arm.S
target/arm/memmove-arm.S
diff --git a/lib/arm_support/arm_support.make b/lib/arm_support/arm_support.make
new file mode 100644
index 0000000..0f6f768
--- /dev/null
+++ b/lib/arm_support/arm_support.make
@@ -0,0 +1,17 @@
+# __________ __ ___.
+# Open \______ \ ____ ____ | | _\_ |__ _______ ___
+# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+# \/ \/ \/ \/ \/
+#
+
+ARMSUPPORT_DIR = $(ROOTDIR)/lib/arm_support
+ARMSUPPORT_SRC = $(ARMSUPPORT_DIR)/support-arm.S
+ARMSUPPORT_OBJ := $(call c2obj, $(ARMSUPPORT_SRC))
+
+OTHER_SRC += $(ARMSUPPORT_SRC)
+
+$(LIBARMSUPPORT): $(ARMSUPPORT_OBJ)
+ $(SILENT)$(shell rm -f $@)
+ $(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
diff --git a/firmware/target/arm/support-arm.S b/lib/arm_support/support-arm.S
index 6141a3f..6141a3f 100644
--- a/firmware/target/arm/support-arm.S
+++ b/lib/arm_support/support-arm.S
diff --git a/tools/root.make b/tools/root.make
index dd827d6..3cdee2c 100644
--- a/tools/root.make
+++ b/tools/root.make
@@ -70,9 +70,12 @@ ifeq (,$(findstring checkwps,$(APPSDIR)))
endif
endif
-#included before codecs.make and plugins.make so they see $(LIBSETJMP)
+#included before codecs.make and plugins.make so they see them)
ifndef APP_TYPE
include $(ROOTDIR)/lib/libsetjmp/libsetjmp.make
+ ifeq (arm,$(ARCH))
+ include $(ROOTDIR)/lib/arm_support/arm_support.make
+ endif
endif
ifneq (,$(findstring bootloader,$(APPSDIR)))
@@ -176,6 +179,13 @@ LINKRAM := $(BUILDDIR)/ram.link
ROMLDS := $(FIRMDIR)/rom.lds
LINKROM := $(BUILDDIR)/rom.link
+ifeq (arm,$(ARCH))
+ LIBARMSUPPORT_LINK := -larm_support
+else
+ LIBARMSUPPORT_LINK :=
+endif
+
+
$(LINKRAM): $(RAMLDS) $(CONFIGFILE)
$(call PRINTS,PP $(@F))
@@ -185,19 +195,21 @@ $(LINKROM): $(ROMLDS)
$(call PRINTS,PP $(@F))
$(call preprocess2file,$<,$@,-DLOADADDRESS=$(LOADADDRESS))
-$(BUILDDIR)/rockbox.elf : $$(OBJ) $$(FIRMLIB) $$(VOICESPEEXLIB) $$(SKINLIB) $$(LINKRAM)
+$(BUILDDIR)/rockbox.elf : $$(OBJ) $$(FIRMLIB) $$(VOICESPEEXLIB) $$(SKINLIB) $$(LIBARMSUPPORT) $$(LINKRAM)
$(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJ) \
-L$(BUILDDIR)/firmware -lfirmware \
- -L$(BUILDDIR)/lib -lskin_parser \
+ -L$(BUILDDIR)/lib -lskin_parser $(LIBARMSUPPORT_LINK) \
-L$(BUILDDIR)/apps/codecs $(VOICESPEEXLIB:lib%.a=-l%) \
-lgcc $(BOOTBOXLDOPTS) $(GLOBAL_LDOPTS) \
-T$(LINKRAM) -Wl,-Map,$(BUILDDIR)/rockbox.map
-$(BUILDDIR)/rombox.elf : $$(OBJ) $$(FIRMLIB) $$(VOICESPEEXLIB) $$(SKINLIB) $$(LINKROM)
+$(BUILDDIR)/rombox.elf : $$(OBJ) $$(FIRMLIB) $$(VOICESPEEXLIB) $$(SKINLIB) $$(LIBARMSUPPORT) $$(LINKROM)
$(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJ) \
- $(VOICESPEEXLIB) $(FIRMLIB) -lgcc $(GLOBAL_LDOPTS) \
- -L$(BUILDDIR)/lib -lskin_parser \
- -L$(BUILDDIR)/firmware -T$(LINKROM) -Wl,-Map,$(BUILDDIR)/rombox.map
+ -L$(BUILDDIR)/firmware -lfirmware \
+ -L$(BUILDDIR)/lib -lskin_parser $(LIBARMSUPPORT_LINK) \
+ -L$(BUILDDIR)/apps/codecs $(VOICESPEEXLIB:lib%.a=-l%) \
+ -lgcc $(GLOBAL_LDOPTS) \
+ -T$(LINKROM) -Wl,-Map,$(BUILDDIR)/rombox.map
$(BUILDDIR)/rockbox.bin : $(BUILDDIR)/rockbox.elf
$(call PRINTS,OC $(@F))$(OC) $(if $(filter yes, $(USE_ELF)), -S -x, -O binary) $< $@