#!/bin/csh
#############################################################################
#  Written 1994++ by Peter Boesecke                                         #
#  Copyright (C) 2011 European Synchrotron Radiation Facility               #
#                        Grenoble, France                                   #
#                                                                           #
#     Principal authors: Peter Boesecke  (boesecke@esrf.eu)                 #
#                                                                           #
#     This program is free software: you can redistribute it and/or modify  #
#     it under the terms of the GNU General Public License as published by  #
#     the Free Software Foundation, either version 3 of the License, or     #
#     (at your option) any later version.                                   #
#                                                                           #
#     This program is distributed in the hope that it will be useful,       #
#     but WITHOUT ANY WARRANTY; without even the implied warranty of        #
#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         #
#     GNU General Public License for more details.                          #
#                                                                           #
#     You should have received a copy of the GNU General Public License     #
#     along with this program.  If not, see <http://www.gnu.org/licenses/>. #
#############################################################################
# -I include paths separated by \
# -g source files separated by space
# -L library paths separated by \
# -l libraries
# -o output file
setenv SAXSPACK $cwd/../saxspack
setenv EDFPACK $cwd/../edfpack
setenv DEST    $cwd/../bin
#
mkdir -p $DEST
#
setenv file_prefix "$1"
$CC -I$SAXSPACK -I$EDFPACK -O \
    -g3 $file_prefix.c $SAXSPACK/SaxsError.c $SAXSPACK/SaxsExpression.c \
                      $SAXSPACK/SaxsInput.c $SAXSPACK/SaxsImage.c \
                      $SAXSPACK/SaxsReplacekey.c \
                      $SAXSPACK/mca.c $SAXSPACK/SaxsParameter.c \
                      $SAXSPACK/SaxsRoutine.c $SAXSPACK/SaxsOption.c \
                      $EDFPACK/filename.c $EDFPACK/ipol.c \
                      $EDFPACK/numio.c $EDFPACK/edfio.c $EDFPACK/bslio.c \
                      $EDFPACK/raster.c $EDFPACK/gamma.c $EDFPACK/project.c \
                      $EDFPACK/cmpr.c \
                      $EDFPACK/strlib.c $EDFPACK/rot3d.c $EDFPACK/tilt3d.c \
                      $EDFPACK/r2t.c $EDFPACK/sx.c \
    -L$SAXSPACK -L$EDFPACK\
    -lm -lz\
    -o $DEST/$file_prefix
 

