Re: [OT] automatically write enabled macros of the makefile into a file



On Wed, 30 Aug 2006 18:14:33 -0400, Kamaraju Kusumanchi wrote:

The code comes with a makefile. The code contains many

#ifdef
#endif

constructs which are preprocessed by cpp (The C preprocessor). ...

#ifdef construct1
write(10,*) 'construct1 is enabled'
#else
write(10,*) 'construct1 is disabled'
#endif

But this is very time consuming to do for all of the macros. Now it would
be much easier, if, before preprocessing the code, there is a way to
automatically write a file which tells which macros were enabled and which
macros were disabled.

Instead of writing them at each individual places, why don't you write
just one output line at a central place. Say right at the beging of
program excution, you put:

write(10,*) 'Compiled with construct1=${construct1} construct1=${construct2}...'

The ${construct1} & ${construct2} should be populated by make, before cpp
see them...

HTH

tong




--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages