|
From: | Rafael Garabato |
Subject: | Re: Initialization targets |
Date: | Wed, 16 Jan 2008 16:02:45 -0200 |
On Jan 16, 2008 7:14 AM, Rafael Garabato <address@hidden> wrote:As Paul said, the only way to do this is to make always a prerequisite
> 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.
of every target. It turns out that it isn't that hard to do.
Consider:
deps := dep1 dep2
all: $(deps);echo all# make always a prerequisite of every target listed in $(deps)
dep1:
echo dep1
dep2:
echo dep2
$(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
[Prev in Thread] | Current Thread | [Next in Thread] |