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:
@@ -1,5 +1,7 @@
|
||||
# stk (Stalwart Toolkit)
|
||||
|
||||
[](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.
|
||||
|
||||
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
|
||||
```
|
||||
* 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
|
||||
|
||||
```c
|
||||
#include <stk.h>
|
||||
#include <stk/stk.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void)
|
||||
@@ -197,7 +199,7 @@ Run the included test suite:
|
||||
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.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -58,10 +58,12 @@ test: debug
|
||||
cd ${.CURDIR}/test && ${MAKE} -f bmake.mk
|
||||
|
||||
install: release
|
||||
install -d ${LIBDIR} ${INCDIR}
|
||||
install -d ${LIBDIR} ${INCDIR}/stk
|
||||
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:
|
||||
rm -f ${LIBDIR}/${FULL_LIB}
|
||||
rm -f ${INCDIR}/stk.h
|
||||
rm -rf ${INCDIR}/stk
|
||||
|
||||
@@ -61,17 +61,20 @@ test: debug
|
||||
# Installation (Unix only)
|
||||
ifneq ($(OS),Windows_NT)
|
||||
install: release
|
||||
install -d $(LIBDIR) $(INCDIR)
|
||||
install -d $(LIBDIR) $(INCDIR)/stk
|
||||
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:
|
||||
rm -f $(LIBDIR)/$(FULL_LIB)
|
||||
rm -f $(INCDIR)/stk.h
|
||||
rm -rf $(INCDIR)/stk
|
||||
else
|
||||
install:
|
||||
@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:
|
||||
@echo "make uninstall is not supported on Windows."
|
||||
|
||||
Reference in New Issue
Block a user