bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in match-anything rules: non-terminal interpreted as terminal


From: Ian Hutchinson
Subject: Bug in match-anything rules: non-terminal interpreted as terminal
Date: Tue, 28 Aug 2007 22:56:16 -0400 (EDT)

Here's a transcript illustrating the bug. Don't worry about mpif77 it's just an alternative to the non-existent f77

address@hidden maketests]$ cat makefile
OBJECTS=subroutine.o
HEADERS=header.f
G77=mpif77

% : %.f  makefile $(OBJECTS) $(HEADERS)
        $(G77) -o $*.f $(OBJECTS)

%.o : %.f makefile $(HEADERS)
        $(G77) -c $*.f

address@hidden maketests]$ ls
header.f  makefile  subroutine.f  testprog.f
address@hidden maketests]$ make testprog
f77    testprog.f   -o testprog
make: f77: Command not found
make: *** [testprog] Error 127
address@hidden maketests]$
address@hidden maketests]$ make subroutine.o
mpif77 -c subroutine.f
address@hidden maketests]$ make testprog
mpif77 -o testprog.f subroutine.o
address@hidden maketests]$ make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i686-redhat-linux-gnu
address@hidden maketests]$

When subroutine.o exists, the match-anything pattern % : %.f is obeyed.
When it does not exist, the match-anything pattern is ignored and a built-in rule invoked to call (non-existent command) f77.
This make behaviour is what is described in the info as "terminal".
However, the rule is not marked as terminal by having ::
This appears to me to be a bug in make or in its documentation.

        Ian Hutchinson
        http://www.psfc.mit.edu/people/hutch/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]