summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSergey Zolotarev <sryze@protonmail.com>2023-10-06 20:39:21 +0000
committerGitHub <noreply@github.com>2023-10-06 16:39:21 -0400
commit6acce16ee3a03df1cc06c46398f594009a0e31b9 (patch)
tree17068e87bf0000448c022a3287691a2cb1d05966 /Makefile
parente820d9966d55db0c219a40450c6881ba48730070 (diff)
downloadgitea-6acce16ee3a03df1cc06c46398f594009a0e31b9.tar.gz
gitea-6acce16ee3a03df1cc06c46398f594009a0e31b9.zip
Remove .exe suffix when cross-compiling on Windows (#27448)
When compiling GItea for Linux on Windows, you get a `gitea.exe` file as output, but because it's a Linux executable, the `.exe` extension is unnecessary. This PR adds a check for `GOOS` environment variable in addition to `OS`.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 8 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index cbf3aff8eb..0662da5536 100644
--- a/Makefile
+++ b/Makefile
@@ -49,10 +49,14 @@ ifeq ($(HAS_GO), yes)
CGO_CFLAGS ?= $(shell $(GO) env CGO_CFLAGS) $(CGO_EXTRA_CFLAGS)
endif
-ifeq ($(OS), Windows_NT)
- GOFLAGS := -v -buildmode=exe
- EXECUTABLE ?= gitea.exe
-else ifeq ($(OS), Windows)
+ifeq ($(GOOS),windows)
+ IS_WINDOWS := yes
+else ifeq ($(patsubst Windows%,Windows,$(OS)),Windows)
+ ifeq ($(GOOS),)
+ IS_WINDOWS := yes
+ endif
+endif
+ifeq ($(IS_WINDOWS),yes)
GOFLAGS := -v -buildmode=exe
EXECUTABLE ?= gitea.exe
else