Hello,
in a current project, I have two groups of source files:
- Group A files must be pre-processed with an external preprocessor before being compiled and linked.
- Group B files will be compiled and linked just like normal.
It is important, however, to save the pre-processed files under new filenames, as the original files must be kept.
So, for a single Group A file arclen.for, I would do:
fcomp = c:\\Program Files (x86)\\FTN95\\ftn95
fpp = c:\\Program Files (x86)\\Intel\\Compiler\\11.1\\065\\bin\\intel64\\fpp
arclen__PP.for : arclen.for
$(fpp) $(fppargs) /P arclen.for arclen__PP.for
arclen__PP.obj : arclen__PP.for
$(fcomp) arclen__PP.for $(fd)
with fppargs, fd being some fixed parameters for compiler/preprocessor.
But since I need many Group A files to be pre-processed, I would need an automated way to specify input and output filenames for the preprocessor and hand them on to the compiler.
I tried doing things such as
ppedfiles : $(ppfiles)
$(foreach file,$(ppfiles),$(fpp) $(fppargs) /P $(file) $(file)__PP)
but it didn't work.
I'm new to makefiles so I'd gladly appreciate some help.
*** Note: I know that ftn95 can pre-process, too (/CFPP), but it doesn't support all the options I need.
To be more specific, I need to handle
#ifdef __INTEL_
#define dot(a,b,n) ddot(n,a,1,b,1)
#endif
in a number of source files, but the Ftn95 pre-processor doesn't like the second line of this, even if the whole block should be omitted anyway, as it is only relevant when using the Intel compiler.