liujiandao
2024-04-18 7d1b46b246613585acda03a2148db76ebea79de1
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