From 6c80a46a3a7877b898928b013e1645241069d57b Mon Sep 17 00:00:00 2001 From: Andrew Alderwick Date: Tue, 27 Jul 2021 21:13:12 +0100 Subject: [PATCH] Added instructions and adaptation for Windows build --- README.md | 12 ++++++++++++ build.sh | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3aad9c0..aee5158 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,18 @@ mk If the build fails on 9front because of missing headers or functions, try again after `rm -r /sys/include/npe`. +### Windows + +Uxn can be built on Windows with [MSYS2](https://www.msys2.org/). Install by downloading from their website or with Chocolatey with `choco install msys2`. In the MSYS shell, type: + +```sh +pacman -S git mingw-w64-x86_64-gcc mingw64/mingw-w64-x86_64-SDL2 +export PATH="${PATH}:/mingw64/bin" +git clone https://git.sr.ht/~rabbits/uxn +cd uxn +./build.sh +``` + ## Getting Started Begin by building the assembler and emulator by running the build script. The assembler(`uxnasm`) and emulator(`uxnemu`) are created in the `/bin` folder. diff --git a/build.sh b/build.sh index b04ce6a..f98b8e8 100755 --- a/build.sh +++ b/build.sh @@ -24,7 +24,11 @@ fi mkdir -p bin CFLAGS="-std=c89 -Wall -Wno-unknown-pragmas" -UXNEMU_LDFLAGS="-L/usr/local/lib $(sdl2-config --cflags --libs)" +if [ -n "${MSYSTEM}" ]; then + UXNEMU_LDFLAGS="-static $(sdl2-config --cflags --static-libs)" +else + UXNEMU_LDFLAGS="-L/usr/local/lib $(sdl2-config --cflags --libs)" +fi if [ "${1}" = '--debug' ]; then