Well, some steps to the solution.
First, you can use compiler commands with
make KBUILD_VERBOSE=1 | tee build.log
grep '^ gcc' build.log
Currently, I select only one gcc command line for further steps. For example, the kernel / kmod.c assembly looks like this:
gcc <LIST OF MANY OPTIONS> -c -o kernel/kmod.o kernel/kmod.c
-c, -o ... -E, . -fdirectives-only -undef , GNU. -nostdinc, c, make .
, , . , grep, : grep -v '#include' kernel/kmod.c. : autoconf.h Makefile. , , #ifdef CONFIG_... .
#define autoconf.h grep -v '^#'.
:
grep -v '#include' kernel/kmod.c | gcc -E -fdirectives-only -undef <ORIGINAL KERNEL BUILD GCC OPTIONS WITHOUT -c AND -o ...> - |grep -v '^#'
/kmod.c, , kmod.o.
: ? , , ?