#!/bin/zsh #need zsh for fallthrough #toolchain v1.0 #This is free software. #Licence: Public Domain #Autor: Markus Raab set -e FILE="$@" JUMP="" #overjump c when using c++ case "$FILE" in *cpp) echo "$FILE: compile" h8300-hitachi-coff-g++ -O2 -fno-rtti -fno-exceptions -static -fno-common -fno-non-call-exceptions -fno-weak -fno-default-inline -S $FILE -o /tmp/s FILE=/tmp/s JUMP="yes" ;& *c) if test -z "$JUMP" then echo "$FILE: compile" h8300-hitachi-coff-gcc -O2 -S $FILE -o /tmp/s FILE=/tmp/s fi ;& *s) #.s are h8/300 assembler files echo "$FILE: assemble" ../h8300asm/h8300-asm -i $FILE -o /tmp/b FILE=/tmp/b ;& *b) #.b are basic assembler files echo "$FILE: basicasm" ../basicasm/basicasm -i $FILE -o /tmp/f FILE=/tmp/f ;& *f) echo "$FILE: simulate" ../simulator/simulator -f $FILE ;; *) echo "Don't know how to toolchain \`$FILE'" >&2 exit 2 ;; esac exit 0