7 Commits

5 changed files with 50 additions and 49 deletions
+21 -1
View File
@@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [1.0.0-pre.12] - 2026-03-29
### Fixed
- `gmake.mk`: changed static library extension on Windows from `.lib` to `.a` for MinGW compatibility
- `module_loader`: use `RTLD_GLOBAL` when loading modules to correctly expose host symbols to dynamic libraries
## [1.0.0-pre.11] - 2026-03-15
### Fixed
- `gmake.mk`: `PREFIX` now defaults to `/usr` on Linux instead of `/usr/local`
## [1.0.0-pre.10] - 2026-03-14
### Fixed
- `bmake.mk`: all target and object paths now anchored with `${.CURDIR}` to fix incorrect path nesting when building from outside the project root; substitution delimiters switched to `|` to avoid conflicts with path separators; compile rules now emit `-MT`/`-MF` for correct dependency file targeting; removed stale `.-include` directives for `.d` files; release lib rules now use `${.TARGET}` consistently
- `gmake.mk`: removed `AR`/`ARFLAGS_STATIC` variables and the `ifeq`-guarded static lib rules; both debug and release static lib rules now use `ar rcs` directly, as MinGW ships `ar` and `lib.exe` was incorrect
## [1.0.0-pre.9] - 2026-03-12
### Changed
@@ -201,7 +218,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Dependency management and versioning not yet implemented
- API is unstable and subject to change in future releases
[Unreleased]: https://github.com/anth64/stk/compare/v1.0.0-pre.9...HEAD
[Unreleased]: https://github.com/anth64/stk/compare/v1.0.0-pre.12...HEAD
[1.0.0-pre.12]: https://github.com/anth64/stk/compare/v1.0.0-pre.11...v1.0.0-pre.12
[1.0.0-pre.11]: https://github.com/anth64/stk/compare/v1.0.0-pre.10...v1.0.0-pre.11
[1.0.0-pre.10]: https://github.com/anth64/stk/compare/v1.0.0-pre.9...v1.0.0-pre.10
[1.0.0-pre.9]: https://github.com/anth64/stk/compare/v1.0.0-pre.8...v1.0.0-pre.9
[1.0.0-pre.8]: https://github.com/anth64/stk/compare/v1.0.0-pre.7...v1.0.0-pre.8
[1.0.0-pre.7]: https://github.com/anth64/stk/compare/v1.0.0-pre.6...v1.0.0-pre.7
+2 -2
View File
@@ -46,7 +46,7 @@ build.bat debug release
./build.sh install
```
Installs to `/usr/local` by default. Use `PREFIX` to customize:
Installs to `/usr` on Linux, `/usr/local` on BSD/macOS by default. Use `PREFIX` to customize:
```bash
./build.sh PREFIX=$HOME/.local install
```
@@ -234,7 +234,7 @@ stk_init();
## Project Status
**Current Version:** 1.0.0-pre.9
**Current Version:** 1.0.0-pre.12
### What Works
- Cross-platform module loading and hot-reloading
+22 -29
View File
@@ -23,55 +23,48 @@ CFLAGS_STATIC =
all: debug
OBJS_DEBUG_SHARED = ${SRCS:S/^src\//obj\/debug\/shared\//:S/.c$/.o/}
OBJS_DEBUG_STATIC = ${SRCS:S/^src\//obj\/debug\/static\//:S/.c$/.o/}
OBJS_RELEASE_SHARED = ${SRCS:S/^src\//obj\/release\/shared\//:S/.c$/.o/}
OBJS_RELEASE_STATIC = ${SRCS:S/^src\//obj\/release\/static\//:S/.c$/.o/}
OBJS_DEBUG_SHARED = ${SRCS:S|^src/|${.CURDIR}/obj/debug/shared/|:S/.c$/.o/}
OBJS_DEBUG_STATIC = ${SRCS:S|^src/|${.CURDIR}/obj/debug/static/|:S/.c$/.o/}
OBJS_RELEASE_SHARED = ${SRCS:S|^src/|${.CURDIR}/obj/release/shared/|:S/.c$/.o/}
OBJS_RELEASE_STATIC = ${SRCS:S|^src/|${.CURDIR}/obj/release/static/|:S/.c$/.o/}
debug: ${BIN_DIR}/debug/${FULL_LIB} ${BIN_DIR}/debug/${STATIC_LIB}
release: ${BIN_DIR}/release/${FULL_LIB} ${BIN_DIR}/release/${STATIC_LIB}
debug: ${.CURDIR}/${BIN_DIR}/debug/${FULL_LIB} ${.CURDIR}/${BIN_DIR}/debug/${STATIC_LIB}
release: ${.CURDIR}/${BIN_DIR}/release/${FULL_LIB} ${.CURDIR}/${BIN_DIR}/release/${STATIC_LIB}
${BIN_DIR}/debug/${FULL_LIB}: ${OBJS_DEBUG_SHARED}
${.CURDIR}/${BIN_DIR}/debug/${FULL_LIB}: ${OBJS_DEBUG_SHARED}
@mkdir -p ${.TARGET:H}
${CC} -shared -o ${.TARGET} ${.ALLSRC} ${LDFLAGS_PLAT}
${BIN_DIR}/debug/${STATIC_LIB}: ${OBJS_DEBUG_STATIC}
${.CURDIR}/${BIN_DIR}/debug/${STATIC_LIB}: ${OBJS_DEBUG_STATIC}
@mkdir -p ${.TARGET:H}
ar rcs ${.TARGET} ${.ALLSRC}
${BIN_DIR}/release/${FULL_LIB}: ${OBJS_RELEASE_SHARED}
@mkdir -p ${.CURDIR}/${BIN_DIR}/release
${CC} -shared -s -o ${.CURDIR}/${BIN_DIR}/release/${FULL_LIB} ${.ALLSRC} ${LDFLAGS_PLAT}
${.CURDIR}/${BIN_DIR}/release/${FULL_LIB}: ${OBJS_RELEASE_SHARED}
@mkdir -p ${.TARGET:H}
${CC} -shared -s -o ${.TARGET} ${.ALLSRC} ${LDFLAGS_PLAT}
${BIN_DIR}/release/${STATIC_LIB}: ${OBJS_RELEASE_STATIC}
@mkdir -p ${.CURDIR}/${BIN_DIR}/release
ar rcs ${.CURDIR}/${BIN_DIR}/release/${STATIC_LIB} ${.ALLSRC}
${.CURDIR}/${BIN_DIR}/release/${STATIC_LIB}: ${OBJS_RELEASE_STATIC}
@mkdir -p ${.TARGET:H}
ar rcs ${.TARGET} ${.ALLSRC}
.for _src in ${SRCS}
_obj_base = ${_src:S/^src\///:S/.c$/.o/}
obj/debug/shared/${_obj_base}: ${_src}
${.CURDIR}/obj/debug/shared/${_src:S|^src/||:S/.c$/.o/}: ${.CURDIR}/${_src}
@mkdir -p ${.TARGET:H}
${CC} ${CFLAGS_BASE} -g -O0 -MMD -MP -c ${.ALLSRC} -o ${.TARGET}
${CC} ${CFLAGS_BASE} -g -O0 -MMD -MP -MT ${.TARGET} -MF ${.TARGET:S/.o$/.d/} -c ${.ALLSRC} -o ${.TARGET}
obj/debug/static/${_obj_base}: ${_src}
${.CURDIR}/obj/debug/static/${_src:S|^src/||:S/.c$/.o/}: ${.CURDIR}/${_src}
@mkdir -p ${.TARGET:H}
${CC} ${CFLAGS_BASE} ${CFLAGS_STATIC} -g -O0 -MMD -MP -c ${.ALLSRC} -o ${.TARGET}
${CC} ${CFLAGS_BASE} ${CFLAGS_STATIC} -g -O0 -MMD -MP -MT ${.TARGET} -MF ${.TARGET:S/.o$/.d/} -c ${.ALLSRC} -o ${.TARGET}
obj/release/shared/${_obj_base}: ${_src}
${.CURDIR}/obj/release/shared/${_src:S|^src/||:S/.c$/.o/}: ${.CURDIR}/${_src}
@mkdir -p ${.TARGET:H}
${CC} ${CFLAGS_BASE} -O2 -MMD -MP -c ${.ALLSRC} -o ${.TARGET}
${CC} ${CFLAGS_BASE} -O2 -MMD -MP -MT ${.TARGET} -MF ${.TARGET:S/.o$/.d/} -c ${.ALLSRC} -o ${.TARGET}
obj/release/static/${_obj_base}: ${_src}
${.CURDIR}/obj/release/static/${_src:S|^src/||:S/.c$/.o/}: ${.CURDIR}/${_src}
@mkdir -p ${.TARGET:H}
${CC} ${CFLAGS_BASE} ${CFLAGS_STATIC} -O2 -MMD -MP -c ${.ALLSRC} -o ${.TARGET}
${CC} ${CFLAGS_BASE} ${CFLAGS_STATIC} -O2 -MMD -MP -MT ${.TARGET} -MF ${.TARGET:S/.o$/.d/} -c ${.ALLSRC} -o ${.TARGET}
.endfor
.-include "obj/debug/shared/*.d"
.-include "obj/debug/static/*.d"
.-include "obj/release/shared/*.d"
.-include "obj/release/static/*.d"
clean:
rm -rf ${.CURDIR}/${OBJ_DIR} ${.CURDIR}/${BIN_DIR}
+4 -16
View File
@@ -3,14 +3,12 @@ include config.mk
ifeq ($(OS),Windows_NT)
SHELL := cmd.exe
FULL_LIB := $(LIB_NAME).dll
STATIC_LIB := $(LIB_NAME).lib
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))
AR := lib
ARFLAGS_STATIC := /OUT:
else
FULL_LIB := lib$(LIB_NAME).so
STATIC_LIB := lib$(LIB_NAME).a
@@ -19,14 +17,12 @@ else
CFLAGS_STATIC :=
MKDIR = mkdir -p $(1)
RMDIR = rm -rf $(1)
AR := ar
ARFLAGS_STATIC := rcs
endif
RELEASE_LDFLAGS := -s
CFLAGS_BASE := -Wall -Wpedantic -I$(INC_DIR) -std=c89 $(CFLAGS_PLAT)
PREFIX ?= /usr/local
PREFIX ?= /usr
LIBDIR ?= $(PREFIX)/lib
INCDIR ?= $(PREFIX)/include
@@ -44,11 +40,7 @@ $(BIN_DIR)/debug/$(FULL_LIB): $(SRCS:src/%.c=obj/debug/shared/%.o)
$(BIN_DIR)/debug/$(STATIC_LIB): $(SRCS:src/%.c=obj/debug/static/%.o)
@$(call MKDIR,$(@D))
ifeq ($(OS),Windows_NT)
$(AR) $(ARFLAGS_STATIC)$@ $^
else
$(AR) $(ARFLAGS_STATIC) $@ $^
endif
ar rcs $@ $^
obj/debug/shared/%.o: src/%.c
@$(call MKDIR,$(@D))
@@ -65,11 +57,7 @@ $(BIN_DIR)/release/$(FULL_LIB): $(SRCS:src/%.c=obj/release/shared/%.o)
$(BIN_DIR)/release/$(STATIC_LIB): $(SRCS:src/%.c=obj/release/static/%.o)
@$(call MKDIR,$(@D))
ifeq ($(OS),Windows_NT)
$(AR) $(ARFLAGS_STATIC)$@ $^
else
$(AR) $(ARFLAGS_STATIC) $@ $^
endif
ar rcs $@ $^
obj/release/shared/%.o: src/%.c
@$(call MKDIR,$(@D))
+1 -1
View File
@@ -278,7 +278,7 @@ void *platform_load_library(const char *path)
#ifdef _WIN32
return (void *)LoadLibraryA(path);
#else
return dlopen(path, RTLD_NOW);
return dlopen(path, RTLD_NOW | RTLD_GLOBAL);
#endif
}