0

I am reading linux kernel source code recently.

The source code use too many Macros to divide files, functions, variables.

But a lot of these Macro are ignored by me. The files, functions, variables depend on the Macro I ignore create too much disturbance.

Is there any method to remove all these files, functions, variables depend on Undefined Macros in the source project?

Thanks a lot.

  • Why do you want to remove all this... The source code contains them for a good reason (make the kernel working in all configurations). If you want to do some static analysis of the kernel consider also http://coccinelle.lip6.fr/ & http://gcc-melt.org/ – Basile Starynkevitch Aug 15 '13 at 03:47
  • 1
    You can run gcc preprocessor (`gcc -E`) to process macros. – Eddy_Em Aug 15 '13 at 04:26
  • Possible [duplicate](http://stackoverflow.com/questions/3916979/gcc-preprocessor) – Eddy_Em Aug 15 '13 at 04:33

1 Answers1

0
make dir/file.i  - Build the form of preprocessed source code only

e.g.

make kernel/locking/spinlock.i
cat kernel/locking/spinlock.i
wenjianhn
  • 438
  • 3
  • 7