uxn11/build.sh

27 lines
1.4 KiB
Bash
Raw Normal View History

2022-03-26 20:23:52 -04:00
#!/bin/sh -e
2022-03-26 21:32:46 -04:00
clang-format -i src/uxn11.c
2022-04-05 12:17:08 -04:00
clang-format -i src/devices/*
2022-03-26 20:23:52 -04:00
echo "Cleaning.."
rm -f ./bin/*
echo "Building.."
mkdir -p bin
2022-03-26 21:46:17 -04:00
2022-03-30 13:37:47 -04:00
if [ "${1}" = '--install' ];
then
echo "Installing.."
gcc src/uxn.c src/devices/system.c src/devices/screen.c src/devices/controller.c src/devices/mouse.c src/devices/file.c src/devices/datetime.c src/uxn11.c -D_POSIX_C_SOURCE=199309L -DNDEBUG -Os -g0 -s -o bin/uxn11 -lX11
2022-04-05 12:01:05 -04:00
# gcc src/uxn.c src/devices/system.c src/devices/file.c src/devices/datetime.c src/uxncli.c -D_POSIX_C_SOURCE=199309L -DNDEBUG -Os -g0 -s -o bin/uxncli
2022-03-30 13:37:47 -04:00
cp bin/uxn11 ~/bin
else
gcc -std=c89 -D_POSIX_C_SOURCE=199309L -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Wvla -g -Og -fsanitize=address -fsanitize=undefined src/uxn.c src/devices/system.c src/devices/screen.c src/devices/controller.c src/devices/mouse.c src/devices/file.c src/devices/datetime.c src/uxn11.c -o bin/uxn11 -lX11
2022-04-05 12:01:05 -04:00
# gcc -std=c89 -D_POSIX_C_SOURCE=199309L -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Wvla -g -Og -fsanitize=address -fsanitize=undefined src/uxn.c src/devices/system.c src/devices/file.c src/devices/datetime.c src/uxncli.c -o bin/uxncli
2022-03-30 13:37:47 -04:00
fi
2022-03-26 21:46:17 -04:00
2022-04-03 13:43:13 -04:00
echo "Done."
# echo "Running.."
2022-04-05 12:29:06 -04:00
bin/uxn11 ~/roms/left.rom README.md