From b00eab153cb7a7e1ed731f3211dfa2d9ed7f5f9c Mon Sep 17 00:00:00 2001 From: Adrien Guatto Date: Sun, 12 Feb 2012 00:11:27 +0100 Subject: [PATCH] heptc script: compile C code in addition to Java. --- heptc | 7 +++++++ tools/heptc-c.sh | 33 --------------------------------- 2 files changed, 7 insertions(+), 33 deletions(-) delete mode 100755 tools/heptc-c.sh diff --git a/heptc b/heptc index ed73cff..16904e6 100755 --- a/heptc +++ b/heptc @@ -70,6 +70,13 @@ java ) popd > /dev/null fi ;; +c ) + shift + set -e + compile -target c "$@" + base_f=`basename ${!#} .ept` + cd ${base_f}_c && cc -I`$HEPTC -where`/c *.c -o ../${base_f} +;; -- | * ) compile "$@" esac diff --git a/tools/heptc-c.sh b/tools/heptc-c.sh deleted file mode 100755 index ff4ebff..0000000 --- a/tools/heptc-c.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -# This small helper scripts automates the Heptagon -> C translation. - -if [ $# -lt 1 ] -then - echo Usage: $0 file.ept - exit 1 -fi - -if `which heptc.native` 2>/dev/null; then - HEPTC=heptc.native -else - HEPTC=heptc.byte -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 - "$HEPTC" $@ -s main -target c $F $@ || exit 1 -fi - -# Compile it with GCC -cc -I "`$HEPTC -where`/c" -std=c99 $REP/*.c -o "`basename $F .ept`" || exit 1