Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 16 lines (12 sloc) 536 Bytes
#! /bin/sh
[ -e 'm1' ] || { echo 'm1 does not exist'; exit 1; }
[ -e 'm0_assembler.pl' ] || { echo 'm0_assembler.pl does not exist'; exit 1; }
[ -e 'm0' ] || { echo 'm0 does not exist'; exit 1; }
filename=${1%.*}
file_suffixe=${1##*.}
[ "$file_suffixe" = 'm1' ] || { echo "file suffixe is not 'm1'"; exit 1; }
./m1 $1 2>/dev/null > $filename.m0
[ -s $filename.m0 ] || { echo "error: outputs a empty file $filename.m0 when compiling $1"; exit 1; }
./m0_assembler.pl $filename.m0 >/dev/null
./m0 $filename.m0b || { exit 1; }
exit 0