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



I have a very large code written in fortran 90. The fact that it is written in
fortran 90 has nothing to do with the question. I just mentioned it just in
case there is a fortran 90 specific solution.

The code comes with a makefile. The code contains many

#ifdef
#endif

constructs which are preprocessed by cpp (The C preprocessor). Before
compiling the code I enable/disable some of the macros (defined by #ifdef
#endif constructs) in the makefile and make+run the code. This constitutes
a "test case" for me. The output of the code varies from "test case" to "test
case" (obviously)! So if I want to reproduce a previous "test case", I need
to know which macros were enabled and which macros were disabled during the
preprocessing stage. Currently what I am doing is to create a separate
function containing statements such as

#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. Can the GNU make or any other utility do this kind of
stuff? If not any ideas/suggestions which give functionality close to this?

thanks
raju

--
http://kamaraju.googlepages.com/cornell-bazaar
http://groups.google.com/group/cornell-bazaar/about


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



Relevant Pages

  • Re: Interfacing between Fortran and C - a little utility
    ... have to use these macros for setting up the Fortran-C interface. ... Create the program with the Fortran and C compilers you want to use. ... #ifdef FOR_DBL_UNDERSCORE ...
    (comp.lang.fortran)
  • Re: utrace comments
    ... of single-step on machines/configurations where single-step is always ... It is not mentioned in Documentation/CodingStyle, and the existing kernel ... I don not think these kinds of macros are a very good idea. ...
    (Linux-Kernel)
  • [PATCH] standardise macro for module init & exit
    ... In kernel source code, ... module_exit macros were used a little nonstandardly ... I removed the last semicolon when the module_init and ...
    (Linux-Kernel)
  • Re: RosAsm is a loser
    ... By the way, ass-hole, here is a statement taken from a RosAsm ... Message ' Conditional macros Test:', ... " does not support width format option" ...
    (alt.lang.asm)
  • [PATCH] Handcrafted MIN/MAX removal
    ... Cleanups done to use min/max macros from kernel.h. ... struct seeprom_descriptor; ... Mask of relevant bits. ...
    (Linux-Kernel)