On Jan 16, 2008 7:14 AM, Rafael Garabato <[EMAIL PROTECTED]> wrote:
> I would like to know if it exists a way to define a target that will
> always be executed once and prior to any other target, regardless of the
> target that is specified.
As Paul said, the only way to do this is to make always a prerequisite
of every target. It turns out that it isn't that hard to do.
Consider:
deps := dep1 dep2
all: $(deps);
echo all
dep1:
echo dep1
dep2:
echo dep2
# make always a prerequisite of every target listed in $(deps)
$(foreach d,$(deps),$(eval $(d): always))
.PHONY: always
always:
echo always
#EOF
Making always a .PHONY target ensures that it is run every time the
makefile is run.
Ken
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make