View previous topic :: View next topic |
Author |
Message |
Shahram
Joined: 13 May 2013 Posts: 25
|
Posted: Sun Apr 11, 2021 11:26 am Post subject: MK32 does not work for the below simple example. |
|
|
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 |
|
Back to top |
|
|
Shahram
Joined: 13 May 2013 Posts: 25
|
Posted: Tue May 04, 2021 10:09 am Post subject: |
|
|
Dear Paul,
Would you please answer my simple question |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Tue May 04, 2021 11:09 am Post subject: |
|
|
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. |
|
Back to top |
|
|
DietmarSiepmann
Joined: 03 Jun 2013 Posts: 279
|
Posted: Tue May 04, 2021 5:19 pm Post subject: |
|
|
Shahram,
your makefile needs TABS in oder to work at the beginning of your command lines:
Code: | ftn95 $< /check
SLINK prog.lnk
|
Command
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:
Code: | [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
Code: | lo prog.obj
lo sub.obj
file prog.exe
|
and executing make generated the expected objects:
Code: | prog.obj
sub.obj
prog.exe |
Regards,
Dietmar |
|
Back to top |
|
|
Shahram
Joined: 13 May 2013 Posts: 25
|
Posted: Mon May 17, 2021 11:28 am Post subject: |
|
|
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? |
|
Back to top |
|
|
Shahram
Joined: 13 May 2013 Posts: 25
|
Posted: Mon May 17, 2021 12:13 pm Post subject: |
|
|
It write for me that:
Target is up to date
and nothing will change, although I have changed the sub.f95 file |
|
Back to top |
|
|
Shahram
Joined: 13 May 2013 Posts: 25
|
Posted: Mon May 17, 2021 12:14 pm Post subject: |
|
|
and after changing SUB.f95 I recompile it too. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Mon May 17, 2021 1:12 pm Post subject: |
|
|
Shahram
I have created a simple test like yours and it works for me. Here is my test code...
makefile
---------
Code: | .SUFFIXES: .f95 .obj
.f95.obj:
ftn95 $< /check
prog.exe: prog.obj sub.obj
SLINK prog.lnk |
prog.f95
---------
Code: | program prog
call sub1()
end |
sub.f95
--------
Code: | subroutine sub1()
print *,'c1c1'
end |
prog.lnk
---------
Code: | 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. |
|
Back to top |
|
|
DietmarSiepmann
Joined: 03 Jun 2013 Posts: 279
|
Posted: Mon May 17, 2021 2:25 pm Post subject: |
|
|
Shahram,
the online help (started via ftn95 --help) says if navigating to
--> ftn95 --> MK32 --> Reference --> Rules
Quote: |
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
Code: | [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 |
|
Back to top |
|
|
|