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.
41 lines
753 B
Makefile
41 lines
753 B
Makefile
plat ?= darwin
|
|
plats = linux darwin
|
|
|
|
arch ?= amd64
|
|
archs = amd64 arm arm64
|
|
|
|
all: stock ss
|
|
|
|
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
|
|
|
|
ss:
|
|
$(call build_app,ss,$(plat),$(arch))
|
|
.PHONY: ss
|
|
|
|
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/* root@119.29.105.154:/root/stock/builder/
|