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

[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



Reply to: