#!/bin/csh # CVS: $Id$ # Name: pc_helper # Author: MR # Date: 19-Feb-2017 # Description: # Runs a helper executable; builds it first, if necessary cd src if (-e $0:t.f90) then set dir=. else set dir=pre_and_post_processing if (!(-e $dir/$0:t.f90)) then if (-e $PENCIL_HOME/src/$dir/$0:t.f90) then ln -s $PENCIL_HOME/src/$dir/$0:t.f90 $dir/$0:t.f90 else echo "No source for helper $0:t available." exit endif endif endif #echo ENVIRONMENT: $PENCIL_CONFIG_FILES if ( ! -e $0:t.x ) then if ( -e .config-files || $PENCIL_CONFIG_FILES != '' ) then cd .. echo "Building" $0:t.x "(if necessary) by pc_build" pc_build -l -q -s -t $0:t > /dev/null else echo "Building" $0:t.x "(if necessary) by make" make $0:t > /dev/null cd .. endif else cd .. endif if ( $? != 0) then echo "Build of executable $0:t.x failed." exit endif set dir=src/$dir if ($# == 0) then $dir/$0:t.x else $dir/$0:t.x $* endif