On Mar 21, 7:39 am, "tuli" <email@example.com> wrote:
I use Microsoft's NMAKE. One advantage it has is not requiring tabs in
> 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)
make files. Here is my procedure, done at the Windows command line
(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
(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
g95 -c $(opt) $*.f90
g95 -o $(exec) $(opt) $**
echo $(exec) created
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
all: clean compile