This commit is contained in:
ston1th 2021-07-11 23:43:10 +02:00
commit 58caf0527e
3 changed files with 20 additions and 10 deletions

View file

@ -2,7 +2,7 @@ CC=go
BUILD=build -v -trimpath
VERSION=$(shell cat VERSION)
GCFLAGS=-gcflags '-e'
LDFLAGS=-ldflags '-X main.version=$(VERSION) -s -w'
LDFLAGS=-ldflags '-buildid= -X main.version=$(VERSION) -s -w'
PROGRAM=gowiki
ENV=CGO_ENABLED=0 GO111MODULE=on
@ -11,16 +11,16 @@ all: $(PROGRAM)
setup:
$(CC) get -u github.com/client9/misspell
release: clean gofmt codeqa
release: clean gofmt govet codeqa
$(ENV) $(CC) $(BUILD) $(GCFLAGS) $(LDFLAGS)
release-vendor: clean gofmt codeqa
release-vendor: clean gofmt govet codeqa
$(ENV) $(CC) $(BUILD) -mod=vendor $(GCFLAGS) $(LDFLAGS)
vendor: clean gofmt
vendor: clean gofmt govet
$(ENV) $(CC) $(BUILD) -mod=vendor $(GCFLAGS) $(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