diff --git a/GNUmakefile b/GNUmakefile deleted file mode 100644 index c3f2d048..00000000 --- a/GNUmakefile +++ /dev/null @@ -1,47 +0,0 @@ -.PHONY: build -export CGO=0 - -DIR = $(shell echo $${DIR:-$(shell pwd)/builds}) - -# Builds for mac os -build_mac: GOOS = darwin -build_mac: GOARCH = amd64 -build_mac: _build - -# Builds for linux 32bit -build_linux_386: GOOS = linux -build_linux_386: GOARCH = 386 -build_linux_386: _build - -# Builds for linux 64bit -build_linux_amd64: GOOS = linux -build_linux_amd64: GOARCH = amd64 -build_linux_amd64: _build - -# Builds for Windows 64bit -build_windows_64: GOOS = windows -build_windows_64: GOARCH = amd64 -build_windows_64: _build_win - -# Builds for Windows 32bit -build_windows_32: GOOS = windows -build_windows_32: GOARCH = 386 -build_windows_32: _build_win - -_build: - @mkdir -p builds - @echo "building vultr-cli" - env GOOS=$(GOOS) GOARCH=$(GOARCH) go build -gcflags=-trimpath=$$GOPATH -o $(DIR)/vultr-cli_$(GOOS)_$(GOARCH) - @echo "built $(DIR)/vultr-cli_$(GOOS)_$(GOARCH)" - -_build_win: - @mkdir -p builds - @echo "building vultr-cli" - env GOOS=$(GOOS) GOARCH=$(GOARCH) go build -gcflags=-trimpath=$$GOPATH -o $(DIR)/vultr-cli_$(GOOS)_$(GOARCH).exe - @echo "built $(DIR)/vultr-cli_$(GOOS)_$(GOARCH)" - -remove: - @rm -rf builds - -format: - @go fmt ./... \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..7b77aa34 --- /dev/null +++ b/Makefile @@ -0,0 +1,30 @@ +.PHONY: remove format + +export CGO=0 +export GOFLAGS=-mod=vendor -trimpath + +DIR?=builds + +$(DIR): + mkdir -p $(DIR) + +$(DIR)/vultr-cli_darwin_amd64: $(DIR) + env GOOS=darwin GOARCH=amd64 go build -o $@ + +$(DIR)/vultr-cli_linux_386: $(DIR) + env GOOS=linux GOARCH=386 go build -o $@ + +$(DIR)/vultr-cli_linux_amd64: $(DIR) + env GOOS=linux GOARCH=amd64 go build -o $@ + +$(DIR)/vultr-cli_windows_386.exe: $(DIR) + env GOOS=windows GOARCH=386 go build -o $@ + +$(DIR)/vultr-cli_windows_amd64.exe: $(DIR) + env GOOS=windows GOARCH=amd64 go build -o $@ + +remove: + @rm -rf builds + +format: + @go fmt ./...