由于某些原因,我需要在远程服务器上编译和测试我的项目。
我使用的一个解决方案是ssh + make,这是我当前使用的r_makefile脚本
# usage: make -f r_makefile
all.remote: a.remote b.remote makefile.remote
%.remote: %.c
scp $< remotehost:~/work/test
touch $@
makefile.remote: makefile
scp $< remotehost:~/work/test
touch $@
test: all.remote
ssh remotehost 'cd work/test && make test'还有makefile。
CC = gcc
objects = a.o b.o
a: $(objects)
$(CC) $(objects) -o a
a.o: a.c
b.o: b.c
test: a
./a它现在对我来说很好,但我必须同时跟踪makefile和r_makefile。随着代码的增长(这使得我的makefile更加复杂),修改r_makefile变得越来越困难。
我想知道是否有工具可以为我做这件事,或者自动生成r_makefile。我目前使用git进行版本控制。
远程编译和测试的最佳实践是什么?有没有其他方法来实现这个目标?
发布于 2011-11-14 16:50:04
远程测试的最佳实践是使用DejaGnu。该项目在文档上有点稀缺,但功能相当强大,并且支持开箱即用的远程测试。
https://stackoverflow.com/questions/8118711
复制相似问题