some updates
This commit is contained in:
parent
1ce33aa89a
commit
1410847c03
43 changed files with 78 additions and 345 deletions
36
Makefile
36
Makefile
|
|
@ -2,43 +2,45 @@ CC=go
|
|||
BUILD=build -v -trimpath
|
||||
VERSION=$(shell cat VERSION)
|
||||
GCFLAGS=-gcflags '-e'
|
||||
LDFLAGS=-ldflags '-buildid= -X main.version=$(VERSION) -s -w'
|
||||
LDFLAGS=-ldflags '-buildid=$(VERSION) -X main.version=$(VERSION) -s -w'
|
||||
PROGRAM=gowiki
|
||||
CMD=-o $(PROGRAM) cmd/gowiki/main.go
|
||||
ENV=CGO_ENABLED=0 GO111MODULE=on
|
||||
|
||||
all: $(PROGRAM)
|
||||
|
||||
setup:
|
||||
$(CC) get -u github.com/client9/misspell
|
||||
$(CC) install github.com/client9/misspell/cmd/misspell@latest
|
||||
$(CC) install honnef.co/go/tools/cmd/staticcheck@latest
|
||||
|
||||
release: clean gofmt govet codeqa
|
||||
$(ENV) $(CC) $(BUILD) $(GCFLAGS) $(LDFLAGS)
|
||||
release: clean gofmt codeqa
|
||||
$(ENV) $(CC) $(BUILD) $(GCFLAGS) $(LDFLAGS) $(CMD)
|
||||
|
||||
release-vendor: clean gofmt govet codeqa
|
||||
$(ENV) $(CC) $(BUILD) -mod=vendor $(GCFLAGS) $(LDFLAGS)
|
||||
release-vendor: clean gofmt codeqa
|
||||
$(ENV) $(CC) $(BUILD) -mod=vendor $(GCFLAGS) $(LDFLAGS) $(CMD)
|
||||
|
||||
vendor: clean gofmt govet
|
||||
$(ENV) $(CC) $(BUILD) -mod=vendor $(GCFLAGS) $(LDFLAGS)
|
||||
vendor: clean gofmt
|
||||
$(ENV) $(CC) $(BUILD) -mod=vendor $(GCFLAGS) $(LDFLAGS) $(CMD)
|
||||
|
||||
$(PROGRAM): clean gofmt govet
|
||||
$(ENV) $(CC) $(BUILD) $(GCFLAGS) $(LDFLAGS)
|
||||
$(PROGRAM): clean gofmt
|
||||
$(ENV) $(CC) $(BUILD) $(GCFLAGS) $(LDFLAGS) $(CMD)
|
||||
|
||||
clean:
|
||||
$(CC) clean -x
|
||||
|
||||
codeqa: misspell golint test
|
||||
|
||||
gofmt:
|
||||
$(CC) fmt ./...
|
||||
|
||||
codeqa: govet misspell staticcheck test
|
||||
|
||||
govet:
|
||||
$(CC) vet ./...
|
||||
|
||||
golint:
|
||||
$(GOPATH)/bin/golint .
|
||||
|
||||
misspell:
|
||||
$(GOPATH)/bin/misspell pkg/* main.go Makefile README.md sri.sh
|
||||
$(GOPATH)/bin/misspell cmd/* pkg/* Makefile README.md sri.sh
|
||||
|
||||
staticcheck:
|
||||
$(GOPATH)/bin/staticcheck ./...
|
||||
|
||||
test:
|
||||
ifeq ($(shell go env GOARCH), $(shell go env GOHOSTARCH))
|
||||
|
|
@ -51,4 +53,4 @@ else
|
|||
$(info skipping tests of other platforms)
|
||||
endif
|
||||
|
||||
.PHONY: setup release release-vendor vendor build clean codeqa gofmt govet golint misspell test
|
||||
.PHONY: setup release release-vendor vendor build clean codeqa gofmt govet misspell staticcheck test
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue