yinbangzhong
2024-07-29 9f78e3b126b15a9b331c3a1a318da1ceea30114c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
VER="0.0.1"
DATA=$(shell date +%Y%m%d)
GIT=$(shell git rev-parse --short HEAD)
BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
 
build: checkfile
    ${GOPATH}/bin/swag init
    go build -v -a -ldflags "-X main.MinVersion=$(VER) -X main.PublishDate=$(DATA) -X main.CommitId=$(GIT) -X main.Branch=$(BRANCH)"
clean:
    rm apsServer -f
 
.PHONY: checkfile
checkfile:
    if [ ! -f $(GOPATH)/bin/swag ];then \
        go install github.com/swaggo/swag/cmd/swag@latest; \
    fi