heptagon/tools/hec-c.sh
2010-06-21 12:11:06 +02:00

28 lines
425 B
Bash
Executable file
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
# This small helper scripts automates the Heptagon -> C translation.
if [ $# -lt 1 ]
then
echo Usage: $0 file.ept
exit 1
fi
compile=1
if [ $# -gt 2 ];
then
nocompile=0
fi
F=$1
REP=`basename $F .ept`_c
shift
# Compile source file to VHDL, flattening node calls
if [ $compile -eq 1 ]; then
hec.byte $@ -s main -target c $F || exit 1
fi
# Compile it with GCC
cc $REP/*.c -o `basename $F .ept` || exit 1