Makefile.ide: Generalize to apply to more targets
Makefile.ide: Generalize to apply to more targets

It is important to note that this CL moves the format
of the compile commands json away from the simplified
commands that bear outputs. It instead inserts the
arguments that we actually use for compilation.

One caveat with this approach is that we still don't
capture special modified args that are associated with
a specific build target, like the following:

$(out)/RW/common/blah.o: CFLAGS += -g

This is because our compile commands json targets
will not match this rule.

This is benchmarked using the following command:
> time make ide-compile-cmds-hatch
Note that the extra $(shell sed ...) invocation
slows the benchmark down by about 1sec.

BRANCH=none
BUG=b:250077363,b:236389226,b:176500425
TEST=# bloonchipper doesn't work without c++ support
     make ide-compile-cmds-hatch -j
TEST=# Board kukui_scp only has an RW image.
     make ide-compile-cmds-kukui_scp
     # Only an RW compile_commands.json should be created.

Signed-off-by: Craig Hesling <383db090fd8ef907a606ac8a9eccd2962bc489cf@chromium.org>
Change-Id: I0a3542bbd5478311e8f2b253f88c936915ed5032
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3866112
Reviewed-by: Abe Levkoy <2e1ad7039298f93262cf06bbb457275fb3e2ecb5@chromium.org>
Reviewed-by: Andrea Grandi <f017805e76e0e7a74072a3bac1b6e29e65eedeab@google.com>

coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec