I've found that creating an empty rule works around the problem:

# GNUmakefile
-include foo.mk

.PHONY: all
all: | foo.mk
        @echo $(@)

foo.mk:


$ gmake all $

Noel

Noel Yap wrote:

Stranger still, the rule for all is never triggered so the makefile has no output whatsoever.

This behaviour persists even if an order rule is used:

# GNUmakefile
-include foo.mk

.PHONY: all
all: | foo.mk
    @echo $(@)


$ gmake $

Noel

Noel Yap wrote:

I have the following makefile:

-include foo.mk

.PHONY: all
all: foo.mk
    @echo all


Since there's no rule to create foo.mk, I'd expect the build to fail since all is dependent on foo.mk, but it seems that the -include turns off this error. Is this a bug?


Thanks,
Noel

PS
This throws a kink into the "delayed error message" workaround for "include" that I had proposed.



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



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



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

Reply via email to