URL:
<http://savannah.gnu.org/bugs/?27497>
Summary: Later double-colon rules don't fire if earlier ones
think target is up to date
Project: make
Submitted by: None
Submitted on: Tue 22 Sep 2009 15:08:01 UTC
Severity: 3 - Normal
Item Group: Bug
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Component Version: 3.81
Operating System: POSIX-Based
Fixed Release: None
Triage Status: None
_______________________________________________________
Details:
I have a collection of files, %.a and %.b, and I want to generate %.c from
them. If %.b exists, I want %.c to depend on %.a and %.b, and otherwise I want
%.c to depend on only %.a. I do this:
all : foo.c
%.c :: %.a %.b
echo %.a %.b > $@
touch $@
%.c :: %.a
echo %.a > $@
This works fine (except that if %.b is deleted, %.c isn't rebuilt):
$ touch foo.a
$ make
echo %.a > foo.c
$ touch foo.b
$ make
echo %.a %.b > foo.c
$
However, if I reverse the order of the rules:
all : foo.c
%.c :: %.a
echo %.a > $@
%.c :: %.a %.b
echo %.a %.b > $@
touch $@
Then it no longer works:
$ touch foo.a
$ make
echo %.a > foo.c
$ touch foo.b
$ make
make: Nothing to be done for `all'.
$
Now, the first rule hasn't fired and updated foo.c, and the second rule says
foo.c is not up-to-date, so the second rule's actions should be run, but they
aren't.
$ 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 x86_64-redhat-linux-gnu
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Tue 22 Sep 2009 15:08:02 UTC Name: WorkingMakefile Size: 74B By:
None
Example makefiles showing the problem
<http://savannah.gnu.org/bugs/download.php?file_id=18754>
-------------------------------------------------------
Date: Tue 22 Sep 2009 15:08:01 UTC Name: BrokenMakefile Size: 74B By:
None
Example makefiles showing the problem
<http://savannah.gnu.org/bugs/download.php?file_id=18753>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?27497>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
_______________________________________________
Bug-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-make