Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b860b0d607 |
No files matched your search
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [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
|
## [1.0.0] - 2026-09-29
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ stk_init();
|
|||||||
|
|
||||||
## Project Status
|
## Project Status
|
||||||
|
|
||||||
**Current Version:** 1.0.0
|
**Current Version:** 1.0.1
|
||||||
|
|
||||||
### What Works
|
### What Works
|
||||||
- Cross-platform module loading and hot-reloading
|
- Cross-platform module loading and hot-reloading
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
|
UNAME_S=$(uname -s)
|
||||||
|
export UNAME_S
|
||||||
|
|
||||||
if [ "$OS" = "linux" ]; then
|
OS=$(echo "$UNAME_S" | tr '[:upper:]' '[:lower:]')
|
||||||
MK_FILE="gmake.mk"
|
|
||||||
else
|
case "$OS" in
|
||||||
MK_FILE="bmake.mk"
|
linux|mingw*|msys*|ucrt*|clang*) MK_FILE="gmake.mk" ;;
|
||||||
fi
|
*) MK_FILE="bmake.mk" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
HAS_INSTALL=0
|
HAS_INSTALL=0
|
||||||
HAS_UNINSTALL=0
|
HAS_UNINSTALL=0
|
||||||
|
|||||||
@@ -1,22 +1,40 @@
|
|||||||
include config.mk
|
include config.mk
|
||||||
|
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(UNAME_S),)
|
||||||
SHELL := cmd.exe
|
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
|
FULL_LIB := $(LIB_NAME).dll
|
||||||
STATIC_LIB := lib$(LIB_NAME).a
|
STATIC_LIB := lib$(LIB_NAME).a
|
||||||
LDFLAGS_PLAT :=
|
LDFLAGS_PLAT :=
|
||||||
CFLAGS_PLAT :=
|
CFLAGS_PLAT :=
|
||||||
CFLAGS_STATIC :=
|
CFLAGS_STATIC :=
|
||||||
MKDIR = if not exist $(subst /,\,$(1)) mkdir $(subst /,\,$(1))
|
|
||||||
RMDIR = if exist $(subst /,\,$(1)) rd /s /q $(subst /,\,$(1))
|
|
||||||
else
|
else
|
||||||
FULL_LIB := lib$(LIB_NAME).so
|
FULL_LIB := lib$(LIB_NAME).so
|
||||||
STATIC_LIB := lib$(LIB_NAME).a
|
STATIC_LIB := lib$(LIB_NAME).a
|
||||||
LDFLAGS_PLAT := -ldl
|
LDFLAGS_PLAT := -ldl
|
||||||
CFLAGS_PLAT := -fPIC
|
CFLAGS_PLAT := -fPIC
|
||||||
CFLAGS_STATIC :=
|
CFLAGS_STATIC :=
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(IS_POSIX_SHELL),1)
|
||||||
MKDIR = mkdir -p $(1)
|
MKDIR = mkdir -p $(1)
|
||||||
RMDIR = rm -rf $(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
|
endif
|
||||||
|
|
||||||
RELEASE_LDFLAGS := -s
|
RELEASE_LDFLAGS := -s
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#define STK_VERSION_MAJOR 1
|
#define STK_VERSION_MAJOR 1
|
||||||
#define STK_VERSION_MINOR 0
|
#define STK_VERSION_MINOR 0
|
||||||
#define STK_VERSION_PATCH 0
|
#define STK_VERSION_PATCH 1
|
||||||
|
|
||||||
#define STK_STRINGIFY_HELPER(x) #x
|
#define STK_STRINGIFY_HELPER(x) #x
|
||||||
#define STK_STRINGIFY(x) STK_STRINGIFY_HELPER(x)
|
#define STK_STRINGIFY(x) STK_STRINGIFY_HELPER(x)
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
|
UNAME_S=$(uname -s)
|
||||||
|
export UNAME_S
|
||||||
|
|
||||||
if [ "$OS" = "linux" ]; then
|
OS=$(echo "$UNAME_S" | tr '[:upper:]' '[:lower:]')
|
||||||
MK_FILE="gmake.mk"
|
|
||||||
else
|
case "$OS" in
|
||||||
MK_FILE="bmake.mk"
|
linux|mingw*|msys*|ucrt*|clang*) MK_FILE="gmake.mk" ;;
|
||||||
fi
|
*) MK_FILE="bmake.mk" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
make -f "$MK_FILE" "$@"
|
make -f "$MK_FILE" "$@"
|
||||||
@@ -1,14 +1,32 @@
|
|||||||
include config.mk
|
include config.mk
|
||||||
|
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(UNAME_S),)
|
||||||
SHELL := cmd.exe
|
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
|
MODULE_EXT = .dll
|
||||||
MKDIR = if not exist $(subst /,\,$(1)) mkdir $(subst /,\,$(1))
|
|
||||||
RMDIR = if exist $(subst /,\,$(1)) rd /s /q $(subst /,\,$(1))
|
|
||||||
else
|
else
|
||||||
MODULE_EXT = .so
|
MODULE_EXT = .so
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(IS_POSIX_SHELL),1)
|
||||||
MKDIR = mkdir -p $(1)
|
MKDIR = mkdir -p $(1)
|
||||||
RMDIR = rm -rf $(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
|
endif
|
||||||
|
|
||||||
CC = cc
|
CC = cc
|
||||||
|
|||||||
+32
-15
@@ -2,9 +2,21 @@ CC := cc
|
|||||||
CFLAGS = -Wall -Wpedantic -I../include -std=c89
|
CFLAGS = -Wall -Wpedantic -I../include -std=c89
|
||||||
LDFLAGS = -L../bin/debug -lstk
|
LDFLAGS = -L../bin/debug -lstk
|
||||||
|
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(UNAME_S),)
|
||||||
SHELL := cmd.exe
|
UNAME_S := $(shell uname -s)
|
||||||
.SHELLFLAGS := /c
|
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
|
MODULE_EXT = .dll
|
||||||
EXE_EXT = .exe
|
EXE_EXT = .exe
|
||||||
else
|
else
|
||||||
@@ -13,6 +25,11 @@ else
|
|||||||
LDFLAGS += -Wl,-rpath,../bin/debug
|
LDFLAGS += -Wl,-rpath,../bin/debug
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq ($(IS_POSIX_SHELL),1)
|
||||||
|
SHELL := cmd.exe
|
||||||
|
.SHELLFLAGS := /c
|
||||||
|
endif
|
||||||
|
|
||||||
.PHONY: all test clean
|
.PHONY: all test clean
|
||||||
|
|
||||||
all: test
|
all: test
|
||||||
@@ -27,28 +44,28 @@ test_mod_dep$(MODULE_EXT): test_mod_dep.c
|
|||||||
$(CC) $(CFLAGS) -fPIC -shared -o $@ test_mod_dep.c
|
$(CC) $(CFLAGS) -fPIC -shared -o $@ test_mod_dep.c
|
||||||
|
|
||||||
setup:
|
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 not exist mods mkdir mods
|
||||||
@if exist test_mod.dll copy /Y test_mod.dll mods\ >nul 2>&1
|
@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
|
@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
|
endif
|
||||||
|
|
||||||
test: test_program$(EXE_EXT) test_mod$(MODULE_EXT) test_mod_dep$(MODULE_EXT) setup
|
test: test_program$(EXE_EXT) test_mod$(MODULE_EXT) test_mod_dep$(MODULE_EXT) setup
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(IS_POSIX_SHELL),1)
|
||||||
@set PATH=../bin/debug;%PATH% && cmd /C "test_program.exe"
|
@./test_program$(EXE_EXT)
|
||||||
else
|
else
|
||||||
@./test_program
|
@set PATH=../bin/debug;%PATH% && cmd /C "test_program.exe"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
clean:
|
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
|
@del /Q test_program.exe test_mod.dll test_mod_dep.dll 2>nul || true
|
||||||
@rmdir /S /Q mods 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
|
endif
|
||||||
Reference in new issue
Block a user