You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.1 KiB
39 lines
1.1 KiB
GOHOSTOS:=$(shell go env GOHOSTOS) |
|
GOPATH:=$(shell go env GOPATH) |
|
VERSION=$(shell git describe --tags --always) |
|
|
|
ifeq ($(GOHOSTOS), windows) |
|
#the `find.exe` is different from `find` in bash/shell. |
|
#to see https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/find. |
|
#changed to use git-bash.exe to run find cli or other cli friendly, caused of every developer has a Git. |
|
Git_Bash= $(subst cmd\,bin\bash.exe,$(dir $(shell where git))) |
|
INTERNAL_PROTO_FILES=$(shell $(Git_Bash) -c "find internal -name *.proto") |
|
API_PROTO_FILES=$(shell $(Git_Bash) -c "find api -name *.proto") |
|
else |
|
INTERNAL_PROTO_FILES=$(shell find internal -name *.proto) |
|
API_PROTO_FILES=$(shell find api -name *.proto) |
|
endif |
|
|
|
|
|
.PHONY: build |
|
# build |
|
build: |
|
mkdir -p bin/ && go build -ldflags "-X main.Version=$(VERSION)" -o ./bin ./... |
|
|
|
run: |
|
mkdir -p bin/ && go build -ldflags "-X main.Version=$(VERSION)" -o ./bin ./... |
|
./bin/server |
|
|
|
up: |
|
go mod tidy |
|
go get git.gz.internal.jumaiyx.cn/jm/jmproto |
|
|
|
.PHONY: generate |
|
# generate |
|
generate: |
|
go mod tidy |
|
go get github.com/google/wire/cmd/wire@latest |
|
go generate ./... |
|
wire: |
|
cd ./cmd/src-room && wire |
|
|
|
|