Compare commits
4
Commits
d7ea214137
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ba1129ca4 | ||
|
|
cd0adcb7e7 | ||
|
|
ff0f2cd7a0 | ||
|
|
9e4eb91044 |
No files matched your search
@@ -1,2 +1,3 @@
|
|||||||
bin/
|
bin/
|
||||||
build/
|
build/
|
||||||
|
buildSoLib
|
||||||
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-73
@@ -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
|
|
||||||
Reference in new issue
Block a user