#!/usr/bin/perl

unshift @ARGV,"hs.out_code.c" unless $ARGV[0] =~ /^[^-]/;

open IN, "<$ARGV[0]";

shift @ARGV;

while (<IN>) {
    /jhc_c_compile\[\] = \"(.*)\";/ or next;
    my $cmd = ("$1 " . (join " ",@ARGV));
    print "; $cmd\n";
    exec $cmd or die "can't exec";

}

die "couldn't recompile";
