BIN_NAME = "hmdeploy-linux-unknown-amd64" BIN_INSTALL = $(shell whereis $(BIN_NAME) | cut -d ' ' -f2) VERSION = 0.1.1 run: lint @go run main.go build: lint @echo "building binary..." @CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X main.Version=$(VERSION)" -o $(BIN_NAME) main.go && echo "$(BIN_NAME) v$(VERSION) built" install: build @echo "installing v$(VERSION)..." @mv $(BIN_NAME) $(GOPATH)/bin/hmdeploy @echo "program installed: $(GOPATH)/bin/hmdeploy" @$(GOPATH)/bin/hmdeploy --version lint: @echo "format and lint..." @golangci-lint fmt ./... @golangci-lint run ./...