makefile - Rule for all targets in make - even if the file exists -
i want create makefile outputs foo no matter target name given make.
so of these should work:
$ make foo $ make foo $ make foobar foo
the following makefile want:
%: @echo foo .phony:
however fails if there exists file same name target:
$ touch abc $ make abc make: `abc' date.
as .phony doesn't accept pattern rules, don't know how can make ignore every file.
how about:
all $(makecmdgoals): ; @echo foo .phony: $(makecmdgoals)
Comments
Post a Comment