Hi Dave,
Thanks for replying.
On Sunday 11 November 2007 14:20:04 Dave Korn wrote:
> On 10 November 2007 17:52, Paul Millar wrote:
> > I've a makefile of medium complexity
> >
> > I have a work-around for this, but I was wondering if:
> > a. is this a bug or a known problem?
> >
> > b. whether there's anyway of indicating the order in which phase 1
> > activity should take place (e.g. do the include first, delay expanding
> > the prerequisites, that sort of thing).
> >
> > I can post the makefile somewhere, if that helps.
>
> What would really help would be a cut-down trivial testcase, with just
> enough in it to show the required dependencies and the autogeneration.
> It's pretty hard to know what's going on without seeing an example, but the
> first thing I'd look at in such a testcase would be whether you're running
> into problems from the use of ':=' immediate evaluation versus '=' deferred
> evaluation.
I've attached a small test-case (it's very small, so I hope emailing it to the
list is OK). This test-case replicates the problem without using include, so
this may not have been the root-cause.
There are four parts to the test-case:
First, run the makefile as-is. This should demonstrate correct
behaviour.
Second, comment the first TEST_LIST definition and uncomment the second
TEST_LIST definition. The output should be different and, if run
with --warn-undefined-variables, you should get a warning.
Third, uncomment the PHONY definition. You should find the problem
persists.
Forth, uncomment the initial TEST_LIST definition and comment the
second
definition. You should *still* see the problem persist.
Only when the PHONY is commented again does the makefile work.
I'm using make v3.81 on Debian sid.
HTH,
Paul.
#
# Minimum test-case for bug.
#
# 1. Defining the variable here works.
TEST_LIST = foo
test: $(TEST_LIST:%=%__FOO__)
@echo \$$\(TEST_LIST\) is $(TEST_LIST)
%__FOO__:
@echo Got prerequisite $(@:%__FOO__=%)
# 2. Comment above TEST_LIST defn and uncomment the one below one
# doesn't work. (tested with GNU Make v3.81)
# TEST_LIST = test1
# 3. Uncomment this PHONY defn and neither TEST_LIST defn works.
#.PHONY: test1 test1__FOO__
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make