# C-shell please!

if ($1:e != "n") then
    set pn = $1.n
    def2n < $1.def > $pn
    net2n < $1.net >> $pn
    if ($status) then
	echo "Problem in $1.net encountered"
	exit (1)
    endif
else
    set pn = $1
endif
/lib/cpp $pn | gs_pp > sim.h
if ($status) then
    echo "Preprocessing unsuccessful"
    exit (1)
endif
cc -O -o $pn:r -I. DISTR-DIR/gs.c DISTR-DIR/GS.o
if($status) then
    echo "Ooops, something went wrong"
else
    rm sim.h
endif


