[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #27497] Later double-colon rules don't fire if earlier ones think t
From: |
anonymous |
Subject: |
[bug #27497] Later double-colon rules don't fire if earlier ones think target is up to date |
Date: |
Tue, 22 Sep 2009 15:08:03 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.0.11) Gecko/2009060309 Ubuntu/9.10 (karmic) Firefox/3.0.11 |
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 #27497] Later double-colon rules don't fire if earlier ones think target is up to date,
anonymous <=