#!/bin/tcsh # This script is the liason between the Xcode IDE and the BMS makefile system # used by JANA and DANA. The main reason it is needed rather than invoking # "make" directly is so the output can be captured and error and warning # messages have the full path prepended to allow the IDE to properly identify # the errors to the user in the editor(s). # # The argument(s) passed to "make" from this script comes in through the BUILD_STYLE # environment variable which is set by Xcode to the Active Configuration. The # configurations can be edited by Project->Edit Project Settings and then choosing the # Configurations tab on the window that pops up. The configurations are set to # exactly the arguments one would pass in if invoking make from the command line. # Set the HALLD_HOME environment variable to the local directory since # we can't easily control it in the environment when running Xcode setenv HALLD_HOME $SOURCE_ROOT # Xcode likes to set OS to "MACOS" but the BMS make system uses "Darwin" # Change OS to "Darwin" if it is "MACOS" (in reality, this scriptwill only # be used by Xcode so this change will always be made). [ $OS = MACOS ] && setenv OS Darwin # Run "make" and pipe the output through awk. The awk script will prepend the # current working directory to each output line containing "error:" or "warning:". # The effect is to replace filenames with ones including the full path in lines # containing errors and warnings so that clicking them in the build results # window of Xcode will open the appropriate file and highlight the appropriate line. make $BUILD_STYLE $1 $2 $3 |& awk '/(error:)|(warning:)/ {printf "'${PWD}'/"}; // {print}'