#!/bin/csh

# ****************************************************************************
#  FILE     : build
#  SHORTNAME: build

#  PURPOSE  : Shell scipt to call make 
#	      1) kernel in the directory kernel/source
#	      2) X user interface in xgui/source
#	      3) compiler in compiler/source (commented out )
#	      4) tools in tools/source

#  AUTHOR   : Tilman Sommer, Niels Mache, Thomas Korb, Ralf Huebner
#  DATE     : 22.05.91 (A. Zell)

#  MODIFICATIONS:
#  22.05.91: cosmetic changes
#  19.08.93: tools added (R. Huebner)
#  12.04.94: all rule removed (R. Huebner)

#             Copyright (c) 1990-1995  SNNS Group, IPVR, Univ. Stuttgart, FRG
#
# ****************************************************************************



echo "************************************************"
echo "*                                              *"
echo "*  SNNS  - Stuttgart Neural Network Simulator  *"
echo "*                                              *"
echo "*         building SNNS version 4.0 ...        *"
echo "*                                              *"
echo "************************************************"
echo ""
set rootdir = `echo $cwd`
if ( $1 == 'all' || $1 == 'kernel' || $1 == 'sim' || $1 == 'rpc') then
	echo "Building kernel ... "
	cd kernel/sources
	echo "Compiling ..."
	make
	echo "Installing ..."
	make install
	cd ../.. 
	echo "Done."
	echo ""
else
endif

if ( $1 == 'all' || $1 == 'xgui' || $1 == 'sim' || $1 == 'rpc') then
	echo "Building XGUI ... "
	cd xgui/sources
	echo "Compiling ..."
	make
	echo "Installing ..."
	make install
	cd ../.. 
	echo "Done."
	echo ""
else
endif

#if ( $1 == 'all' || $1 == 'compiler') then
#	echo "Building compiler ... "
#	cd compiler/sources 
#	echo "Compiling ..."
#	make
#	echo "Installing ..."
#	make install
#	cd ../.. 
#	echo "Done."
#	echo ""
#else
#endif

if ( $1 == 'all' || $1 == 'rpc') then
	echo "Building RPC ... "
	cd rpc/sources
	echo "Compiling ..."
	make
	echo "Installing ..."
	make install
	cd ../.. 
	echo "Done."
	echo ""
else
endif

if ( $1 == 'all' || $1 == 'tools' ) then
	echo "Building Tools ... "
	cd tools/sources
	echo "Compiling ..."
	make
	echo "Installing ..."
	make install
	cd ../.. 
	echo "Done."
	echo ""
else
endif
