Compare commits

...
2 Commits
Author SHA1 Message Date
anth64 afca7ac885 docs: add CHANGELOG.md 2026-11-10 07:50:39 +01:00
anth64 fce0ee79cb fix: support MSYS2 builds on gmake
uname -s under MSYS2 never reports Windows_NT, so gmake.mk's
Windows_NT checks could silently fall through to the Linux path.
Detect MINGW/MSYS/UCRT/CLANG/CYGWIN uname prefixes in build.sh
and gmake.mk, separating "building for Windows" (binary names,
libs) from "running under cmd.exe" (mkdir/rd vs mkdir -p/rm -rf).
MSYS2 keeps the posix shell builtins even when targeting Windows.
2026-11-10 07:50:39 +01:00
3 changed files with 42 additions and 9 deletions

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Fixed
- `build.sh`: `uname -s` exported once and reused by make instead of being re-run
- `gmake.mk`: stopped relying on the `OS` env var alone (unset under MSYS2), now also detects Windows via `uname -s` (`MINGW*`/`MSYS*`/`UCRT*`/`CLANG*`/`CYGWIN*`), with the native-Windows `cmd.exe` mkdir/rd path reserved for environments without a POSIX shell; fixes MSYS2 builds silently falling through to the Linux `mkdir -p`/`rm -rf` path mismatch
+4 -1
View File
@@ -1,6 +1,9 @@
#!/bin/sh
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
UNAME_S=$(uname -s)
export UNAME_S
OS=$(echo "$UNAME_S" | tr '[:upper:]' '[:lower:]')
if [ "$OS" = "freebsd" ]; then
MK_FILE="bmake.mk"
+26 -8
View File
@@ -1,4 +1,18 @@
ifeq ($(OS),Windows_NT)
ifeq ($(UNAME_S),)
UNAME_S := $(shell uname -s)
endif
ifneq (,$(filter MINGW% MSYS% UCRT% CLANG% CYGWIN%,$(UNAME_S)))
IS_WINDOWS := 1
IS_POSIX_SHELL := 1
else ifeq ($(OS),Windows_NT)
IS_WINDOWS := 1
IS_POSIX_SHELL :=
else
IS_WINDOWS :=
IS_POSIX_SHELL := 1
endif
ifeq ($(IS_WINDOWS),1)
CLOCK_SRC := src/platform/clock/win32.c
INPUT_SRC := src/platform/client/input/sdl.c
else
@@ -19,8 +33,7 @@ LIBSKELE_SRCS := $(ENGINE_SRCS) $(SOFT_PLAT_SRCS)
LIBGLSKELE_SRCS := $(ENGINE_SRCS) $(GL_PLAT_SRCS)
LIBSKELE_SRV_SRCS := $(ENGINE_SRCS)
ifeq ($(OS),Windows_NT)
SHELL := cmd.exe
ifeq ($(IS_WINDOWS),1)
LIBSKELE := $(BIN_DIR)/debug/libskele.a
LIBGLSKELE := $(BIN_DIR)/debug/libglskele.a
LIBSKELE_SRV := $(BIN_DIR)/debug/libskeleserver.a
@@ -35,8 +48,6 @@ ifeq ($(OS),Windows_NT)
SERVER_BIN_R := $(BIN_DIR)/release/skele_server.exe
LDFLAGS_PLAT :=
CFLAGS_PLAT :=
MKDIR = if not exist $(subst /,\,$(1)) mkdir $(subst /,\,$(1))
RMDIR = if exist $(subst /,\,$(1)) rd /s /q $(subst /,\,$(1))
else
LIBSKELE := $(BIN_DIR)/debug/libskele.a
LIBGLSKELE := $(BIN_DIR)/debug/libglskele.a
@@ -52,11 +63,18 @@ else
SERVER_BIN_R := $(BIN_DIR)/release/skele_server
LDFLAGS_PLAT :=
CFLAGS_PLAT :=
MKDIR = mkdir -p $(1)
RMDIR = rm -rf $(1)
endif
ifeq ($(OS),Windows_NT)
ifeq ($(IS_POSIX_SHELL),1)
MKDIR = mkdir -p $(1)
RMDIR = rm -rf $(1)
else
SHELL := cmd.exe
MKDIR = if not exist $(subst /,\,$(1)) mkdir $(subst /,\,$(1))
RMDIR = if exist $(subst /,\,$(1)) rd /s /q $(subst /,\,$(1))
endif
ifeq ($(IS_WINDOWS),1)
GL_LIB := -lopengl32
LDFLAGS_PLAT :=
CFLAGS_PLAT :=