简体   繁体   中英

how to find out preprocessors defined in linux driver

Is there a way to find out what preprocessors are defined in your linux driver/kernel code when building? I could use a text search tool (I actually did), but I inherit a big tree of linux driver/kernel code. It's so big that my text search tool gets an error when I search for a certain preprocessor in the whole code tree.

gcc can dump all defined macros to stdout in preprocessing mode:

gcc -E -dM foo.c

This includes any macros predefined by the compiler, which can be a little annoying. In any case, you should be able to hack up your Makefile to contain a target that dumps this information to files for each compilation unit.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM