#!/bin/bash # Copyright 2009 Alain Muller # #This file is part of STEP. # #The program is distributed under the terms of the GNU General Public #License. # # For usage, see below. script=$(basename $0); usage() { cat >&2 <<-END $script is the STEP driver in front of pips. Usage: $script file_1 [file_n]"; PIPS_SRCPATH environnment variable may be used to specify source file directories Preprocessing options may be extended by PIPS_FPP_FLAGS and PIPS_CPP_FLAGS environnment variables. They can be used to locate the include files. END exit ${1:-1} } if [ $# -lt 1 ] then usage 4 exit; fi arg1=$1; extension=${arg1#${arg1%.*}}; case $extension in .f) workspace=$(basename $1 .f); ;; .c) workspace=$(basename $1 .c); ;; *) exit 1; ;; esac destination=$workspace"-STEP"; if [ -e $destination ] then rm -rf $destination; fi mkdir -p $destination/Source; #Source file copy for f in $* do cp $f $destination/Source/; source_files="$source_files ./Source/$(basename $f)"; done #tpips file generation tpips_file=$destination/$workspace.tpips; cat >$tpips_file <