Makefiles on Windows
When using the make command to build your project, beLow can generate a compilation database file using the below-make-intercept tool (also available as a CLI tool when installing beLow).
A fake make command is injected while running your build script; it instruments calls to make to run them in dry-run mode, parses the log and injects a new log so a compilation database can be generated.
To work with make, give your make command as the Build script when asked.
Generating compile commands from a make command is only possible when run from a clean state. Always provide a Clean script if you can, or ensure your project is in a clean state before running the intercept.
If your call to make is wrapped by a script or a command that calls make by its absolute path or uses path injection, this method will not work.
Example: If you use STM32CubeIDE and build via the stm32cubeidec CLI tool, this method will not work because that tool calls make using its own injected make path. See the STM32CubeIDE compatibility page for more information: https://docs.wedolow.com/below-technical-documentation/compatibility-guide/stm32cubeide-on-windows
As stated above, you can also directly use the below-make-intercept tool to generate a compilation database outside of beLow (in this case, use local mode). Use it to check whether beLow can generate a compilation database for your make command.
Example: writing compile_commands.json
To generate a compile_commands.json file:
make clean
below-make-intercept "make all" > compile_commands.jsonOn Windows, to ensure compile_commands.json is encoded in a neutral encoding (not depending on system language), prefer this PowerShell form:
make clean
below-make-intercept "make all" | Out-File -Encoding ASCII -FilePath .\compile_commands.jsonIf beLow cannot generate compile_commands.json automatically from your build scripts for any reason, you may use below-make-intercept directly in the Configure script.
