fix(install): install headers to stk/ subdirectory for proper namespacing

- Install headers to /include/stk/ instead of /include/
- Update README examples to use #include <stk/stk.h>
- Update Windows install instructions to reflect stk/ directory structure
- Add MPL-2.0 license badge to README
- Clarify DLL can be placed in binary or lib directory on Windows

This prevents header name collisions with other libraries and follows
standard library distribution conventions (similar to SDL).
Users now include stk headers as <stk/stk.h> rather than <stk.h>.
This commit is contained in:
2026-02-02 22:52:44 +01:00
parent 96a3d80e60
commit 043fea6092
3 changed files with 17 additions and 10 deletions
+5 -3
View File
@@ -1,5 +1,7 @@
# stk (Stalwart Toolkit) # stk (Stalwart Toolkit)
[![License: MPL 2.0](https://img.shields.io/badge/License-MPL_2.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)
`stk` is a lightweight, modular toolkit for building games and game engines. It provides a **portable foundation** for dynamically loading modules, native or WASM, without enforcing any architecture or design choices. `stk` is a lightweight, modular toolkit for building games and game engines. It provides a **portable foundation** for dynamically loading modules, native or WASM, without enforcing any architecture or design choices.
It is designed to run on modern systems running POSIX and Windows using C89. It is designed to run on modern systems running POSIX and Windows using C89.
@@ -53,7 +55,7 @@ sudo ./build.sh PREFIX=$HOME/.local install
``` ```
build.bat release build.bat release
``` ```
* Once finished building, copy `include/stk.h` and `bin/release/stk.dll` to your project directory. * Once finished building, copy the headers from `include/` to `your_project/include/stk/` and `bin/release/stk.dll` to your project's lib directory.
--- ---
@@ -62,7 +64,7 @@ build.bat release
### Basic Example ### Basic Example
```c ```c
#include <stk.h> #include <stk/stk.h>
#include <stdio.h> #include <stdio.h>
int main(void) int main(void)
@@ -197,7 +199,7 @@ Run the included test suite:
build.bat test # Windows build.bat test # Windows
``` ```
The test will watch the `modules/` directory and report when modules are loaded, reloaded, or unloaded. The test will watch the `mods/` directory and report when modules are loaded, reloaded, or unloaded.
--- ---
+5 -3
View File
@@ -58,10 +58,12 @@ test: debug
cd ${.CURDIR}/test && ${MAKE} -f bmake.mk cd ${.CURDIR}/test && ${MAKE} -f bmake.mk
install: release install: release
install -d ${LIBDIR} ${INCDIR} install -d ${LIBDIR} ${INCDIR}/stk
install -m 755 ${.CURDIR}/${BIN_DIR}/release/${FULL_LIB} ${LIBDIR}/ install -m 755 ${.CURDIR}/${BIN_DIR}/release/${FULL_LIB} ${LIBDIR}/
install -m 644 ${.CURDIR}/${INC_DIR}/stk.h ${INCDIR}/ install -m 644 ${.CURDIR}/${INC_DIR}/stk.h ${INCDIR}/stk/
install -m 644 ${.CURDIR}/${INC_DIR}/stk_version.h ${INCDIR}/stk/
install -m 644 ${.CURDIR}/${INC_DIR}/stk_log.h ${INCDIR}/stk/
uninstall: uninstall:
rm -f ${LIBDIR}/${FULL_LIB} rm -f ${LIBDIR}/${FULL_LIB}
rm -f ${INCDIR}/stk.h rm -rf ${INCDIR}/stk
+7 -4
View File
@@ -61,17 +61,20 @@ test: debug
# Installation (Unix only) # Installation (Unix only)
ifneq ($(OS),Windows_NT) ifneq ($(OS),Windows_NT)
install: release install: release
install -d $(LIBDIR) $(INCDIR) install -d $(LIBDIR) $(INCDIR)/stk
install -m 755 $(BIN_DIR)/release/$(FULL_LIB) $(LIBDIR)/ install -m 755 $(BIN_DIR)/release/$(FULL_LIB) $(LIBDIR)/
install -m 644 $(INC_DIR)/stk.h $(INCDIR)/ install -m 644 $(INC_DIR)/stk.h $(INCDIR)/stk/
install -m 644 $(INC_DIR)/stk_version.h $(INCDIR)/stk/
install -m 644 $(INC_DIR)/stk_log.h $(INCDIR)/stk/
uninstall: uninstall:
rm -f $(LIBDIR)/$(FULL_LIB) rm -f $(LIBDIR)/$(FULL_LIB)
rm -f $(INCDIR)/stk.h rm -rf $(INCDIR)/stk
else else
install: install:
@echo "make install is not supported on Windows." @echo "make install is not supported on Windows."
@echo "Copy include/stk.h and bin/release/stk.dll to your project." @echo "Copy include/ directory contents to your_project/include/stk/"
@echo "Copy bin/release/stk.dll to your project's lib directory."
uninstall: uninstall:
@echo "make uninstall is not supported on Windows." @echo "make uninstall is not supported on Windows."