diff --git a/Makefile b/Makefile index 2eef4af..e4b99cc 100644 --- a/Makefile +++ b/Makefile @@ -12,14 +12,14 @@ GIT := $(shell git rev-parse --short HEAD) DIRTY := $(shell git diff-index --quiet HEAD 2> /dev/null > /dev/null || echo "-dirty") -default: build/dev.${UNAME_S} build/dev ## Builds dev for your current operating system and runs tests +default: build/dev ## Builds dev for your current operating system and runs tests .PHONY: help help: ## Show this help @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) .PHONY: all -all: build/dev.linux build/dev.darwin ## Builds dev binaries for linux and osx +all: build/dev ## Builds dev binaries for all operating systems .PHONY: clean clean: ## Removes all build artifacts @@ -40,18 +40,12 @@ test: .PHONY: checks checks: lint vet test ## Run static analysis and tests -build/dev.linux: $(GOFILES_BUILD) ## Creates the linux binary - @GOOS=linux CGO_ENABLED=0 go build -ldflags \ - '-X "github.com/wish/dev/cmd.BuildDate=${DATE}" -X "github.com/wish/dev/cmd.BuildSha=$(GIT)${DIRTY}" -X "github.com/wish/dev/cmd.BuildVersion=$(VERSION)${V_DIRTY}"' \ - -o build/dev.linux -mod=vendor cmd/dev/* - -build/dev.darwin: $(GOFILES_BUILD) ## Creates the osx binary - @GOOS=darwin CGO_ENABLED=0 go build -ldflags \ +build/dev: ## Make a link to the executable for this OS type for convenience + @CGO_ENABLED=0 go build -ldflags \ '-X "github.com/wish/dev/cmd.BuildDate=${DATE}" -X "github.com/wish/dev/cmd.BuildSha=$(GIT)${DIRTY}" -X "github.com/wish/dev/cmd.BuildVersion=$(VERSION)${V_DIRTY}"' \ - -o build/dev.darwin -mod=vendor cmd/dev/* + -o build/dev -mod=vendor cmd/dev/* -build/dev: ## Make a link to the executable for this OS type for convenience - $(shell mkdir -p build; ln -s dev.${UNAME_S} build/dev) + $(shell mkdir -p build; ln -s build/dev) .PHONY: watch watch: ## Watch .go files for changes and rerun build (requires entr, see https://github.com/clibs/entr)