#! /bin/csh
set tmp = Makefile.tmp$$
switch (`uname`)
case HP-UX:
echo "CFLAGS = +O3 -I/usr/include/X11R5 -I/usr/include/Motif1.2" >! $tmp
echo "LFLAGS = -L/usr/lib/X11R5 -L/usr/lib/Motif1.2" >> $tmp
echo "LIBS = -lXm -lXt -lX11 -lM" >> $tmp
breaksw
case SunOS:
if (`uname -r | cut -d. -f1` > 4) then
echo "CFLAGS = -O -DANSI -I/usr/dt/include" >! $tmp
echo "LFLAGS = -L/usr/dt/lib"  >> $tmp
echo "LIBS = -lXm -lXt -lSM -lICE -lX11 -lm" >> $tmp
else
goto unkownOS
endif
breaksw
case Linux:
if (! -d /usr/include/Xm && ! -d /usr/X11R6/include/Xm) then
	echo "This machine has no Motif development environment."
	exit 1
else
echo "CFLAGS = -O -DANSI -DLinux -I/usr/X11R6/include" >! $tmp
echo "LFLAGS = -L/usr/X11R6/lib"  >> $tmp
echo "LIBS = -lXm -lXpm -lXt -lXext -lSM -lICE -lX11 -lm" >> $tmp
endif
breaksw
default:
goto unkownOS
endsw
cat $tmp Makefile.dst >! Makefile
rm $tmp
make
exit 0
unkownOS:
echo "Sorry, I don't know how to make it on `uname -sr`."
exit 1
