#------------------------------->  Makefile  <--------------------------------#
#- Copyright (C) 199x by International Computer Science Institute            -#
#- This file is part of the GNU Sather package. It is free software; you may -#
#- redistribute  and/or modify it under the terms of the  GNU General Public -#
#- License (GPL)  as  published  by the  Free  Software  Foundation;  either -#
#- version 2 of the license, or (at your option) any later version.          -#
#- This  program  is distributed  in the  hope that it will  be  useful, but -#
#- WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY -#
#- or FITNESS FOR A PARTICULAR PURPOSE. See Doc/GPL for more details.        -#
#- The license text is also available from:  Free Software Foundation, Inc., -#
#- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA                     -#
#------------->  Please email comments to <bug-sather@gnu.org>  <-------------#

# This file is useful to compile the am library on the Meiko computer.
#. This is used for cross compiling at ICSI
all: am.a

am.a:	*.[ch]
	@ echo Making am library for platform meiko;		\
	(touch Makefile; 			\
		HEADERDIR=../../Platforms/meiko 			\
		LIBDIR=../../Platforms/meiko 			\
		PCFLAGS="-Wall -DMEIKO -DAM_THREADS -DSOLARIS_THREADS -D_REENTRANT" \
		CFLAGS="-g -O2  -I/opt/meiko/include"						\
		PLIBS="-L/opt/meiko/lib -L/u/sather/lib -lposix4 -lthread2.3 -lew -lelan -ldl"	\
		$(MAKE) libam.a)

clean:
	@echo Cleaning System/pSather/am...
	@(cd ../../pSather/am; $(MAKE) clean)
	@-$(RM) libam.a
	@-$(RM) am.h

test:
	( HEADERDIR=../../Platforms/meiko 			\
		LIBDIR=../../Platforms/meiko 			\
		PCFLAGS="-Wall -DMEIKO -DAM_THREADS -DSOLARIS_THREADS -D_REENTRANT" \
		CFLAGS="-g -O2  -I/opt/meiko/include"						\
		AM_TEST="./mesg 4 100"		\
		PLIBS="queueThread.o -L/opt/meiko/lib -L/u/sather/lib -lposix4 -lthread -lew -lelan -lkstat -ldl -lelf"	\
		$(MAKE) test)
