summaryrefslogtreecommitdiff
path: root/Makefile.ide
Commit message (Collapse)AuthorAgeFilesLines
* Makefile.ide: Simplify cmd_json_list and std var formatCraig Hesling2022-10-111-6/+5
| | | | | | | | | | | | | 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>
* Makefile.ide: Add support for utilsCraig Hesling2022-10-051-9/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for utils into both the RO/compile_commands.json and the RW/compile_commands.json. Additionally, it adds a dedicated util/compile_commands.json to the build directory. Usages: > make all-ide-compile-cmds -j$(nproc) Creates R[WO]/compile_commands.json and util/compile_commands.json for all boards. > make ide-compile-cmds-$BOARD -j Creates R[WO]/compile_commands.json and util/compile_commands.json > make BOARD=$BOARD build/$BOARD/util/compile_commands.json Creates just the util/compile_commands.json using the minimal number of JSON conversions. BRANCH=none BUG=b:250077363,b:236389226,b:176500425 TEST=make ide-compile-cmds-bloonchipper -j ln -sf build/bloonchipper/RW/compile_commands.json # Ensure that the entry for ectool.cc is correct in the json file. # Ensure that lang support works in ectool.cc and clangd doesn't # report "ASTWorker building file ... with command inferred from ...". # Ensure that the command reported in the clangd output is correct # for an x86 based machine. TEST=make ide-compile-cmds-hatch -j # Do the same check as above. TEST=make all-ide-compile-cmds -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. TEST=make BOARD=hatch build/hatch/util/compile_commands.json # Should produce the above compile_commands.json for # just the utils of hatch. Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I7c2ac0ee9de2397abae296a30c3794da1676030e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3926090 Reviewed-by: Andrea Grandi <agrandi@google.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* Makefile.ide: Add c++ supportCraig Hesling2022-10-051-0/+5
| | | | | | | | | | | | | | | | BRANCH=none BUG=b:250077363,b:236389226,b:176500425 TEST=make ide-compile-cmds-bloonchipper -j TEST=make all-ide-compile-cmds -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 <hesling@chromium.org> Change-Id: I90abed48bef4db848bf7678ca49a7d2b882d9051 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3926089 Reviewed-by: Andrea Grandi <agrandi@google.com> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* Makefile.ide: Generalize to apply to more targetsCraig Hesling2022-10-051-19/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <hesling@chromium.org> Change-Id: I0a3542bbd5478311e8f2b253f88c936915ed5032 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3866112 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Andrea Grandi <agrandi@google.com>
* Update license boilerplate text in source code filesMike Frysinger2022-09-121-1/+1
| | | | | | | | | | | | | | | Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BRANCH=none BUG=chromium:1098010 TEST=`repo upload` works Change-Id: Icd3a1723c20595356af83d190b2c6a9078b3013b Signed-off-by: Mike Frysinger <vapier@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3891203 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* make: Add ide-compile-cmds targets suiteCraig Hesling2022-08-261-0/+75
This suite of targets generates compile_commands.json for specific boards/images. It places the output file under build/$BOARD/{RO,RW}/compile_commands.json. Targets: * all-ide-compile-cmds Generates the compile_commands for all boards * ide-compile-cmds BOARD=$BOARD Generates the compile_commands for BOARD * ide-compile-cmds-$BOARD Generates the compile_commands for BOARD Cons: * Doesn't include commands for any tests or utils * Can't easily capture build commands for cryptoc, since it invokes cryptoc's makefile. BRANCH=none BUG=b:236389226,b:176500425 TEST=make all-ide-compile-cmds -j TEST=make ide-compile-cmds-bloonchipper -j less build/bloonchipper/RW/compile_commands.json TEST=make BOARD=bloonchipper ide-compile-cmds TEST=# Board kukui_scp only has an RW image. make BOARD=kukui_scp ide-compile-cmds # Only an RW compile_commands.json should be created. TEST=make BOARD=hatch build/hatch/RO/compile_commands.json clangd --check=build/hatch/RO/compile_commands.json Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I008648e84da70149425f8a36f818b3953c7fa36d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3826375 Reviewed-by: Andrea Grandi <agrandi@google.com>