问题
One of the projects I'm working on uses gnu make for testing. I would like to test on a platform that doesn't have a make implementation, but does have a POSIX shell.
Is it possible to create a script (preferably in python) that can "stitch" a remote shell to make, and put it in make's SHELL environment variable?
If not, is there another way anyone can think of to do it?
回答1:
It is possible.
Create a script that forwards commands to a remote host. For example:
#!/bin/bash
shift # remove -c argument
exec ssh remote_host "$@"
And make it executable (chmod +x).
And then in Makefile:
SHELL := './my_shell.sh'
all :
@echo `hostname` is making $@
Outputs:
$ make
remote_host.peer1.net is making all
来源:https://stackoverflow.com/questions/11396816/can-i-use-gnu-makes-shell-variable-to-connect-to-a-remote-shell