Hi: 2009/7/9 CHEN Cheng <[email protected]>: > 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
_______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
