I have a large header file which has many sections that are included or omitted depending on whether certain names are defined in the file. For example lines like-
\#define A
\#define B 2
...
\#ifdef A
...
...
\#endif
...
\#ifdef B
...
\#ifndef A
...
\#endif
\#endif
I want to produce a file in which all sections that would be omitted, because of the names that are and are not defined, would be removed. I also want to remove single and multi-line comments from the output file.
I have tried
gcc -E Configuration.h > Configuration.i
but this only produces output such as-
1 "Configuration.h"
1 "built-in" 1
1 "built-in" 3
341 "built-in" 3
1 "command line" 1
1 "built-in" 2
1 "Configuration.h" 2
(I the above text each line is actually preceded by a hash character and the words built-in and command line are enclosed in angle brackets, but typing these characters in my message produces strange effects.)
Any suggestions as to how I might do what I want. I would prefer not to have to write code or script to do this.
gcccommand should work, but doesn't? In what way does your existing command fail?