From hunt@mph124.rh.psu.edu  Tue Sep 16 11:17:58 1997
Received: from mph124.rh.psu.edu (hunt@MPH124.rh.psu.edu [128.118.126.83])
          by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id LAA10514
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 16 Sep 1997 11:17:57 -0700 (PDT)
Received: (from hunt@localhost)
	by mph124.rh.psu.edu (8.8.7/8.8.7) id OAA01592;
	Tue, 16 Sep 1997 14:17:56 -0400 (EDT)
Message-Id: <199709161817.OAA01592@mph124.rh.psu.edu>
Date: Tue, 16 Sep 1997 14:17:56 -0400 (EDT)
From: Matthew Hunt <mph@pobox.com>
To: FreeBSD-gnats-submit@freebsd.org
Subject: make can't build executable from single Fortran source
X-Send-Pr-Version: 3.2

>Number:         4556
>Category:       misc
>Synopsis:       make can't build executable from single Fortran source
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    will
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 16 11:20:02 PDT 1997
>Closed-Date:    Wed Jun 6 13:16:33 PDT 2001
>Last-Modified:  Wed Jun 06 13:16:46 PDT 2001
>Originator:     Matthew Hunt
>Release:        FreeBSD 2.2-STABLE i386
>Organization:
none
>Environment:

FreeBSD mph124.rh.psu.edu 2.2-STABLE FreeBSD 2.2-STABLE #0: Thu Sep 11 20:08:28 EDT 1997     hunt@mph124.rh.psu.edu:/usr/src/sys/compile/WOPR  i386

#       $Id: sys.mk,v 1.16.2.3 1997/04/20 20:16:13 jkh Exp $

>Description:

As the legions reported unnecessarily to jkh, some people write Fortran
on FreeBSD.  It seems that make knows how to build foo.o from foo.f, but
cannot build foo from foo.f.  Contrast this behavior with C code; make can
build a single C source file into a binary.

>How-To-Repeat:

I have a simple Fortran program contained in prob1.f.  No Makefile is
present in the current directory.

mph124:~/tmp$ ls -l prob1* 
-rw-r--r--  1 hunt  users  132 Sep 16 14:06 prob1.f

mph124:~/tmp$ make prob1
make: don't know how to make prob1. Stop

mph124:~/tmp$ make prob1.o
f77   -O -c prob1.f
prob1.f:
   MAIN:

>Fix:
	
As far as I can tell, it should work!  /usr/share/mk/sys.mk has these
two rules:

.f:
        ${FC} ${FFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC}

[...]

.f.o:
        ${FC} ${FFLAGS} -c ${.IMPSRC}


I cannot figure out why the second one works, but the first does not.
>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: FreeBSD-gnats-submit@FreeBSD.ORG, mph@pobox.com
Cc:  Subject: Re: misc/4556: make can't build executable from single Fortran source
Date: Wed, 17 Sep 1997 19:39:37 +1000

 >>Description:
 >
 >As the legions reported unnecessarily to jkh, some people write Fortran
 >on FreeBSD.  It seems that make knows how to build foo.o from foo.f, but
 >cannot build foo from foo.f.  Contrast this behavior with C code; make can
 >build a single C source file into a binary.
 
 >As far as I can tell, it should work!  /usr/share/mk/sys.mk has these
 >two rules:
 >
 >.f:
 >        ${FC} ${FFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC}
 >
 >[...]
 >
 >.f.o:
 >        ${FC} ${FFLAGS} -c ${.IMPSRC}
 >
 >
 >I cannot figure out why the second one works, but the first does not.
 
 The first one is hidden inside a %POSIX ifdef.
 
 Bruce

From: Matthew Hunt <hunt@mph124.rh.psu.edu>
To: Bruce Evans <bde@zeta.org.au>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: misc/4556: make can't build executable from single Fortran source
Date: Wed, 17 Sep 1997 08:40:25 -0400

 On Wed, Sep 17, 1997 at 07:39:37PM +1000, Bruce Evans wrote:
 
 > The first one is hidden inside a %POSIX ifdef.
 
 Ah, yes.  Actually, the two I posted are both inside the ifdef, but
 in the else clause, there's:
 
 .e.o .r.o .F.o .f.o:
         ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} -c ${.IMPSRC}
 
 Thanks for clearing that up, I should have noticed it myself.  So
 I guess my question now is, should there be a rule like:
 
 .f:
         ${FC} ${FFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC}
 
 in the non-Posix ruleset?
 
 -- 
 Matthew Hunt <mph@pobox.com> * Think locally, act globally.
 finger hunt@mph124.rh.psu.edu for PGP public key.
Responsible-Changed-From-To: freebsd-bugs->will 
Responsible-Changed-By: will 
Responsible-Changed-When: Fri Sep 29 13:45:28 PDT 2000 
Responsible-Changed-Why:  
Over to MAINTAINER. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=4556 
State-Changed-From-To: open->feedback 
State-Changed-By: will 
State-Changed-When: Sun Oct 8 22:06:42 PDT 2000 
State-Changed-Why:  
I see that sys.mk still does not have a .f ruleset in 
sys.mk, for the non-POSIX case.  Is there some rule against 
having this ruleset in sys.mk, or shall I add it now and 
close this PR? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=4556 
State-Changed-From-To: feedback->closed 
State-Changed-By: obrien 
State-Changed-When: Wed Jun 6 13:16:33 PDT 2001 
State-Changed-Why:  
OBE (already fixed) 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=4556 
>Unformatted:
