help-make
[Top][All Lists]
Advanced

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

Re: Something very simple


From: Philip Guenther
Subject: Re: Something very simple
Date: Mon, 5 Feb 2007 13:51:55 -0700

On 2/5/07, Billy Patton <address@hidden> wrote:
Ther is a lot more in the make_gds, but this is very simple

define make_gds
  echo ${1}
# ${SCRIPTS}/via_array_${1}.awk >/dev/null

endef

via_array     :
  for X in 1 3 5 7 ; do \
    $(call make_gds,$$X) ; \
  done

Isn't the problem obvious from what make outputs when you try to build
via_array?

$ make via_array
for X in 1 3 5 7 ; do \
                echo $X
/bin/sh: syntax error: `for' unmatched
make: *** [via_array] Error 1
$

Make expands the commands to get:

for X in 1 3 5 7; do \
 echo $X
 # ${SCRIPTS}/via_array_$X.awk >/dev/null; \
done

There's no backslash on the second line, so make tries to invoke the
shell twice, once with the first two lines and once with the second
two lines.  If you want make_gds to expand to just one line, then put
a backslash at the end of the first line:

define make_gds
 echo ${1} \
#  ${SCRIPTS}/via_array_${1}.awk >/dev/null
endef


But beware!  If you uncomment the second line then you also need a semicolon:

define make_gds
 echo ${1} ; \
 ${SCRIPTS}/via_array_${1}.awk >/dev/null
endef


Philip Guenther




reply via email to

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