From 8d00ec5c4ee87717f585e4240d981ed1cbe8062c Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Sun, 2 Aug 2015 09:38:41 -0400 Subject: [PATCH] build: build libc as object, not kbuild library (lib.a) The way we build the libc files is not a real library that can be used as a libc and makes managing the source files a bit difficult, so lets revert back to building the c function files like everything else in the system to avoid any confusion. Change-Id: I4e998e37bc376522fe253c4aefefe7804597f0f2 Signed-off-by: Anas Nashif --- Makefile | 8 ++------ lib/Makefile | 1 + lib/libc/Makefile | 4 ++-- lib/libc/minimal/Makefile | 6 +----- lib/libc/minimal/source/Makefile | 2 ++ lib/libc/minimal/source/stdout/Makefile | 2 ++ lib/libc/minimal/source/string/Makefile | 1 + lib/libc/newlib/Makefile | 2 +- 8 files changed, 12 insertions(+), 14 deletions(-) create mode 100644 lib/Makefile create mode 100644 lib/libc/minimal/source/Makefile create mode 100644 lib/libc/minimal/source/stdout/Makefile create mode 100644 lib/libc/minimal/source/string/Makefile diff --git a/Makefile b/Makefile index 12f8675f7e113..22e5113d06bd9 100644 --- a/Makefile +++ b/Makefile @@ -519,8 +519,8 @@ scripts: scripts_basic include/config/auto.conf include/config/tristate.conf $(Q)$(MAKE) $(build)=$(@) -core-y := arch/ kernel/ misc/ net/ -platform-y := drivers/ +core-y := lib/ arch/ kernel/ misc/ net/ +platform-y := drivers/ ifneq ($(strip $(PROJECT)),) core-y += $(SOURCE_DIR) @@ -551,14 +551,10 @@ include/config/auto.conf: ; endif # $(dot-config) ifdef CONFIG_MINIMAL_LIBC -# Objects we will link into the kernel / subdirs we need to visit -KLIBC_DIR := lib/libc/minimal -libs-y := $(KLIBC_DIR)/ ZEPHYRINCLUDE += -I$(srctree)/lib/libc/minimal/include endif ifdef CONFIG_TOOLCHAIN_NEWLIB -libs-y += lib/libc/newlib/ ALL_LIBS += c m endif diff --git a/lib/Makefile b/lib/Makefile new file mode 100644 index 0000000000000..7a484c417c2fe --- /dev/null +++ b/lib/Makefile @@ -0,0 +1 @@ +obj-y := libc/ diff --git a/lib/libc/Makefile b/lib/libc/Makefile index 2e5063bfea3f3..1546361a3a663 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -1,2 +1,2 @@ -libs-$(CONFIG_MINIMAL_LIBC) += minimal/ -libs-$(CONFIG_NEWLIB) += newlib/ +obj-$(CONFIG_MINIMAL_LIBC) += minimal/ +obj-$(CONFIG_NEWLIB) += newlib/ diff --git a/lib/libc/minimal/Makefile b/lib/libc/minimal/Makefile index 8888360ebdbb7..2049e9782f9de 100644 --- a/lib/libc/minimal/Makefile +++ b/lib/libc/minimal/Makefile @@ -1,5 +1 @@ -lib-y := source/stdout/fprintf.o -lib-y += source/stdout/prf.o -lib-y += source/stdout/sprintf.o -lib-y += source/stdout/stdout_console.o -lib-y += source/string/string.o +obj-y := source/ diff --git a/lib/libc/minimal/source/Makefile b/lib/libc/minimal/source/Makefile new file mode 100644 index 0000000000000..2a7d847fb71ca --- /dev/null +++ b/lib/libc/minimal/source/Makefile @@ -0,0 +1,2 @@ +obj-y := stdout/ +obj-y += string/ diff --git a/lib/libc/minimal/source/stdout/Makefile b/lib/libc/minimal/source/stdout/Makefile new file mode 100644 index 0000000000000..d52ca6c36c696 --- /dev/null +++ b/lib/libc/minimal/source/stdout/Makefile @@ -0,0 +1,2 @@ + +obj-y = fprintf.o prf.o sprintf.o stdout_console.o diff --git a/lib/libc/minimal/source/string/Makefile b/lib/libc/minimal/source/string/Makefile new file mode 100644 index 0000000000000..e5d4d36a81b62 --- /dev/null +++ b/lib/libc/minimal/source/string/Makefile @@ -0,0 +1 @@ +obj-y := string.o diff --git a/lib/libc/newlib/Makefile b/lib/libc/newlib/Makefile index a4d561090b905..34ea9c1f2b8bf 100644 --- a/lib/libc/newlib/Makefile +++ b/lib/libc/newlib/Makefile @@ -1 +1 @@ -lib-y := libc-hooks.o +obj-y := libc-hooks.o