github.com/vicanso/pike@v1.0.1-0.20210630235453-9099e041f6ec/Makefile (about) 1 .PHONY: default test test-cover dev hooks 2 3 # for dev 4 dev: 5 air -c .air.toml 6 7 # for test 8 test: 9 go test -race -cover ./... 10 11 test-cover: 12 go test -race -coverprofile=test.out ./... && go tool cover --html=test.out 13 14 bench: 15 go test -benchmem -bench=. ./... 16 17 lint: 18 golangci-lint run --timeout=2m 19 20 tidy: 21 go mod tidy 22 23 cp-asset: 24 rm -rf asset/web && cp -rf web asset/web 25 26 build: 27 go build -ldflags "-X main.date=`date -u +%Y%m%d.%H%M%S` -X main.commit=`git rev-parse --short HEAD`" -o pike 28 29 build-linux: 30 GOOS=linux GOARCH=amd64 make build && mv pike pike-linux 31 32 build-darwin: 33 GOOS=darwin GOARCH=amd64 make build && mv pike pike-darwin 34 35 build-win: 36 GOOS=windows GOARCH=amd64 make build && mv pike pike-win.exe 37 38 hooks: 39 cp hooks/* .git/hooks/