#!/bin/sh echorun() { echo $1 $1 } compile() { echorun "$cc -c $cflags $include $lflags -o $1.o $1.c $libs" } compile_and_link() { echorun "$cc $cflags $include $lflags -o $1 $1.c $libs" } start=`pwd` dir=`realpath $0` dir=`dirname $dir` echorun "cd $dir" if [ "$1" = 'clean' ] ; then echorun "rm -f *.o linux" echorun "cd $start" exit fi cc='gcc' cflags='-g' include="-I../../prb -I../../prge" lflags="-L../../prb -L../../prge" libs='-lprb -lprge -lGL -lX11 -lm' compile_and_link linux echorun "cd $start"