help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Kicking myself w/ Target specific variables on gmake 3.79.1


From: chorn
Subject: Re: Kicking myself w/ Target specific variables on gmake 3.79.1
Date: Mon, 9 Apr 2001 22:16:00 -0400
User-agent: Mutt/1.2.5i

On 2001/04/09 20:50:00 -0400, Paul D. Smith wrote:

> %% address@hidden writes:
> 
>   c> VAL := $@
> 
> This can't work, since ":=" means "immediate evaluation" and when this
> line is read in by make, the value of the variable $@ is empty (of
> course, since it only has a value within a rule context).
> 
>   c> %: VAL := $@
> 
> Ditto here; why do you want to use ":=" instead of just "=" here?
> 
>   c> LIST := a b c
>   c> $(LIST): echo-val
>   c> echo-val: ; @echo VAL = $(VAL)
> 
> I guess I'm not sure _what_ you're trying to do; maybe a little context
> or description about the results you're looking for would help.

It looks pretty weird huh?

Well, here's what I've done explicitly in the past, and am now trying to
find some clean rules to do instead.  Sure, there are other ways to do
this, 

> make install-host1
building in /somedir/host1/
[etc...]

So if I have:

HOSTS := host1 host2 host3
INSTALL_HOSTS := $(addprefix install-,$(HOSTS))

# Here's my "goal"
$(INSTALL_HOSTS) : $(INSTALL_DIR) := $(subst install-,$(NULL),$@)
$(INSTALL_HOSTS) : install-all

install-all:
        copy foobar /somedir/$(INSTALL_DIR)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]