#*---------------------------------------------------------------------*/
#*   A pratical implementation for the Scheme programming language     */
#*                                                                     */
#*                                    ,--^,                            */
#*                              _ ___/ /|/                             */
#*                          ,;'( )__, ) '                              */
#*                         ;;  //   L__.                               */
#*                         '   \\   /  '                               */
#*                              ^   ^                                  */
#*                                                                     */
#*   Copyright (c) 1992-1999 Manuel Serrano                            */
#*                                                                     */
#*     Bug descriptions, use reports, comments or suggestions are      */
#*     welcome. Send them to                                           */
#*       bigloo-request@kaolin.unice.fr                                */
#*       http://kaolin.unice.fr/bigloo                                 */
#*                                                                     */
#*   This program is free software; you can redistribute it            */
#*   and/or modify it under the terms of the GNU General Public        */
#*   License 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 the     */
#*   GNU General Public License for more details.                      */
#*                                                                     */
#*   You should have received a copy of the GNU General Public         */
#*   License along with this program; if not, write to the Free        */
#*   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,   */
#*   MA 02111-1307, USA.                                               */
#*---------------------------------------------------------------------*/
#*=====================================================================*/
#*    serrano/prgm/project/bigloo/examples/Makefile                    */
#*    -------------------------------------------------------------    */
#*    Author      :  Manuel Serrano                                    */
#*    Creation    :  Thu Jun 19 20:48:50 1997                          */
#*    Last change :  Sun Jan 10 07:45:00 1999 (serrano)                */
#*    -------------------------------------------------------------    */
#*    The global example Makefile (just a wrapper).                    */
#*=====================================================================*/

#*---------------------------------------------------------------------*/
#*    Compilers, Tools and Destinations                                */
#*---------------------------------------------------------------------*/
# the shell to be used
SHELL           = /bin/sh

#*---------------------------------------------------------------------*/
#*    Flags                                                            */
#*---------------------------------------------------------------------*/
POPULATION	= Makefile

#*---------------------------------------------------------------------*/
#*    The directory that compose the examples                          */
#*---------------------------------------------------------------------*/
DIRECTORIES	= Afile Args Depend Embedded Fib Foreign        \
                  Lower Match Object Pragma Process Roman       \
                  Runtime Yacc2bigloo Dsssl Socket ClientServer \
                  Lib

#*---------------------------------------------------------------------*/
#*    compile everything                                               */
#*---------------------------------------------------------------------*/
test:
	for d in $(DIRECTORIES); do    \
	   (cd $$d; $(MAKE) test);     \
        done;

#*---------------------------------------------------------------------*/
#*    clean                                                            */
#*---------------------------------------------------------------------*/
clean:
	for d in $(DIRECTORIES); do    \
	   (cd $$d; $(MAKE) -s clean); \
        done;

Dclean: clean

#*---------------------------------------------------------------------*/
#*    pop ...                                                          */
#*---------------------------------------------------------------------*/
pop:
	@ for d in $(DIRECTORIES); do  \
	     (cd $$d; $(MAKE) -s pop); \
          done;
	@ echo $(POPULATION:%=examples/%)

#*---------------------------------------------------------------------*/
#*    distrib                                                          */
#*---------------------------------------------------------------------*/
distrib:
	@ if [ `pwd` = $$HOME/prgm/project/bigloo/examples ]; then   \
             echo "*** ERROR:Illegal dir to make a distrib `pwd`";   \
             exit 1;                                                 \
          fi
	@ $(MAKE) clean
	@ for d in $(DIRECTORIES); do                  \
	     for f in `(cd $$d; $(MAKE) -s pop;)`; do  \
                (cd ..; $(BIN)/copyright $$f);         \
             done;                                     \
          done;
	@ $(BIN)/copyright $(POPULATION)
