-MACHINES ?= valnure.cs.ucsb.edu sperm.cs.ucsb.edu basalt.cs.ucsb.edu \
- graal.ens-lyon.fr allo-psmn.ens-lyon.fr \
- nala.cs.utk.edu
-
-# ACTION: What to do there
-# possible values:
-# - clean: erase any previously existing source tree and
-# open the new open
-# - touch: touch every file of the source tree to deal with
-# clock brokenness. May help, may harm.
-# - config: launch configure
-# - compile: run 'make'
-# - install: run 'make install'
-# - check: run 'make check'
-#
-# default value:
-ACTION ?= clean untar config compile check
-
-REMOTE_PREFIX ?='${HOME}/gras'
-
-remote: @PACKAGE@-@VERSION@.tar.gz tools/compile-remote-worker
- @echo;echo "----[ Recompile the package on remote hosts ]----"
- @test -e buildlogs/@PACKAGE@-@VERSION@ || mkdir -p buildlogs/@PACKAGE@-@VERSION@
- @for site in $(MACHINES) ; do \
- machine=`echo $$site |sed 's/^\([^%]*\)%.*$$/\1/'`;\
- machine2=`echo $$site |sed 's/^\([^%]*\)%\(.*\)$$/\2/'`;\
- cmd="\"sh -c 'env REMOTE_PREFIX=$(REMOTE_PREFIX) $(REMOTE_PREFIX)/src/compile-remote-worker $(ACTION) 2>&1'\"";\
- if echo $$site | grep '%' >/dev/null ; then \
- echo "----[ Compile on $$machine2 (behide $$machine) ]----";\
- else \
- machine=$$site;\
- echo "----[ Compile on $$machine ]----";\
- fi;\
- \
- echo "-- Copy the data over"; \
- scp @PACKAGE@-@VERSION@.tar.gz tools/compile-remote-worker \
- $$machine:$(REMOTE_PREFIX)/src;\
- \
- echo "-- Compiling... (the output gets into buildlogs/@PACKAGE@-@VERSION@/$$site.log)"; \
- if echo $$site | grep '%' >/dev/null ; then \
- if ssh -CA $$machine "env REMOTE_PREFIX=$(REMOTE_PREFIX) ssh -A $$machine2 $$cmd" 2>&1 > buildlogs/@PACKAGE@-@VERSION@/$$site.log;\
- then echo "Sucessful"; else echo "Failed (check buildlogs/@PACKAGE@-@VERSION@/$$site.log)"; fi;echo; \
- else \
- if ssh -CA $$machine "eval $$cmd" 2>&1 > buildlogs/@PACKAGE@-@VERSION@/$$site.log ;\
- then echo "Sucessful"; else echo "Failed (check buildlogs/@PACKAGE@-@VERSION@/$$site.log)"; fi;echo; \
- fi;\
- done