#!/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)

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



echo "************************************************"
echo "*                                              *"
echo "*  SNNS  - Stuttgart Neural Network Simulator  *"
echo "*                                              *"
echo "*         building SNNS version 4.1 ...        *"
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 -e
	echo "Installing ..."
	make -e install
	cd ../.. 
	echo "Done."
	echo ""
endif

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


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

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