Hi,

I thought of setting SHELL to some ssh script to allow load sharing of parallel make (when you use -j). But I have techical difficulties: line continuations do not work well. This simplest form I have:

$ cat myshell
#!/bin/bash
# Turn $* into an array to remove -c
args=( `echo $*` )
ssh localhost "cd $PWD; ${args[*]:1}"


$ cat Makefile
SHELL = ./myshell
all:
        # Comment are okay
        t=`echo "\"Complicated quoting seems okay\'\\""`
        echo This is the remote host as desired: $$HOSTNAME
        echo But line continuations && \
        echo are not.

I suspect it has to do with the shell and not with make, although make does pass the line continuation character "\" without passing the newline to ./myshell (echo $* to see).

Any advice would be appreciated as I have tried many different variations for quoting the ssh arguments (such as [EMAIL PROTECTED]). The idea is to make it work the same with and without overriding SHELL.

Note that $PWD must be expanded on the localhost, and the args aims to be the thing make passes to the shell which I want to relay to the remote host.

Has this been attempted before? How can I fix the line continuation problem?

Thanks,
Martin


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to