Silverfrost Forums

Welcome to our forums

MK32 does not work for the below simple example.

11 Apr 2021 10:26 #27478

I am using ftn77 and ftn95 2006 version. This is my makefile constructed as defined in the user guide:

.SUFFIXES: .for .obj .for.obj: ftn77 $< /check prog.exe: prog.obj sub.obj SLINK prog.lnk

and these are simple programs:

Prog.FOR:

winapp 500000,500000 options(intL) program prog include <windows.ins> INCLUDE <EXCEPTN.INS> call sub1 stop end

SUB.FOR: subroutine sub1 print *,'c1c1' print *,'d1d1' return end

I intend to use MK32 but this is the answer and PROG.exe do not uptodate with the new text I included for the print in sub.for and recompile it but nothing happens: the command is: MK32 -DD

The output is:

[Salford MK/Win32 Version 3.89, Copyright (c) Silverfrost Ltd. 1996-2006] .SUFFIXES: .for .obj .for.obj: ftn77 $< /check prog.exe: prog.obj sub.obj SLINK prog.lnk .SUFFIXES: .for .obj .for.obj: ftn77 $< /check prog.exe: prog.obj sub.obj SLINK prog.lnk

Target is up to date.

Please let me know where is my mistake on using MK32

4 May 2021 9:09 #27686

Dear Paul,

Would you please answer my simple question

4 May 2021 10:09 #27687

Shahram

I have not used MK32 for many years and I think that the documentation is quite comprehensive. Perhaps someone who is more familiar with MAKE can help you.

4 May 2021 4:19 #27691

Shahram,

your makefile needs TABS in oder to work at the beginning of your command lines:

ftn95 $< /check
SLINK prog.lnk

Command mk32 -n

shows what would be done (no execution). For I do not use ftn77 but ftn95 I changed your makefile (including the TABS) as appropriate. Having done this calling 'make -n' results in following output:

[Salford MK/Win32 Version 3.89, Copyright (c) Silverfrost Ltd. 1996-2006]
ftn95 prog.for /check
ftn95 sub.for /check
SLINK prog.lnk

No I added file prog.lnk as

lo prog.obj  
lo sub.obj   
file prog.exe

and executing make generated the expected objects:

prog.obj
sub.obj
prog.exe

Regards, Dietmar

17 May 2021 10:28 #27784

Dear DietmarSiepmann

Thank you for the answer, but it does not work for me. Note that I am using the exact version of FTN95 as you have used in your command.

I have changed the files to .f95 and still does not work. However, I do not know what do you mean by using the TABS! Is it an especial character that can not be seen in the makefile codes you have copied?

17 May 2021 11:13 #27785

It write for me that:

Target is up to date

and nothing will change, although I have changed the sub.f95 file

17 May 2021 11:14 #27786

and after changing SUB.f95 I recompile it too.

17 May 2021 12:12 #27787

Shahram

I have created a simple test like yours and it works for me. Here is my test code...

makefile

.SUFFIXES: .f95 .obj
.f95.obj:
          ftn95 $< /check
prog.exe: prog.obj sub.obj
          SLINK prog.lnk

prog.f95

program prog
call sub1()
end

sub.f95

subroutine sub1()
print *,'c1c1'
end

prog.lnk

lo prog.obj
lo sub.obj
file

I type mk32 on the command line and the components compile and link.

I change sub.f95, compile it and then type mk32 on the command line. mk32 spawns SLINK to create the exe from the obj files that are up to date.

17 May 2021 1:25 #27788

Shahram,

the online help (started via ftn95 --help) says if navigating to --> ftn95 --> MK32 --> Reference --> Rules

A line in a makefile that starts with a TAB or SPACE is a rule.

Your makefile did not have a preceding TAB or BLANK. Hence it produced results you did not expect.

It often is a good idea to use special options (like -n or -D or -DD for mk32) in case of problems/unexpected results when using make utilities (like mk32 e.g.). If you add e.g. a TAB (tabulator key) at the beginning of your rules, then command 'make -D' results in

[Salford MK/Win32 Version 3.89, Copyright (c) Silverfrost Ltd. 1996-2006]
.SUFFIXES: .for .obj
.for.obj:
        ftn95 $< /check ${OPTIONS}
prog.exe: prog.obj sub.obj
        SLINK prog.lnk

Target is up to date.

Now please notice that rules are indented in the output. You could substitute the TAB by 1 or more characters BLANK in the makefile as Paul has suggested.

Regards, Dietmar

Please login to reply.