| commit | ade2ea2b6bd5f2e5a49265f0206f69b67f5c0a53 | [log] [tgz] |
|---|---|---|
| author | Gwendal Grignou <gwendal@chromium.org> | Sat Feb 01 01:29:36 2025 |
| committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Feb 03 22:50:31 2025 |
| tree | fb4b8cc5cd3d8cf9459bc275d0ce118b5ca1ad6c | |
| parent | fc2d277abe411700f77f377ac7266849db00d453 [diff] |
FROMLIST: Makefile: fix conditional around sparse
sparse would always be invoked, since `ifdef C` is always true afet `C ?= xx`.
Instead, use ifeq to check if C is 0 or 1.
Fixes f884bfe684f ("mmc-utils: Make functions static for local scope enforcement")
(am from https://patchwork.kernel.org/patch/13956017/)
(also found at https://lore.kernel.org/r/20250201012936.2816101-1-gwendal@chromium.org)
BUG=b:393646176
TEST=Check with emake, emake C=1, emake C=0 that sparse not used in the
later invocation.
Change-Id: I29488386a4b1e5a32de4e174eb1289d4a8671fc4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/mmc-utils/+/6222513
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Commit-Queue: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Jordan Abrahams-Whitehead <ajordanr@google.com>
diff --git a/Makefile b/Makefile index 06ae0f7..c0284bb 100644 --- a/Makefile +++ b/Makefile
@@ -27,14 +27,14 @@ # make C=1 to enable sparse - default C ?= 1 -ifdef C +ifeq "$(C)" "1" check = sparse $(CHECKFLAGS) $(AM_CFLAGS) endif all: $(progs) .c.o: -ifdef C +ifeq "$(C)" "1" $(check) $< endif $(CC) $(CPPFLAGS) $(CFLAGS) $(DEPFLAGS) -c $< -o $@