#*=====================================================================*/
#*    serrano/prgm/project/bigloo/Makefile                             */
#*    -------------------------------------------------------------    */
#*    Author      :  Manuel Serrano                                    */
#*    Creation    :  Wed Nov 16 08:43:20 1994                          */
#*    Last change :  Mon Apr  8 12:54:49 1996 (serrano)                */
#*    -------------------------------------------------------------    */
#*    Le gans make coordinateur                                        */
#*=====================================================================*/

#*---------------------------------------------------------------------*/
#*     Les flags ...                                                   */
#*---------------------------------------------------------------------*/
DESTDIR		= "/usr/local"
MANDIR		= "/usr/local/man/man1"
VERSION         = 1.8
CVERSION	= 0.2
BIGLOO          = bin/bigloo$(VERSION)
BEEP            = tools/beep
SHELL           = /bin/sh
DATE		= `date +%m-%d-%y`

#*---------------------------------------------------------------------*/
#*    recette                                                          */
#*---------------------------------------------------------------------*/
recette:
	@ (cd recette; $(MAKE) touchall; $(MAKE); recette)
	@ echo "Recette Done..."
	@ $(BEEP)
	@ echo "-------------------------------"
	  
#*---------------------------------------------------------------------*/
#*    doc                                                              */
#*---------------------------------------------------------------------*/
doc:
	@ (cd documentation/Tex; doc; doc )
	@ echo "Documentation Done..."
	@ $(BEEP)
	@ echo "-------------------------------"
	
#*---------------------------------------------------------------------*/
#*    distribution                                                     */
#*---------------------------------------------------------------------*/
distrib:
	@ distribution/build $(MAKE)
	@ echo "Distribution Done..."
	@ $(BEEP)
	@ echo "-------------------------------"
	
#*---------------------------------------------------------------------*/
#*    libs                                                             */
#*---------------------------------------------------------------------*/
libs:
	@ (cd runtime$(VERSION); $(MAKE); $(MAKE) -i touchall; \
           $(MAKE) lib_u; $(MAKE) lib )
	@ echo "Librarie Done..."
	@ $(BEEP)
	@ echo "-------------------------------"
	
#*---------------------------------------------------------------------*/
#*    bootstrap                                                        */
#*---------------------------------------------------------------------*/
bootstrap:
	@ \cp $(BIGLOO) "$(BIGLOO).$(DATE)"
	@ (cd comptime$(VERSION); $(MAKE) -i touchall; $(MAKE))
	@ echo "Bigloo Done..."
	@ $(BEEP)
	@ echo "-------------------------------"

#*---------------------------------------------------------------------*/
#*    largebootstrap                                                   */
#*---------------------------------------------------------------------*/
largebootstrap:
	@ \cp $(BIGLOO) "$(BIGLOO).$(DATE)"
	@ (cd comptime$(VERSION);   \
	   $(MAKE) -i touchall;     \
	   $(MAKE);                 \
	   $(MAKE) -i touchall;     \
	   $(MAKE))
	@ echo "Bigloo Done..."
	@ $(BEEP)
	@ echo "-------------------------------"

#*---------------------------------------------------------------------*/
#*    fullbootstrap                                                    */
#*---------------------------------------------------------------------*/
fullbootstrap:
	@ \cp $(BIGLOO) "$(BIGLOO).$(DATE)"
	@ \rm -f distribution/SITE
	@ echo "`pwd`" > distribution/SITE
	@ (cd comptime$(VERSION); $(MAKE) -i touchall; $(MAKE))
	@ (cd runtime$(VERSION); $(MAKE); $(MAKE) -i touchall; \
	   $(MAKE) lib_u; $(MAKE) lib )
	@ (cd comptime$(VERSION); $(MAKE) -i touchall; $(MAKE))
	@ (cd comptime$(VERSION); $(MAKE) -i touchall; $(MAKE))
	@ (cd recette; $(MAKE) -i touchall; $(MAKE))
	@ echo "Bigloo Done..."
	@ $(BEEP)
	@ echo "-------------------------------"

#*---------------------------------------------------------------------*/
#*    Le boot                                                          */
#*---------------------------------------------------------------------*/
boot:
	@ distribution/boot 
	@ $(BEEP)
	@ echo "-------------------------------"

#*---------------------------------------------------------------------*/
#*    L'install                                                        */
#*---------------------------------------------------------------------*/
install:
	@ distribution/install $(DESTDIR) $(MANDIR)

#*---------------------------------------------------------------------*/
#*    clean                                                            */
#*---------------------------------------------------------------------*/
clean:
	@ find comptime$(VERSION) -name '*.o' -exec \rm {} \;
	@ find runtime$(VERSION) -name '*.o' -exec \rm {} \;
	@ \rm -f tools/GC_if_mach
	@ \rm -f tools/GC_if_not_there
	@ \rm -f tools/if_mach
	@ \rm -f tools/if_not_there
	@ \rm -f tools/beep
	@ \rm -f tools/dirname
	@ \rm -f lib/$(VERSION)/*.a
	@ \rm -f bin/bigloo$(VERSION)
	@ find examples ! \( -name '*.scm' -o -name 'README'    \
                             -o -name 'Makefile' -o -name '*.c' \
                             -o -name '*.h' -o -name '*.sch' \) \
                             -type f -exec \rm {} \;
	@ echo "Cleanup Done..."
	@ $(BEEP)
	@ echo "-------------------------------"

#*---------------------------------------------------------------------*/
#*    Clean                                                            */
#*---------------------------------------------------------------------*/
Clean:
	@ find comptime$(VERSION) -name '*.o' -exec \rm {} \;
	@ find runtime$(VERSION) -name '*.o' -exec \rm {} \;
	@ \rm -f tools/GC_if_mach
	@ \rm -f tools/GC_if_not_there
	@ \rm -f tools/if_mach
	@ \rm -f tools/if_not_there
	@ \rm -f tools/beep
	@ \rm -f tools/dirname
	@ \rm -f lib/$(VERSION)/*.a
	@ \rm -f bin/bigloo$(VERSION)
	@ find examples ! \( -name '*.scm' -o -name 'README'    \
                             -o -name 'Makefile' -o -name '*.c' \
                             -o -name '*.h' -o -name '*.sch' \) \
                             -type f -exec \rm {} \;
	@ (cd cigloo; $(MAKE) clean)
	@ (cd xlib; $(MAKE) clean)
	@ echo "Cleanup Done..."
	@ $(BEEP)
	@ echo "-------------------------------"

#*---------------------------------------------------------------------*/
#*    xv                                                               */
#*    -------------------------------------------------------------    */
#*    On recherche tous les fichiers de plus de 15 caracteres          */
#*    (a cause de la version linux).                                   */
#*---------------------------------------------------------------------*/
xv:
	@ find . -name '???????????????*' -print

#*---------------------------------------------------------------------*/
#*    viii ...                                                         */
#*    -------------------------------------------------------------    */
#*    On recherche tous les fichiers de plus de 8 caracteres           */
#*    (pour ms-dos)                                                    */
#*---------------------------------------------------------------------*/
viii:
	@ find . \( -name '?????????*.*' -o -name '*.????*' \) -print


