commit 2a179c9

neauoire  ·  2022-04-06 19:38:34 +0000 UTC
parent 60b20ea
Improved build script
2 files changed,  +20, -12
+6, -4
 1@@ -25,7 +25,7 @@ The stack mapping is 254 bytes of data, a byte for the pointer and a byte for an
 2 All you need is X11.
 3 
 4 ```sh
 5-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
 6+gcc -DNDEBUG -Og -g0 -s 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
 7 ```
 8 
 9 ### Terminal
10@@ -33,13 +33,15 @@ gcc src/uxn.c src/devices/system.c src/devices/screen.c src/devices/controller.c
11 If you wish to build the emulator without graphics mode:
12 
13 ```sh
14-cc src/devices/datetime.c src/devices/system.c src/devices/file.c src/uxn.c -DNDEBUG -Os -g0 -s src/uxncli.c -o bin/uxncli
15+gcc -DNDEBUG -Og -g0 -s src/uxn.c src/devices/system.c src/devices/file.c src/devices/datetime.c src/uxncli.c -o bin/uxncli
16 ```
17 
18-## Run
19+## Usage
20+
21+The first parameter is the rom file, the subsequent arguments will be accessible to the rom, via the [Console vector](https://wiki.xxiivv.com/site/varvara.html#console).
22 
23 ```sh
24-bin/uxnemu bin/polycat.rom
25+bin/uxnemu bin/polycat.rom arg1 arg2
26 ```
27 
28 ## Devices
+14, -8
 1@@ -1,32 +1,38 @@
 2 #!/bin/sh -e
 3 
 4+RELEASE_FLAGS="-DNDEBUG -Og -g0 -s"
 5+DEBUG_FLAGS="-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"
 6+EMU_INC="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"
 7+CLI_INC="src/uxn.c src/devices/system.c src/devices/file.c src/devices/datetime.c src/uxncli.c -o bin/uxncli"
 8+
 9 if [ "${1}" = '--format' ];
10 then
11 	echo "Formatting.."
12+	clang-format -i src/uxn.c
13+	clang-format -i src/uxn.h
14 	clang-format -i src/uxn11.c
15 	clang-format -i src/uxncli.c
16 	clang-format -i src/devices/*
17 fi
18 
19 echo "Cleaning.."
20-rm -f ./bin/*
21-
22-echo "Building.."
23+rm -f bin/*
24 mkdir -p bin
25 
26+echo "Building.."
27 if [ "${1}" = '--install' ];
28 then
29 	echo "Installing.."
30-	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
31-	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
32+	gcc ${RELEASE_FLAGS} ${EMU_INC}
33+	gcc ${RELEASE_FLAGS} ${CLI_INC}
34 	cp bin/uxn11 ~/bin
35 	cp bin/uxncli ~/bin
36 else
37-	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
38-	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
39+	gcc ${DEBUG_FLAGS} ${EMU_INC}
40+	gcc ${DEBUG_FLAGS} ${CLI_INC} 
41 fi
42 
43-echo "Assembling polycat.."
44+echo "Assembling.."
45 bin/uxncli etc/drifblim.rom etc/polycat.tal && mv etc/polycat.rom bin/
46 
47 echo "Running.."