Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Fortran Programming Language

make


Hello,

I never have to use MAKE. In all the documentation I checked it is
assumed the the reader knows how to use it.
I feel stupid but I have to ask:

How to use MAKE? I understand it works like a script but:

1. Does it work only in a DOS window (i.e. have to use 'cmd' and
navigate to the directory where the MAKE file is)
2. what is the syntax for the  command? (i.e. MAKE MAKE_FILE ? - tried
that and it does not work)

Thanks

Tuli

The multiple incompatible and no longer supported kinds of MAKE for
Windows are designed to make you feel stupid.  The way out of that is to
use gnu make http://www.gnu.org/software/make/  e.g. as supplied by
cygwin http://sourceware.redhat.com/cygwin/
but it is still a little more complicated to use with typical Windows
Fortran compilers.  There are multiple schools of thought on ways to
accommodate Windows Fortrans in make.
While gui style make applications for Windows are available at a price,
the more widespread ones work only under text shells, with sh
compatibility conferring a big advantage over Windows cmd shell.
On Mar 21, 7:39 am, "tuli" <tuli.herscov@gmail.com> wrote:

> Hello,

> I never have to use MAKE. In all the documentation I checked it is
> assumed the the reader knows how to use it.
> I feel stupid but I have to ask:

> How to use MAKE? I understand it works like a script but:

> 1. Does it work only in a DOS window (i.e. have to use 'cmd' and
> navigate to the directory where the MAKE file is)
> 2. what is the syntax for the  command? (i.e. MAKE MAKE_FILE ? - tried
> that and it does not work)

I use Microsoft's NMAKE. One advantage it has is not requiring tabs in
make files. Here is my procedure, done at the Windows command line
(cmd).

(1) Create a text file listing the Fortran sources needed to build a
program, one per line, with files containing modules preceding those
that use the modules. For example, it could look like

foo.f90
xfoo.f90

(2) Create a make file that looks as follows. I have a Python program
that does this. With minor modifications it will work with other
compilers -- the opt variable will be different, and most commercial
compilers name object files with the .obj rather than .o extension.

exec = mat_g95mak.exe
obj  =  foo.o xfoo.o
opt  = -Wall -Wextra -ftrace=full -fbounds-check -freal=nan

all: clean run

.f90.o:
  g95 -c $(opt) $*.f90

$(exec): $(obj)
  g95 -o $(exec) $(opt) $**

compile: $(exec)
   echo $(exec) created

run: $(exec)
   $(exec)

clean:
   if exist $(exec) del $(exec)

This does NOT check for module dependencies, unfortunately.

(3) To compile and run the program, issue the command

nmake /nologo /f make_foo.txt

where make_foo.txt is the file created in the previous step.

To compile but not run, replace

all: clean run

with

all: clean compile

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc