From 77023fea0f553f52191f99cb9f6559aa68436ce8 Mon Sep 17 00:00:00 2001 From: Elliot Nunn Date: Mon, 21 May 2018 15:19:04 +0800 Subject: [PATCH] Add Unix shell script to wrap EasyBuild --- EasyBuild | 5 +++++ EasyBuild.sh | 19 +++++++++++++++++++ README.md | 4 ++++ 3 files changed, 28 insertions(+) create mode 100755 EasyBuild.sh diff --git a/EasyBuild b/EasyBuild index 22568a3..26f5c32 100644 --- a/EasyBuild +++ b/EasyBuild @@ -13,3 +13,8 @@ End Make -w -d Sources=: -f "{MAKE_FILE}" RomMondo > "{MAKE_OUT}" "{MAKE_OUT}" + +# So that RomMondo is definitely the newest thing in the tree! +SetDirectory :BuildResults:RISC:Image: +Catenate RomMondo > RomMondoX +Rename -y RomMondoX RomMondo diff --git a/EasyBuild.sh b/EasyBuild.sh new file mode 100755 index 0000000..ae7563a --- /dev/null +++ b/EasyBuild.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# Avoid the uber-slow step of running the emulator when nothing has changed + +if [ ! -f BuildResults/RISC/Image/RomMondo ] +then + echo "RomMondo not yet built" + echo "> Starting emulator to build RomMondo" + empw EasyBuild + echo "< Emulator done" + exit +fi + +echo "Checking for files updated since RomMondo" +find . ! -regex '.*/\..*' ! -iname '*.dmg' -newer BuildResults/RISC/Image/RomMondo | grep . || exit 0 + +echo "> Starting emulator to build RomMondo" +empw EasyBuild +echo "< Emulator done" diff --git a/README.md b/README.md index 96442a1..56f64a9 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,10 @@ Using EMPW, that's: empw EasyBuild +Even nicer is this Unix shell script, which avoids unnecessary launches of the emulator: + + ./EasyBuild.sh + The 3 MB image will be at `BuildResults/RISC/Image/RomMondo`. What's next?