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