http://kernelnewbies.org/FAQ/KernelCrossCompilation


Generating Preprocessed files

Yet another facet of kernel compilation is that it helps you to generate preprocessed files. This is extremely useful when you suspect something could be wrong with your macros. In 2.4 days, we could get the command line and add -c option and redirect the result of gcc preprocessor to a file. In 2.6, it is built into the kernel. Here is how.

Say, I want to generate the preprocessor output for kernel/dma.c,

[...@kartel /space/kernel.org/linux-exp]$ make kernel/dma.i
  CHK     include/linux/version.h
  CHK     include/linux/utsrelease.h
  CALL    scripts/checksyscalls.sh
  CPP     kernel/dma.i

Done. open kernel/dma.i to see what preprocessor did to dma.c 

This is available for a module (not a part of kernel) too,

[r...@hydra1 linuxdriver]# make -C /lib/modules/2.6.18-92.el5/build/ M=$(pwd)/src  hxge_main.i
make: Entering directory `/usr/src/kernels/2.6.18-92.el5-x86_64'
  CPP [M] /root/hydra-src/linuxdriver/src/hxge_main.i
make: Leaving directory `/usr/src/kernels/2.6.18-92.el5-x86_64'

Reply via email to