use libelf to find code offset in the exe
This commit is contained in:
16
build.sh
16
build.sh
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
CFLAGS="-Wall -Wextra -Wpedantic -std=c99 -O3"
|
||||
CFLAGS="-Wall -Wextra -Wpedantic -std=c99"
|
||||
|
||||
echo "building mos6502..."
|
||||
cc $CFLAGS -o mos6502 mos6502.c
|
||||
@@ -16,4 +16,16 @@ if command -v pkg-config >/dev/null; then
|
||||
fi
|
||||
else
|
||||
echo "pkg-config not found - skipping chip8..."
|
||||
fi
|
||||
fi
|
||||
|
||||
if command -v pkg-config >/dev/null; then
|
||||
LIBELF_FLAGS=$(pkg-config --cflags --libs libelf 2>/dev/null)
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "building riscv64..."
|
||||
cc $CFLAGS -o riscv64 riscv64.c $LIBELF_FLAGS
|
||||
else
|
||||
echo "raylib not found - skipping riscv64..."
|
||||
fi
|
||||
else
|
||||
echo "pkg-config not found - skipping riscv64..."
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user