summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2022-06-24 12:04:25 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-07-19 17:55:40 +0000
commit05612223ba9bfb08e47b374fc4a81b1e65e5f35e (patch)
treeb4ce3805312d05bae8f7326ec0dae7731542fb1b /Makefile
parentfd972cd0bcf2695949f3f6818f249e532e280695 (diff)
downloadchrome-ec-05612223ba9bfb08e47b374fc4a81b1e65e5f35e.tar.gz
Makefile: Add option to compile with the C standard library
Add the USE_BUILTIN_STDLIB variable, which defaults to 1 and will use the EC standard library implementation (the "builtin" directory). When USE_BUILTIN_STDLIB is set to 0, the toolchain's C standard library will be used instead. BRANCH=none BUG=b:234181908 TEST=./util/compare_build.sh -b all -j 120 => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I63285569205b9c560655dfead6a260c270a92494 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3712035 Reviewed-by: Eric Yilun Lin <yllin@google.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile6
1 files changed, 6 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index cdf926daa8..3e07f151f4 100644
--- a/Makefile
+++ b/Makefile
@@ -268,7 +268,9 @@ include $(BASEDIR)/build.mk
ifneq ($(BASEDIR),$(BDIR))
include $(BDIR)/build.mk
endif
+ifeq ($(USE_BUILTIN_STDLIB), 1)
include builtin/build.mk
+endif
include chip/$(CHIP)/build.mk
include core/$(CORE)/build.mk
include common/build.mk
@@ -308,7 +310,9 @@ ifneq ($(PBDIR),)
all-obj-$(1)+=$(call objs_from_dir_p,$(PBDIR),board-private,$(1))
endif
all-obj-$(1)+=$(call objs_from_dir_p,common,common,$(1))
+ifeq ($(USE_BUILTIN_STDLIB), 1)
all-obj-$(1)+=$(call objs_from_dir_p,builtin,builtin,$(1))
+endif
all-obj-$(1)+=$(call objs_from_dir_p,driver,driver,$(1))
all-obj-$(1)+=$(call objs_from_dir_p,power,power,$(1))
ifdef CTS_MODULE
@@ -355,7 +359,9 @@ dirs=core/$(CORE) chip/$(CHIP) $(BASEDIR) $(BDIR) common fuzz power test \
dirs+= private private-kandou $(PDIR) $(PBDIR)
dirs+=$(shell find common -type d)
dirs+=$(shell find driver -type d)
+ifeq ($(USE_BUILTIN_STDLIB), 1)
dirs+=builtin
+endif
common_dirs=util
ifeq ($(custom-ro_objs-y),)