diff options
author | Sergey Zolotarev <sryze@protonmail.com> | 2023-10-06 20:39:21 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-06 16:39:21 -0400 |
commit | 6acce16ee3a03df1cc06c46398f594009a0e31b9 (patch) | |
tree | 17068e87bf0000448c022a3287691a2cb1d05966 /Makefile | |
parent | e820d9966d55db0c219a40450c6881ba48730070 (diff) | |
download | gitea-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-- | Makefile | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -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 |