How to do make debugging

less than 1 minute read

Verbose output

When writing make rules, we use make V=1 to see the commands being executed. for example, when make kernel image for raspberry pi, the output will be like this:

$ ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make zImage V=1

verbose mode

Shell xtrace mode

Another option is to use shell xtrace mode, this will show you more detailed info than verbose mode:

$ ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make zImage SHELL='sh -x'

Build AOSP

In case of you are working on aosp, try to use showcommands to see what happens.

Dummy make

Use make -n or make --dry-run to do nothing but show the making process.

References