#!/bin/csh
#
# File:    compilegcc
# Purpose: Used to compile C and C++ with PC^2
# Author:  pc2@ecs.csus.edu
#
# $HeadURL: http://pc2.ecs.csus.edu/repos/pc2v9/branches/PC2_RELEASE_9_2_x/samps/scripts/compilegcc $
#

set e=
set mainfile=$1
set basename=`echo $mainfile | sed 's/\.[^\.]*$//'`
set ext=`echo $mainfile | awk -F. '{print $NF}'`

if ("x$ext" == "xcpp") then
  $e g++ -lm -o $basename $mainfile
else 
  $e gcc -lm -o $basename $mainfile
endif

# eof $Id: compilegcc 2090 2010-04-10 19:28:54Z laned $
