summaryrefslogtreecommitdiffstats
path: root/lib
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 /lib
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 'lib')
-rw-r--r--lib/arm_support/arm_support.make16
-rw-r--r--lib/libsetjmp/libsetjmp.make16
-rw-r--r--lib/rbcodec/rbcodec.make18
-rw-r--r--lib/skin_parser/skin_parser.make16
-rw-r--r--lib/unwarminder/unwarminder.make15
5 files changed, 42 insertions, 39 deletions
diff --git a/lib/arm_support/arm_support.make b/lib/arm_support/arm_support.make
index a3775ee3b0..054d723e62 100644
--- a/lib/arm_support/arm_support.make
+++ b/lib/arm_support/arm_support.make
@@ -6,14 +6,16 @@
# \/ \/ \/ \/ \/
#
-ARMSUPPORT_DIR = $(ROOTDIR)/lib/arm_support
-ARMSUPPORT_SRC = $(ARMSUPPORT_DIR)/support-arm.S
-ARMSUPPORT_OBJ := $(call c2obj, $(ARMSUPPORT_SRC))
+ARMSUPPORTLIB_DIR := $(ROOTDIR)/lib/arm_support
+ARMSUPPORTLIB_SRC := $(ARMSUPPORTLIB_DIR)/support-arm.S
+ARMSUPPORTLIB_OBJ := $(call c2obj, $(ARMSUPPORTLIB_SRC))
+ARMSUPPORTLIB := $(BUILDDIR)/lib/libarm_support.a
-OTHER_SRC += $(ARMSUPPORT_SRC)
+OTHER_SRC += $(ARMSUPPORTLIB_SRC)
+# both core and plugins link this
+CORE_LIBS += $(ARMSUPPORTLIB)
+PLUGIN_LIBS += $(ARMSUPPORTLIB)
-LIBARMSUPPORT := $(BUILDDIR)/lib/libarm_support.a
-
-$(LIBARMSUPPORT): $(ARMSUPPORT_OBJ)
+$(ARMSUPPORTLIB): $(ARMSUPPORTLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
diff --git a/lib/libsetjmp/libsetjmp.make b/lib/libsetjmp/libsetjmp.make
index b7d4cad25f..f8df7513c9 100644
--- a/lib/libsetjmp/libsetjmp.make
+++ b/lib/libsetjmp/libsetjmp.make
@@ -6,16 +6,16 @@
# \/ \/ \/ \/ \/
#
-SETJMP_DIR = $(ROOTDIR)/lib/libsetjmp
-SETJMP_SRC = $(call preprocess, $(SETJMP_DIR)/SOURCES)
-SETJMP_OBJ := $(call c2obj, $(SETJMP_SRC))
+SETJMPLIB_DIR = $(ROOTDIR)/lib/libsetjmp
+SETJMPLIB_SRC = $(call preprocess, $(SETJMPLIB_DIR)/SOURCES)
+SETJMPLIB_OBJ := $(call c2obj, $(SETJMPLIB_SRC))
-OTHER_SRC += $(SETJMP_SRC)
+SETJMPLIB = $(BUILDDIR)/lib/libsetjmp.a
-LIBSETJMP = $(BUILDDIR)/lib/libsetjmp.a
+INCLUDES += -I$(SETJMPLIB_DIR)
+OTHER_SRC += $(SETJMPLIB_SRC)
+EXTRA_LIBS += $(SETJMPLIB)
-INCLUDES += -I$(SETJMP_DIR)
-
-$(LIBSETJMP): $(SETJMP_OBJ)
+$(SETJMPLIB): $(SETJMPLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
diff --git a/lib/rbcodec/rbcodec.make b/lib/rbcodec/rbcodec.make
index afa289ba28..cd669d22c9 100644
--- a/lib/rbcodec/rbcodec.make
+++ b/lib/rbcodec/rbcodec.make
@@ -5,15 +5,15 @@
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
-RBCODEC_LIB = $(RBCODEC_BLD)/librbcodec.a
-RBCODEC_SRC := $(call preprocess, $(RBCODEC_DIR)/SOURCES)
-RBCODEC_OBJ := $(call c2obj, $(RBCODEC_SRC))
-INCLUDES += -I$(RBCODEC_DIR) -I$(RBCODEC_DIR)/dsp -I$(RBCODEC_DIR)/metadata
-OTHER_SRC += $(RBCODEC_SRC)
+# RBCODEC_BLD is defined in the calling Makefile
+RBCODECLIB_DIR := $(ROOTDIR)/lib/rbcodec
+RBCODECLIB_SRC := $(call preprocess, $(RBCODECLIB_DIR)/SOURCES)
+RBCODECLIB_OBJ := $(call c2obj, $(RBCODECLIB_SRC))
+RBCODECLIB := $(BUILDDIR)/lib/librbcodec.a
-$(RBCODEC_BLD)/%.o: $(RBCODEC_DIR)/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $<)$(CC) $(CFLAGS) $(RBCODEC_CFLAGS) -c $< -o $@
+INCLUDES += -I$(RBCODECLIB_DIR) -I$(RBCODECLIB_DIR)/dsp -I$(RBCODECLIB_DIR)/metadata
+OTHER_SRC += $(RBCODECLIB_SRC)
+CORE_LIBS += $(RBCODECLIB)
-$(RBCODEC_LIB): $(RBCODEC_OBJ)
+$(RBCODECLIB): $(RBCODECLIB_OBJ)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
diff --git a/lib/skin_parser/skin_parser.make b/lib/skin_parser/skin_parser.make
index 0be85f3e58..42104a2822 100644
--- a/lib/skin_parser/skin_parser.make
+++ b/lib/skin_parser/skin_parser.make
@@ -5,16 +5,16 @@
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
#
-SKINP_DIR = $(ROOTDIR)/lib/skin_parser
-SKINP_SRC = $(call preprocess, $(SKINP_DIR)/SOURCES)
-SKINP_OBJ := $(call c2obj, $(SKINP_SRC))
+SKINPARSLIB_DIR = $(ROOTDIR)/lib/skin_parser
+SKINPARSLIB_SRC = $(call preprocess, $(SKINPARSLIB_DIR)/SOURCES)
+SKINPARSLIB_OBJ := $(call c2obj, $(SKINPARSLIB_SRC))
-OTHER_SRC += $(SKINP_SRC)
+SKINPARSLIB = $(BUILDDIR)/lib/libskin_parser.a
-SKINLIB = $(BUILDDIR)/lib/libskin_parser.a
+INCLUDES += -I$(SKINPARSLIB_DIR)
+OTHER_SRC += $(SKINPARSLIB_SRC)
+CORE_LIBS += $(SKINPARSLIB)
-INCLUDES += -I$(SKINP_DIR)
-
-$(SKINLIB): $(SKINP_OBJ)
+$(SKINPARSLIB): $(SKINPARSLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
diff --git a/lib/unwarminder/unwarminder.make b/lib/unwarminder/unwarminder.make
index f570d49640..5093156f54 100644
--- a/lib/unwarminder/unwarminder.make
+++ b/lib/unwarminder/unwarminder.make
@@ -6,16 +6,17 @@
# \/ \/ \/ \/ \/
#
-UNWARM_DIR = $(ROOTDIR)/lib/unwarminder
-UNWARM_SRC = $(call preprocess, $(UNWARM_DIR)/SOURCES)
-UNWARM_OBJ := $(call c2obj, $(UNWARM_SRC))
+UNWARMLIB_DIR = $(ROOTDIR)/lib/unwarminder
+UNWARMLIB_SRC = $(call preprocess, $(UNWARMLIB_DIR)/SOURCES)
+UNWARMLIB_OBJ := $(call c2obj, $(UNWARMLIB_SRC))
-OTHER_SRC += $(UNWARM_SRC)
+OTHER_SRC += $(UNWARMLIB_SRC)
-UNWARMINDER = $(BUILDDIR)/lib/libunwarminder.a
+UNWARMLIB = $(BUILDDIR)/lib/libunwarminder.a
+CORE_LIBS += $(UNWARMLIB)
-INCLUDES += -I$(UNWARM_DIR)
+INCLUDES += -I$(UNWARMLIB_DIR)
-$(UNWARMINDER): $(UNWARM_OBJ)
+$(UNWARMLIB): $(UNWARMLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null