DATESTAMP := $(shell date -u +%Y.%m%d.%H%M)

all:
	@echo try:
	@echo make prep
	@echo make screen

local:
	mkdir $(DATESTAMP)
	inventory/inventory.sh $(DATESTAMP)
	cd cpu; make

prep:
	git update-server-info
	cat loadbot/testservers |xargs --verbose -n 1 --replace=BLAH scp loadbot/prep.pl BLAH:
	cat loadbot/testservers |xargs --verbose -n 1 --replace=BLAH ssh BLAH ./prep.pl

push:
	-git commit -a
	-git push
	git update-server-info
	git show -s --format=%H

pull:
	git update-server-info
	cat loadbot/testservers |xargs --verbose -n 1 --replace=BLAH ssh BLAH "cd benchmarks; git pull"

docpu:
	cat loadbot/testservers |xargs --verbose -n 1 --replace=BLAH ssh BLAH "screen -d -m -S docpu -c /root/benchmarks/cpu/screenrc"

killall:
	cat loadbot/testservers |xargs --verbose -n 1 --replace=BLAH ssh BLAH "killall screen"

listscreen:
	cat loadbot/testservers |xargs --verbose -n 1 --replace=BLAH ssh BLAH "screen -list"

jcarr:
	cat loadbot/testservers |xargs --verbose -n 1 --replace=BLAH ssh BLAH "echo . /root/benchmarks/loadbot/.jcarr/.bashrc >> /root/.bashrc"

logs:
	cat loadbot/testservers |xargs --verbose -n 1 --replace=BLAH ssh BLAH "uname -r; cat loadbot.0"

prepkern:
	cat loadbot/testservers |xargs --verbose -n 1 --replace=BLAH ssh BLAH "/root/benchmarks/kernel/build.pl --prep"

dokern:
	cat loadbot/testservers |xargs --verbose -n 1 --replace=BLAH ssh BLAH "screen -d -m -S dokern -c /root/benchmarks/kernel/screenrc"