This commit is contained in:
ston1th 2021-07-11 23:42:54 +02:00
commit 1bb92bd581
2 changed files with 25 additions and 16 deletions

View file

@ -1,8 +1,8 @@
CC=go
BUILD=build -v -trimpath
BUILD=build -a -v -trimpath
VERSION=$(shell cat VERSION)
GCFLAGS=-gcflags 'all=-e'
LDFLAGS=-ldflags '-X main.version=$(VERSION) -s -w'
GCFLAGS=-gcflags '-e'
LDFLAGS=-ldflags '-buildid= -X main.version=$(VERSION) -s -w'
PROGRAM=docstore
ENV=CGO_ENABLED=0 GO111MODULE=on
@ -11,16 +11,16 @@ all: $(PROGRAM)
setup:
$(CC) get github.com/client9/misspell
release: clean gofmt codeqa
release: clean gofmt govet codeqa
$(ENV) $(CC) $(BUILD) $(LDFLAGS)
release-vendor: clean gofmt codeqa
release-vendor: clean gofmt govet codeqa
$(ENV) $(CC) $(BUILD) -mod=vendor $(LDFLAGS)
vendor: clean gofmt
vendor: clean gofmt govet
$(ENV) $(CC) $(BUILD) -mod=vendor $(LDFLAGS)
$(PROGRAM): clean gofmt
$(PROGRAM): clean gofmt govet
$(ENV) $(CC) $(BUILD) $(GCFLAGS) $(LDFLAGS)
clean:
@ -29,13 +29,16 @@ clean:
codeqa: misspell golint test
gofmt:
gofmt -w pkg/ main.go
$(CC) fmt ./...
govet:
$(CC) vet ./...
golint:
$(GOPATH)/bin/golint .
misspell:
$(GOPATH)/bin/misspell pkg/* templates/* main.go Makefile README.md sri.sh templates.sh
$(GOPATH)/bin/misspell pkg/* main.go Makefile README.md sri.sh
test:
ifeq ($(shell go env GOARCH), $(shell go env GOHOSTARCH))
@ -48,4 +51,4 @@ else
$(info skipping tests of other platforms)
endif
.PHONY: setup release release-vendor vendor build clean codeqa gofmt golint misspell test
.PHONY: setup release release-vendor vendor build clean codeqa gofmt govet golint misspell test