github.com/jacekolszak/noteo@v0.5.0/Makefile (about) 1 mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) 2 mkfile_dir := $(dir $(mkfile_path)) 3 4 .PHONY: all 5 all: lint test install 6 7 .PHONY: install 8 install: 9 # -s omits the symbol table and debug information 10 # -w omits the DWARF symbol table 11 go install -ldflags "-s -w" 12 13 .PHONY: lint 14 lint: 15 echo $(mkfile_dir) 16 docker run --rm -v $(mkfile_dir):/app -w /app golangci/golangci-lint:v1.30.0 golangci-lint run -v -E goimports,unconvert,misspell,gocyclo,deadcode,errcheck,gosimple,govet,ineffassign,staticcheck,structcheck,typecheck,unused,varcheck,gocritic,gochecknoinits 17 18 .PHONY: test 19 test: 20 go test -race ./... 21 22 .PHONY: test 23 release: 24 env GOOS=linux GOARCH=amd64 go build -o releases/linux_amd64/noteo 25 cd releases/linux_amd64 && tar cfz noteo_linux.tar.gz noteo 26 env GOOS=darwin GOARCH=amd64 go build -o releases/darwin_amd64/noteo 27 cd releases/darwin_amd64 && tar cfz noteo_macos.tar.gz noteo 28 env GOOS=windows GOARCH=amd64 go build -o releases/windows_amd64/noteo.exe 29 cd releases/windows_amd64 && zip noteo_windows.zip noteo.exe