From 5159bae8095fe1ffdbd82ce3626aed329d0cf149 Mon Sep 17 00:00:00 2001 From: Adrian Macneil Date: Sun, 30 Jan 2022 14:24:37 -0800 Subject: [PATCH] Append .exe to Windows builds (#270) --- Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 08beceb8..5e218629 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,10 @@ export CGO_ENABLED = 1 # strip binaries FLAGS := -tags sqlite_omit_load_extension,sqlite_json -ldflags '-s' +# default output file +OUTPUT ?= dbmate + +# platform-specific settings GOOS := $(shell go env GOOS) ifeq ($(GOOS),linux) # statically link binaries to support alpine linux @@ -12,8 +16,11 @@ endif ifeq ($(GOOS),darwin) export SDKROOT ?= $(shell xcrun --sdk macosx --show-sdk-path) endif - -OUTPUT ?= dbmate +ifeq ($(GOOS),windows) + ifneq ($(suffix $(OUTPUT)),.exe) + OUTPUT := $(addsuffix .exe,$(OUTPUT)) + endif +endif .PHONY: all all: fix build wait test