[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem with .phony .secondary between 3.79.1 and 3.81
From: |
Andy Juniper |
Subject: |
Problem with .phony .secondary between 3.79.1 and 3.81 |
Date: |
Tue, 01 Dec 2009 16:39:59 +0000 |
User-agent: |
Thunderbird 2.0.0.21 (X11/20090320) |
I need some help with the behaviour .phony .secondary targets, and the
way that this has changed between 3.79.1 and 3.81.
I have a .phony target (i.e. a target which never exists as a real file)
which I only want to be 'built' if something that depends on it needs to
be rebuilt (i.e. a secondary).
This can be demonstrated with a simple makefile:
.PHONY: all
all: fileb
.PHONY: prepare
.SECONDARY: prepare
prepare:
@echo $@
filea: prepare filea.dep
@echo $@
@touch $@
fileb: prepare filea fileb.dep
@echo $@
@touch $@
In 3.79.1, this works as expected and the "prepare" target is only
rebuilt if filea or fileb are rebuilt. Running make a second time just
reports that there is nothing to be done.
But in 3.81, running make a second time will rebuild everything again.
In this example, it's not a problem, but in the original case, the
prepare target deleted the build directory and thus everything above it
needed to be rebuilt.
Running 3.81 with -d shows the following debug of interest:
Updating goal targets....
Considering target file `all'.
File `all' does not exist.
Considering target file `fileb'.
Considering target file `prepare'.
File `prepare' does not exist.
Finished prerequisites of target file `prepare'.
Must remake target `prepare'.
So my questions are:
- was the behaviour which made this work in 3.79.1 accidental or deliberate?
- how to recreate this behaviour in 3.81?
- is there a fix for 3.81 which will recreate the required behaviour?
thanks,
Andy Juniper
address@hidden
- Problem with .phony .secondary between 3.79.1 and 3.81,
Andy Juniper <=