Instructions for Macros, (C++/F77 preprocessor, invocation)
I need a set of instructions for setting up some macros to allow for more than one version of my application (different output, licensed/unlicensed ect). I need to be able to define or undefine when I compile and also need to control these options with command line arguments when calling make. I need examples of what to add to the src (ifdef, .h files, etc), changes for the make file, and how to include the proper arguments when calling make.
Some of the code is in C++ and some is in Fortran77. The code is compiled and built with g++ and g77 under cygwin using a single make file. I don't know if g77 has the same ifdef features as gcc/g++. If you want to bid on instructions for just the C++ code, that is fine, just specify. I know this is fairly straight forward and that it can be managed with some macros in the code, some conditionals in the make, and -D/-U in the shell lines, but I just don't have time at the moment to work it all out.
In my f77 code, I need to be able to compile versions that have different forms of the program output. If I can specify blocks of code that will be included (compiled) in some cases and not in others, that would give me what I need. I need code samples for the f77 src, the makefile, and the command line arguments that call make.
In my C++ code, I need to be able to skip blocks of code in some cases and also to build with a different rule depending on weather or not a block of code is included or not. For example, a block of code may include a call to a function in a different object file or library. If that block of code is not compiled, then a different rule should be used that doesn't link to the unnecessary object file. In the make, I would probably handle this with a conditional containing two different rules and pass in the tested value, but there may be other ways to manage this.