#* --------------------------------------------------------------------*/
#*    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/contrib/Makefile                     */
#*    -------------------------------------------------------------    */
#*    Author      :  Manuel Serrano                                    */
#*    Creation    :  Thu Jun 19 20:48:50 1997                          */
#*    Last change :  Sun Mar 22 07:48:00 1998 (serrano)                */
#*    -------------------------------------------------------------    */
#*    The global contrib Makefile (mainly for backuping).              */
#*=====================================================================*/

#*---------------------------------------------------------------------*/
#*    Flags                                                            */
#*---------------------------------------------------------------------*/
BACKUPDIR       = $$HOUSE/backup
BACKUPNAME      = contrib

CONTRIBS	= Makefile           \
                  apropos.tar.gz     \
                  dload-0.1.tar.gz   \
                  emacs.tar.gz       \
                  format.tar.gz      \
                  scmdoc.tar.gz      \
                  scmsockets.tar.gz  \
                  slibinit.tar.gz    \
                  stepper-0.1c.tar.gz

POPULATION	= README $(CONTRIBS)

#*---------------------------------------------------------------------*/
#*    backup                                                           */
#*---------------------------------------------------------------------*/
backup:
	@ echo "Backuping $(BACKUPNAME) in $(BACKUPDIR)"
	@ (\rm -f $(BACKUPDIR)/$(BACKUPNAME).tar.gz;                   \
           cleanup;                                                    \
           tar cf $(BACKUPDIR)/$(BACKUPNAME).tar $(POPULATION);        \
           gzip $(BACKUPDIR)/$(BACKUPNAME).tar)
	@ echo "done..."
	@ echo "-------------------------------"

#*---------------------------------------------------------------------*/
#*    restore ...                                                      */
#*---------------------------------------------------------------------*/
restore:
	@ echo "Restoring $(BACKUPNAME) from $(BACKUPDIR)"
	@ (gzip -d --to-stdout $(BACKUPDIR)/$(BACKUPNAME).tar.gz | tar xfp -)
	@ echo "done..."
	@ echo "-------------------------------"

#*---------------------------------------------------------------------*/
#*    pop ...                                                          */
#*---------------------------------------------------------------------*/
pop:
	@ echo $(POPULATION:%=contrib/%)

#*---------------------------------------------------------------------*/
#*    clean                                                            */
#*---------------------------------------------------------------------*/
.PHONY: Clean clean
clean:
	@ find . \( -name '*[~%]'                   \
                       -o -name '.??*[~%]'          \
                       -o -name '#*#'               \
                       -o -name '?*#'               \
                       -o -name \*core \)           \
                     -type f -exec rm {} \;   
	@ echo "cleanup done..."
	@ $(BEEP)
	@ echo "-------------------------------"

Clean: clean

Dclean: clean
DClean: Clean
	@ /bin/rm emacs.tar.gz

#*---------------------------------------------------------------------*/
#*    distrib                                                          */
#*---------------------------------------------------------------------*/
distrib:
	@ if [ `pwd` = $$HOME/prgm/project/bigloo/contrib ]; then    \
             echo "*** ERROR:Illegal dir to make a distrib `pwd`";   \
             exit 1;                                                 \
          fi
	@ $(MAKE) clean
	@ $(BIN)/copyright $(POPULATION)

