silverfrost Site Admin

Joined: 29 Nov 2006 Posts: 191 Location: Manchester
|
Posted: Tue Sep 07, 2004 9:54 pm Post subject: Compiling multiple source files using batch files |
|
|
Summary
This article outlines a simple method of developing a project using DOS batch files allowing for global and non-global compiler switches.
Solution
This method uses two batch files. One called comp.bat, containing the one line:
Code: | @ECHO OFF
ftn95 %1 %2 %3 %4 %5 %6 %7 %8 %9 [plus any global options e.g. /CHECK] |
and another, called compall.bat, which is simply a list of the files to be compiled using comp.bat thus:
Code: | @ECHO OFF
comp file1.f95
comp file2.f95
comp file3.f95 [plus options relating to a particular file e.g. /INTL]
comp file4.f95 |
An easy way to create this file is to type
Code: | dir *.for /b > compall.bat |
then edit the newly created compall.bat and put 'comp' before each filename in the file.
This will give you total control over the switches and options applied to the compilation of each of the files.
To compile all your code you can now simply type COMPALL at the MS-DOS Command Prompt
Note that you will still need to link the object code produced from the compilation. An easy way to do this is to use a SLINK command script. See the Users Guide for more information on this. |
|