# -*- Mode: makefile  -*-
#
# $Id: Makefile.am,v 1.1 1997/02/08 16:10:34 prudhomm Exp $
#
# SUMMARY:      
# USAGE:        make <make-target>
#
# AUTHOR:       Christophe Prud'homme
# ORG:           
# E-MAIL:       Christophe.Prudhomme@asci.fr
#
# ORIG-DATE:    10-Nov-96 at 15:07:11
# LAST-MOD:     10-Nov-96 at 15:07:11 by Christophe Prud'homme
#
# DESCRIPTION:  
#  - Look in GNU Coding standards for further informations
#
# $Log: Makefile.am,v $
# Revision 1.1  1997/02/08 16:10:34  prudhomm
# testsuite for freefem
# corrected small bugs
#
# DESCRIP-END.	

AUTOMAKE_OPTIONS=dejagnu
SUBDIRS		= config lib freefem.0

host		= @host@
host_alias	= @host_alias@
host_cpu	= @host_cpu@
host_vendor	= @host_vendor@
host_os		= @host_os@
target_os	= @target_os@
target_alias	= @target_alias@
target_cpu	= @target_cpu@
target_vendor	= @target_vendor@
host_triplet	= @host_triplet@
target_triplet	= @target_triplet@


RUNTEST 	= runtest
RUNTESTFLAGS 	=
FLAGS_TO_PASS 	=

check:site.exp all
	$(RUNTEST) $(RUNTESTFLAGS) $(FLAGS_TO_PASS) \
		--tool $(top_builddir)/src/freefem --srcdir $(top_srcdir)/testsuite

site.exp: $(top_srcdir)/config.status Makefile
	@echo "Making a new config file..."
	-@rm -f ./tmp?
	@touch site.exp

	-@mv site.exp site.bak
	@echo "## these variables are automatically\
	generated by make ##" > ./tmp0
	@echo "# Do not edit here. If you wish to\
	override these values" >> ./tmp0
	@echo "# add them to the last section" >> ./tmp0
	@echo "set host_os ${host_os}" >> ./tmp0
	@echo "set host_alias ${host_alias}" >> ./tmp0
	@echo "set host_cpu ${host_cpu}" >> ./tmp0
	@echo "set host_vendor ${host_vendor}" >> ./tmp0
	@echo "set target_os ${target_os}" >> ./tmp0
	@echo "set target_alias ${target_alias}" >> ./tmp0
	@echo "set target_cpu ${target_cpu}" >> ./tmp0
	@echo "set target_vendor ${target_vendor}" >> ./tmp0
	@echo "set host_triplet ${host_canonical}" >> ./tmp0
	@echo "set target_triplet ${target_canonical}">>./tmp0
	@echo "set tool freefem" >> ./tmp0
	@echo "set srcdir ${srcdir}" >> ./tmp0
	@echo "set objdir `pwd`" >> ./tmp0
	@echo "set EXAMPLENAME ${top_builddir}/src/freefem" >> ./tmp0
	@echo "## All variables above are generated by\
	configure. Do Not Edit ##" >> ./tmp0
	@cat ./tmp0 > site.exp
	@sed < site.bak \
		-e '1,/^## All variables above are.*##/ d' \
		>> site.exp
	-@rm -f ./tmp?
