[U-Boot] [PATCH v3 6/9] scaled down version of generic libraries for SPL

Daniel Schwierzeck
2011-07-18T16:09:18Z

From: Aneesh V <aneesh@ti.com>

Signed-off-by: Aneesh V <aneesh@ti.com>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
---
Changes since RFC v1:
- none

arch/arm/lib/Makefile | 2 ++
common/Makefile | 9 ++++++---
drivers/serial/Makefile | 3 +++
fs/fat/Makefile | 6 +++++-
lib/Makefile | 11 +++++++----
5 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index d31321a..300c8fa 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(ARCH).o
LIBGCC = $(obj)libgcc.o

+ifndef CONFIG_SPL_BUILD
GLSOBJS += _ashldi3.o
GLSOBJS += _ashrdi3.o
GLSOBJS += _divsi3.o
@@ -45,6 +46,7 @@ COBJS-y += interrupts.o
COBJS-y += reset.o
SOBJS-$(CONFIG_USE_ARCH_MEMSET) += memset.o
SOBJS-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o
+endif

SRCS := $(GLSOBJS:.o=.S) $(GLCOBJS:.o=.c) \
$(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
diff --git a/common/Makefile b/common/Makefile
index 224b7cc..124a427 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -26,17 +26,15 @@ include $(TOPDIR)/config.mk
LIB = $(obj)libcommon.o

# core
+ifndef CONFIG_SPL_BUILD
COBJS-y += main.o
-COBJS-y += console.o
COBJS-y += command.o
COBJS-y += dlmalloc.o
COBJS-y += exports.o
COBJS-$(CONFIG_SYS_HUSH_PARSER) += hush.o
COBJS-y += image.o
-COBJS-y += memsize.o
COBJS-y += s_record.o
COBJS-$(CONFIG_SERIAL_MULTI) += serial.o
-COBJS-y += stdio.o
COBJS-y += xyzModem.o

# core command
@@ -173,6 +171,11 @@ COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
COBJS-$(CONFIG_MODEM_SUPPORT) += modem.o
COBJS-$(CONFIG_UPDATE_TFTP) += update.o
COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
+endif
+
+COBJS-y += console.o
+COBJS-y += memsize.o
+COBJS-y += stdio.o

COBJS := $(sort $(COBJS-y))
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 0e171b6..1dcc1c7 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -55,7 +55,10 @@ COBJS-$(CONFIG_S3C44B0_SERIAL) += serial_s3c44b0.o
COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
COBJS-$(CONFIG_TEGRA2) += serial_tegra2.o
+
+ifndef CONFIG_SPL_BUILD
COBJS-$(CONFIG_USB_TTY) += usbtty.o
+endif

COBJS := $(sort $(COBJS-y))
SRCS := $(COBJS:.o=.c)
diff --git a/fs/fat/Makefile b/fs/fat/Makefile
index bc45966..93b6f07 100644
--- a/fs/fat/Makefile
+++ b/fs/fat/Makefile
@@ -24,7 +24,11 @@ include $(TOPDIR)/config.mk
LIB = $(obj)libfat.o

AOBJS =
-COBJS-$(CONFIG_CMD_FAT) := fat.o file.o
+COBJS-$(CONFIG_CMD_FAT) := fat.o
+
+ifndef CONFIG_SPL_BUILD
+COBJS-$(CONFIG_CMD_FAT) += file.o
+endif

SRCS := $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
OBJS := $(addprefix $(obj),$(AOBJS) $(COBJS-y))
diff --git a/lib/Makefile b/lib/Makefile
index afa6914..884f64c 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -25,6 +25,7 @@ include $(TOPDIR)/config.mk

LIB = $(obj)libgeneric.o

+ifndef CONFIG_SPL_BUILD
COBJS-$(CONFIG_ADDR_MAP) += addr_map.o
COBJS-$(CONFIG_BZIP2) += bzlib.o
COBJS-$(CONFIG_BZIP2) += bzlib_crctable.o
@@ -35,9 +36,7 @@ COBJS-$(CONFIG_USB_TTY) += circbuf.o
COBJS-y += crc7.o
COBJS-y += crc16.o
COBJS-y += crc32.o
-COBJS-y += ctype.o
COBJS-y += display_options.o
-COBJS-y += div64.o
COBJS-y += errno.o
COBJS-$(CONFIG_GZIP) += gunzip.o
COBJS-y += hashtable.o
@@ -48,11 +47,15 @@ COBJS-y += net_utils.o
COBJS-y += qsort.o
COBJS-$(CONFIG_SHA1) += sha1.o
COBJS-$(CONFIG_SHA256) += sha256.o
-COBJS-y += string.o
COBJS-y += strmhz.o
+COBJS-$(CONFIG_RBTREE) += rbtree.o
+endif
+
+COBJS-y += ctype.o
+COBJS-y += div64.o
+COBJS-y += string.o
COBJS-y += time.o
COBJS-y += vsprintf.o
-COBJS-$(CONFIG_RBTREE) += rbtree.o

COBJS := $(COBJS-y)
SRCS := $(COBJS:.o=.c)
--
1.7.6