# -*- Mode: makefile  -*-
#
# $Id: Makefile.am,v 1.3 1997/02/08 16:21:25 prudhomm Exp $
#
# SUMMARY:      
# USAGE:        make <make-target>
#
# AUTHOR:       Christophe Prud'homme
# ORG:           
# E-MAIL:       Christophe.Prudhomme@asci.fr
#
# ORIG-DATE:     2-Nov-96 at 03:56:10
# LAST-MOD:      8-Feb-97 at 16:10:05 by Christophe Prud'homme
#
# DESCRIPTION:  
#  - Look in GNU Coding standards for further informations
#
# $Log: Makefile.am,v $
# Revision 1.3  1997/02/08 16:21:25  prudhomm
# many changes
# support for EMACS
# added new directories: contrib ...
#
# Revision 1.2  1996/11/02 02:58:48  prudhomm
# added file headers
# added informations in README file
#
# DESCRIP-END.	

host		= @host@

SUBDIRS		= @LIBADAPT@ @LIBCOMM@ src config doc examples testsuite contrib

DATA_SUBDIRS	= examples doc


EXTRA_DIST	= FAQ makefile.x GNUINSTALL


check: all
	cd testsuite && make check

bindist: all
	rm -rf $(distdir)-$(host)
	mkdir $(distdir)-$(host)
	cp src/freefem $(distdir)-$(host)
	for subdir in $(DATA_SUBDIRS); do		\
	  test -d $(distdir)-$(host)/$$subdir		\
	  || mkdir $(distdir)-$(host)/$$subdir		\
	  || exit 1;				\
	  chmod 777 $(distdir)-$(host)/$$subdir;	\
	  (cd $$subdir && $(MAKE) distdir=../$(distdir)-$(host)/$$subdir distdir) \
	    || exit 1; \
	done
	chmod -R a+r $(distdir)-$(host)
	$(TAR) chozf $(distdir)-$(host).tar.gz $(distdir)-$(host)
	rm -rf $(distdir)-$(host)