I'm searching for a preprocessor which allows for partial preprocessing of C source files. What I want to do is to skip certain or all #include and to define some macros on the command line (or a separate file), the preprocessor then should only process what I specified and ignore the rest.
Here is an example of what I want to do:
#define FOO
#ifdef FOO
/* FOO */
#endif
#ifdef BAR
/* BAR */
#endif
should be translated into
/* FOO */
#ifdef BAR
/* BAR */
#endif
Some time ago at my previous job I needed a similar preprocessor and I think that I found a link to a standalone preprocessor here on stackoverflow, however after an hour of searching the web I gave up.