PDA

View Full Version : How use gnu make with Lahey?


emamm
12-08-2003, 07:32 PM
Hello

I need desperately to convert a makefile that I use on linux to one on windows. On windows I am running Lahey (simple command lines with just the basics).

Here is what I did to convert the Makefile to windows-Lahey.

PROG = genrandom

SRCS = f2kcli.for model.for funstrings.for stat.for l90rand.for genrandom.for

OBJS = f2kcli.obj model.obj funstrings.obj stat.obj l90rand.obj genrandom.obj

LIBS =

F90 = lf95
F90FLAGS = -chkglobal -g
LDFLAGS =

all: $(PROG)

$(PROG): $(OBJS)
$(F90) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)

clean:
rm -f $(PROG) $(OBJS)

install:

mv -f genrandom ../

.SUFFIXES: $(SUFFIXES) .for

.for.out:
$(F90) $(F90FLAGS) -c $<

Unfortunately make returns an error:

No rule to make target f2kcli.obj

What am I doing wrong?

Many thanks

Ed

tzeis
12-09-2003, 04:51 PM
Unfortunately, I know very little about GNU make, but I do have some suggestions, however.
1) I see a line starting with ".for.out", shouldn't this be ".for.obj"? The error message is indicating that it doesn't know the rule for compiling a source into an object.
2) If all your source code is in a single directory, and there are no other source file in that directory, we provide a utility called Automake that you can use to build your code. While in the directory where the source code is, type "am" at the command prompt. A dialog will appear that will allow you to set things up, it is pretty easy.

emamm
12-09-2003, 06:37 PM
Hello

Changing to obj wouldn't help.

Somehow I don't have automake. Is it part of Lahey products?

Many thanks

Ed

tzeis
12-09-2003, 07:47 PM
If you have LF95 Express, Automake would not be included. If you have Standard or Pro, it should be there. You can check for it by looking in the bin directory for automake.exe, am.bat and plusfort.fig.

I did not see a rule in the makefile for compiling the .for files, it seems to me that is all you are lacking. The ".for.out" dependency seems to contain a compilation command that would do the correct compilation, but there are no files with a ".out" extension anywhere.

emamm
12-09-2003, 09:39 PM
Hello

Express then: no automake.

I change to .for.o, lf95 generates all obj files. Why Lahey doesnīt
generate .o is a mistery to me!

Does the version for linux uses gnu-make?

Many thanks

Ed

Lahey Support
12-09-2003, 09:59 PM
Unlike Linux on Windows object files have the .obj extension. This is standard.

On Linux gnu-make can be used with LF95. LF95 Linux PRO includes Automake.

emamm
12-09-2003, 10:37 PM
Hello

Automake is free with plusfort on linux.

Anyway I canīt understand why Lahey doesnīt work with gnu-make.

Eduardo