6 Commits
Author SHA1 Message Date
anth64 ad2fb169ca docs: changelog entry for v1.0.3 2026-11-14 18:03:53 +01:00
anth64 b094b385d5 fix: install depends on release instead of manual pre-build
clean+install in one invocation (make or build.sh/build.bat) wiped the
release build between the pre-build and the install check. install now
has a real release prerequisite so make's own dependency graph handles
rebuilds correctly regardless of target order.
2026-11-14 15:41:11 +01:00
anth64 f1b9383d52 docs: release v1.0.2 2026-11-10 19:08:39 +01:00
anth64 fbcca3b8b2 fix: build.bat builds release before install
Matches build.sh: running install without release already built
previously just failed or installed stale artifacts.
2026-11-10 19:08:24 +01:00
anth64 462e3420ea fix: skip doas/sudo escalation for install under MSYS2
Neither doas nor sudo exist there and id -u never reports root,
so install/uninstall always hit the no-root error. IS_WIN is now
computed once alongside MK_FILE and reused for the priv check.
2026-11-10 19:08:11 +01:00
anth64 b860b0d607 fix: support MSYS2 builds on gmake
uname -s under MSYS2 never reports Windows_NT, so build.sh picked
bmake.mk and gmake.mk's platform branches silently fell through to
the Linux path (.so + -ldl), breaking the link. Detect MINGW/MSYS/
UCRT/CLANG uname prefixes in build.sh and route to gmake.mk; export
UNAME_S once so make doesn't call uname again. gmake.mk, test/gmake.mk,
and module_template/gmake.mk now derive Windows-vs-Unix from uname
instead of $(OS), with the cmd.exe/batch command path reserved for
environments without a POSIX shell (MSYS2 keeps mkdir -p/rm -rf).
2026-11-10 19:08:11 +01:00
10 changed files with 122 additions and 46 deletions

No files matched your search

+18
View File
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [1.0.3] - 2026-11-14
### Fixed
- `gmake.mk`/`bmake.mk`: `install` now depends on `release` instead of a manual pre-check, so `clean install` (and `clean` anywhere earlier in the same invocation) no longer wipes the release build out from under `install`
- `build.sh`/`build.bat`: removed the now-redundant manual `release` pre-build, since `make` handles it via the dependency above
## [1.0.2] - 2026-11-10
### Fixed
- `build.sh`: install/uninstall no longer requires `doas`/`sudo` under MSYS2, where neither exists and `id -u` never reports root
- `build.bat`: now builds `release` before `install`, no separate manual build step needed
## [1.0.1] - 2026-11-09
### Fixed
- `build.sh`/`module_template/build.sh`: detect MSYS2 (`MINGW64_NT`/`MINGW32_NT`/`MSYS_NT`/`UCRT64_NT`/`CLANG64_NT` etc.) and route to `gmake.mk` instead of `bmake.mk`; `uname -s` result exported once and reused by make instead of being re-run
- `gmake.mk`/`test/gmake.mk`/`module_template/gmake.mk`: stopped relying on the `OS` env var (unset under MSYS2), now detect Windows via `uname -s` with the native-Windows `cmd.exe`/batch-command path reserved for environments without a POSIX shell; fixes MSYS2 builds failing to link with `cannot find -ldl`
## [1.0.0] - 2026-09-29
### Added
+1 -1
View File
@@ -236,7 +236,7 @@ stk_init();
## Project Status
**Current Version:** 1.0.0
**Current Version:** 1.0.3
### What Works
- Cross-platform module loading and hot-reloading
+1 -2
View File
@@ -72,8 +72,7 @@ test: debug
@echo "=== Building and running stk tests ==="
cd ${.CURDIR}/test && ${MAKE} -f bmake.mk
install:
@test -f ${.CURDIR}/${BIN_DIR}/release/${FULL_LIB} || { echo "Run 'make -f bmake.mk release' before installing."; exit 1; }
install: release
install -d ${LIBDIR} ${INCDIR}/stk
install -m 755 ${.CURDIR}/${BIN_DIR}/release/${FULL_LIB} ${LIBDIR}/
install -m 644 ${.CURDIR}/${BIN_DIR}/release/${STATIC_LIB} ${LIBDIR}/
+2
View File
@@ -1,2 +1,4 @@
@echo off
setlocal
make -f gmake.mk %*
+14 -11
View File
@@ -1,12 +1,19 @@
#!/bin/sh
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
UNAME_S=$(uname -s)
export UNAME_S
if [ "$OS" = "linux" ]; then
MK_FILE="gmake.mk"
else
MK_FILE="bmake.mk"
fi
OS=$(echo "$UNAME_S" | tr '[:upper:]' '[:lower:]')
case "$OS" in
linux|mingw*|msys*|ucrt*|clang*) MK_FILE="gmake.mk" ;;
*) MK_FILE="bmake.mk" ;;
esac
case "$OS" in
mingw*|msys*|ucrt*|clang*) IS_WIN=1 ;;
*) IS_WIN=0 ;;
esac
HAS_INSTALL=0
HAS_UNINSTALL=0
@@ -18,11 +25,7 @@ for arg in "$@"; do
done
if [ "$HAS_INSTALL" = "1" ] || [ "$HAS_UNINSTALL" = "1" ]; then
if [ "$HAS_INSTALL" = "1" ]; then
make -f "$MK_FILE" release
fi
if [ "$(id -u)" = "0" ]; then
if [ "$IS_WIN" = "1" ] || [ "$(id -u)" = "0" ]; then
PRIV=""
elif command -v doas > /dev/null 2>&1; then
PRIV="doas"
+23 -6
View File
@@ -1,22 +1,40 @@
include config.mk
ifeq ($(OS),Windows_NT)
SHELL := cmd.exe
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)
FULL_LIB := $(LIB_NAME).dll
STATIC_LIB := lib$(LIB_NAME).a
LDFLAGS_PLAT :=
CFLAGS_PLAT :=
CFLAGS_STATIC :=
MKDIR = if not exist $(subst /,\,$(1)) mkdir $(subst /,\,$(1))
RMDIR = if exist $(subst /,\,$(1)) rd /s /q $(subst /,\,$(1))
else
FULL_LIB := lib$(LIB_NAME).so
STATIC_LIB := lib$(LIB_NAME).a
LDFLAGS_PLAT := -ldl
CFLAGS_PLAT := -fPIC
CFLAGS_STATIC :=
endif
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
RELEASE_LDFLAGS := -s
@@ -81,8 +99,7 @@ test: debug
@$(MAKE) -C test -f gmake.mk
ifneq ($(OS),Windows_NT)
install:
@test -f $(BIN_DIR)/release/$(FULL_LIB) || { echo "Run 'make -f gmake.mk release' before installing."; exit 1; }
install: release
install -d $(LIBDIR) $(INCDIR)/stk
install -m 755 $(BIN_DIR)/release/$(FULL_LIB) $(LIBDIR)/
install -m 644 $(BIN_DIR)/release/$(STATIC_LIB) $(LIBDIR)/
+1 -1
View File
@@ -3,7 +3,7 @@
#define STK_VERSION_MAJOR 1
#define STK_VERSION_MINOR 0
#define STK_VERSION_PATCH 0
#define STK_VERSION_PATCH 3
#define STK_STRINGIFY_HELPER(x) #x
#define STK_STRINGIFY(x) STK_STRINGIFY_HELPER(x)
+8 -6
View File
@@ -1,11 +1,13 @@
#!/bin/sh
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
UNAME_S=$(uname -s)
export UNAME_S
if [ "$OS" = "linux" ]; then
MK_FILE="gmake.mk"
else
MK_FILE="bmake.mk"
fi
OS=$(echo "$UNAME_S" | tr '[:upper:]' '[:lower:]')
case "$OS" in
linux|mingw*|msys*|ucrt*|clang*) MK_FILE="gmake.mk" ;;
*) MK_FILE="bmake.mk" ;;
esac
make -f "$MK_FILE" "$@"
+22 -4
View File
@@ -1,14 +1,32 @@
include config.mk
ifeq ($(OS),Windows_NT)
SHELL := cmd.exe
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)
MODULE_EXT = .dll
MKDIR = if not exist $(subst /,\,$(1)) mkdir $(subst /,\,$(1))
RMDIR = if exist $(subst /,\,$(1)) rd /s /q $(subst /,\,$(1))
else
MODULE_EXT = .so
endif
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
CC = cc
+32 -15
View File
@@ -2,9 +2,21 @@ CC := cc
CFLAGS = -Wall -Wpedantic -I../include -std=c89
LDFLAGS = -L../bin/debug -lstk
ifeq ($(OS),Windows_NT)
SHELL := cmd.exe
.SHELLFLAGS := /c
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)
MODULE_EXT = .dll
EXE_EXT = .exe
else
@@ -13,6 +25,11 @@ else
LDFLAGS += -Wl,-rpath,../bin/debug
endif
ifneq ($(IS_POSIX_SHELL),1)
SHELL := cmd.exe
.SHELLFLAGS := /c
endif
.PHONY: all test clean
all: test
@@ -27,28 +44,28 @@ test_mod_dep$(MODULE_EXT): test_mod_dep.c
$(CC) $(CFLAGS) -fPIC -shared -o $@ test_mod_dep.c
setup:
ifeq ($(OS),Windows_NT)
ifeq ($(IS_POSIX_SHELL),1)
@mkdir -p mods
@cp -f test_mod$(MODULE_EXT) mods/ 2>/dev/null || true
@cp -f test_mod_dep$(MODULE_EXT) mods/ 2>/dev/null || true
else
@if not exist mods mkdir mods
@if exist test_mod.dll copy /Y test_mod.dll mods\ >nul 2>&1
@if exist test_mod_dep.dll copy /Y test_mod_dep.dll mods\ >nul 2>&1
else
@mkdir -p mods
@cp -f test_mod.so mods/ 2>/dev/null || true
@cp -f test_mod_dep.so mods/ 2>/dev/null || true
endif
test: test_program$(EXE_EXT) test_mod$(MODULE_EXT) test_mod_dep$(MODULE_EXT) setup
ifeq ($(OS),Windows_NT)
@set PATH=../bin/debug;%PATH% && cmd /C "test_program.exe"
ifeq ($(IS_POSIX_SHELL),1)
@./test_program$(EXE_EXT)
else
@./test_program
@set PATH=../bin/debug;%PATH% && cmd /C "test_program.exe"
endif
clean:
ifeq ($(OS),Windows_NT)
ifeq ($(IS_POSIX_SHELL),1)
@rm -f test_program$(EXE_EXT) test_mod$(MODULE_EXT) test_mod_dep$(MODULE_EXT)
@rm -rf mods
else
@del /Q test_program.exe test_mod.dll test_mod_dep.dll 2>nul || true
@rmdir /S /Q mods 2>nul || true
else
@rm -f test_program test_mod.so test_mod_dep.so
@rm -rf mods
endif