From 3b9199d5d45cb42c3ae30386e7bc3e7f4caf9583 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Mon, 18 May 2015 09:00:49 -0400 Subject: [PATCH] Kbuild: optionally build minimal c library Change-Id: Ib949ec199ba0dec3c5a1a1a6c9fbf355efcc8104 Signed-off-by: Anas Nashif --- Kconfig | 7 +++++++ Makefile | 12 ++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Kconfig b/Kconfig index 3896eb16f4c..58e0dbe6135 100644 --- a/Kconfig +++ b/Kconfig @@ -17,6 +17,13 @@ config CROSS_COMPILE directory to select the cross-compiler automatically. endmenu +config MINIMAL_LIBC + bool + prompt "Build minimal c library" + default y + help + Build integrated minimal c library. + menu "Debugging Options" config STDOUT_CONSOLE diff --git a/Makefile b/Makefile index 162cdb846d5..df4259cc9d5 100644 --- a/Makefile +++ b/Makefile @@ -385,7 +385,6 @@ CFLAGS_KERNEL = AFLAGS_KERNEL = CFLAGS_GCOV = -fprofile-arcs -ftest-coverage -STDINCLUDE := -I$(srctree)/lib/libc/minimal/include # Use USERINCLUDE when you must reference the UAPI directories only. USERINCLUDE := -include $(CURDIR)/include/generated/autoconf.h @@ -575,11 +574,9 @@ scripts: scripts_basic include/config/auto.conf include/config/tristate.conf \ asm-generic $(Q)$(MAKE) $(build)=$(@) -# Objects we will link into tinymountain / subdirs we need to visit -KLIBC_DIR := lib/libc/minimal + core-y := arch/ kernel/ misc/ net/ bsp-y := drivers/ -libs-y := $(KLIBC_DIR)/ ifneq ($(strip $(PROJECT)),) core-y += $(SOURCE_DIR) @@ -626,6 +623,13 @@ else include/config/auto.conf: ; endif # $(dot-config) +ifdef CONFIG_MINIMAL_LIBC +# Objects we will link into tinymountain / subdirs we need to visit +KLIBC_DIR := lib/libc/minimal +libs-y := $(KLIBC_DIR)/ +TIMOINCLUDE += -I$(srctree)/lib/libc/minimal/include +endif + #File that includes all prepare special embedded architecture targets. include $(srctree)/scripts/Makefile.preparch sinclude $(srctree)/scripts/Makefile.$(SRCARCH).preparch