#!/usr/bin/env zsh # Run commonly-used SubX programs using the SubX VM in 'debug mode'. if [ $# -eq 0 ] then echo "Usage: $0 " echo echo "Naming convention: Binaries starting with 'ex' will be assumed to live in examples/" echo "Other binaries will be assumed to live in apps/" exit 1 fi if [[ $1 == 'ex'* ]] then CFLAGS=-g ./subx --map --trace run examples/$* 2>x exit $? fi CFLAGS=-g ./subx --map --trace run apps/$* 2>x exit $?