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


_______________________________________________ Help-make mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to