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.
38 lines
701 B
Makefile
38 lines
701 B
Makefile
3 years ago
|
plat ?= darwin
|
||
|
plats = linux darwin
|
||
|
|
||
|
arch ?= amd64
|
||
|
archs = amd64 arm arm64
|
||
|
|
||
|
all: stock
|
||
|
|
||
|
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:
|
||
|
-@scp builder/stock root@119.29.105.154:/root/stock/builder/
|