1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
#!/bin/sh
#
# setup.sh -- invoked by top-level Makefile
USAGE="usage: setup.sh configname [No]Graphics"
NAME=$1
GPX=$2
TOP=..
SRC=$TOP/src
# check parameters
case "$GPX" in
Graphics) XL='$(XLIBS)';;
NoGraphics) XL= ;;
*) echo "$USAGE" 1>&2; exit 1;;
esac
# check that configuration exists
if [ ! -d "$NAME" ]; then
echo "no configuration directory for $NAME" 1>&2
exit 1
fi
# report the version being built
grep '#define Version[ND]' $SRC/h/version.h
# build the "define.h" file
echo "#define Config \"$NAME\"" > $SRC/h/define.h
echo "#define $GPX 1" >> $SRC/h/define.h
echo "" >> $SRC/h/define.h
cat $NAME/define.h >> $SRC/h/define.h
# build the "Makedefs" file
echo "# from config/$NAME" > $TOP/Makedefs
echo "" >> $TOP/Makedefs
cat $NAME/Makedefs >> $TOP/Makedefs
echo "" >> $TOP/Makedefs
echo "# $GPX" >> $TOP/Makedefs
echo "XL = $XL" >> $TOP/Makedefs
# report actions
echo " configured $NAME"
echo " with $GPX"
# run customization script, if one exists
if [ -f $NAME/custom.sh ]; then
cd $NAME
sh custom.sh
fi
|