Skip to content

Commit

Permalink
feat(makefile): update makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
joyme123 committed Sep 9, 2024
1 parent 4942e2f commit 363a6e5
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
# 获取系统架构
UNAME_M := $(shell uname -m)

# 根据系统架构设置 ARCH 变量
ifeq ($(UNAME_M),x86_64)
ARCH := amd64
else ifeq ($(UNAME_M),amd64)
ARCH := amd64
else ifeq ($(UNAME_M),aarch64)
ARCH := arm64
else ifeq ($(UNAME_M),arm64)
ARCH := arm64
else
ARCH := unknown
endif

.PHONY: build install install-for-mason test
build:
go build -o bin/thriftls main.go
install:
cp bin/thriftls /usr/local/bin/thriftls
install-for-mason:
cp bin/thriftls ~/.local/share/nvim/mason/packages/thriftls/thriftls-darwin-arm64
cp bin/thriftls ~/.local/share/nvim/mason/packages/thriftls/thriftls-darwin-$(ARCH)
test:
@go test -gcflags=all=-l -gcflags=all=-d=checkptr=0 -race -coverpkg=./... -coverprofile=coverage.out $(shell go list ./...)
@go tool cover -func coverage.out | tail -n 1 | awk '{ print "Total coverage: " $$3 }'
Expand Down

0 comments on commit 363a6e5

Please sign in to comment.