You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
plat ?= darwin
|
|
|
|
plats = linux darwin
|
|
|
|
|
|
|
|
arch ?= amd64
|
|
|
|
archs = amd64 arm arm64
|
|
|
|
|
|
|
|
all: idata
|
|
|
|
|
|
|
|
define build_app
|
|
|
|
@echo 'building $(1) ...'
|
|
|
|
@GOOS=$(2) GOARCH=$(3) go build -o builder/$(1) ./cmd/$(1)
|
|
|
|
@echo 'build $(1) done'
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
|
|
idata:
|
|
|
|
$(call build_app,idata,$(plat),$(arch))
|
|
|
|
.PHONY: idata
|
|
|
|
|
|
|
|
clean:
|
|
|
|
-@rm -f builder/*
|
|
|
|
|
|
|
|
run:
|
|
|
|
-@mkdir -p logs
|
|
|
|
@nohup ./builder/idata >> logs/idata.log &
|
|
|
|
@ps -ef | grep ./builder/idata | grep -v grep
|
|
|
|
|
|
|
|
stop:
|
|
|
|
-@pkill -2 idata
|
|
|
|
-@ps -ef | grep ./builder/idata | grep -v grep
|
|
|
|
|
|
|
|
ps:
|
|
|
|
-@ps -ef | grep ./builder/idata | grep -v grep | wc -l
|
|
|
|
-@ps -ef | grep ./builder/idata | grep -v grep
|
|
|
|
|
|
|
|
push:
|
|
|
|
-@scp builder/* root@119.29.105.154:/root/idata/bin/
|