detect instruction types

This commit is contained in:
2026-02-28 17:19:27 +01:00
parent d06473b555
commit 1cbf764e8b
2 changed files with 65 additions and 14 deletions

View File

@@ -1,31 +1,24 @@
#!/bin/bash
set -euo pipefail
CFLAGS="-Wall -Wextra -Wpedantic -std=c99"
echo "building mos6502..."
cc $CFLAGS -o mos6502 mos6502.c
cc -Wall -Wextra -Wpedantic -std=c99 -o mos6502 mos6502.c
if command -v pkg-config >/dev/null; then
RAYLIB_FLAGS=$(pkg-config --cflags --libs raylib 2>/dev/null)
if [ $? -eq 0 ]; then
echo "building chip8..."
cc $CFLAGS -o chip8 chip8.c $RAYLIB_FLAGS
cc -Wall -Wextra -Wpedantic -std=c99 -o chip8 chip8.c $RAYLIB_FLAGS
else
echo "raylib not found - skipping chip8..."
fi
else
echo "pkg-config not found - skipping chip8..."
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
cc -Wall -Wextra -Wpedantic -std=gnu11 -Wno-gnu-binary-literal -o riscv64 riscv64.c $LIBELF_FLAGS
else
echo "raylib not found - skipping riscv64..."
echo "libelf not found - skipping riscv64..."
fi
else
echo "pkg-config not found - skipping riscv64..."
echo "pkg-config not found - skipping the rest..."
fi