#* --------------------------------------------------------------------*/
#*    Copyright (c) 1992-1998 by Manuel Serrano. All rights reserved.  */
#*                                                                     */
#*                                     ,--^,                           */
#*                               _ ___/ /|/                            */
#*                           ,;'( )__, ) '                             */
#*                          ;;  //   L__.                              */
#*                          '   \   /  '                               */
#*                               ^   ^                                 */
#*                                                                     */
#*                                                                     */
#*    This program is distributed in the hope that it will be useful.  */
#*    Use and copying of this software and preparation of derivative   */
#*    works based upon this software are permitted, so long as the     */
#*    following conditions are met:                                    */
#*           o credit to the authors is acknowledged following         */
#*             current academic behaviour                              */
#*           o no fees or compensation are charged for use, copies,    */
#*             or access to this software                              */
#*           o this copyright notice is included intact.               */
#*      This software is made available AS IS, and no warranty is made */
#*      about the software or its performance.                         */
#*                                                                     */
#*      Bug descriptions, use reports, comments or suggestions are     */
#*      welcome. Send them to                                          */
#*        Manuel Serrano -- Manuel.Serrano@unice.fr                    */
#*-------------------------------------------------------------------- */
#*=====================================================================*/
#*    serrano/prgm/project/bigloo/examples/Makefile                    */
#*    -------------------------------------------------------------    */
#*    Author      :  Manuel Serrano                                    */
#*    Creation    :  Thu Jun 19 20:48:50 1997                          */
#*    Last change :  Thu Feb 19 14:06:17 1998 (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 Pp Pragma Process Roman   \
                  Runtime Yacc2bigloo Dsssl

#*---------------------------------------------------------------------*/
#*    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/Example ]; 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)
