summaryrefslogtreecommitdiffstats
path: root/tools/root.make
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2012-03-26 22:24:57 +0200
committerThomas Martitz <kugel@rockbox.org>2012-03-26 22:27:40 +0200
commitf269aa0060950f7b9c42216267c639a2fb556196 (patch)
tree218ad3a737f11cb18e48676f300bc22038cfa140 /tools/root.make
parent9445d4625a3d47b28d756a5763165eb73d6b4ada (diff)
downloadrockbox-f269aa0060950f7b9c42216267c639a2fb556196.tar.gz
rockbox-f269aa0060950f7b9c42216267c639a2fb556196.tar.bz2
rockbox-f269aa0060950f7b9c42216267c639a2fb556196.zip
build system: unify/simplify library handling a bit.
libs in $ROOT/lib now add to $(CORE_LIBS) and $(EXTRA_LIBS) and are automatically linked by the core and codecs/plugins respectively. Change-Id: Iff482c792a8c8142718f6a16a450c6e2f1497c9a
Diffstat (limited to 'tools/root.make')
-rw-r--r--tools/root.make43
1 files changed, 14 insertions, 29 deletions
diff --git a/tools/root.make b/tools/root.make
index 1bac0d6600..eb7e7480d3 100644
--- a/tools/root.make
+++ b/tools/root.make
@@ -58,8 +58,9 @@ endif
all: $(DEPFILE) build
-# Subdir makefiles. their primary purpose is to populate SRC, OTHER_SRC &
-# ASMDEFS_SRC but they also define special dependencies and compile rules
+# Subdir makefiles. their primary purpose is to populate SRC, OTHER_SRC,
+# ASMDEFS_SRC, CORE_LIBS and EXTRA_LIBS. But they also define special
+# dependencies and compile rules
include $(TOOLSDIR)/tools.make
ifeq (,$(findstring checkwps,$(APPSDIR)))
@@ -95,10 +96,8 @@ else ifneq (,$(findstring database,$(APP_TYPE)))
else ifneq (,$(findstring warble,$(APP_TYPE)))
include $(ROOTDIR)/lib/rbcodec/test/warble.make
else
- RBCODEC_DIR = $(ROOTDIR)/lib/rbcodec
- RBCODEC_BLD = $(BUILDDIR)/lib/rbcodec
include $(APPSDIR)/apps.make
- include $(RBCODEC_DIR)/rbcodec.make
+ include $(ROOTDIR)/lib/rbcodec/rbcodec.make
include $(APPSDIR)/lang/lang.make
ifdef SOFTWARECODECS
@@ -179,12 +178,6 @@ ifeq (,$(findstring bootloader,$(APPSDIR)))
OBJ += $(LANG_O)
-ifeq (arm,$(ARCH))
- UNWARMINDER_LINK := -lunwarminder
-else
- UNWARMINDER_LINK :=
-endif
-
ifndef APP_TYPE
## target build
@@ -194,12 +187,6 @@ 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))
$(call preprocess2file,$<,$@,-DLOADADDRESS=$(LOADADDRESS))
@@ -208,23 +195,21 @@ $(LINKROM): $(ROMLDS)
$(call PRINTS,PP $(@F))
$(call preprocess2file,$<,$@,-DLOADADDRESS=$(LOADADDRESS))
-$(BUILDDIR)/rockbox.elf : $$(OBJ) $$(FIRMLIB) $$(RBCODEC_LIB) $$(VOICESPEEXLIB) $$(SKINLIB) $$(LIBARMSUPPORT) $$(UNWARMINDER) $$(LINKRAM)
+$(BUILDDIR)/rockbox.elf : $$(OBJ) $(FIRMLIB) $(VOICESPEEXLIB) $(CORE_LIBS) $$(LINKRAM)
$(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJ) \
-L$(BUILDDIR)/firmware -lfirmware \
- -L$(RBCODEC_BLD) -lrbcodec \
- -L$(BUILDDIR)/lib -lskin_parser $(LIBARMSUPPORT_LINK) \
- $(UNWARMINDER_LINK) -L$(BUILDDIR)/apps/codecs \
- $(VOICESPEEXLIB:lib%.a=-l%) -lgcc $(BOOTBOXLDOPTS) \
- $(GLOBAL_LDOPTS) -T$(LINKRAM) -Wl,-Map,$(BUILDDIR)/rockbox.map
+ -L$(BUILDDIR)/apps/codecs $(call a2lnk, $(VOICESPEEXLIB)) \
+ -L$(BUILDDIR)/lib $(call a2lnk, $(CORE_LIBS)) \
+ -lgcc $(BOOTBOXLDOPTS) $(GLOBAL_LDOPTS) \
+ -T$(LINKRAM) -Wl,-Map,$(BUILDDIR)/rockbox.map
-$(BUILDDIR)/rombox.elf : $$(OBJ) $$(FIRMLIB) $$(RBCODEC_LIB) $$(VOICESPEEXLIB) $$(SKINLIB) $$(LIBARMSUPPORT) $$(UNWARMINDER) $$(LINKROM)
+$(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) -lrbcodec \
- -L$(BUILDDIR)/lib -lskin_parser $(LIBARMSUPPORT_LINK) \
- $(UNWARMINDER_LINK) -L$(BUILDDIR)/apps/codecs \
- $(VOICESPEEXLIB:lib%.a=-l%) -lgcc $(GLOBAL_LDOPTS) \
- -T$(LINKROM) -Wl,-Map,$(BUILDDIR)/rombox.map
+ -L$(BUILDDIR)/apps/codecs $(call a2lnk, $(VOICESPEEXLIB)) \
+ -L$(BUILDDIR)/lib $(call a2lnk, $(CORE_LIBS)) \
+ -lgcc $(BOOTBOXLDOPTS) $(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) $< $@