1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/dist/testbed-support/Makefile.iotlab
Martine Lenders 0566471173 dist: make iotlab-exp dependent on all
iotlab-exp uses `$(ELFFILE)` for the first flash so it needs to be
there.
2015-08-05 19:07:33 +02:00

30 lines
1.3 KiB
Makefile

.PHONY: iotlab-auth iotlab-exp iotlab-flash iotlab-reset iotlab-term
IOTLAB_NODES ?= 5
IOTLAB_DURATION ?= 30
IOTLAB_SITE ?= grenoble
IOTLAB_TYPE ?= "m3:at86rf231"
IOTLAB_AUTH ?= $(HOME)/.iotlabrc
IOTLAB_USER ?= $(shell cut -f1 -d: $(IOTLAB_AUTH))
IOTLAB_EXP_ID ?= $(shell experiment-cli get -l --state Running | grep -m 1 '"id"' | grep -Eo '[[:digit:]]+')
$(IOTLAB_AUTH):
auth-cli -u $(IOTLAB_USER)
iotlab-exp: $(IOTLAB_AUTH) all
ifeq (,$(AD))
@echo "experiment-cli submit -d $(IOTLAB_DURATION) -l $(IOTLAB_NODES),archi=$(IOTLAB_TYPE)+site=$(IOTLAB_SITE),$(ELFFILE),$(IOTLAB_PROFILE) -n riot_makefile_experiment"
endif
$(eval NEW_ID := $(shell experiment-cli submit -d $(IOTLAB_DURATION) -l $(IOTLAB_NODES),archi=$(IOTLAB_TYPE)+site=$(IOTLAB_SITE),$(ELFFILE),$(IOTLAB_PROFILE) -n riot_makefile_experiment | grep -Eo '[[:digit:]]+'))
$(AD)experiment-cli wait -i $(NEW_ID)
iotlab-flash: $(IOTLAB_AUTH) all
$(AD)node-cli --update $(ELFFILE) -i $(IOTLAB_EXP_ID)
iotlab-reset: $(IOTLAB_AUTH)
$(AD)node-cli --reset -i $(IOTLAB_EXP_ID)
iotlab-term:
$(AD)ssh -t $(IOTLAB_USER)@$(IOTLAB_SITE).iot-lab.info "test -f ~/.iotlabrc || auth-cli -u $(IOTLAB_USER)"
$(AD)ssh -t $(IOTLAB_USER)@$(IOTLAB_SITE).iot-lab.info "serial_aggregator -i $(IOTLAB_EXP_ID)"