[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
trouble with order rules in implicit rules
From: |
Noel Yap |
Subject: |
trouble with order rules in implicit rules |
Date: |
Fri, 16 Apr 2004 13:31:25 -0400 |
User-agent: |
Mozilla Thunderbird 0.5 (Windows/20040212) |
I have the following makefile:
.PHONY: install
install: foo/bar/baz
.PRECIOUS: %/.
%/.:
mkdir -p $(@)
foo/%: ./% | foo/.
@echo foo/%
touch $(@)
foo/bar/%: bar/% | foo/bar/.
@echo foo/bar/%
touch $(@)
bar/baz:
which produces the following output:
$ gmake
mkdir -p foo/.
foo/%
touch foo/bar/baz
touch: creating `foo/bar/baz': No such file or directory
gmake: *** [foo/bar/baz] Error 1
If the makefile is changed to:
.PHONY: install
install: foo/bar/baz
.PRECIOUS: %/.
%/.:
mkdir -p $(@)
foo/bar/%: bar/% | foo/bar/.
@echo foo/bar/%
touch $(@)
bar/baz:
it works as expected:
$ gmake
mkdir -p foo/bar/.
foo/bar/%
touch foo/bar/baz
I had thought that the better-matching rule would be the one used. Is there a
bug here? What do I need to do to get this to work the way I want?
Thanks,
Noel
- trouble with order rules in implicit rules,
Noel Yap <=