forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Compiling multiple source files using batch files

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> KBase
View previous topic :: View next topic  
Author Message
silverfrost
Site Admin


Joined: 29 Nov 2006
Posts: 191
Location: Manchester

PostPosted: Tue Sep 07, 2004 9:54 pm    Post subject: Compiling multiple source files using batch files Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> KBase All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group