summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYilun Lin <yllin@google.com>2019-05-24 11:18:26 +0800
committerchrome-bot <chrome-bot@chromium.org>2019-06-03 01:11:04 -0700
commit49436b18d2a77b994fe76d8c2f070000e2cdb58a (patch)
tree327729dead0cf855fca17c067d499c66773ebe06 /util
parent7ccb50f4352309813cffd98460bd7dcb48d4657f (diff)
downloadchrome-ec-49436b18d2a77b994fe76d8c2f070000e2cdb58a.tar.gz
Makefile: Replace flag -DX with -DX= to be supported by IS_ENABLED().
IS_ENABLED works for an empty-string-defined macro. However, -D options default to define the macro to 1. This CL forces those macros, such as BOARD_* CHIP_*, CORE_*, CHIP_VARIANT_* and CHIP_FAMILIY_*, to be defined as an empty string, so that it can be supported by IS_ENABLED macro. TEST=use if(IS_ENABLED(BOARD_KRANE)) and see compilation success. TEST=compares build directory w/ and w/o this CL, and see the .smap are the same: ls build/*/*/ec.*.smap | sed -e 's|build/||' | \ xargs -I{} diff -u -a build/{} build.new/{} BUG=none BRANCH=None Change-Id: I96e2aa1cb5f3369e5e445a674595a9234f26707a Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1627840 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'util')
-rw-r--r--util/build.mk6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/build.mk b/util/build.mk
index 4fb6b7e1f0..3238fb749a 100644
--- a/util/build.mk
+++ b/util/build.mk
@@ -52,7 +52,7 @@ $(out)/util/genvif: $(genvif-pd-objs) board/$(BOARD)/board.h \
$(out)/util/genvif: BUILD_LDFLAGS+=$(genvif-pd-objs) -flto
STANDALONE_FLAGS=-ffreestanding -fno-builtin -nostdinc \
- -Ibuiltin/ -D"__keep= " -DVIF_BUILD
+ -Ibuiltin/ -D"__keep= " -DVIF_BUILD=$(EMPTY)
$(out)/util/%/usb_pd_policy.o: %/usb_pd_policy.c
-@ mkdir -p $(@D)
@@ -63,7 +63,7 @@ ifneq ($(CONFIG_BOOTBLOCK),)
build-util-bin += gen_emmc_transfer_data
# Bootblock is only packed in RO image.
-$(out)/util/gen_emmc_transfer_data: BUILD_LDFLAGS += -DSECTION_IS_RO
+$(out)/util/gen_emmc_transfer_data: BUILD_LDFLAGS += -DSECTION_IS_RO=$(EMPTY)
endif # CONFIG_BOOTBLOCK
ifneq ($(CONFIG_IPI),)
@@ -78,7 +78,7 @@ ifneq ($(CONFIG_TOUCHPAD_HASH_FW),)
build-util-bin += gen_touchpad_hash
# Assume RW section (touchpad FW must be identical for both RO+RW)
-$(out)/util/gen_touchpad_hash: BUILD_LDFLAGS += -DSECTION_IS_RW
+$(out)/util/gen_touchpad_hash: BUILD_LDFLAGS += -DSECTION_IS_RW=$(EMPTY)
OPENSSL_CFLAGS := $(shell $(PKG_CONFIG) --libs openssl)
OPENSSL_LDFLAGS := $(shell $(PKG_CONFIG) --libs openssl)