BINARY="build/iot_service"
VERSION=1.0.0
export GOARCH=amd64
export GOOS=linux
SHELL := D:\Programs\Git\bin\bash.exe

clear:
	@$(RM) ${BINARY}

build:
	@go build  -o ${BINARY} ./

push-test:clear build
	@$(push_test)
.PHONY: build push-test

define push_test
	ssh root@110.40.223.170 "service  go-iot_service stop;/usr/bin/rm -rf /opt/lc/iot_svr/iot_service"
    scp -r build/* root@110.40.223.170:/opt/lc/iot_svr/
    ssh root@110.40.223.170 "chmod +x /opt/lc/iot_svr/iot_service;service  go-iot_service start;sleep 3;service  go-iot_service status"
endef