summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Hesling <hesling@chromium.org>2022-10-05 15:05:24 -0400
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-10-11 18:51:01 +0000
commit93929652936de91fb7bbc20fe4c959425327d585 (patch)
tree177558cda488be104ddd7642c5d48ca14ce3814f
parent3fe8b5c5f1acec9fb913b8be1bc7264e0625c527 (diff)
downloadchrome-ec-93929652936de91fb7bbc20fe4c959425327d585.tar.gz
Makefile.ide: Simplify cmd_json_list and std var format
BRANCH=none BUG=b:236389226,b:176500425 TEST=./util/clangd_config.py bloonchipper TEST=make -j16 all-ide-compile-cmds Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Ied9b16e543f1d8113b7c0535d7aaa397518fa3ec Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3931850 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Andrea Grandi <agrandi@google.com>
-rw-r--r--Makefile.ide11
1 files changed, 5 insertions, 6 deletions
diff --git a/Makefile.ide b/Makefile.ide
index 5f11f2c725..a87ea0b809 100644
--- a/Makefile.ide
+++ b/Makefile.ide
@@ -15,10 +15,10 @@
# If env EXTERNAL_TRUNK_PATH is defined, we use this to build the
# absolute path to the ec directory. Otherwise, we just take the abspath of ".".
-ide_ec_path_ext = \
+ide-ec-path-ext = \
$(if $(EXTERNAL_TRUNK_PATH),$(EXTERNAL_TRUNK_PATH)/src/platform/ec)
-ide_ec_path_abs = $(abspath .)
-ide_ec_path = $(or $(ide_ec_path_ext),$(ide_ec_path_abs))
+ide-ec-path-abs = $(abspath .)
+ide-ec-path = $(or $(ide-ec-path-ext),$(ide-ec-path-abs))
# Clang doesn't support these GCC options.
ide-filters = -mno-sched-prolog -fconserve-stack
@@ -82,8 +82,7 @@ $(out)/util/compile_commands.json: $(ide-utils)
ide-comma = ,
ide-space = $() $()
ide-esc-quoted = $(patsubst %,\"%\",$(1))
-ide-comma-sep = $(subst $(ide-space),$(ide-comma)$(ide-space),$(ide-esc-quoted))
-cmd_json_list = $(ide-comma-sep)
+cmd_json_list = $(subst $(ide-space),$(ide-comma)$(ide-space),$(ide-esc-quoted))
# Replace any ".compile_cmd.json" with ".o" and filter out $(ide-filters) words.
# The replace is needed because we are invoking build commands from within our
@@ -108,7 +107,7 @@ cmd_to_compile_cmd_json = \
printf ' %s\n' \
$(call cmd_json_list,$(call cmd_rep_filter,$(3),$(4))) >>$@ ;\
printf ' ],\n' >>$@ ;\
- printf ' "directory": "$(ide_ec_path)",\n' >>$@ ;\
+ printf ' "directory": "$(ide-ec-path)",\n' >>$@ ;\
printf ' "file": "$(5)"\n' >>$@ ;\
printf '}\n' >>$@ ;