Skip to content

Commit

Permalink
Append .exe to Windows builds (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
amacneil authored Jan 30, 2022
1 parent 09b8d69 commit 5159bae
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 5159bae

Please sign in to comment.