#!/bin/bash cd "`dirname "$0"`/.." FPC_SRC_DIR="$PWD" COMP_DIR="$FPC_SRC_DIR/compiler" RTL_DIR="$FPC_SRC_DIR/rtl" SPARC_BINUTILS_DIR="/usr/local/bin/sparc-linux" INCLUDE_PATH=`echo -Fi"$RTL_DIR/"{unix,linux,sparc,inc,linux/sparc,objpas/sysutils}` UNITS_PATH=`echo -Fu"$RTL_DIR/"{unix,linux,sparc,inc,linux/sparc,objpas,inc}` SRC_DIR=`echo "$COMP_DIR/"{,sparc,systems}:` TEST_DIR="$FPC_SRC_DIR/tests/test" if [[ "$1" == "-B" ]] || [[ "$#" == 0 ]] then cd "$COMP_DIR" fpc pp -gl -oppcsparc -dExtDebug -Fu"sparc;systems" -FE"sparc" -dSPARC -dGDB -dNewRA "$1" fi if [[ "$#" -gt "0" ]] && ( [[ "$1" != "-B" ]] || [[ "$#" -gt "1" ]] ) then cd "$TEST_DIR" COMPILE_COMMAND='"$COMP_DIR/sparc/ppcsparc" -s -al $UNITS_PATH -FD"$SPARC_BINUTILS_DIR" $INCLUDE_PATH "-FE$TEST_DIR" -dSPARC' if [[ "$1" == "-gdb" ]] then shift 1 eval gdb -d \"$SRC_DIR\" --args $COMPILE_COMMAND "$@" else FILES_LIST=`ls $1` shift 1 for FileName in $FILES_LIST do eval "$COMPILE_COMMAND" "$FileName" "$@" if [[ $? != 0 ]] then break; fi done fi fi