help-make
[Top][All Lists]
Advanced

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

Re: some queston about make


From: CHEN Cheng
Subject: Re: some queston about make
Date: Thu, 9 Jul 2009 14:39:17 +0800
User-agent: Mutt/1.5.17 (2007-11-01)

On Thu, Jul 09, 2009 at 02:22:03PM +0800, loody wrote:
> Dear all:
> I have some questions about make usage:
> 1. when passing command to shell why we have to add ";" at each end of 
> command.
> Is it the rule define in make or in shell?
It is required by the shell to express a sequence of commands, which is
explained in the Bash manual (section 3.2.3 Lists of Commands).

> example like below:
> do_test:
>  libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
>                 $(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \
>                         link_a.$(SHLIB_TARGET); \
>                 libs="-l$$i $$libs"; \
>         done
> 
> 2. why sometimes we use "{}" to embrace variable instead of "()"
> Is that due to we have to pass it to shell?
I think you can use either way to reference a variable, as said in
the gmake manual (section 6.1 Basics of Variable References):
    To substitute a variable's value, write a dollar sign followed by the
    name of the variable in parentheses or braces: either `$(foo)' or
    `${foo}' is a valid reference to the variable `foo'. 

> 
> example like below:
> ifeq (0,${MAKELEVEL})
> whoami := $(shell whoami)
> host-type := $(shell arch)
> MAKE := ${MAKE} host-type=${host-type} whoami=${whoami}
> endif
> 
> appreciate your help,
> miloody
> 
> 
> _______________________________________________
> Help-make mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-make




reply via email to

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