PDA

View Full Version : How to run preprocessor only?! (HELP!)


diglan
2008.07.03, 04:36 AM
Hi, guys!
I've been writing some special tool for making search through obective-c source code.
And now, I've got a problem with compilation stages.
There is need to preprocess whole source code at the first time before searching, and which takes modified modules only.

Well, it's like to run my own script instead gcc during building project, so that I would insert -E flag in gcc calling.
Thank you!
Sorry for my English.

Chris Burkhardt
2008.07.05, 08:14 PM
You can invoke the GNU C preprocessor with the cpp command.

http://gcc.gnu.org/onlinedocs/cpp/

Is that what you are asking about?

Skorche
2008.07.06, 12:20 AM
From the GCC man page:

-E Stop after the preprocessing stage; do not run the compiler proper.
The output is in the form of preprocessed source code, which is
sent to the standard output.

Input files which don't require preprocessing are ignored.