help-make
[Top][All Lists]
Advanced

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

Re: some queston about make


From: loody
Subject: Re: some queston about make
Date: Thu, 9 Jul 2009 14:57:41 +0800

Hi:

2009/7/9 CHEN Cheng <address@hidden>:
> 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
I find where you mention.
thanks for your kind help:)
miloody




reply via email to

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