~rabbits/drifblim

51d5d569ec25187a8f9fa26250e8b97e40d7a65c — neauoire 1 year, 2 months ago 336b60f
Removed build script, added makefile
2 files changed, 26 insertions(+), 28 deletions(-)

D build.sh
A makefile
D build.sh => build.sh +0 -28
@@ 1,28 0,0 @@
#!/bin/sh -e

set -o nounset # Fails when accessing an unset variable.
set -o errexit # Exits if a command exits with a non-zero status.

name="drifblim"
roms_dir=${UXN_ROMS_DIR-"$HOME/roms"}
asm="uxnasm"
emu="uxncli"
lin="uxncli $roms_dir/uxnlin.rom"
bal="uxncli $roms_dir/uxnbal.rom"
src="src/${name}.tal"
dst="bin/${name}.rom"
arg="${src} ${dst}"

mkdir -p bin
case "$*" in *--lint*) $lin $src ;; esac
case "$*" in *--bal*) $bal $src ;; esac
$asm $src $dst
case "$*" in *--save*) cp $dst $roms_dir ;; esac
$emu $dst $arg

# Test with hello.rom
$emu $dst examples/hello.tal bin/hello.rom
$emu bin/hello.rom

# Test interactive mode
# uxnemu "${roms_dir}/left.rom" examples/hello.tal | $emu $dst ^bin/hello.rom

A makefile => makefile +26 -0
@@ 0,0 1,26 @@
ID=drifblim
DIR=~/roms
ASM=uxnasm
LIN=uxncli ${DIR}/uxnlin.rom
EMU=uxncli
ROM=bin/${ID}.rom

all: ${ROM}

clean:
	@ rm -f ${ROM} ${ROM}.sym
lint:
	@ ${LIN} src/${ID}.tal
run: ${ROM}
	@ ${EMU} ${ROM} src/${ID}.tal ${ROM}
	@ ${EMU} ${ROM} examples/hello.tal bin/hello.rom
	@ ${EMU} bin/hello.rom
install: ${ROM}
	@ cp ${ROM} ${DIR}
uninstall:
	@ rm -f ${DIR}/${ID}.rom

.PHONY: all clean lint run install uninstall

${ROM}: src/${ID}.tal
	@ mkdir -p bin && ${ASM} src/${ID}.tal ${ROM}