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.

37 lines
696 B
Makefile

3 years ago
plat ?= darwin
plats = linux darwin
arch ?= amd64
archs = amd64 arm arm64
3 years ago
all: stock
3 years ago
define build_app
@echo 'building $(1) ...'
@GOOS=$(2) GOARCH=$(3) go build -o builder/$(1) ./cmd/$(1)
@echo 'build $(1) done'
endef
stock:
$(call build_app,stock,$(plat),$(arch))
.PHONY: stock
clean:
-@rm -f builder/*
run:
-@mkdir -p logs
@nohup ./builder/stock >> logs/stock.log &
@ps -ef | grep ./builder/stock | grep -v grep
stop:
-@pkill -2 stock
-@ps -ef | grep ./builder/stock | grep -v grep
ps:
-@ps -ef | grep ./builder/stock | grep -v grep | wc -l
-@ps -ef | grep ./builder/stock | grep -v grep
push:
3 years ago
-@scp builder/* root@119.29.105.154:/root/stock/builder/