Delete buildSoLib

This commit is contained in:
wullie committed 2026-10-26 19:18:02 +00:00
1 parent cd0adcb7e7
commit 5ba1129ca4
1 file changed
-73
-73
View File
@@ -1,73 +0,0 @@
#!/bin/bash
set -e
CC="gcc"
CFLAGS="-DWRATHINT -I./include -fPIC"
OBJ_BUILD="build/"
BIN_DIR="bin/"
HED_DIR="include"
build() {
echo "Building stdWullie..."
# Find all C source files
mapfile -t SRC < <(find src -type f -name '*.c')
# Compile each source file
OBJ=()
for src in "${SRC[@]}"; do
obj="${src%.c}.o"
echo "Compiling $src -> $obj"
"$CC" $CFLAGS -c "$src" -o "$obj"
OBJ+=("$obj")
done
# Create output directories
mkdir "$OBJ_BUILD"
mkdir "$BIN_DIR"
# Link shared library
echo "Linking libstdWullie.so..."
"$CC" -nostdlib -shared -o libstdWullie.so \
-fno-stack-protector \
"${OBJ[@]}"
# Move object files
mv "${OBJ[@]}" "$OBJ_BUILD"
# Move library
mv libstdWullie.so "$BIN_DIR"
# Copy header
cp "$HED_DIR/stdWullie.h" "$BIN_DIR"
# Copy header directory
cp -r "$HED_DIR/stdWullie/" "$BIN_DIR"
echo "Build complete."
}
clean() {
echo "Cleaning..."
rm -rf "$OBJ_BUILD" "$BIN_DIR"
build
}
case "${1:-build}" in
build|stdWullie)
build
;;
clean)
clean
;;
*)
echo "Usage: $0 {build|stdWullie|clean}"
exit 1
;;
esac