macros and defines used in file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
The Story:I have a large project (C++). It contains about 200 shared files (thatis - code shared by all of components) and 6 components (in fact muchmore, but only 6 are compiled on *nix systems). This shared code isshared only on "file level", as each components requires them to becompiled with flag "COMPONENT_FLAG" set to different value, i.e.ComponentNumberOne is compiled with-DCOMPONENT_NAME=COMPONENT_NUMBER_ONE passed on command line etc. Ascompilation of 200 files takes some time, especially on oldermachines, and is repeated for each component, there are effectively1.2k files to compile.
The Problem:I'm trying to find files that don't depend on value of a macro/definedvalue. That is, I'd like to find a way to divide my files in two sets.Files in one set do not depend on hypothetical "COMPONENT_NAME"#define, and those in other set do. I tried to do so by setting"COMPONENT_NAME" to some "strange" value, but it's frequently used in"#ifdef" directives, where almost anything goes, so this is no good.Grepping sources also isn't viable, as those directives frequentlycontrol included headers.
So, my question is - is there a way to force cpp or gcc (As I believegcc has internal preprocessor, which can do a little more thatstandalone cpp?) to show defines and macros used during filepreprocessing, even those, who aren't used because '#if' branchingforbade it? Or is there any other, clever method to do what I want?(Clever as in "not by hand" :] ).
TIA,-- Jędrzej Dudkiewicz
I really hate this damn machine, I wish that they would sell it.It never does just what I want, but only what I tell it.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux