help-make
[Top][All Lists]
Advanced

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

Re: Multi-line string


From: Greg Chicares
Subject: Re: Multi-line string
Date: Sun, 03 Feb 2008 13:22:40 +0000
User-agent: Thunderbird 2.0.0.9 (Windows/20071031)

On 2008-02-03 08:46Z, Yang Zhang wrote:
> Hi, I'd like to write something like the following in my Makefile, but I 
> get an error - make thinks the string is unterminated. How may I do 
> this? Thanks in advance.
> 
>    tar czf - -C $(WEBDIR) . | \
>    ssh shell-sf ' 
>  
> 
>      set -o errexit -o nounset
>      rm -rf assorted/htdocs/scala-commons/
>      mkdir -p assorted/htdocs/scala-commons/
>      cd assorted/htdocs/scala-commons/
>      tar xzf -'

In your makefile, write a backslash at the end of each continued
line, even where your shell wouldn't require it. See

http://www.gnu.org/software/automake/manual/make/Splitting-Lines.html

for an explanation of how 'make' passes a command like this

        tar czf - -C $(WEBDIR) . | \
        ssh shell-sf ' \
         \
         \
        more options \
        even more options'

to your shell; when 'sh' would or would not remove the backslash-
newline pairs; and how to prevent possible problems when 'sh'
doesn't remove them.




reply via email to

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