I am working on a large project using C language, which has a lot of preprocessor macros: #ifdef/#if. The macros are defined in makefile.
In order to get the clean code, I modified the makefile to use "gcc -E". But the gcc preprocessor would expand the included header file as well, which I do not expect.
Is there any method to get rid of the #ifdef/#if without expand the included header files? I searched GCC options but not find an answer yet.
An example:
#include "a.h"
#ifdef ABC
func()
#else
func(a)
#endif
{
...
}
In makefile, this source is compiled with -DABC, I am looking for a method to change the file to:
#include "a.h"
func()
{
...
}