From 93929652936de91fb7bbc20fe4c959425327d585 Mon Sep 17 00:00:00 2001 From: Craig Hesling Date: Wed, 5 Oct 2022 15:05:24 -0400 Subject: 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 Change-Id: Ied9b16e543f1d8113b7c0535d7aaa397518fa3ec Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3931850 Reviewed-by: Abe Levkoy Reviewed-by: Andrea Grandi --- Makefile.ide | 11 +++++------ 1 file 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' >>$@ ; -- cgit v1.2.1