# Makefile generated by imake - do not edit!
# $TOG: imake.c /main/104 1998/03/24 12:45:15 kaleb $

##################### Generic Header ######################################
# $Id: Imake.tmpl,v 1.30 1999/08/27 18:27:13 queinnec Exp queinnec $

# Define commands and other parameters specific to site:

##################### Generic Site Parameters #############################
# $Id: Site.def,v 1.25 2001/04/02 17:04:46 queinnec Exp $

HOME   		= /home/queinnec
HOST		= perou
HOSTTYPE	= i586
CVSROOT         = /home/cvsowner/cvsd-root/master

LATEX		= latex
BIBTEX		= bibtex
DELATEX		= detex -l
MAKEINDEX	= makeindex
SPELL		= ispell -l
EPELLE		= epelle -latex
PACK		= gzip
UNPACK		= gunzip
RM		= rm -f
CC		= cc
MAKE            = make
DVIPS           = dvips
DVIPSFLAGS	= -D600 -Z
LiSP2TeXFLAGS   = -vU -I/usr/local/lib/LiSP2TeX
RSYNC		= rsync --rsh ssh -z
RDIST		= rdist -P /usr/bin/ssh
RSH		= ssh -A -g -X
HEVEA		= hevea
HEVEAFLAGS	= -v -I ${HOME}/Hevea
HACHA		= hacha
HACHAFLAGS	= -v

TIME		= time
DELATEX         = cat
WAISDATABASES   = /usr/local/lib/freewais-sf/databases
PRINT           = print
FTPHOST		=	localhost

FTPDIR		=	/stuff/WebPublic/queinnec
LATEX2HTMLDIR	=	/usr/lib/latex2html

EXPORTFLAGS	=	-ftp_dir=${FTPDIR}

# The generic rules that hold everywhere. They mainly concern
# concern TeX generation which is a not naive task given the
# circular constraints that exist.
.SUFFIXES: .epelle .spell .ind .idx .pdf .ps .dvi .bbl .aux .tex .bk .hbk

.tex.dvi: ;	${LATEX} $*.tex
.tex.aux: ;	${LATEX} $*.tex
.tex.bbl: ;	-${BIBTEX} $*
.idx.ind: ;	${MAKEINDEX} $*
.tex.spell: ;	${DELATEX} $*.tex | ${SPELL} | sort -u >$*.spell
.tex.epelle:
	DICOPLUS=${HOME}/.dicoplus.z ${EPELLE} $*.tex >$*.epelle

.dvi.ps:
	${DVIPS} ${DVIPSFLAGS} $*.dvi -o $*.ps
.ps.pdf:
	ps2pdf $*.ps $*.pdf

# Default entry for the LiSP2TeX tool
LiSP2TeXFLAGS   = -vU -I/usr/local/lib/LiSP2TeX
.SUFFIXES: .tex .bk
.bk.tex :
	LiSP2TeX ${LiSP2TeXFLAGS} -- $*.bk > $*.tx
	expand < $*.tx > $*.tex && rm $*.tx
.SUFFIXES: .tex .hbk
.hbk.tex :
	LiSP2TeX ${LiSP2TeXFLAGS} -- $*.hbk > $*.tx
	expand < $*.tx > $*.tex && rm $*.tx

# Rules to convert xfig figures.
.SUFFIXES: .tex .ps .eps .xfig .gif
.xfig.ps : ;	fig2dev -L ps $*.xfig > $*.ps
.xfig.eps : ;	fig2dev -L eps $*.xfig > $*.eps
.xfig.tex : ;	fig2dev -L latex $*.xfig > $*.tex
.xfig.gif :
	fig2dev -L gif -t '#ffffff' $*.xfig $*.gf
	giftrans -t '#ffffff' -o $*.gif $*.gf
	rm $*.gf

###########################################################################
# $Id: Imake.rules,v 1.35 2000/09/20 12:14:02 queinnec Exp $

###################### Specific entries ###################################

# $Id: Imakefile,v 1.112 2001/04/24 08:49:37 queinnec Exp $
# ## Copyright (c) 1990-94 by Christian Queinnec. All rights reserved.

# ##                ***********************************************
# ##                    Small, Efficient and Innovative Class System
# ##                                    Meroon V3
# ##                              Christian Queinnec
# ##                   \'Ecole Polytechnique & INRIA--Rocquencourt
# ##                ************************************************

# ## 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.

# ## This is the Imakefile of the Meroon V3 system. It is a very large
# ## Imakefile!  Please set up the following variables so you can
# ## rebuild Meroon V3 with your preferred Scheme compiler.
# ## For that, run `make' which will compile Meroon and try to install
# ## the resulting files. If the installation does not succeed
# ## (generally because you cannot install the resulting files), become
# ## super-user and run `make install'. For these two make invocations,
# ## you must at least indicate which compiler you are building (the
# ## SCHEME variable) and which type of machine you choose (the
# ## HOSTTYPE variable is often set up by tcsh and other shells).

work : qnc.hack build.meroon

# ###############################################################################
#                    	Public variables
# ###############################################################################

# Define here your own maker. The preferred one is imake (that's why this
# file is an Imakefile) but make (or Gnu make) should also be correct on
# the Makefile that appears in the distribution. There is no need to use
# xmkmf but just imake with your personal configuration if you have one.

MAKE    =       make
# MAKE   =       imake -I$$HOME/config -e

# Choose the compiler you want to use. Some values are possible for
# now: It can be SCC for Scheme->C, BGL for Bigloo or GSC for
# Gambit-C. You can either change this variable or just say `make
# SCHEME=BGL' in the command line.

# SCHEME	= SCC
# SCHEME	= BGL
# SCHEME	= GSC

# This variable tells which type of computer you are using. It is
# usually setup by tcsh and then automatically imported here. I use
# sun4, news_mips, vax etc. It is only used to name the subdirectory
# of o/ where all compilation products will go. This allows to compile
# Meroon concurrently for multiple architectures without messing files.

# HOSTTYPE	= 	MyComputer
# HOSTTYPE       =       sun4
# HOSTTYPE       =       news_mips

# The C compiler to use (gcc works for Scheme->C and Bigloo) and additional
# flags for this compiler.

CC		= 	gcc
CFLAGS          = 	-O3

# These variables drive the installation process. They are usual so I
# do not spend time to comment them. Since installation is done by
# copying files, you may consider running make clean to recover disk
# place.

MANEXTENSION    = 1
MANDIR          = /usr/man/man${MANEXTENSION}
BINDIR          = /usr/local/bin

# Documentation will be installed in this directory.

DOCDIR          = /usr/local/lib/Meroon-V3

# To use the install program is known to be not portable (see
# autoconf documentation) so I use cp instead.

# INSTALL	= install -c
INSTALL		= cp

# To update an archive file. Ranlib does not exist on some machine where it
# conveniently replaced with touch or echo or whatever neutral command.

# RANLIB		= touch
RANLIB		= ranlib

# It is often useful to specify this variable to avoid problems.

SHELL	=	/bin/sh

# ########### If you use Scheme->C then you must set up the following
# variables: SCC defines the name of the Scheme->C compiler to
# use.  Additional flags for Scheme->C compilation for your machine
# can be specified with SCCFLAGS.  SCCDIR is the directory where is
# the object.h file of Scheme->C [You can find what this place is
# after reading the scc shell-script under flag LIBDIR].

SCC		= scc
SCCFLAGS	=
SCCDIR		= /usr/local/lib/schemetoc

# These are the additional flags used by the C compiler when invoked by scc.
# The extended interpreter/compiler sci+ or scc++ will be installed
# in the BINDIR directory specified above.

SCC_CFLAGS	= ${CFLAGS} -I${SCCDIR}

# This is the path to where are the compiled files of Scheme->C, we need
# them to build a new compiler with Meroon in it. In this directory can
# be found the scsc subdirectory (which is needed) and some other
# directories such as scrt, test, xlib ...

SCC_SRC_DIR	= /your/path/leading/to/scheme2c/compiled/sources

# ###########  If you use Bigloo then you must set up the following variables:
# BIGLOO defines the compiler to use, BIGLOOFLAGS the additional
# flags. All numbers in Meroon V3 are fixnums so use -farithmetic.
# The extended compiler will be installed in BINDIR as specified above.

BIGLOO		= bigloo
BIGLOOFLAGS	= -q -O3 -farithmetic -v -eval "(set! *indent* (not 1))"

# Indicate the version of Bigloo you want to use. This is needed to compute
# some paths.

BIGLOOVERSION	= 2.1a

# This is the absolute path to the compiled files of the Bigloo compiler.
# We need them to build the extended compiler: bigloo++. Pay attention
# this path leads to the comptime subdirectory of the Bigloo distribution.

BIGLOO_SRC_DIR	= /usr/local/src/bigloo${BIGLOOVERSION}/comptime

# Bigloo uses Gnu make for its generation. Often make is sufficient to
# handle Bigloo's makefile but sometimes you may find an old old make
# in which case, you have to use the real Gnu make.

BIGLOO_MAKER	= gmake

# This directory is where Bigloo stores its necessary files. Usually
# it is something like /usr/local/lib/bigloo/<version#>/. You probably
# need to be root to write in those directories. In this directory will
# be installed the libmeroonV3.a library, the *.bgl modules for MeroonV3
# and the module of modules meroonV3.bgl that is needed to compile files
# using Meroon. There will be also a file called meroon that defines how
# files with the .oon extension should be compiled. If you ignore what this
# directory is, run `bigloo -query' to see where is its lib-dir.

# BIGLOO_LIB_DIR	=	/usr/local/lib/bigloo/${BIGLOOVERSION}

# Starting with 1.9, bigloo libdir changed. Archives, shared libraries
# are now stored in this directory with a name containing the
# biglooversion.

BIGLOO_LIB_DIR	=	/usr/local/lib/bigloo

# To link bigloo++ with Bigloo <=1.6b you need to be able to recompile
# BIGLOO_SRC_DIR/Tools/date.o, if you may change these rights just run
# chmod -R a+w BIGLOO_SRC_DIR/ otherwise, remove the line that
# recompiles Tools/date.o from BIGLOO_SRC_DIR/Makefile.

# To install bigloo++ and besides being able to install it in BINDIR,
# to install its documentation in MANDIR, you'll also need to be able
# to write in BIGLOO_LIB_DIR, just run chmod -R a+w BIGLOO_LIB_DIR.

# ###########  If you use Gambit-C then you must set up the following variables:
# GAMBIT_COMPILER is the name of the Gambit-C compiler.

GAMBIT_COMPILER	= 	gsc

# GAMBIT_DIR is the directory where the real sources of Gambit are.

GAMBIT_DIR	= 	/usr/local/src/gambc30

# Tells the name of the gambit library

GAMBIT_LIBRARY	=	${GAMBIT_DIR}/lib/libgambc.a

# These are the flags used to compile Meroon sources with Gambit.
# The gambit.h file should be reachable from it.

GAMBIT_CFLAGS	=	${CFLAGS} -D___SINGLE_HOST -I${GAMBIT_DIR}/lib

# Tells in which directory the gsi.scm file is:

GAMBIT_GSI_DIR	=	${GAMBIT_DIR}/gsi

# Tells in which directory the gsc.scm file is:

GAMBIT_GSC_DIR	=	${GAMBIT_DIR}/gsc

# You must also copy from ${GAMBIT_GSC_DIR}/makefile the definitions
# of MODULES and MODULES_O and paste it into GSC_MODULES and
# GSC_MODULES_O. Remove the final 'gsc' name from them and surround
# any names of GSC_MODULES within "".

GSC_MODULES = "_host" "_utils" "_source" "_parms" 	"_env" "_ptree1" "_ptree2" "_gvm" "_back" 	"_front" "_prims" "_t-c-1" "_t-c-2" "_t-c-3"

GSC_MODULES_O = _host.o _utils.o _source.o _parms.o 	_env.o _ptree1.o _ptree2.o _gvm.o _back.o 	_front.o _prims.o _t-c-1.o _t-c-2.o _t-c-3.o

# ########### If you care to send me a mail after installing Meroon
# then use that address. If you remove the definition nothing will be
# sent. You may alternatively say 'no' when asked to send the message.
# Look below at the propose-sending-mail entry.

MEROON_MAIL	=	mail
MEROON_ADDRESS	=	Christian.Queinnec@lip6.fr

# ########################################################## End of public part.
# This is normally the script that will be run if you invoke make
# without any arguments.

# A useful abbreviation for the next entries.
OPT	= "HOSTTYPE=${HOSTTYPE}" "SCHEME=${SCHEME}"

build.meroon : check-shell-variables
	@echo
	@echo
	@echo "	Compiling Meroon V3..."
	@echo
	@echo All compilation product will go into o/${HOSTTYPE}/${SCHEME}
	@echo
	${MAKE} ${OPT} sch.bgl.cp
	@echo
	@echo
	@echo Compiling modules into the libmeroonV3.a library...
	@echo
	${MAKE} ${OPT} o/${HOSTTYPE}/${SCHEME}/libmeroonV3.a
	@echo
	@echo
	@echo Generating a compiler/interpreter for Meroon V3...
	@echo
	${MAKE} ${OPT} o/${HOSTTYPE}/${SCHEME}/${SCHEME}++
	@echo
	@echo
	@echo "Trying to install ${SCHEME}++ (you may have to be su)..."
	@echo
	${MAKE} ${OPT} install
	@echo
	@echo
	@echo "Meroon V3 is ready."

# Install SCHEME++, libraries and other files. You probably have to be su.

install : check-shell-variables
	${MAKE} ${OPT} ${SCHEME}.install
	@[ -n "${MEROON_MAIL}" ] && [ -n "${MEROON_ADDRESS}" ] 		&& ${MAKE} ${OPT} propose-sending-mail

# Propose to send a mail. You then help me to justify (with respect to
# my employers) the time I spend on Meroon. This is not mandatory and
# you may still use Meroon-V3 without reporting it!

propose-sending-mail :
	@echo
	@echo
	@echo "Do you want to send me a mail (yes,no)[y] ? "
	-read ans ; case $$ans in [nN]*) exit 0 ;; *) 	   ( date ; uname -a ; hostname ; domainname ;	     sed -n -e "/define meroon-distribution-name/p" <revision.scm ;	     echo $$USER installed Meroon for ${SCHEME}. ;	   ) | ( ${MEROON_MAIL} ${MEROON_ADDRESS} ; echo "Thanks!" ) & ;; 	esac

# Check that shell variables HOSTTYPE and SCHEME are correctly set.

check-shell-variables :
	@[ -n "${SCHEME}" ] || (echo "Missing variable SCHEME !!!" ; exit 1)
	@[ -n "${HOSTTYPE}" ] || (echo "Missing variable HOSTTYPE !!!" ; exit 1)

clean.install : SCC.clean.install BGL.clean.install

# ##############################################################################
# My personal entries so I can just type make and do what I want.

qnc.hack :
	-@[ X$$USER = Xqueinnec ] && ${MAKE} do.qnc

do.qnc :
	@echo -n "Build Meroon for (install,scc,sci,bigloo,distrib,gsi,gsc,all) [nothing] ? "
	@read ans ; case $$ans in 						[sS][cC][cC]*) 	make do.qnc.scc ;;				[sS][cC][iI]*) 	make do.qnc.sci ;;				[sS]*) 		make do.qnc.s2c ;;				[bB]*) 		make do.qnc.bigloo ;;				[gG][sS][iI]*)	make do.qnc.gsi ;;				[gG][sS][cC]*)	make do.qnc.gsc ;;				[dD]*)		make do.qnc.distribution ;; 			[aA]*)		make do.qnc.all ;;				[iI]*)		make install ;; 				*) : ;; esac

	make do.qnc.clean
	echo "QNC's hack finished, stop here." ; exit 1

do.qnc.s2c : do.qnc.sci do.qnc.scc
do.qnc.all : do.qnc.s2c do.qnc.bigloo

do.qnc.sci :
	${MAKE} mkdir
	@echo -n "	Rebuild sci+ entirely (y,n)[n] ? "
	@read ans; case $$ans in 		[yY]*) rm -rf o/${HOSTTYPE}/SCC/?* ; 		${MAKE} all.SCC "BOOT_SCM=${BOOT_SCM}" ;; 		*) : ;; esac

	${MAKE} test.sci+ ${BINDIR}/sci+ SCHEME=SCC "BOOT_SCM=${BOOT_SCM}"
	@echo -n "	Rebuild my own sci (y,n)[y] ? "
	@read ans; case $$ans in [yY]*) cd ${HOME}/s2c ; m ;; *) : ;; esac
do.qnc.scc :
	${MAKE} mkdir
	@echo -n "	Rebuild scc++ entirely (y,n)[n] ? "
	@read ans; case $$ans in 		[yY]*) rm -rf o/${HOSTTYPE}/SCC/?* ; 		${MAKE} all.SCC "BOOT_SCM=${BOOT_SCM}" ;; 		*) : ;; esac

	${MAKE} test.scc++ ${BINDIR}/scc++ SCHEME=SCC "BOOT_SCM=${BOOT_SCM}"
do.qnc.bigloo :
	${MAKE} mkdir HOSTTYPE="$$HOSTTYPE"
	@echo -n "	Rebuild bigloo++ entirely (y,n)[n] ? "
	@read ans; case $$ans in 		[yY]*) rm -rf o/${HOSTTYPE}/BGL/?* ;; 		*) : ;; esac;

	-cd o/${HOSTTYPE}/BGL/ ; ln -s macinst.scm macinst.bigloo.bgl
	-cd o/${HOSTTYPE}/BGL/ ; ln -s instance.scm instance.bigloo.bgl
	${MAKE} all.BGL SCHEME=BGL "BOOT_SCM=${BOOT_SCM}"
	${MAKE} BGL.install SCHEME=BGL "BOOT_SCM=${BOOT_SCM}"
	${MAKE} test.bigloo++ SCHEME=BGL "BOOT_SCM=${BOOT_SCM}"
do.qnc.gsi :
	${MAKE} mkdir
	@echo -n "	Rebuild gsi+ entirely (y,n)[n] ? "
	@read ans; case $$ans in 		[yY]*) rm -rf o/${HOSTTYPE}/GSC/?* ;; 		*) : ;; esac

	${MAKE} GSI.install SCHEME=GSC "BOOT_SCM=${BOOT_SCM}"
	${MAKE} test.gsi+ SCHEME=GSC "BOOT_SCM=${BOOT_SCM}"
do.qnc.gsc :
	${MAKE} mkdir
	@echo -n "	Rebuild gsc++ entirely (y,n)[n] ? "
	@read ans; case $$ans in 		[yY]*) rm -rf o/${HOSTTYPE}/GSC/?* ;; 		*) : ;; esac

	${MAKE} GSC.install SCHEME=GSC "BOOT_SCM=${BOOT_SCM}"
	${MAKE} test.gsc++ SCHEME=GSC "BOOT_SCM=${BOOT_SCM}"

do.qnc.distribution :
	@echo -n "Give a value to DISTRIBUTION_NAME ? "
	@read DISTRIBUTION_NAME ; export DISTRIBUTION_NAME ; 		${MAKE} distribution "BOOT_SCM=${BOOT_SCM}"

# Try to install as if being a regular user.
TmpOpt	= HOSTTYPE=bar SCHEME=BGL
do.notqnc.install :
	cp `ls -t Meroon*.tar.gz | head -1` /tmp
	gunzip /tmp/Meroon*.tar.gz
	cd /tmp ; tar -xvf Meroon*.tar && rm Meroon*.tar
	cd /tmp/MeroonV3-* ; USER=foo make ${TmpOpt}

# These are big executables and anything to regenerate them easily is still
# present (the library and the redundant .o files) so remove them.
do.qnc.clean :
	-cd o/${HOSTTYPE}/SCC ; rm thinman* sci+ scc++ sccomp++
	-cd o/${HOSTTYPE}/BGL ; rm bigloo++ test
	-cd ${BINDIR} ; rm sci+

# ##############################################################################
#			Sources						      #
# ##############################################################################
# These are all the sources of Meroon. Some are only needed while
# bootstrapping Meroon.

SOURCES = 	access.scm 				alloc.scm				anomaly.scm 				Basics.scm				careless.scm				clone.scm				coinst.scm				Coercers.scm				computl.scm				definers.scm 				dsssl.scm				dispatch.scm				egal.scm 				exodus.scm 				extract.scm				filer.scm				fill.scm 				genes1.scm 				genes2.scm 				handy.scm				instance.scm				interm.scm				libgen.scm 				macinst.scm				macros.scm				maker.scm				meroon.scm 				modify.scm				multi.scm 				nodsssl.scm				option.scm				postset.scm				revision.scm 				runtime.scm 				show.scm 				size.scm 				trace.scm 				unveil.scm				utils.scm				view.scm				walker.scm

# Note: files Basics.scm and Coercers.scm are generated by the bootstrap.

# These are the customization files.

CUSTOM	=	meroon.bigloo			instance.bigloo			macinst.bigloo			oo.bigloo			meroon.elk			oo.elk				meroon.gam			oo.gam				compile.gam			icoon.hqx			lncoon.hqx			lnioon.hqx			build.gam			meroon.guile			meroon.guile-ii			meroon.gsc			instance.gsc			macinst.gsc			compile.gsc			oo.gsi				meroon.gambc24			meroon.mac			oo.mac				meroon.mit			oo.mit				meroon.mzscheme			oo.mzscheme			meroon.osc			oo.osc				meroon.pcg			oo.pcg				meroon.pcs			oo.pcs				meroon.slib			oo.slib				meroon.s2c			oo.s2c				meroon.vscm			oo.vscm

# Note: missing .fools .siod .s48 .umb

OTHER_FILES =	FUTURE				Imakefile			Makefile			meroonV3.interface			Timings.blaye			rminit.prl			expand.bgl			tester.scm			oo3.tst				oo3dsssl.tst			postset.tst			clexpand.scm			xpnd.scm			bl.scm

# Documentations

DOC_FILES =	ChangeLog				README					HINTS					Doc/oopil.dvi				Doc/oopil.ps				Doc/meroon.1				Doc/MeroonV3.dvi			Doc/MeroonV3.ps				Doc/dispatch.dvi			Doc/dispatch.ps

# ##############################################################################
#			Tests						      #
# ##############################################################################

test :	test.elk 			test.sci 			test.bigloo 			test.slib			test.oscheme			test.guile			test.mit			test.mzscheme			test.gambit			test.vscm

# Timing interpreters (see raw results below)
# Caution: these interpreters are benched over the tests suite which displays
# a lot of things so printing time is not negligible.

# SEE	=
SEE	= 1> /dev/null

timings :
	@echo "Caution this will last nearly 20 minutes!!!"
	${TIME} ${MAKE} do.timings
do.timings :
	@echo tests done on `hostname` on `date` | tee /dev/tty	> /tmp/timings
	true @echo "	Timing sci..." | tee /dev/tty	>> /tmp/timings
	true ${MAKE} test.sci	< /dev/null	${SEE}	2> /tmp/tt
	true tail -2 /tmp/tt 			>> /tmp/timings
	@echo "	Timing bigloo..." | tee /dev/tty	>> /tmp/timings
	${MAKE} test.bigloo	< /dev/null	${SEE}	2> /tmp/tt
	tail -2 /tmp/tt 			>> /tmp/timings
	@echo "	Timing slib..." | tee /dev/tty	>> /tmp/timings
	${MAKE} test.slib		< /dev/null	${SEE}	2> /tmp/tt
	tail -2 /tmp/tt 			>> /tmp/timings
	true @echo "	Timing elk..." | tee /dev/tty 	>> /tmp/timings
	true ${MAKE} test.elk		</dev/null 	${SEE}	2> /tmp/tt
	true tail -2 /tmp/tt 			>> /tmp/timings
	@echo ; echo Final results are:
	@cat /tmp/timings ; echo ; rm /tmp/tt

# tests done on blaye on Tue Oct 12 GMT+0200 1993
# Don't try to reproduce them, Meroon changed as well as the test suite.
# Final results are:
#        Timing sci...
# 216.92user 2.29system 3:40.27elapsed 99%CPU (615text+23924data 13140max)k
# 0inputs+1outputs (10major+64minor)pagefaults 0swaps
#        Timing bigloo...
# 111.70user 1.78system 1:54.99elapsed 98%CPU (1698text+8684data 5604max)k
# 0inputs+10outputs (48major+181minor)pagefaults 0swaps
#        Timing slib...
# 119.52user 0.95system 2:01.57elapsed 99%CPU (351text+1558data 980max)k
# 0inputs+5outputs (6major+33minor)pagefaults 0swaps
#        Timing elk...
# 574.10user 1.69system 9:37.11elapsed 99%CPU (295text+15868data 8340max)k
# 15inputs+3outputs (9major+28minor)pagefaults 0swaps

# ##################################################Testing with MzScheme
# Testing with mzscheme
MZSCHEME	= mzscheme

# Ok with MzScheme 100.
test.mzscheme :
	echo "					(set! read-case-sensitive #t)			(load \"meroon.mzscheme\")			(load \"meroon.scm\")				(define *meroon-debug* #t)			(load \"oo.mzscheme\")				(and (test-oo \"oo3.tst\")			     (begin (load \"postset.scm\")		            (test-oo \"postset.tst\") ) )" 	| ${TIME} ${MZSCHEME}

# Does not work yet.
compile.for.mzscheme :
	mzc -z -p meroon.mzscheme macros.scm macinst.scm careless.scm 	    utils.scm instance.scm revision.scm walker.scm runtime.scm 	    option.scm access.scm dispatch.scm handy.scm definers.scm 	    alloc.scm genes1.scm genes2.scm Basics.scm fill.scm coinst.scm 	    maker.scm view.scm libgen.scm Coercers.scm anomaly.scm multi.scm 	    show.scm trace.scm size.scm unveil.scm egal.scm clone.scm

clean ::
	-rm *.zo

# ##################################################Testing with Scheme->C
# Testing with sci 15mar93.
SCI	= /usr/local/bin/sci -sch 12

# ## My sci already contains Meroon now (see ~/s2c/Imakefile)
MY_SCI	= $$HOME/bin/$${HOSTTYPE}/sci
test.qnc.sci :
	echo "			(load \"oo.s2c\")		(test-oo \"oo3.tst\")"			| ${TIME} ${MY_SCI}

# Also test the Scheme->C prologue with a bare sci
test.sci :
	echo "			(load \"meroon.s2c\")		(load \"meroon.scm\")		(define *meroon-debug* #t)	(load \"oo.s2c\")		(test-oo \"oo3.tst\")" 			| ${TIME} ${SCI}

# ###################################################Testing with Elk
# Elk 2.2 is case-sensitive by default. [No dsssl support here]
ELK	= elk -h 20000
ELKDIR	= /usr/local/elk

test.elk :
	@echo "						(load \"${ELKDIR}/runtime/scm/debug.scm\")		(load \"${ELKDIR}/runtime/scm/trace.scm\")		(load \"meroon.elk\")					(load \"meroon.scm\")					(define *meroon-debug* #t)				(load \"oo.elk\")					(and (test-oo \"oo3.tst\")				     ''(test-oo \"oo3dsssl.tst\")			     (begin (load \"postset.scm\")			            (test-oo \"postset.tst\") ) )"		| ${TIME} ${ELK}

# ###################################################Testing with SIOD
# SIOD is not a complete Scheme implementation, tests cannot be carried.
SIOD	= siod -h20000

test.siod :
	@echo "						(load \"meroon.siod\")					(load \"meroon.scm\")					(define *meroon-debug* #t)				(load \"oo.siod\")					(test-oo \"oo3.tst\")"			| ${TIME} ${SIOD}

# ###################################################Testing with Bigloo
# Test with interpreted bigloo, mine already contains Meroon.
MY_BIGLOO = $$HOME/bin/$$HOSTTYPE/bigloo+
# Can also test with bigloo -nil to test a little eq-ness of #f and ().

test.my.bigloo :
	echo "					(define *meroon-debug* #t)			(load \"oo.bigloo\")				(test-oo \"oo3.tst\")"			| ${TIME} ${MY_BIGLOO} -i

# OK now for bigloo 2.1a (No dsssl support here)
test.bigloo :
	echo "					(load \"meroon.bigloo\")			(load \"meroon.scm\")				(define *meroon-debug* #t)			(load \"oo.bigloo\")				(and (test-oo \"oo3.tst\")			     ''(test-oo \"oo3dsssl.tst\")		     (begin (load \"postset.scm\")		            (test-oo \"postset.tst\") ) )"	| ${TIME} ${BIGLOO} -i

# Test on blaye for test.bigloo (11 feb 97, Audrey+3)
# 193.48user 11.48system 5:49.69elapsed 58%CPU
# Test on lispou pc-1 133MHz (Noel+1 9 feb 98)
# 24.94user 1.10system 0:49.13elapsed 52%CPU

# ###################################################Testing with SCM
# Test with interpreted SCM+SLIB (scm4e1, slib2a1)
SLIB 		= scm
SLIB_DIR	= /usr/local/src/slib
SLIB_INIT_SCM	= /usr/local/src/scm/Init5c2.scm

test.slib :
	export SCM_INIT_PATH=${SLIB_INIT_SCM} ; echo "		(load \"meroon.slib\")				(load \"meroon.scm\")				(define *meroon-debug* #t)			(load \"oo.slib\")				(and (test-oo \"oo3.tst\")			     (begin (load \"postset.scm\")		            (test-oo \"postset.tst\") ) )"	| ${TIME} ${SLIB}

# Time on cornas for test.slib (18 Oct 94, Wenceslas+1)
# 75.43user 19.58system 1:45.20elapsed 90%CPU

# ###################################################Testing with Guile
# Test with interpreted guile-iii
GUILE	 = guile

test.guile :
	echo "					(load \"meroon.guile\")				(load \"meroon.scm\")				(define *meroon-debug* #t)			(load \"oo.slib\")				(test-oo \"oo3.tst\")"			| ${TIME} ${GUILE}

# on my pc-1 166MHz: Noel+1
#  42.51user 0.63system 0:57.09elapsed 75%CPU

# ###################################################Testing with OScheme
# Test with interpreted OScheme 1 (14 Feb 1995)
OSCHEME	= oscheme

test.oscheme :
	echo "					(load \"meroon.osc\")				(load \"meroon.scm\")				(define *meroon-debug* #t)			(load \"oo.osc\")				(test-oo \"oo3.tst\")				(exit 0)"			| ${TIME} ${OSCHEME}

# Compute profiling information with OScheme
# Takes roughly 2641.560u 9.130s 44:28.20 99.3% on blaye.
# ((dispatch index= 77758
#        subclass= 815590
#       immediate= 491882
#     global= 0 else= 0)
# (generic-calls= 569565))

profile.with.oscheme :
	${MAKE} profile.bench1.with.oscheme 		profile.bench2.with.oscheme 2>&1 | tee Examples/oscheme.profile

# Takes roughly 964.26user 3.33system 16:16.71elapsed 99%CPU on blaye.
# Results: ((dispatch index=      72540
#                     subclass=  815240
#                     immediate= 491470
#                     global=         0
#                     else=           0)
#           (generic-calls=      563839))

profile.bench1.with.oscheme :
	echo "					(load \"meroon.osc\")				(set! *meroon-features* (cons 'profile *meroon-features*))	(load \"meroon.scm\")				(define *meroon-debug* #t)			(load \"Examples/pinterp.scm\")			(set! *generic-call-counter* 0)			(set! *indexed-dispatch* 0)			(set! *subclass-dispatch* 0)			(set! *immediate-dispatch* 0)			(set! *global-dispatch* 0)			(set! *else-dispatch* 0)			(start-bench)					(display \`((dispatch index= ,*indexed-dispatch* 	     subclass= ,*subclass-dispatch*		     immediate= ,*immediate-dispatch*		     global= ,*global-dispatch*			     else= ,*else-dispatch* )			    (generic-calls= ,*generic-call-counter*)))	(newline)					(show-dispatcher)				"			| ${TIME} ${OSCHEME}

# Takes roughly 1675.46user 4.65system 28:08.21elapsed 99%CPU on blaye.
# Results: ((dispatch index=     243130
#                     subclass=       0
#                     immediate= 483552
#                     global=         0
#                     else=           0)
#           (generic-calls=      726523))

profile.bench2.with.oscheme :
	echo "					(load \"meroon.osc\")				(set! *meroon-features* (cons 'profile *meroon-features*))	(load \"meroon.scm\")				(define *meroon-debug* #t)			(load \"Examples/vsg.scm\")			(load \"Examples/vsg-bench.scm\")		(set! *generic-call-counter* 0)			(set! *indexed-dispatch* 0)			(set! *subclass-dispatch* 0)			(set! *immediate-dispatch* 0)			(set! *global-dispatch* 0)			(set! *else-dispatch* 0)			(start-bench)					(display \`((dispatch index= ,*indexed-dispatch* 	     subclass= ,*subclass-dispatch*		     immediate= ,*immediate-dispatch*		     global= ,*global-dispatch*			     else= ,*else-dispatch* )			    (generic-calls= ,*generic-call-counter*)))	(newline)					(show-dispatcher)				"			| ${TIME} ${OSCHEME}

# ###################################################Testing with MIT Scheme
# Test with interpreted MIT Scheme 7.2.0
MIT	= mit-scheme -large

test.mit :
	echo "					(load \"meroon.mit\")				(define *meroon-debug* #t)			(load \"meroon.scm\")				(load \"oo.mit\")				(test-oo \"oo3.tst\")"			| ${TIME} ${MIT}

# Time on cornas for test.mit (18 Oct 94, Wenceslas+1)
# 174.96user 24.14system 3:26.30elapsed 96%CPU

# ###################################################Testing with Gambit
# Test with interpreted Gambit (C-version) 2.2b
GAMBIT	= gsi

# Test with interpreted Gambit-C version 2.4, still correct with 3.0

test.gambit : meroon.gambc24
	(  cat meroon.gsc meroon.gambc24 ; 	  echo "				(define *meroon-debug* #t)			(load \"oo.gsi\")				(and (test-oo \"oo3.tst\")			     (test-oo \"oo3dsssl.tst\")			     (begin (load \"postset.scm\")		            (test-oo \"postset.tst\") ) )		" ;  )			| ${TIME} ${GAMBIT}

# Time on lispou (pc-1 133Mhz) (Noel+1, 9 feb 98)
# 43.31user 2.40system 1:15.97elapsed 60%CP
# Time on perou (pc-1 450Mhz) (Paques2001, 16 avril 2001)
# 14.46user 1.06system 0:33.87elapsed 45%CPU

# ###################################################Testing with Scheme48
# Test with Scheme48                            UNFINISHED
SCHEME48_LIBDIR	= /usr/local/lib/scheme48
SCHEME48 =	scheme48

meroon.image :
	( echo ",open signals handle environments"	;	  echo ",build meroon.image"			;	  echo ",exit"					;	  : ) | ${SCHEME48}

test.s48 :
	( echo ",open signals handle environments"	;	  echo ",load meroon.s48"			;	  echo ",load meroon.scm"			;	  echo "(define *meroon-debug* #t)"		;	  echo ",load oo.s48"				;	  echo "(test-oo \"oo3.tst\")"			;	  : ) | ${TIME} ${SCHEME48}

# ###################################################Testing with UMB Scheme
# Test with UMB Scheme                     GIVEN UP
UMB =	umbscheme

test.umb :
	echo "				(load \"meroon.umb\")			(load \"meroon.scm\")			(define *meroon-debug* #t)		(load \"oo.umb\")			(test-oo \"oo3.tst\")"			| ${TIME} ${UMB}

# ###################################################Testing with fools
# Test with fools                          GIVEN UP
FOOLS_DIR =	/usr/local/lib/fools
FOOLS = fools ${FOOLS_DIR}/init.scm ${FOOLS_DIR}/extra.scm 		${FOOLS_DIR}/macros.scm

test.fools :
	echo "				(load \"meroon.fools\")			(load \"meroon.scm\")			(define *meroon-debug* #t)		(load \"oo.fools\")			(test-oo \"oo3.tst\")"			| ${TIME} ${FOOLS}

# ###################################################Testing with vscm
# Test with vscm			UNFINISHED
VSCM		= vscm
VSCM_SRC_DIR	= /usr/local/src/vscmV0r4
VSCM_LIB_DIR	= /usr/local/lib/vscm

test.vscm :
	echo "				(load \"meroon.vscm\")			(load \"meroon.scm\")			(define *meroon-debug* #t)		(load \"oo.vscm\")			(test-oo \"oo3.tst\")"			| ${TIME} ${VSCM}

# Build a new core image with slib and Meroon in it.
# We have to modify vscm.init to contain the appropriate path to the
# slib directory (actually it contains /u/blume/Research/Scheme/slib).
# Actually (11 X 94) vscm.init from the vscm distribution is incorrect and
# lacks some functions, take the one that comes from SLIB_DIR.
# Also fixed some bugs in slib, you should have slib > 2a1.

build.vscm+ :
	if [ -f ${SLIB_DIR}/vscm.init ] ; then : ; 	else echo "Cannot find the slib directory!?" ; exit 1 ; fi

	echo "					(load \"meroon.vscm\")				(load \"meroon.scm\")				(slib:dump \"o/${HOSTTYPE}/vscm4meroon\")	(load \"oo.vscm\")				(test-oo \"oo3.tst\")				"						| ${TIME} ${VSCM}

	mv o/${HOSTTYPE}/vscm4meroon ${VSCM_LIB_DIR}

test.vscm+ :
	echo "						(load \"oo.vscm\")					(test-oo \"oo3.tst\")" 	| ${TIME} ${VSCM} -b ${VSCM_LIB_DIR}/vscm4meroon

# ##############################################################################
#  		Compiling Meroon					      #
# ##############################################################################
# This is difficult due to the bootstrap of Meroon. The basic idea is that
# you must have a working Meroon in your compiler to compile Meroon. So
# you must load Meroon so it can expand itself in order to be compiled.
# Only Bigloo and Scheme->C are handled here.
# Before anything run:					make mkdir
# then for Scheme->C:			make all.SCC
# 	   followed by:			make o/${HOSTTYPE}/SCC/libmeroonV3.a
# for Bigloo			make all.BGL
#     followed by:		make o/${HOSTTYPE}/BGL/libmeroonV3.a
#          and by:		make o/${HOSTTYPE}/BGL/bigloo++

# ################################################# Compiling Meroon
# Prepare Scheme->C and Bigloo modules and interfaces for compilation.
# Use Elk for that task to preserve case sensitivity. Make sure also
# that the bootstrap (building Basics.scm and Coercers.scm) is already
# done and correct. You can also use Scheme->C for that task (but without
# preserving case sensitivity).
# BOOT_SCM	= ${SCI}
BOOT_SCM	= ${ELK}
# #BOOT_SCM	= ${MZSCHEME}

# This directory is used to build scc++
WORK_SCCplus_DIR	= o/${HOSTTYPE}/SCC/schemetoc+meroon

# Prepare the directories where to store the modules.

mkdir :
	-[ -d o ] 			|| mkdir o
	-[ -d o/${HOSTTYPE} ] 		|| mkdir o/${HOSTTYPE}
	-[ -d o/${HOSTTYPE}/SCC ] 	|| mkdir o/${HOSTTYPE}/SCC
	-[ -d ${WORK_SCCplus_DIR} ] 	|| mkdir ${WORK_SCCplus_DIR}
	-[ -d o/${HOSTTYPE}/BGL ]  	|| mkdir o/${HOSTTYPE}/BGL
	-[ -d o/${HOSTTYPE}/GSC ]	|| mkdir o/${HOSTTYPE}/GSC

# Prepare all modules and interfaces in one go. Generate them into
# the DEST_DIR directory. BOOT_SCM will generate Bigloo and Scheme->C modules.

DEST_DIR	= o/${HOSTTYPE}
all.sch all.scc all.SCC : Basics.scm Coercers.scm
	@[ -n "${BOOT_SCM}" ] || (echo "Missing variable BOOT_SCM." ; exit 1)
	@echo "(begin						  (define boot-scm \"${BOOT_SCM}\")				  (load \"extract.scm\")					  (generate-all-sch-interfaces \"${DEST_DIR}/SCC/\")		  (generate-all-scc-modules \"${DEST_DIR}/SCC/\")		  \"All modules and interfaces regenerated.\"					)" | ${BOOT_SCM}

${DEST_DIR}/SCC/all-o :
	-rm -f ${DEST_DIR}/SCC/all-o
	${MAKE} ${OPT} ${DEST_DIR}/SCC/do.all-o DEST_DIR=${DEST_DIR}
	chmod a=r ${DEST_DIR}/SCC/all-o

all.bgl : Basics.scm Coercers.scm
	@echo "(begin						  (define boot-scm \"${BOOT_SCM}\")				  (load \"extract.scm\")					  (generate-all-bgl-modules \"${DEST_DIR}/BGL/\")		  \"All modules and interfaces regenerated.\"					)" | ${BOOT_SCM}

# To simplify the boot, the body of the Bigloo modules is expanded by Bigloo.

all.BGL : ${DEST_DIR}/BGL/all-o
	@echo "(begin 					(load \"expand.bgl\")					(generate-all-bgl-bodies \"${DEST_DIR}/BGL/\")		\"All module bodies regenerated.\" )"	| ${BIGLOO}

${DEST_DIR}/BGL/all-o :
	-rm -f ${DEST_DIR}/BGL/all-o
	${MAKE} ${OPT} ${DEST_DIR}/BGL/do.all-o DEST_DIR=${DEST_DIR}
	chmod a=r ${DEST_DIR}/BGL/all-o

# In the distribution, where we are not sure of the presence of Elk or
# Scheme->C, the modules to compile are taken from the distribution.

sch.bgl.cp :
	if [ -d o/HOSTTYPE ] ; 	then mv o/HOSTTYPE o/${HOSTTYPE} ;	     [ -d ${WORK_SCCplus_DIR} ] || mkdir ${WORK_SCCplus_DIR} ;	else exit 0 ; fi

# To rebuild Basics.scm and Coercers.scm, you must have interm.scm
# which is a fragment of Basics.scm written by hand. They are built
# using Elk which is case-sensitive.
# Whenever exodus.scm is changed, you must rebuild Basics.scm and
# Coercers.scm must be rebuilt. Then remove these files and run this
# entry. Don't forget also to update genes*.scm that build classes by hand.

Basics.scm Coercers.scm : genes1.scm genes2.scm
Basics.scm Coercers.scm : meroon.elk interm.scm exodus.scm filer.scm
	@[ -f Basics.scm -a -f Coercers.scm ] || echo "	(begin (load \"meroon.elk\" (global-environment))	       (set! *meroon-features* 				         (cons (quote bootstrap) *meroon-features*) )	       \"Half a minute (or so) please...\" )		(begin (load \"meroon.scm\" (global-environment))	       \"Basics.scm and Coercers.scm rebuilt.\" )" 	| ${BOOT_SCM}

	@grep "nd of Basics.scm"   Basics.scm
	@grep "nd of Coercers.scm" Coercers.scm
	chmod a=r Basics.scm Coercers.scm

# For all files that belong to the runtime of Meroon, builds the
# appropriate Makefile entries to rebuild it and compile it.
# You need the imake command to use that macro. You also need perl to patch
# Scheme->C generated C files (to impose a correct initialization order).
# My usual machine has a small virtual memory so if I cannot compile with cc -O
# I retry without the -O option (this was necessary for genesis and schfrm).

# They are cited as they are loaded in meroon.scm. It is important that the
# same files appear here and in meroon.scm.

o/${HOSTTYPE}/SCC/macros.sch : macros.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"macros.scm\" \"o/${HOSTTYPE}/SCC/macros.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/macros.sch
o/${HOSTTYPE}/SCC/macros.sc : macros.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"macros.scm\" \"o/${HOSTTYPE}/SCC/macros.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/macros.sc
o/${HOSTTYPE}/BGL/macros.bgl : macros.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"macros.scm\" \"o/${HOSTTYPE}/BGL/macros.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/macros.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/macros.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/macros.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo macros.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/macros.o : o/${HOSTTYPE}/BGL/macros.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} macros.bgl
${BIGLOO_LIB_DIR}/macros.bgl : o/${HOSTTYPE}/BGL/macros.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/macros.bgl 			\
	> ${BIGLOO_LIB_DIR}/macros.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/macros.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/macros.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/macros.sch
${DEST_DIR}/SCC/do.all-o ::
	echo macros.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/macros.o : o/${HOSTTYPE}/SCC/macros.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c macros.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c macros.c
o/${HOSTTYPE}/SCC/macros.c : o/${HOSTTYPE}/SCC/macros.sch
o/${HOSTTYPE}/SCC/macros.c : o/${HOSTTYPE}/SCC/macros.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} macros.sc
	-rm o/${HOSTTYPE}/SCC/macros.org.c
	mv o/${HOSTTYPE}/SCC/macros.c o/${HOSTTYPE}/SCC/macros.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/macros
	rm o/${HOSTTYPE}/SCC/macros.org.c

o/${HOSTTYPE}/SCC/dsssl.sch : dsssl.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"dsssl.scm\" \"o/${HOSTTYPE}/SCC/dsssl.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/dsssl.sch
o/${HOSTTYPE}/SCC/dsssl.sc : dsssl.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"dsssl.scm\" \"o/${HOSTTYPE}/SCC/dsssl.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/dsssl.sc
o/${HOSTTYPE}/BGL/dsssl.bgl : dsssl.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"dsssl.scm\" \"o/${HOSTTYPE}/BGL/dsssl.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/dsssl.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/dsssl.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/dsssl.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo dsssl.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/dsssl.o : o/${HOSTTYPE}/BGL/dsssl.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} dsssl.bgl
${BIGLOO_LIB_DIR}/dsssl.bgl : o/${HOSTTYPE}/BGL/dsssl.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/dsssl.bgl 			\
	> ${BIGLOO_LIB_DIR}/dsssl.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/dsssl.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/dsssl.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/dsssl.sch
${DEST_DIR}/SCC/do.all-o ::
	echo dsssl.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/dsssl.o : o/${HOSTTYPE}/SCC/dsssl.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c dsssl.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c dsssl.c
o/${HOSTTYPE}/SCC/dsssl.c : o/${HOSTTYPE}/SCC/dsssl.sch
o/${HOSTTYPE}/SCC/dsssl.c : o/${HOSTTYPE}/SCC/dsssl.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} dsssl.sc
	-rm o/${HOSTTYPE}/SCC/dsssl.org.c
	mv o/${HOSTTYPE}/SCC/dsssl.c o/${HOSTTYPE}/SCC/dsssl.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/dsssl
	rm o/${HOSTTYPE}/SCC/dsssl.org.c

o/${HOSTTYPE}/SCC/nodsssl.sch : nodsssl.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"nodsssl.scm\" \"o/${HOSTTYPE}/SCC/nodsssl.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/nodsssl.sch
o/${HOSTTYPE}/SCC/nodsssl.sc : nodsssl.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"nodsssl.scm\" \"o/${HOSTTYPE}/SCC/nodsssl.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/nodsssl.sc
o/${HOSTTYPE}/BGL/nodsssl.bgl : nodsssl.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"nodsssl.scm\" \"o/${HOSTTYPE}/BGL/nodsssl.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/nodsssl.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/nodsssl.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/nodsssl.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo nodsssl.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/nodsssl.o : o/${HOSTTYPE}/BGL/nodsssl.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} nodsssl.bgl
${BIGLOO_LIB_DIR}/nodsssl.bgl : o/${HOSTTYPE}/BGL/nodsssl.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/nodsssl.bgl 			\
	> ${BIGLOO_LIB_DIR}/nodsssl.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/nodsssl.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/nodsssl.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/nodsssl.sch
${DEST_DIR}/SCC/do.all-o ::
	echo nodsssl.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/nodsssl.o : o/${HOSTTYPE}/SCC/nodsssl.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c nodsssl.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c nodsssl.c
o/${HOSTTYPE}/SCC/nodsssl.c : o/${HOSTTYPE}/SCC/nodsssl.sch
o/${HOSTTYPE}/SCC/nodsssl.c : o/${HOSTTYPE}/SCC/nodsssl.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} nodsssl.sc
	-rm o/${HOSTTYPE}/SCC/nodsssl.org.c
	mv o/${HOSTTYPE}/SCC/nodsssl.c o/${HOSTTYPE}/SCC/nodsssl.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/nodsssl
	rm o/${HOSTTYPE}/SCC/nodsssl.org.c

o/${HOSTTYPE}/SCC/macinst.sch : macinst.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"macinst.scm\" \"o/${HOSTTYPE}/SCC/macinst.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/macinst.sch
o/${HOSTTYPE}/SCC/macinst.sc : macinst.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"macinst.scm\" \"o/${HOSTTYPE}/SCC/macinst.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/macinst.sc
o/${HOSTTYPE}/BGL/macinst.bgl : macinst.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"macinst.scm\" \"o/${HOSTTYPE}/BGL/macinst.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/macinst.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/macinst.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/macinst.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo macinst.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/macinst.o : o/${HOSTTYPE}/BGL/macinst.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} macinst.bgl
${BIGLOO_LIB_DIR}/macinst.bgl : o/${HOSTTYPE}/BGL/macinst.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/macinst.bgl 			\
	> ${BIGLOO_LIB_DIR}/macinst.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/macinst.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/macinst.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/macinst.sch
${DEST_DIR}/SCC/do.all-o ::
	echo macinst.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/macinst.o : o/${HOSTTYPE}/SCC/macinst.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c macinst.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c macinst.c
o/${HOSTTYPE}/SCC/macinst.c : o/${HOSTTYPE}/SCC/macinst.sch
o/${HOSTTYPE}/SCC/macinst.c : o/${HOSTTYPE}/SCC/macinst.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} macinst.sc
	-rm o/${HOSTTYPE}/SCC/macinst.org.c
	mv o/${HOSTTYPE}/SCC/macinst.c o/${HOSTTYPE}/SCC/macinst.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/macinst
	rm o/${HOSTTYPE}/SCC/macinst.org.c

o/${HOSTTYPE}/SCC/careless.sch : careless.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"careless.scm\" \"o/${HOSTTYPE}/SCC/careless.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/careless.sch
o/${HOSTTYPE}/SCC/careless.sc : careless.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"careless.scm\" \"o/${HOSTTYPE}/SCC/careless.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/careless.sc
o/${HOSTTYPE}/BGL/careless.bgl : careless.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"careless.scm\" \"o/${HOSTTYPE}/BGL/careless.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/careless.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/careless.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/careless.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo careless.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/careless.o : o/${HOSTTYPE}/BGL/careless.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} careless.bgl
${BIGLOO_LIB_DIR}/careless.bgl : o/${HOSTTYPE}/BGL/careless.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/careless.bgl 			\
	> ${BIGLOO_LIB_DIR}/careless.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/careless.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/careless.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/careless.sch
${DEST_DIR}/SCC/do.all-o ::
	echo careless.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/careless.o : o/${HOSTTYPE}/SCC/careless.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c careless.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c careless.c
o/${HOSTTYPE}/SCC/careless.c : o/${HOSTTYPE}/SCC/careless.sch
o/${HOSTTYPE}/SCC/careless.c : o/${HOSTTYPE}/SCC/careless.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} careless.sc
	-rm o/${HOSTTYPE}/SCC/careless.org.c
	mv o/${HOSTTYPE}/SCC/careless.c o/${HOSTTYPE}/SCC/careless.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/careless
	rm o/${HOSTTYPE}/SCC/careless.org.c

o/${HOSTTYPE}/SCC/utils.sch : utils.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"utils.scm\" \"o/${HOSTTYPE}/SCC/utils.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/utils.sch
o/${HOSTTYPE}/SCC/utils.sc : utils.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"utils.scm\" \"o/${HOSTTYPE}/SCC/utils.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/utils.sc
o/${HOSTTYPE}/BGL/utils.bgl : utils.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"utils.scm\" \"o/${HOSTTYPE}/BGL/utils.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/utils.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/utils.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/utils.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo utils.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/utils.o : o/${HOSTTYPE}/BGL/utils.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} utils.bgl
${BIGLOO_LIB_DIR}/utils.bgl : o/${HOSTTYPE}/BGL/utils.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/utils.bgl 			\
	> ${BIGLOO_LIB_DIR}/utils.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/utils.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/utils.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/utils.sch
${DEST_DIR}/SCC/do.all-o ::
	echo utils.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/utils.o : o/${HOSTTYPE}/SCC/utils.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c utils.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c utils.c
o/${HOSTTYPE}/SCC/utils.c : o/${HOSTTYPE}/SCC/utils.sch
o/${HOSTTYPE}/SCC/utils.c : o/${HOSTTYPE}/SCC/utils.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} utils.sc
	-rm o/${HOSTTYPE}/SCC/utils.org.c
	mv o/${HOSTTYPE}/SCC/utils.c o/${HOSTTYPE}/SCC/utils.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/utils
	rm o/${HOSTTYPE}/SCC/utils.org.c

o/${HOSTTYPE}/SCC/instance.sch : instance.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"instance.scm\" \"o/${HOSTTYPE}/SCC/instance.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/instance.sch
o/${HOSTTYPE}/SCC/instance.sc : instance.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"instance.scm\" \"o/${HOSTTYPE}/SCC/instance.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/instance.sc
o/${HOSTTYPE}/BGL/instance.bgl : instance.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"instance.scm\" \"o/${HOSTTYPE}/BGL/instance.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/instance.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/instance.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/instance.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo instance.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/instance.o : o/${HOSTTYPE}/BGL/instance.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} instance.bgl
${BIGLOO_LIB_DIR}/instance.bgl : o/${HOSTTYPE}/BGL/instance.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/instance.bgl 			\
	> ${BIGLOO_LIB_DIR}/instance.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/instance.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/instance.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/instance.sch
${DEST_DIR}/SCC/do.all-o ::
	echo instance.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/instance.o : o/${HOSTTYPE}/SCC/instance.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c instance.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c instance.c
o/${HOSTTYPE}/SCC/instance.c : o/${HOSTTYPE}/SCC/instance.sch
o/${HOSTTYPE}/SCC/instance.c : o/${HOSTTYPE}/SCC/instance.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} instance.sc
	-rm o/${HOSTTYPE}/SCC/instance.org.c
	mv o/${HOSTTYPE}/SCC/instance.c o/${HOSTTYPE}/SCC/instance.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/instance
	rm o/${HOSTTYPE}/SCC/instance.org.c

o/${HOSTTYPE}/SCC/revision.sch : revision.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"revision.scm\" \"o/${HOSTTYPE}/SCC/revision.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/revision.sch
o/${HOSTTYPE}/SCC/revision.sc : revision.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"revision.scm\" \"o/${HOSTTYPE}/SCC/revision.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/revision.sc
o/${HOSTTYPE}/BGL/revision.bgl : revision.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"revision.scm\" \"o/${HOSTTYPE}/BGL/revision.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/revision.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/revision.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/revision.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo revision.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/revision.o : o/${HOSTTYPE}/BGL/revision.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} revision.bgl
${BIGLOO_LIB_DIR}/revision.bgl : o/${HOSTTYPE}/BGL/revision.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/revision.bgl 			\
	> ${BIGLOO_LIB_DIR}/revision.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/revision.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/revision.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/revision.sch
${DEST_DIR}/SCC/do.all-o ::
	echo revision.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/revision.o : o/${HOSTTYPE}/SCC/revision.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c revision.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c revision.c
o/${HOSTTYPE}/SCC/revision.c : o/${HOSTTYPE}/SCC/revision.sch
o/${HOSTTYPE}/SCC/revision.c : o/${HOSTTYPE}/SCC/revision.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} revision.sc
	-rm o/${HOSTTYPE}/SCC/revision.org.c
	mv o/${HOSTTYPE}/SCC/revision.c o/${HOSTTYPE}/SCC/revision.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/revision
	rm o/${HOSTTYPE}/SCC/revision.org.c

o/${HOSTTYPE}/SCC/walker.sch : walker.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"walker.scm\" \"o/${HOSTTYPE}/SCC/walker.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/walker.sch
o/${HOSTTYPE}/SCC/walker.sc : walker.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"walker.scm\" \"o/${HOSTTYPE}/SCC/walker.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/walker.sc
o/${HOSTTYPE}/BGL/walker.bgl : walker.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"walker.scm\" \"o/${HOSTTYPE}/BGL/walker.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/walker.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/walker.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/walker.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo walker.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/walker.o : o/${HOSTTYPE}/BGL/walker.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} walker.bgl
${BIGLOO_LIB_DIR}/walker.bgl : o/${HOSTTYPE}/BGL/walker.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/walker.bgl 			\
	> ${BIGLOO_LIB_DIR}/walker.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/walker.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/walker.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/walker.sch
${DEST_DIR}/SCC/do.all-o ::
	echo walker.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/walker.o : o/${HOSTTYPE}/SCC/walker.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c walker.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c walker.c
o/${HOSTTYPE}/SCC/walker.c : o/${HOSTTYPE}/SCC/walker.sch
o/${HOSTTYPE}/SCC/walker.c : o/${HOSTTYPE}/SCC/walker.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} walker.sc
	-rm o/${HOSTTYPE}/SCC/walker.org.c
	mv o/${HOSTTYPE}/SCC/walker.c o/${HOSTTYPE}/SCC/walker.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/walker
	rm o/${HOSTTYPE}/SCC/walker.org.c

o/${HOSTTYPE}/SCC/runtime.sch : runtime.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"runtime.scm\" \"o/${HOSTTYPE}/SCC/runtime.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/runtime.sch
o/${HOSTTYPE}/SCC/runtime.sc : runtime.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"runtime.scm\" \"o/${HOSTTYPE}/SCC/runtime.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/runtime.sc
o/${HOSTTYPE}/BGL/runtime.bgl : runtime.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"runtime.scm\" \"o/${HOSTTYPE}/BGL/runtime.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/runtime.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/runtime.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/runtime.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo runtime.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/runtime.o : o/${HOSTTYPE}/BGL/runtime.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} runtime.bgl
${BIGLOO_LIB_DIR}/runtime.bgl : o/${HOSTTYPE}/BGL/runtime.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/runtime.bgl 			\
	> ${BIGLOO_LIB_DIR}/runtime.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/runtime.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/runtime.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/runtime.sch
${DEST_DIR}/SCC/do.all-o ::
	echo runtime.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/runtime.o : o/${HOSTTYPE}/SCC/runtime.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c runtime.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c runtime.c
o/${HOSTTYPE}/SCC/runtime.c : o/${HOSTTYPE}/SCC/runtime.sch
o/${HOSTTYPE}/SCC/runtime.c : o/${HOSTTYPE}/SCC/runtime.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} runtime.sc
	-rm o/${HOSTTYPE}/SCC/runtime.org.c
	mv o/${HOSTTYPE}/SCC/runtime.c o/${HOSTTYPE}/SCC/runtime.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/runtime
	rm o/${HOSTTYPE}/SCC/runtime.org.c

o/${HOSTTYPE}/SCC/option.sch : option.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"option.scm\" \"o/${HOSTTYPE}/SCC/option.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/option.sch
o/${HOSTTYPE}/SCC/option.sc : option.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"option.scm\" \"o/${HOSTTYPE}/SCC/option.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/option.sc
o/${HOSTTYPE}/BGL/option.bgl : option.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"option.scm\" \"o/${HOSTTYPE}/BGL/option.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/option.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/option.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/option.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo option.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/option.o : o/${HOSTTYPE}/BGL/option.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} option.bgl
${BIGLOO_LIB_DIR}/option.bgl : o/${HOSTTYPE}/BGL/option.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/option.bgl 			\
	> ${BIGLOO_LIB_DIR}/option.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/option.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/option.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/option.sch
${DEST_DIR}/SCC/do.all-o ::
	echo option.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/option.o : o/${HOSTTYPE}/SCC/option.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c option.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c option.c
o/${HOSTTYPE}/SCC/option.c : o/${HOSTTYPE}/SCC/option.sch
o/${HOSTTYPE}/SCC/option.c : o/${HOSTTYPE}/SCC/option.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} option.sc
	-rm o/${HOSTTYPE}/SCC/option.org.c
	mv o/${HOSTTYPE}/SCC/option.c o/${HOSTTYPE}/SCC/option.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/option
	rm o/${HOSTTYPE}/SCC/option.org.c

o/${HOSTTYPE}/SCC/access.sch : access.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"access.scm\" \"o/${HOSTTYPE}/SCC/access.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/access.sch
o/${HOSTTYPE}/SCC/access.sc : access.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"access.scm\" \"o/${HOSTTYPE}/SCC/access.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/access.sc
o/${HOSTTYPE}/BGL/access.bgl : access.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"access.scm\" \"o/${HOSTTYPE}/BGL/access.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/access.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/access.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/access.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo access.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/access.o : o/${HOSTTYPE}/BGL/access.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} access.bgl
${BIGLOO_LIB_DIR}/access.bgl : o/${HOSTTYPE}/BGL/access.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/access.bgl 			\
	> ${BIGLOO_LIB_DIR}/access.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/access.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/access.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/access.sch
${DEST_DIR}/SCC/do.all-o ::
	echo access.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/access.o : o/${HOSTTYPE}/SCC/access.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c access.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c access.c
o/${HOSTTYPE}/SCC/access.c : o/${HOSTTYPE}/SCC/access.sch
o/${HOSTTYPE}/SCC/access.c : o/${HOSTTYPE}/SCC/access.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} access.sc
	-rm o/${HOSTTYPE}/SCC/access.org.c
	mv o/${HOSTTYPE}/SCC/access.c o/${HOSTTYPE}/SCC/access.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/access
	rm o/${HOSTTYPE}/SCC/access.org.c

o/${HOSTTYPE}/SCC/dispatch.sch : dispatch.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"dispatch.scm\" \"o/${HOSTTYPE}/SCC/dispatch.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/dispatch.sch
o/${HOSTTYPE}/SCC/dispatch.sc : dispatch.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"dispatch.scm\" \"o/${HOSTTYPE}/SCC/dispatch.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/dispatch.sc
o/${HOSTTYPE}/BGL/dispatch.bgl : dispatch.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"dispatch.scm\" \"o/${HOSTTYPE}/BGL/dispatch.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/dispatch.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/dispatch.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/dispatch.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo dispatch.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/dispatch.o : o/${HOSTTYPE}/BGL/dispatch.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} dispatch.bgl
${BIGLOO_LIB_DIR}/dispatch.bgl : o/${HOSTTYPE}/BGL/dispatch.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/dispatch.bgl 			\
	> ${BIGLOO_LIB_DIR}/dispatch.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/dispatch.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/dispatch.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/dispatch.sch
${DEST_DIR}/SCC/do.all-o ::
	echo dispatch.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/dispatch.o : o/${HOSTTYPE}/SCC/dispatch.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c dispatch.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c dispatch.c
o/${HOSTTYPE}/SCC/dispatch.c : o/${HOSTTYPE}/SCC/dispatch.sch
o/${HOSTTYPE}/SCC/dispatch.c : o/${HOSTTYPE}/SCC/dispatch.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} dispatch.sc
	-rm o/${HOSTTYPE}/SCC/dispatch.org.c
	mv o/${HOSTTYPE}/SCC/dispatch.c o/${HOSTTYPE}/SCC/dispatch.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/dispatch
	rm o/${HOSTTYPE}/SCC/dispatch.org.c

o/${HOSTTYPE}/SCC/handy.sch : handy.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"handy.scm\" \"o/${HOSTTYPE}/SCC/handy.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/handy.sch
o/${HOSTTYPE}/SCC/handy.sc : handy.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"handy.scm\" \"o/${HOSTTYPE}/SCC/handy.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/handy.sc
o/${HOSTTYPE}/BGL/handy.bgl : handy.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"handy.scm\" \"o/${HOSTTYPE}/BGL/handy.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/handy.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/handy.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/handy.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo handy.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/handy.o : o/${HOSTTYPE}/BGL/handy.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} handy.bgl
${BIGLOO_LIB_DIR}/handy.bgl : o/${HOSTTYPE}/BGL/handy.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/handy.bgl 			\
	> ${BIGLOO_LIB_DIR}/handy.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/handy.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/handy.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/handy.sch
${DEST_DIR}/SCC/do.all-o ::
	echo handy.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/handy.o : o/${HOSTTYPE}/SCC/handy.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c handy.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c handy.c
o/${HOSTTYPE}/SCC/handy.c : o/${HOSTTYPE}/SCC/handy.sch
o/${HOSTTYPE}/SCC/handy.c : o/${HOSTTYPE}/SCC/handy.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} handy.sc
	-rm o/${HOSTTYPE}/SCC/handy.org.c
	mv o/${HOSTTYPE}/SCC/handy.c o/${HOSTTYPE}/SCC/handy.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/handy
	rm o/${HOSTTYPE}/SCC/handy.org.c

o/${HOSTTYPE}/SCC/definers.sch : definers.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"definers.scm\" \"o/${HOSTTYPE}/SCC/definers.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/definers.sch
o/${HOSTTYPE}/SCC/definers.sc : definers.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"definers.scm\" \"o/${HOSTTYPE}/SCC/definers.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/definers.sc
o/${HOSTTYPE}/BGL/definers.bgl : definers.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"definers.scm\" \"o/${HOSTTYPE}/BGL/definers.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/definers.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/definers.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/definers.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo definers.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/definers.o : o/${HOSTTYPE}/BGL/definers.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} definers.bgl
${BIGLOO_LIB_DIR}/definers.bgl : o/${HOSTTYPE}/BGL/definers.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/definers.bgl 			\
	> ${BIGLOO_LIB_DIR}/definers.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/definers.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/definers.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/definers.sch
${DEST_DIR}/SCC/do.all-o ::
	echo definers.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/definers.o : o/${HOSTTYPE}/SCC/definers.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c definers.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c definers.c
o/${HOSTTYPE}/SCC/definers.c : o/${HOSTTYPE}/SCC/definers.sch
o/${HOSTTYPE}/SCC/definers.c : o/${HOSTTYPE}/SCC/definers.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} definers.sc
	-rm o/${HOSTTYPE}/SCC/definers.org.c
	mv o/${HOSTTYPE}/SCC/definers.c o/${HOSTTYPE}/SCC/definers.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/definers
	rm o/${HOSTTYPE}/SCC/definers.org.c

o/${HOSTTYPE}/SCC/alloc.sch : alloc.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"alloc.scm\" \"o/${HOSTTYPE}/SCC/alloc.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/alloc.sch
o/${HOSTTYPE}/SCC/alloc.sc : alloc.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"alloc.scm\" \"o/${HOSTTYPE}/SCC/alloc.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/alloc.sc
o/${HOSTTYPE}/BGL/alloc.bgl : alloc.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"alloc.scm\" \"o/${HOSTTYPE}/BGL/alloc.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/alloc.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/alloc.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/alloc.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo alloc.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/alloc.o : o/${HOSTTYPE}/BGL/alloc.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} alloc.bgl
${BIGLOO_LIB_DIR}/alloc.bgl : o/${HOSTTYPE}/BGL/alloc.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/alloc.bgl 			\
	> ${BIGLOO_LIB_DIR}/alloc.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/alloc.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/alloc.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/alloc.sch
${DEST_DIR}/SCC/do.all-o ::
	echo alloc.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/alloc.o : o/${HOSTTYPE}/SCC/alloc.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c alloc.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c alloc.c
o/${HOSTTYPE}/SCC/alloc.c : o/${HOSTTYPE}/SCC/alloc.sch
o/${HOSTTYPE}/SCC/alloc.c : o/${HOSTTYPE}/SCC/alloc.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} alloc.sc
	-rm o/${HOSTTYPE}/SCC/alloc.org.c
	mv o/${HOSTTYPE}/SCC/alloc.c o/${HOSTTYPE}/SCC/alloc.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/alloc
	rm o/${HOSTTYPE}/SCC/alloc.org.c

o/${HOSTTYPE}/SCC/genes1.sch : genes1.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"genes1.scm\" \"o/${HOSTTYPE}/SCC/genes1.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/genes1.sch
o/${HOSTTYPE}/SCC/genes1.sc : genes1.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"genes1.scm\" \"o/${HOSTTYPE}/SCC/genes1.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/genes1.sc
o/${HOSTTYPE}/BGL/genes1.bgl : genes1.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"genes1.scm\" \"o/${HOSTTYPE}/BGL/genes1.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/genes1.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/genes1.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/genes1.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo genes1.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/genes1.o : o/${HOSTTYPE}/BGL/genes1.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} genes1.bgl
${BIGLOO_LIB_DIR}/genes1.bgl : o/${HOSTTYPE}/BGL/genes1.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/genes1.bgl 			\
	> ${BIGLOO_LIB_DIR}/genes1.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/genes1.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/genes1.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/genes1.sch
${DEST_DIR}/SCC/do.all-o ::
	echo genes1.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/genes1.o : o/${HOSTTYPE}/SCC/genes1.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c genes1.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c genes1.c
o/${HOSTTYPE}/SCC/genes1.c : o/${HOSTTYPE}/SCC/genes1.sch
o/${HOSTTYPE}/SCC/genes1.c : o/${HOSTTYPE}/SCC/genes1.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} genes1.sc
	-rm o/${HOSTTYPE}/SCC/genes1.org.c
	mv o/${HOSTTYPE}/SCC/genes1.c o/${HOSTTYPE}/SCC/genes1.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/genes1
	rm o/${HOSTTYPE}/SCC/genes1.org.c

o/${HOSTTYPE}/SCC/genes2.sch : genes2.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"genes2.scm\" \"o/${HOSTTYPE}/SCC/genes2.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/genes2.sch
o/${HOSTTYPE}/SCC/genes2.sc : genes2.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"genes2.scm\" \"o/${HOSTTYPE}/SCC/genes2.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/genes2.sc
o/${HOSTTYPE}/BGL/genes2.bgl : genes2.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"genes2.scm\" \"o/${HOSTTYPE}/BGL/genes2.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/genes2.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/genes2.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/genes2.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo genes2.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/genes2.o : o/${HOSTTYPE}/BGL/genes2.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} genes2.bgl
${BIGLOO_LIB_DIR}/genes2.bgl : o/${HOSTTYPE}/BGL/genes2.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/genes2.bgl 			\
	> ${BIGLOO_LIB_DIR}/genes2.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/genes2.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/genes2.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/genes2.sch
${DEST_DIR}/SCC/do.all-o ::
	echo genes2.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/genes2.o : o/${HOSTTYPE}/SCC/genes2.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c genes2.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c genes2.c
o/${HOSTTYPE}/SCC/genes2.c : o/${HOSTTYPE}/SCC/genes2.sch
o/${HOSTTYPE}/SCC/genes2.c : o/${HOSTTYPE}/SCC/genes2.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} genes2.sc
	-rm o/${HOSTTYPE}/SCC/genes2.org.c
	mv o/${HOSTTYPE}/SCC/genes2.c o/${HOSTTYPE}/SCC/genes2.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/genes2
	rm o/${HOSTTYPE}/SCC/genes2.org.c
# do not Expand Source(interm)

o/${HOSTTYPE}/SCC/Basics.sch : Basics.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"Basics.scm\" \"o/${HOSTTYPE}/SCC/Basics.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/Basics.sch
o/${HOSTTYPE}/SCC/Basics.sc : Basics.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"Basics.scm\" \"o/${HOSTTYPE}/SCC/Basics.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/Basics.sc
o/${HOSTTYPE}/BGL/Basics.bgl : Basics.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"Basics.scm\" \"o/${HOSTTYPE}/BGL/Basics.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/Basics.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/Basics.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/Basics.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo Basics.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/Basics.o : o/${HOSTTYPE}/BGL/Basics.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} Basics.bgl
${BIGLOO_LIB_DIR}/Basics.bgl : o/${HOSTTYPE}/BGL/Basics.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/Basics.bgl 			\
	> ${BIGLOO_LIB_DIR}/Basics.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/Basics.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/Basics.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/Basics.sch
${DEST_DIR}/SCC/do.all-o ::
	echo Basics.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/Basics.o : o/${HOSTTYPE}/SCC/Basics.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c Basics.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c Basics.c
o/${HOSTTYPE}/SCC/Basics.c : o/${HOSTTYPE}/SCC/Basics.sch
o/${HOSTTYPE}/SCC/Basics.c : o/${HOSTTYPE}/SCC/Basics.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} Basics.sc
	-rm o/${HOSTTYPE}/SCC/Basics.org.c
	mv o/${HOSTTYPE}/SCC/Basics.c o/${HOSTTYPE}/SCC/Basics.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/Basics
	rm o/${HOSTTYPE}/SCC/Basics.org.c

o/${HOSTTYPE}/SCC/fill.sch : fill.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"fill.scm\" \"o/${HOSTTYPE}/SCC/fill.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/fill.sch
o/${HOSTTYPE}/SCC/fill.sc : fill.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"fill.scm\" \"o/${HOSTTYPE}/SCC/fill.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/fill.sc
o/${HOSTTYPE}/BGL/fill.bgl : fill.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"fill.scm\" \"o/${HOSTTYPE}/BGL/fill.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/fill.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/fill.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/fill.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo fill.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/fill.o : o/${HOSTTYPE}/BGL/fill.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} fill.bgl
${BIGLOO_LIB_DIR}/fill.bgl : o/${HOSTTYPE}/BGL/fill.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/fill.bgl 			\
	> ${BIGLOO_LIB_DIR}/fill.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/fill.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/fill.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/fill.sch
${DEST_DIR}/SCC/do.all-o ::
	echo fill.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/fill.o : o/${HOSTTYPE}/SCC/fill.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c fill.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c fill.c
o/${HOSTTYPE}/SCC/fill.c : o/${HOSTTYPE}/SCC/fill.sch
o/${HOSTTYPE}/SCC/fill.c : o/${HOSTTYPE}/SCC/fill.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} fill.sc
	-rm o/${HOSTTYPE}/SCC/fill.org.c
	mv o/${HOSTTYPE}/SCC/fill.c o/${HOSTTYPE}/SCC/fill.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/fill
	rm o/${HOSTTYPE}/SCC/fill.org.c

o/${HOSTTYPE}/SCC/coinst.sch : coinst.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"coinst.scm\" \"o/${HOSTTYPE}/SCC/coinst.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/coinst.sch
o/${HOSTTYPE}/SCC/coinst.sc : coinst.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"coinst.scm\" \"o/${HOSTTYPE}/SCC/coinst.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/coinst.sc
o/${HOSTTYPE}/BGL/coinst.bgl : coinst.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"coinst.scm\" \"o/${HOSTTYPE}/BGL/coinst.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/coinst.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/coinst.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/coinst.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo coinst.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/coinst.o : o/${HOSTTYPE}/BGL/coinst.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} coinst.bgl
${BIGLOO_LIB_DIR}/coinst.bgl : o/${HOSTTYPE}/BGL/coinst.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/coinst.bgl 			\
	> ${BIGLOO_LIB_DIR}/coinst.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/coinst.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/coinst.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/coinst.sch
${DEST_DIR}/SCC/do.all-o ::
	echo coinst.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/coinst.o : o/${HOSTTYPE}/SCC/coinst.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c coinst.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c coinst.c
o/${HOSTTYPE}/SCC/coinst.c : o/${HOSTTYPE}/SCC/coinst.sch
o/${HOSTTYPE}/SCC/coinst.c : o/${HOSTTYPE}/SCC/coinst.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} coinst.sc
	-rm o/${HOSTTYPE}/SCC/coinst.org.c
	mv o/${HOSTTYPE}/SCC/coinst.c o/${HOSTTYPE}/SCC/coinst.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/coinst
	rm o/${HOSTTYPE}/SCC/coinst.org.c

o/${HOSTTYPE}/SCC/maker.sch : maker.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"maker.scm\" \"o/${HOSTTYPE}/SCC/maker.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/maker.sch
o/${HOSTTYPE}/SCC/maker.sc : maker.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"maker.scm\" \"o/${HOSTTYPE}/SCC/maker.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/maker.sc
o/${HOSTTYPE}/BGL/maker.bgl : maker.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"maker.scm\" \"o/${HOSTTYPE}/BGL/maker.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/maker.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/maker.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/maker.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo maker.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/maker.o : o/${HOSTTYPE}/BGL/maker.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} maker.bgl
${BIGLOO_LIB_DIR}/maker.bgl : o/${HOSTTYPE}/BGL/maker.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/maker.bgl 			\
	> ${BIGLOO_LIB_DIR}/maker.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/maker.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/maker.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/maker.sch
${DEST_DIR}/SCC/do.all-o ::
	echo maker.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/maker.o : o/${HOSTTYPE}/SCC/maker.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c maker.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c maker.c
o/${HOSTTYPE}/SCC/maker.c : o/${HOSTTYPE}/SCC/maker.sch
o/${HOSTTYPE}/SCC/maker.c : o/${HOSTTYPE}/SCC/maker.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} maker.sc
	-rm o/${HOSTTYPE}/SCC/maker.org.c
	mv o/${HOSTTYPE}/SCC/maker.c o/${HOSTTYPE}/SCC/maker.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/maker
	rm o/${HOSTTYPE}/SCC/maker.org.c
# do not Expand Source(exodus)
# do not Expand Source(filer)

o/${HOSTTYPE}/SCC/view.sch : view.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"view.scm\" \"o/${HOSTTYPE}/SCC/view.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/view.sch
o/${HOSTTYPE}/SCC/view.sc : view.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"view.scm\" \"o/${HOSTTYPE}/SCC/view.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/view.sc
o/${HOSTTYPE}/BGL/view.bgl : view.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"view.scm\" \"o/${HOSTTYPE}/BGL/view.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/view.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/view.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/view.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo view.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/view.o : o/${HOSTTYPE}/BGL/view.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} view.bgl
${BIGLOO_LIB_DIR}/view.bgl : o/${HOSTTYPE}/BGL/view.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/view.bgl 			\
	> ${BIGLOO_LIB_DIR}/view.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/view.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/view.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/view.sch
${DEST_DIR}/SCC/do.all-o ::
	echo view.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/view.o : o/${HOSTTYPE}/SCC/view.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c view.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c view.c
o/${HOSTTYPE}/SCC/view.c : o/${HOSTTYPE}/SCC/view.sch
o/${HOSTTYPE}/SCC/view.c : o/${HOSTTYPE}/SCC/view.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} view.sc
	-rm o/${HOSTTYPE}/SCC/view.org.c
	mv o/${HOSTTYPE}/SCC/view.c o/${HOSTTYPE}/SCC/view.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/view
	rm o/${HOSTTYPE}/SCC/view.org.c

o/${HOSTTYPE}/SCC/libgen.sch : libgen.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"libgen.scm\" \"o/${HOSTTYPE}/SCC/libgen.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/libgen.sch
o/${HOSTTYPE}/SCC/libgen.sc : libgen.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"libgen.scm\" \"o/${HOSTTYPE}/SCC/libgen.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/libgen.sc
o/${HOSTTYPE}/BGL/libgen.bgl : libgen.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"libgen.scm\" \"o/${HOSTTYPE}/BGL/libgen.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/libgen.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/libgen.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/libgen.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo libgen.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/libgen.o : o/${HOSTTYPE}/BGL/libgen.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} libgen.bgl
${BIGLOO_LIB_DIR}/libgen.bgl : o/${HOSTTYPE}/BGL/libgen.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/libgen.bgl 			\
	> ${BIGLOO_LIB_DIR}/libgen.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/libgen.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/libgen.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/libgen.sch
${DEST_DIR}/SCC/do.all-o ::
	echo libgen.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/libgen.o : o/${HOSTTYPE}/SCC/libgen.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c libgen.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c libgen.c
o/${HOSTTYPE}/SCC/libgen.c : o/${HOSTTYPE}/SCC/libgen.sch
o/${HOSTTYPE}/SCC/libgen.c : o/${HOSTTYPE}/SCC/libgen.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} libgen.sc
	-rm o/${HOSTTYPE}/SCC/libgen.org.c
	mv o/${HOSTTYPE}/SCC/libgen.c o/${HOSTTYPE}/SCC/libgen.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/libgen
	rm o/${HOSTTYPE}/SCC/libgen.org.c

o/${HOSTTYPE}/SCC/Coercers.sch : Coercers.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"Coercers.scm\" \"o/${HOSTTYPE}/SCC/Coercers.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/Coercers.sch
o/${HOSTTYPE}/SCC/Coercers.sc : Coercers.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"Coercers.scm\" \"o/${HOSTTYPE}/SCC/Coercers.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/Coercers.sc
o/${HOSTTYPE}/BGL/Coercers.bgl : Coercers.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"Coercers.scm\" \"o/${HOSTTYPE}/BGL/Coercers.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/Coercers.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/Coercers.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/Coercers.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo Coercers.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/Coercers.o : o/${HOSTTYPE}/BGL/Coercers.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} Coercers.bgl
${BIGLOO_LIB_DIR}/Coercers.bgl : o/${HOSTTYPE}/BGL/Coercers.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/Coercers.bgl 			\
	> ${BIGLOO_LIB_DIR}/Coercers.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/Coercers.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/Coercers.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/Coercers.sch
${DEST_DIR}/SCC/do.all-o ::
	echo Coercers.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/Coercers.o : o/${HOSTTYPE}/SCC/Coercers.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c Coercers.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c Coercers.c
o/${HOSTTYPE}/SCC/Coercers.c : o/${HOSTTYPE}/SCC/Coercers.sch
o/${HOSTTYPE}/SCC/Coercers.c : o/${HOSTTYPE}/SCC/Coercers.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} Coercers.sc
	-rm o/${HOSTTYPE}/SCC/Coercers.org.c
	mv o/${HOSTTYPE}/SCC/Coercers.c o/${HOSTTYPE}/SCC/Coercers.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/Coercers
	rm o/${HOSTTYPE}/SCC/Coercers.org.c

o/${HOSTTYPE}/SCC/anomaly.sch : anomaly.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"anomaly.scm\" \"o/${HOSTTYPE}/SCC/anomaly.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/anomaly.sch
o/${HOSTTYPE}/SCC/anomaly.sc : anomaly.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"anomaly.scm\" \"o/${HOSTTYPE}/SCC/anomaly.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/anomaly.sc
o/${HOSTTYPE}/BGL/anomaly.bgl : anomaly.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"anomaly.scm\" \"o/${HOSTTYPE}/BGL/anomaly.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/anomaly.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/anomaly.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/anomaly.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo anomaly.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/anomaly.o : o/${HOSTTYPE}/BGL/anomaly.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} anomaly.bgl
${BIGLOO_LIB_DIR}/anomaly.bgl : o/${HOSTTYPE}/BGL/anomaly.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/anomaly.bgl 			\
	> ${BIGLOO_LIB_DIR}/anomaly.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/anomaly.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/anomaly.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/anomaly.sch
${DEST_DIR}/SCC/do.all-o ::
	echo anomaly.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/anomaly.o : o/${HOSTTYPE}/SCC/anomaly.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c anomaly.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c anomaly.c
o/${HOSTTYPE}/SCC/anomaly.c : o/${HOSTTYPE}/SCC/anomaly.sch
o/${HOSTTYPE}/SCC/anomaly.c : o/${HOSTTYPE}/SCC/anomaly.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} anomaly.sc
	-rm o/${HOSTTYPE}/SCC/anomaly.org.c
	mv o/${HOSTTYPE}/SCC/anomaly.c o/${HOSTTYPE}/SCC/anomaly.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/anomaly
	rm o/${HOSTTYPE}/SCC/anomaly.org.c

o/${HOSTTYPE}/SCC/multi.sch : multi.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"multi.scm\" \"o/${HOSTTYPE}/SCC/multi.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/multi.sch
o/${HOSTTYPE}/SCC/multi.sc : multi.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"multi.scm\" \"o/${HOSTTYPE}/SCC/multi.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/multi.sc
o/${HOSTTYPE}/BGL/multi.bgl : multi.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"multi.scm\" \"o/${HOSTTYPE}/BGL/multi.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/multi.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/multi.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/multi.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo multi.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/multi.o : o/${HOSTTYPE}/BGL/multi.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} multi.bgl
${BIGLOO_LIB_DIR}/multi.bgl : o/${HOSTTYPE}/BGL/multi.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/multi.bgl 			\
	> ${BIGLOO_LIB_DIR}/multi.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/multi.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/multi.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/multi.sch
${DEST_DIR}/SCC/do.all-o ::
	echo multi.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/multi.o : o/${HOSTTYPE}/SCC/multi.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c multi.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c multi.c
o/${HOSTTYPE}/SCC/multi.c : o/${HOSTTYPE}/SCC/multi.sch
o/${HOSTTYPE}/SCC/multi.c : o/${HOSTTYPE}/SCC/multi.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} multi.sc
	-rm o/${HOSTTYPE}/SCC/multi.org.c
	mv o/${HOSTTYPE}/SCC/multi.c o/${HOSTTYPE}/SCC/multi.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/multi
	rm o/${HOSTTYPE}/SCC/multi.org.c

o/${HOSTTYPE}/SCC/show.sch : show.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"show.scm\" \"o/${HOSTTYPE}/SCC/show.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/show.sch
o/${HOSTTYPE}/SCC/show.sc : show.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"show.scm\" \"o/${HOSTTYPE}/SCC/show.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/show.sc
o/${HOSTTYPE}/BGL/show.bgl : show.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"show.scm\" \"o/${HOSTTYPE}/BGL/show.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/show.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/show.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/show.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo show.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/show.o : o/${HOSTTYPE}/BGL/show.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} show.bgl
${BIGLOO_LIB_DIR}/show.bgl : o/${HOSTTYPE}/BGL/show.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/show.bgl 			\
	> ${BIGLOO_LIB_DIR}/show.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/show.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/show.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/show.sch
${DEST_DIR}/SCC/do.all-o ::
	echo show.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/show.o : o/${HOSTTYPE}/SCC/show.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c show.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c show.c
o/${HOSTTYPE}/SCC/show.c : o/${HOSTTYPE}/SCC/show.sch
o/${HOSTTYPE}/SCC/show.c : o/${HOSTTYPE}/SCC/show.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} show.sc
	-rm o/${HOSTTYPE}/SCC/show.org.c
	mv o/${HOSTTYPE}/SCC/show.c o/${HOSTTYPE}/SCC/show.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/show
	rm o/${HOSTTYPE}/SCC/show.org.c

o/${HOSTTYPE}/SCC/trace.sch : trace.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"trace.scm\" \"o/${HOSTTYPE}/SCC/trace.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/trace.sch
o/${HOSTTYPE}/SCC/trace.sc : trace.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"trace.scm\" \"o/${HOSTTYPE}/SCC/trace.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/trace.sc
o/${HOSTTYPE}/BGL/trace.bgl : trace.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"trace.scm\" \"o/${HOSTTYPE}/BGL/trace.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/trace.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/trace.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/trace.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo trace.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/trace.o : o/${HOSTTYPE}/BGL/trace.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} trace.bgl
${BIGLOO_LIB_DIR}/trace.bgl : o/${HOSTTYPE}/BGL/trace.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/trace.bgl 			\
	> ${BIGLOO_LIB_DIR}/trace.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/trace.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/trace.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/trace.sch
${DEST_DIR}/SCC/do.all-o ::
	echo trace.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/trace.o : o/${HOSTTYPE}/SCC/trace.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c trace.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c trace.c
o/${HOSTTYPE}/SCC/trace.c : o/${HOSTTYPE}/SCC/trace.sch
o/${HOSTTYPE}/SCC/trace.c : o/${HOSTTYPE}/SCC/trace.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} trace.sc
	-rm o/${HOSTTYPE}/SCC/trace.org.c
	mv o/${HOSTTYPE}/SCC/trace.c o/${HOSTTYPE}/SCC/trace.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/trace
	rm o/${HOSTTYPE}/SCC/trace.org.c

o/${HOSTTYPE}/SCC/size.sch : size.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"size.scm\" \"o/${HOSTTYPE}/SCC/size.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/size.sch
o/${HOSTTYPE}/SCC/size.sc : size.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"size.scm\" \"o/${HOSTTYPE}/SCC/size.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/size.sc
o/${HOSTTYPE}/BGL/size.bgl : size.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"size.scm\" \"o/${HOSTTYPE}/BGL/size.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/size.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/size.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/size.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo size.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/size.o : o/${HOSTTYPE}/BGL/size.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} size.bgl
${BIGLOO_LIB_DIR}/size.bgl : o/${HOSTTYPE}/BGL/size.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/size.bgl 			\
	> ${BIGLOO_LIB_DIR}/size.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/size.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/size.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/size.sch
${DEST_DIR}/SCC/do.all-o ::
	echo size.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/size.o : o/${HOSTTYPE}/SCC/size.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c size.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c size.c
o/${HOSTTYPE}/SCC/size.c : o/${HOSTTYPE}/SCC/size.sch
o/${HOSTTYPE}/SCC/size.c : o/${HOSTTYPE}/SCC/size.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} size.sc
	-rm o/${HOSTTYPE}/SCC/size.org.c
	mv o/${HOSTTYPE}/SCC/size.c o/${HOSTTYPE}/SCC/size.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/size
	rm o/${HOSTTYPE}/SCC/size.org.c

o/${HOSTTYPE}/SCC/unveil.sch : unveil.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"unveil.scm\" \"o/${HOSTTYPE}/SCC/unveil.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/unveil.sch
o/${HOSTTYPE}/SCC/unveil.sc : unveil.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"unveil.scm\" \"o/${HOSTTYPE}/SCC/unveil.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/unveil.sc
o/${HOSTTYPE}/BGL/unveil.bgl : unveil.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"unveil.scm\" \"o/${HOSTTYPE}/BGL/unveil.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/unveil.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/unveil.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/unveil.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo unveil.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/unveil.o : o/${HOSTTYPE}/BGL/unveil.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} unveil.bgl
${BIGLOO_LIB_DIR}/unveil.bgl : o/${HOSTTYPE}/BGL/unveil.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/unveil.bgl 			\
	> ${BIGLOO_LIB_DIR}/unveil.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/unveil.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/unveil.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/unveil.sch
${DEST_DIR}/SCC/do.all-o ::
	echo unveil.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/unveil.o : o/${HOSTTYPE}/SCC/unveil.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c unveil.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c unveil.c
o/${HOSTTYPE}/SCC/unveil.c : o/${HOSTTYPE}/SCC/unveil.sch
o/${HOSTTYPE}/SCC/unveil.c : o/${HOSTTYPE}/SCC/unveil.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} unveil.sc
	-rm o/${HOSTTYPE}/SCC/unveil.org.c
	mv o/${HOSTTYPE}/SCC/unveil.c o/${HOSTTYPE}/SCC/unveil.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/unveil
	rm o/${HOSTTYPE}/SCC/unveil.org.c

o/${HOSTTYPE}/SCC/egal.sch : egal.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"egal.scm\" \"o/${HOSTTYPE}/SCC/egal.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/egal.sch
o/${HOSTTYPE}/SCC/egal.sc : egal.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"egal.scm\" \"o/${HOSTTYPE}/SCC/egal.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/egal.sc
o/${HOSTTYPE}/BGL/egal.bgl : egal.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"egal.scm\" \"o/${HOSTTYPE}/BGL/egal.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/egal.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/egal.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/egal.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo egal.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/egal.o : o/${HOSTTYPE}/BGL/egal.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} egal.bgl
${BIGLOO_LIB_DIR}/egal.bgl : o/${HOSTTYPE}/BGL/egal.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/egal.bgl 			\
	> ${BIGLOO_LIB_DIR}/egal.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/egal.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/egal.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/egal.sch
${DEST_DIR}/SCC/do.all-o ::
	echo egal.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/egal.o : o/${HOSTTYPE}/SCC/egal.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c egal.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c egal.c
o/${HOSTTYPE}/SCC/egal.c : o/${HOSTTYPE}/SCC/egal.sch
o/${HOSTTYPE}/SCC/egal.c : o/${HOSTTYPE}/SCC/egal.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} egal.sc
	-rm o/${HOSTTYPE}/SCC/egal.org.c
	mv o/${HOSTTYPE}/SCC/egal.c o/${HOSTTYPE}/SCC/egal.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/egal
	rm o/${HOSTTYPE}/SCC/egal.org.c

o/${HOSTTYPE}/SCC/modify.sch : modify.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"modify.scm\" \"o/${HOSTTYPE}/SCC/modify.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/modify.sch
o/${HOSTTYPE}/SCC/modify.sc : modify.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"modify.scm\" \"o/${HOSTTYPE}/SCC/modify.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/modify.sc
o/${HOSTTYPE}/BGL/modify.bgl : modify.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"modify.scm\" \"o/${HOSTTYPE}/BGL/modify.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/modify.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/modify.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/modify.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo modify.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/modify.o : o/${HOSTTYPE}/BGL/modify.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} modify.bgl
${BIGLOO_LIB_DIR}/modify.bgl : o/${HOSTTYPE}/BGL/modify.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/modify.bgl 			\
	> ${BIGLOO_LIB_DIR}/modify.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/modify.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/modify.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/modify.sch
${DEST_DIR}/SCC/do.all-o ::
	echo modify.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/modify.o : o/${HOSTTYPE}/SCC/modify.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c modify.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c modify.c
o/${HOSTTYPE}/SCC/modify.c : o/${HOSTTYPE}/SCC/modify.sch
o/${HOSTTYPE}/SCC/modify.c : o/${HOSTTYPE}/SCC/modify.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} modify.sc
	-rm o/${HOSTTYPE}/SCC/modify.org.c
	mv o/${HOSTTYPE}/SCC/modify.c o/${HOSTTYPE}/SCC/modify.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/modify
	rm o/${HOSTTYPE}/SCC/modify.org.c

o/${HOSTTYPE}/SCC/clone.sch : clone.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-sch-interface \"clone.scm\" \"o/${HOSTTYPE}/SCC/clone.sch\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of interface" o/${HOSTTYPE}/SCC/clone.sch
o/${HOSTTYPE}/SCC/clone.sc : clone.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-scc-module \"clone.scm\" \"o/${HOSTTYPE}/SCC/clone.sc\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/SCC/clone.sc
o/${HOSTTYPE}/BGL/clone.bgl : clone.scm
	@echo "(begin							\
  (define boot-scm \"${BOOT_SCM}\")					\
  (load \"extract.scm\")						\
  (generate-bgl-module \"clone.scm\" \"o/${HOSTTYPE}/BGL/clone.bgl\")	\
		)" | ${BOOT_SCM}
	@grep "^;;; end of module" o/${HOSTTYPE}/BGL/clone.bgl
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/clone.o
${DEST_DIR}/BGL/all-o : ${DEST_DIR}/BGL/clone.bgl
${DEST_DIR}/BGL/do.all-o ::
	echo clone.o >> ${DEST_DIR}/BGL/all-o
o/${HOSTTYPE}/BGL/clone.o : o/${HOSTTYPE}/BGL/clone.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} clone.bgl
${BIGLOO_LIB_DIR}/clone.bgl : o/${HOSTTYPE}/BGL/clone.bgl
	sed -e /include/d < o/${HOSTTYPE}/BGL/clone.bgl 			\
	> ${BIGLOO_LIB_DIR}/clone.bgl
${BIGLOO_LIB_DIR}/install-bgl : ${BIGLOO_LIB_DIR}/clone.bgl
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/clone.o
${DEST_DIR}/SCC/all-o : o/${HOSTTYPE}/SCC/clone.sch
${DEST_DIR}/SCC/do.all-o ::
	echo clone.o >> ${DEST_DIR}/SCC/all-o
o/${HOSTTYPE}/SCC/clone.o : o/${HOSTTYPE}/SCC/clone.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c clone.c ||		\
	${CC} ${SCC_CFLAGS} -O0 -c clone.c
o/${HOSTTYPE}/SCC/clone.c : o/${HOSTTYPE}/SCC/clone.sch
o/${HOSTTYPE}/SCC/clone.c : o/${HOSTTYPE}/SCC/clone.sc meroon.s2c
	cd o/${HOSTTYPE}/SCC; ${SCC} -C -I ../../.. ${SCCFLAGS} clone.sc
	-rm o/${HOSTTYPE}/SCC/clone.org.c
	mv o/${HOSTTYPE}/SCC/clone.c o/${HOSTTYPE}/SCC/clone.org.c
	perl rminit.prl o/${HOSTTYPE}/SCC/clone
	rm o/${HOSTTYPE}/SCC/clone.org.c

# ######################################################## Expansion
# Expand all source files to remove all macros. Macro definitions, such
# as define-class, that must appear in the resulting code are converted
# into a dynamic call to eval. Generated files will appear in a
# sub-directory.

clexpand.scm : ../../icslas/Macros/clexpand.scm
	-ln -s ../../icslas/Macros/clexpand.scm .

expand.all.sources.with.bigloo : clexpand.scm
	-mkdir o o/${HOSTTYPE} o/${HOSTTYPE}/bgl
	echo "(load \"meroon.bigloo\") (load \"xpnd.scm\") (expand-all-sources \"o/${HOSTTYPE}/bgl/\") " | ${BIGLOO}

test.expanded.sources.with.bigloo : expand.all.sources.with.bigloo
	echo "(define native-load load) (native-load \"meroon.bigloo\") (define (load file)   (native-load (string-append \"o/${HOSTTYPE}/bgl/\" file)) ) (load \"meroon.scm\") (set! load native-load) (load \"oo.bigloo\") (test-oo \"oo3.tst\") " | ${TIME} ${BIGLOO}

expand.all.sources.with.gambit23 : clexpand.scm
	-mkdir o o/${HOSTTYPE} o/${HOSTTYPE}/GSC
	echo "(load \"meroon.gsc\") (load \"xpnd.scm\") (expand-all-sources \"o/${HOSTTYPE}/GSC/\") " | ${GAMBIT}

test.expanded.sources.with.gambit23 : expand.all.sources.with.gambit23
	echo "(define native-load load) (native-load \"meroon.gsc\") (define (load file)   (native-load (string-append \"o/${HOSTTYPE}/GSC/\" file)) ) (load \"meroon.scm\") (set! load native-load) (load \"oo.gsi\") (and (test-oo \"oo3.tst\")			     (test-oo \"oo3dsssl.tst\")			     (begin (native-load \"postset.scm\")	            (test-oo \"postset.tst\") ) )		 " | ${TIME} ${GAMBIT}

meroon.gambc24 : meroon.scm
	-rm -f meroon.gambc24
	sed -e s/load/include/g -e 's/\.scm,/\.gambc24,/g' 	    -e 's/\.scm /\.gambc24 /g' 	    -e 's/includee/include/g' -e 's/includei/includi/g' 		 < meroon.scm > meroon.gambc24

_meroon.scm : make_meroon
	./make_meroon
clean ::
	-rm _meroon.* pre_meroon.scm

# #############################################################################
#                         Meroon with Scheme->C                              #
# #############################################################################
# Entries for that are already generated by the Expand Source macro above.
# You need roughly 9 megs for o/${HOSTTYPE}/SCC.

# Regenerate the union of all interfaces.
# Set the path variable to designate the directory where the sources of
# MeroonV3 are (normally the one in which this Imakefile is). Insert an
# absolute path not to be bothered.

o/${HOSTTYPE}/SCC/meroonV3.sch :
	-rm -f o/${HOSTTYPE}/SCC/meroonV3.sch
	( echo "						(define-macro hack-to-load-meroon				    (begin							      (define path \"../../../\")				      \"Load files as specified in meroon.scm\"			      (define native-load load)					      (define (specload file)					         (loadq (string-append path file)) )			      (set! load specload)					      (specload \"meroon.s2c\")					      (set! *meroon-features*  					        (cons 'enough-libraries *meroon-features*) )		      (specload \"meroon.scm\") 				      (set! load native-load)					      (lambda (e m) e) ) )"					;	   cd o/${HOSTTYPE}/SCC ; cat *.sch ) > o/${HOSTTYPE}/SCC/.meroonV3.sch

	cd o/${HOSTTYPE}/SCC ; mv .meroonV3.sch meroonV3.sch
	chmod a=r o/${HOSTTYPE}/SCC/meroonV3.sch

# The main module of Meroon. clone is the final module composing Meroon,
# it will load (in correct order) all the others.

o/${HOSTTYPE}/SCC/meroonV3.sc : o/${HOSTTYPE}/SCC/meroonV3.sch
	@echo "			(module meroonV3 (with clone))	(include \"meroonV3.sch\")"		> o/${HOSTTYPE}/SCC/meroonV3.sc

o/${HOSTTYPE}/SCC/meroonV3.c : o/${HOSTTYPE}/SCC/meroonV3.sc
	cd o/${HOSTTYPE}/SCC ; ${SCC} -C ${SCCFLAGS} meroonV3.sc
o/${HOSTTYPE}/SCC/meroonV3.o : o/${HOSTTYPE}/SCC/meroonV3.c
	cd o/${HOSTTYPE}/SCC ; ${CC} ${SCC_CFLAGS} -c meroonV3.c

# Since all SCC/?*.o are now regenerated, rebuild the library.

o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/all-o
o/${HOSTTYPE}/SCC/libmeroonV3.a : o/${HOSTTYPE}/SCC/meroonV3.o
	-rm -f o/${HOSTTYPE}/SCC/libmeroonV3.a
	cd o/${HOSTTYPE}/SCC ; ar cvr libmeroonV3.a meroonV3.o `cat all-o`
	${RANLIB} o/${HOSTTYPE}/SCC/libmeroonV3.a

# Pack things to save space: less than 1 meg.

SCC.tar.gz :
	csh -c "tar -cvf - o/${HOSTTYPE}/SCC/?*.{c,o,sc,sch} | gzip >SCC.tar.gz"
	@echo "Dont forget to recover space: rm -rf o/${HOSTTYPE}/SCC"
	@echo "Restore with	" gunzip -c SCC.tar.gz | tar -xvf -
	@echo "followed by	" m o/${HOSTTYPE}/SCC/all-o
	@echo "followed by	" m o/${HOSTTYPE}/SCC/libmeroonV3.a

# To use Meroon, you must compile your files with a line like:
#		(include "meroonV3.sch")
# Dont forget to add the (with meroonV3) directive into your module declaration,
# then you must add the o/${HOSTTYPE}/SCC/libmeroonV3.a library at link time.
# Note: You will have to provide appropriate paths for all these files.
# See for example below the o/${HOSTTYPE}/SCC/schfrm.sc entry.

# Build an interpreter with a compiled Meroon in it.
# meroonv3 should not be written meroonV3 here due to the mangling of names
# towards C.

o/${HOSTTYPE}/SCC/SCC++ : o/${HOSTTYPE}/SCC/sci+
o/${HOSTTYPE}/SCC/sci+ : o/${HOSTTYPE}/SCC/libmeroonV3.a
	cd o/${HOSTTYPE}/SCC ; ${SCC} -i -o sci+ -m meroonv3 		libmeroonV3.a

# and test it

test.sci+ : o/${HOSTTYPE}/SCC/sci+
	-${MAKE} ${OPT} test.qnc.sci MY_SCI=o/${HOSTTYPE}/SCC/sci+ 		| tee /tmp/meroon.sci.log

	grep "All tests successfully run!" /tmp/meroon.sci.log
	${MAKE} ${OPT} test.sci.thinman

# ###################################################### Scheme->C installation
# The interpreter sci+ and the compiler scc++ will be installed in BINDIR.

SCC.install : ${BINDIR}/sci+ ${BINDIR}/scc++

${BINDIR}/sci+ : o/${HOSTTYPE}/SCC/sci+
	${INSTALL} o/${HOSTTYPE}/SCC/sci+ 	${BINDIR}
${BINDIR}/scc++ : ${WORK_SCCplus_DIR}/scc++
	${INSTALL} ${WORK_SCCplus_DIR}/scc++ 	${BINDIR}
	${INSTALL} ${WORK_SCCplus_DIR}/sccomp++ 	${BINDIR}

SCC.clean.install :
	-rm ${BINDIR}/sc[ic]++

# ###################################################### scc++ construction
# This assumes that you have the compiled sources of scc somewhere.
# The scc++ compiler is built in WORK_SCCplus_DIR.

${WORK_SCCplus_DIR}/libscsc.a :
	HERE=`pwd` ; export HERE ; cd ${SCC_SRC_DIR}/scsc ; 		ar cvr $${HERE}/${WORK_SCCplus_DIR}/libscsc.a *.o

	ar d ${WORK_SCCplus_DIR}/libscsc.a main.o
	${RANLIB} ${WORK_SCCplus_DIR}/libscsc.a

${WORK_SCCplus_DIR}/sccomp++.sc : ${SCC_SRC_DIR}/scsc/main.sc
	sed -e "s/transform))/transform meroonV3))/" 	    -e "s/libsc.a/libsc++.a/" 		< ${SCC_SRC_DIR}/scsc/main.sc > ${WORK_SCCplus_DIR}/sccomp++.sc

${WORK_SCCplus_DIR}/sccomp++.c : ${WORK_SCCplus_DIR}/sccomp++.sc
	cd ${WORK_SCCplus_DIR} ; ${SCC} -C ${SCCFLAGS} sccomp++.sc

${WORK_SCCplus_DIR}/objects.h : ${SCCDIR}/objects.h
	cp ${SCCDIR}/objects.h ${WORK_SCCplus_DIR}/
${WORK_SCCplus_DIR}/options.h : ${SCCDIR}/options.h
	cp ${SCCDIR}/options.h ${WORK_SCCplus_DIR}/
${WORK_SCCplus_DIR}/predef.sc : ${SCCDIR}/predef.sc
	cp ${SCCDIR}/predef.sc ${WORK_SCCplus_DIR}/

${WORK_SCCplus_DIR}/libsc++.a : ${SCCDIR}/libsc.a
	-rm ${WORK_SCCplus_DIR}/libsc++.a
	-rm o/${HOSTTYPE}/SCC/libsc++.a
	cp ${SCCDIR}/libsc.a o/${HOSTTYPE}/SCC/libsc++.a
	cd o/${HOSTTYPE}/SCC ; ar cvr libsc++.a meroonV3.o `cat all-o`
	${RANLIB} o/${HOSTTYPE}/SCC/libsc++.a
	mv o/${HOSTTYPE}/SCC/libsc++.a ${WORK_SCCplus_DIR}/libsc++.a

${WORK_SCCplus_DIR}/sccomp++ : ${WORK_SCCplus_DIR}/libscsc.a
${WORK_SCCplus_DIR}/sccomp++ : ${WORK_SCCplus_DIR}/libsc++.a
${WORK_SCCplus_DIR}/sccomp++ : ${WORK_SCCplus_DIR}/objects.h
${WORK_SCCplus_DIR}/sccomp++ : ${WORK_SCCplus_DIR}/options.h
${WORK_SCCplus_DIR}/sccomp++ : ${WORK_SCCplus_DIR}/predef.sc
${WORK_SCCplus_DIR}/sccomp++ : o/${HOSTTYPE}/SCC/libmeroonV3.a
${WORK_SCCplus_DIR}/sccomp++ : ${WORK_SCCplus_DIR}/sccomp++.c
	cd ${WORK_SCCplus_DIR} ; ${CC} -o sccomp++ ${SCC_CFLAGS} 		sccomp++.c libscsc.a libsc++.a -lm

${WORK_SCCplus_DIR}/scc++ : ${WORK_SCCplus_DIR}/sccomp++
	cd ${WORK_SCCplus_DIR} ; HERE=`pwd` ; export HERE ; 		echo "#! /bin/csh -f" 				>  scc++ ; 		echo "sccomp++ -LIBDIR $$HERE \$$argv " 	>> scc++ ; 		chmod a+x scc++

test.scc++ : ${BINDIR}/scc++

# ######################################################
# FAUDRAIT AJOUTER MEROONV3.SCH A PREDEF.SC ET -M CLONE.

test.compile.with.scc++ : ${WORK_SCCplus_DIR}/scc++
	echo "						(module test (main start)(with clone))			(define-macro hack 					  (begin (loadq \"../../../meroon.s2c\")		         (loadq \"../../../macros.scm\")			 (loadq \"../../../macinst.scm\")			 (loadq \"../../../careless.scm\")			 (lambda (e m) #f) ) ) 				(define-class Point Object (x y))			(display (make-Point 22 33))(newline)			(show (make-Point 44 55))(newline)			(define-method (show (o Point) . stream)		  (let ((stream (if (pair? stream) (car stream) 	                    (current-output-port) ))) 		    (display (cons (Point-x o)(Point-y o)) stream)	    (newline stream) ) )				(define-generic (manhattan (o Point)) (show o) 42)	(define (start args)					  (show (manhattan (make-Point 11 22)))			  (newline) ) "	>o/${HOSTTYPE}/SCC/test.sc

	PATH=`pwd`/${WORK_SCCplus_DIR}:$$PATH cd o/${HOSTTYPE}/SCC ; 		scc++ -cc ${CC} test.sc -o test

	o/${HOSTTYPE}/SCC/test

# This test was suggested by <thinman@netcom.com>
test.sci.thinman :
	echo "					(module thinman (main start)(with clone))	(include \"meroonV3.sch\")			(display '(attention))(newline)			(define-class x object () :prototype)		(display '(prototype done))(newline)		(define-class x object () ) 			(display '(class done))(newline)		(define (start args) (display 'OK)		                     (newline)	)		"			> o/${HOSTTYPE}/SCC/thinman.sc

	cd o/${HOSTTYPE}/SCC ; 		${SCC} -o thinman ${SCCFLAGS} thinman.sc libmeroonV3.a

	o/${HOSTTYPE}/SCC/thinman

# #############################################################################
#			 Compiling Meroon with bigloo                        #
# #############################################################################
# o/${HOSTTYPE}/BGL requires roughly 25 megs for the compilation and tests.

# The EXTEND_DIR directory specifies where must be stored bigloo files
# and compilation products.

EXTEND_DIR		= o/${HOSTTYPE}/BGL

# This module describes all the exportation of Meroon. It will be installed
# in the final library directory ie in BIGLOO_LIB_DIR.

${EXTEND_DIR}/meroonV3.bgl :
	@echo "                                                         (directives                                                               (import 								    (macros \"${MEROON_BIGLOO_DIR}/macros.bgl\")                  	    (macinst \"${MEROON_BIGLOO_DIR}/macinst.bgl\")                  	    (utils \"${MEROON_BIGLOO_DIR}/utils.bgl\")                              (revision \"${MEROON_BIGLOO_DIR}/revision.bgl\")                        (dsssl \"${MEROON_BIGLOO_DIR}/dsssl.bgl\")                  	    (instance \"${MEROON_BIGLOO_DIR}/instance.bgl\")                        (careless \"${MEROON_BIGLOO_DIR}/careless.bgl\")                        (walker \"${MEROON_BIGLOO_DIR}/walker.bgl\")                            (runtime \"${MEROON_BIGLOO_DIR}/runtime.bgl\")                          (option \"${MEROON_BIGLOO_DIR}/option.bgl\")                            (access \"${MEROON_BIGLOO_DIR}/access.bgl\")                            (dispatch \"${MEROON_BIGLOO_DIR}/dispatch.bgl\")                        (handy \"${MEROON_BIGLOO_DIR}/handy.bgl\")                              (definers \"${MEROON_BIGLOO_DIR}/definers.bgl\")                        (alloc \"${MEROON_BIGLOO_DIR}/alloc.bgl\")                              (genes1 \"${MEROON_BIGLOO_DIR}/genes1.bgl\")                            (genes2 \"${MEROON_BIGLOO_DIR}/genes2.bgl\")                            (Basics \"${MEROON_BIGLOO_DIR}/Basics.bgl\")                            (fill \"${MEROON_BIGLOO_DIR}/fill.bgl\")                                (coinst \"${MEROON_BIGLOO_DIR}/coinst.bgl\")                            (maker \"${MEROON_BIGLOO_DIR}/maker.bgl\")                              (view \"${MEROON_BIGLOO_DIR}/view.bgl\")                        	    (libgen \"${MEROON_BIGLOO_DIR}/libgen.bgl\")                            (Coercers \"${MEROON_BIGLOO_DIR}/Coercers.bgl\")                        (anomaly \"${MEROON_BIGLOO_DIR}/anomaly.bgl\")                          (multi \"${MEROON_BIGLOO_DIR}/multi.bgl\")                              (show \"${MEROON_BIGLOO_DIR}/show.bgl\")                                (trace \"${MEROON_BIGLOO_DIR}/trace.bgl\")                              (size \"${MEROON_BIGLOO_DIR}/size.bgl\")                                (unveil \"${MEROON_BIGLOO_DIR}/unveil.bgl\")                            (egal \"${MEROON_BIGLOO_DIR}/egal.bgl\")                                (modify \"${MEROON_BIGLOO_DIR}/modify.bgl\")                            (clone \"${MEROON_BIGLOO_DIR}/clone.bgl\") ) )                      "               > ${EXTEND_DIR}/meroonV3.bgl

o/${HOSTTYPE}/BGL/meroon-v3.bgl :
	-rm -f o/${HOSTTYPE}/BGL/meroonV3.bgl
	MEROON_BIGLOO_DIR=`pwd`/o/${HOSTTYPE}/BGL ; 	${MAKE} ${OPT} o/${HOSTTYPE}/BGL/meroonV3.bgl 		MEROON_BIGLOO_DIR=$$MEROON_BIGLOO_DIR

	@echo "							(module meroonv3 (include \"meroonV3.bgl\")(eval (export-all)))	"	> o/${HOSTTYPE}/BGL/meroon-v3.bgl

o/${HOSTTYPE}/BGL/meroon-v3.o : o/${HOSTTYPE}/BGL/meroon-v3.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} -c ${BIGLOOFLAGS} meroon-v3.bgl

o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/all-o
o/${HOSTTYPE}/BGL/libmeroonV3.a : o/${HOSTTYPE}/BGL/meroon-v3.o
	-rm -f o/${HOSTTYPE}/BGL/libmeroonV3.a
	cd o/${HOSTTYPE}/BGL ; ar cvr libmeroonV3.a `cat all-o` meroon-v3.o
	${RANLIB} o/${HOSTTYPE}/BGL/libmeroonV3.a

ADDITIONAL_LIBRARIES	= -ldopt $${HERE}/o/${HOSTTYPE}/BGL/libmeroonV3.a
INIT_MAIN_SCM		= $${HERE}/o/${HOSTTYPE}/BGL/bigloo++.bgl

o/${HOSTTYPE}/BGL/BGL++ : o/${HOSTTYPE}/BGL/bigloo++
o/${HOSTTYPE}/BGL/bigloo++ : o/${HOSTTYPE}/BGL/libmeroonV3.a
	MEROON_BIGLOO_DIR=`pwd`/o/${HOSTTYPE}/BGL ; 	${MAKE} ${OPT} o/${HOSTTYPE}/BGL/meroonV3.bgl 		o/${HOSTTYPE}/BGL/bigloo++.bgl 		MEROON_BIGLOO_DIR=$$MEROON_BIGLOO_DIR

	@echo
	@echo compiling bigloo++, hope you have the correct rights...
	@echo
	HERE=`pwd` ; export HERE ; 	   cd ${BIGLOO_SRC_DIR} ; ${BIGLOO_MAKER} mainnewo			BIGLOO_DEST=$${HERE}/o/${HOSTTYPE}/BGL/bigloo++		  ADDITIONAL_BFLAGS="-q -v2 -eval \"(set! *indent* #f)\" -I $$HERE/o/${HOSTTYPE}/BGL"			INIT_MAIN_SCM="${INIT_MAIN_SCM}"					ADDITIONAL_LIBRARIES="${ADDITIONAL_LIBRARIES}"

# This file is similar to BIGLOO_SRC_DIR/Init/main.scm except that it
# imports all of Meroon V3. It is used to generate a stand-alone interpreter.
# The following warning is normal and harmless.
# *** WARNING:bigloo:initialize-eval-primop!
# This variable could be used before initialized -- *exit-bigloo*

${EXTEND_DIR}/bigloo++.bgl :
	echo "						(module main						   (main main)						   (import init_setrc						   init_parse-args					   engine_engine 				           tools_trace					           (meroonv3 \"${MEROON_BIGLOO_DIR}/meroon-v3.bgl\") 	           (display-meroon-banner revision 		             \"${MEROON_BIGLOO_DIR}/revision.bgl\" ) )		(export (exit-bigloo value))				) 						(define *exit-bigloo* (lambda (x) (exit x)))		(define (main argv)					  (if (not (member \"-q\" argv))			      (setup-default-values) )				  (bind-exit (exit)					   (set! *exit-bigloo* exit)				   (display-meroon-banner (current-output-port))	   (unwind-protect					      (if (parse-args argv)				         (bigloo)					         -1 )						      (stop-trace) ) ) )				(define (exit-bigloo value)				   (*exit-bigloo* value))"	> ${EXTEND_DIR}/bigloo++.bgl

# Bigloo++ works as a compiler as well as an interpreter. Test it with
# both functions. First try to use the -help option, then runs bigloo
# as an interpreter on the test suite, then compile a file with the oon
# file extension, then the same file without the oon extension. These tests
# are run in /tmp to avoid the current directories.

test.bigloo++ :: o/${HOSTTYPE}/BGL/bigloo++
	o/${HOSTTYPE}/BGL/bigloo++ -help
	${MAKE} ${OPT} test.my.bigloo MY_BIGLOO=o/${HOSTTYPE}/BGL/bigloo++ 		| tee /tmp/meroon.bgl.log

	grep "All tests successfully run!" /tmp/meroon.bgl.log

test.bigloo++ :: test.compile.with.bigloo++

test.compile.with.bigloo++ :: o/${HOSTTYPE}/BGL/test.oon
	cp o/${HOSTTYPE}/BGL/test.oon /tmp/test.oon
	( HERE=`pwd` ; cd /tmp ;	  $$HERE/o/${HOSTTYPE}/BGL/bigloo++ -v test.oon -o test )

	/tmp/test

test.compile.with.bigloo++ :: o/${HOSTTYPE}/BGL/test.oon
	cp o/${HOSTTYPE}/BGL/test.oon /tmp/test.scm
	( HERE=`pwd` ; cd /tmp ;	  $$HERE/o/${HOSTTYPE}/BGL/bigloo++ test.scm -o test -extend meroon )

	/tmp/test

# This is a small example of a Bigloo module. Its extension is oon so Bigloo
# automatically knows that it uses MeroonV3, all the other details of
# compilation and linking are taken into account automatically.

o/${HOSTTYPE}/BGL/test.oon :
	echo "						(module test (main start))				(define-class Point Object (x y))			(display (make-Point 22 33))(newline)			(show (make-Point 44 55))(newline)			(define-method (show (o Point) . stream)		  (display (cons (Point-x o)(Point-y o)) stream)	  (newline stream) )					(define-generic (manhattan (o Point)) 42)		(define (start args)					  (show (manhattan (make-Point 11 22)))			  (newline) )						"			> o/${HOSTTYPE}/BGL/test.oon

# This is the same file. It is used to show that you can use Meroon without
# the oon extension. Just use the -extend option of Bigloo.

o/${HOSTTYPE}/BGL/test.scm : o/${HOSTTYPE}/BGL/test.oon
	cp o/${HOSTTYPE}/BGL/test.oon o/${HOSTTYPE}/BGL/test.scm

# Use the extend mechanism of Bigloo. This file will be generated into
# BIGLOO_LIB_DIR. Whenever you compile with the `-extend meroon' option
# internal details of compilation (library, interfaces) are dealt invisibly
# so just use the .oon extension.

${EXTEND_DIR}/meroon : o/${HOSTTYPE}/BGL/bigloo++
	@echo "							(quote (Automatically generated do not touch))			(eval '(set! *bigloo-name* 					        (string-append *bigloo-name* \" Meroon V3\")))		(set! *bigloo-user-includes* 					      (cons \"${MEROON_BIGLOO_DIR}/meroonV3.bgl\"	 	            *bigloo-user-includes* ) )				(set! *bigloo-user-lib* 					      (cons \"${MEROON_BIGLOO_DIR}/libmeroonV3.a\"		            *bigloo-user-lib* ) )				"		> ${EXTEND_DIR}/meroon

# #####Try to make a single file containing all of meroon
o/${HOSTTYPE}/BGL/meroon.bgl :
	( echo ";;; Automatically generated (don't touch)" ;	  echo "(module meroon)" ;	  echo "(define-macro (HACK) " ;	  echo "  (eval '(define *meroon-features* '( bigloo 2.1 DSSSL " ;	  echo "          pervasive-meroon-macros )))  " ;	  echo "  42 ) (HACK) " ;	  cat meroon.bigloo 	    macros.scm dsssl.scm macinst.bigloo careless.scm utils.scm 	    instance.bigloo revision.scm walker.scm runtime.scm option.scm 	    access.scm dispatch.scm handy.scm definers.scm alloc.scm 	    genes1.scm genes2.scm Basics.scm fill.scm coinst.scm 	    maker.scm view.scm libgen.scm Coercers.scm anomaly.scm 	    multi.scm show.scm trace.scm size.scm unveil.scm egal.scm 	    modify.scm clone.scm ) > ${EXTEND_DIR}/meroon.bgl

o/${HOSTTYPE}/BGL/meroon.o : o/${HOSTTYPE}/BGL/meroon.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} ${BIGLOOFLAGS} meroon.bgl

# ######################################################## Bigloo installation

BGL.install : ${BIGLOO_LIB_DIR}/libmeroonV3.a
BGL.install : ${BINDIR}/bigloo++

${BIGLOO_LIB_DIR}/libmeroonV3.a : o/${HOSTTYPE}/BGL/libmeroonV3.a
	${INSTALL} o/${HOSTTYPE}/BGL/libmeroonV3.a 	${BIGLOO_LIB_DIR}
	${RANLIB} ${BIGLOO_LIB_DIR}/libmeroonV3.a

${BINDIR}/bigloo++ : o/${HOSTTYPE}/BGL/bigloo++
	${INSTALL} o/${HOSTTYPE}/BGL/bigloo++ 		${BINDIR}

# Remove {meroonV3,bigloo++}.bgl from ${BIGLOO_LIB_DIR} to regenerate them
# with the appropriate path towards ${BIGLOO_LIB_DIR} <johnm@vlibs.com>
BGL.install :
	${MAKE} ${OPT} EXTEND_DIR=${BIGLOO_LIB_DIR} 		MEROON_BIGLOO_DIR=${BIGLOO_LIB_DIR} 		${BIGLOO_LIB_DIR}/meroon			${BIGLOO_LIB_DIR}/install-bgl

	-rm ${BIGLOO_LIB_DIR}/meroonV3.bgl ${BIGLOO_LIB_DIR}/bigloo++.bgl
	${MAKE} ${OPT} EXTEND_DIR=${BIGLOO_LIB_DIR} 		MEROON_BIGLOO_DIR=${BIGLOO_LIB_DIR} 			${BIGLOO_LIB_DIR}/meroonV3.bgl				${BIGLOO_LIB_DIR}/bigloo++.bgl

# Remove all the installed stuff.
BGL.clean.install :
	-rm ${BIGLOO_LIB_DIR}/libmeroonV3.a
	-rm ${BINDIR}/bigloo++
	-rm ${BIGLOO_LIB_DIR}/meroon
	-for f in o/${HOSTTYPE}/BGL/?*.bgl ;	  do rm ${BIGLOO_LIB_DIR}/`basename $$f` ; done

	-rm ${BIGLOO_LIB_DIR}/meroonV3.bgl

# Test if the installed bigloo still works in extended mode ie when compiling
# files with the .oon extension.

test.BGL.after.install : BGL.install
	${BINDIR}/bigloo++ o/${HOSTTYPE}/BGL/test.oon -o /tmp/test
	/tmp/test

# ####################################### Only build a Bigloo+meroon interpreter
# This interpreter will be called bigloo+. It contains a compiled Meroon
# in it so it is quite fast. The interpreter is lighter than bigloo++
# (roughly, 1 meg instead of 3). It is not automatically built so if you
# need it, just say:	make o/${HOSTTYPE}/BGL/bigloo+

# This is a header file for Bigloo, not a module.

o/${HOSTTYPE}/BGL/meroonV3.bgh :
	echo "							(directives							  (import (macros \"macros.bgl\")(utils \"utils.bgl\")		     (revision \"revision.bgl\")(instance \"instance.bgl\")	     (macinst \"macinst.bgl\")(dsssl \"dsssl.bgl\")		     (careless \"careless.bgl\")(walker \"walker.bgl\")		     (runtime \"runtime.bgl\")(option \"option.bgl\")		     (access \"access.bgl\")(dispatch \"dispatch.bgl\")		     (handy \"handy.bgl\")(definers \"definers.bgl\")		     (alloc \"alloc.bgl\")					     (genes1 \"genes1.bgl\")(genes2 \"genes2.bgl\")		     (Basics \"Basics.bgl\")(fill \"fill.bgl\")			     (coinst \"coinst.bgl\")(maker \"maker.bgl\")		     (view \"view.bgl\")(libgen \"libgen.bgl\")			     (Coercers \"Coercers.bgl\")(anomaly \"anomaly.bgl\")	     (multi \"multi.bgl\")					     (show \"show.bgl\")(trace \"trace.bgl\")			     (size \"size.bgl\")(unveil \"unveil.bgl\")			     (egal \"egal.bgl\")(modify \"modify.bgl\")			     (clone \"clone.bgl\") ) )  				(define-expander hack-to-load-meroon				    (begin							      (define path \"./\")					      \"Load files as specified in meroon.scm\"			      (define (spload f) (load (string-append path f)))		      (spload \"macros.bgl\")					      (spload \"utils.bgl\")					      (spload \"dsssl.bgl\")					      (spload \"revision.bgl\")					      (spload \"instance.bgl\")					      (spload \"macinst.bgl\")					      (spload \"careless.bgl\")					      (spload \"walker.bgl\")					      (spload \"runtime.bgl\")					      (spload \"option.bgl\")					      (spload \"access.bgl\")					      (spload \"dispatch.bgl\")					      (spload \"handy.bgl\")					      (spload \"definers.bgl\")					      (spload \"alloc.bgl\")					      (spload \"genes1.bgl\")					      (spload \"genes2.bgl\")					      (spload \"Basics.bgl\")					      (spload \"fill.bgl\")					      (spload \"coinst.bgl\")					      (spload \"maker.bgl\")					      (spload \"view.bgl\")					      (spload \"libgen.bgl\")					      (spload \"Coercers.bgl\")					      (spload \"anomaly.bgl\")					      (spload \"multi.bgl\")					      \"Dont need the other modules\"				      (lambda (e m) e) ) )					"			> o/${HOSTTYPE}/BGL/meroonV3.bgh

# This is the main module, it just starts a very dumb interaction loop.
# You can of course use an improved interaction loop.

o/${HOSTTYPE}/BGL/bigloo+.bgl : o/${HOSTTYPE}/BGL/meroonV3.bgh
	echo "						(module bigloo+	(main start) 				  (include \"meroonV3.bgh\") )				(define (start argv)					  (try (repl) list) ) "			> o/${HOSTTYPE}/BGL/bigloo+.bgl

# Build an interpreter with a compiled Meroon in it.

o/${HOSTTYPE}/BGL/bigloo+ : o/${HOSTTYPE}/BGL/libmeroonV3.a
o/${HOSTTYPE}/BGL/bigloo+ : o/${HOSTTYPE}/BGL/bigloo+.bgl
	cd o/${HOSTTYPE}/BGL ; ${BIGLOO} ${BIGLOOFLAGS} bigloo+.bgl                 -o bigloo+ -ld libmeroonV3.a

# and test this interpreter.

test.bigloo+ : o/${HOSTTYPE}/BGL/bigloo+
	${MAKE} ${OPT} test.my.bigloo MY_BIGLOO=o/${HOSTTYPE}/BGL/bigloo+

# #############################################################################
#			 Compiling Meroon with Gambit                        #
# #############################################################################
# gsi+ is a Gambit interpreter augmented with a compiled Meroon.
# gsc++ is a Gambit interpreter+compiler augmented with a compiled Meroon.
# By default, build the two. There are two methods that are detailed
# below. There is a third method contributed by Brad Lucier, see next section.

# Meroon modules should be in the right order
C_MODULES	=	macros macinst careless utils instance 			dsssl revision walker runtime option access 			dispatch handy definers alloc genes1 			genes2 Basics fill coinst maker libgen 			Coercers anomaly multi show trace size 			unveil egal modify clone

# Compile all Meroon modules into C code.

o/${HOSTTYPE}/GSC/all-c : compile.gsc
	echo "(include \"meroon.gsc\")				(include \"meroon.gambc24\")				(define compiled-meroon-subpath \"o/${HOSTTYPE}/GSC/\")	(load \"compile.gsc\")					'done "		| ${TIME} ${GAMBIT_COMPILER}

# Compile all C modules into .o files.

o/${HOSTTYPE}/GSC/all-o : o/${HOSTTYPE}/GSC/all-c
	cd o/${HOSTTYPE}/GSC/ ; for f in ${C_MODULES} ; do 		make -f ${GAMBIT_GSC_DIR}/makefile 			srcdir=${GAMBIT_GSC_DIR}/ 			srcdirpfx=${GAMBIT_GSC_DIR}/ 			$$f.o ; done

# Gather all .o files into a library.

o/${HOSTTYPE}/GSC/libmeroonV3.a : o/${HOSTTYPE}/GSC/all-o
	-cd o/${HOSTTYPE}/GSC ; rm libmeroonV3.a
	cd o/${HOSTTYPE}/GSC ; ar cvr libmeroonV3.a 		`for f in ${C_MODULES} ; do echo $$f.o ; done`

	-ranlib o/${HOSTTYPE}/GSC/libmeroonV3.a

# Copy the original gsi.scm (change a relative pathname into an absolute one).

o/${HOSTTYPE}/GSC/gsi+.scm :
	sed -e "/include/s;../lib;${GAMBIT_DIR}/lib;" 		< ${GAMBIT_GSI_DIR}/gsi.scm 		> o/${HOSTTYPE}/GSC/gsi+.scm

# Build the link file gsi+_.c

o/${HOSTTYPE}/GSC/gsi+_.c : o/${HOSTTYPE}/GSC/gsi+.scm
	cd o/${HOSTTYPE}/GSC ; ${GAMBIT_COMPILER} 		-f `for f in ${C_MODULES} ; do echo $$f.c ; done` gsi+.scm

# Build gsi+ now.

o/${HOSTTYPE}/GSC/gsi+ : o/${HOSTTYPE}/GSC/libmeroonV3.a
o/${HOSTTYPE}/GSC/gsi+ : o/${HOSTTYPE}/GSC/gsi+_.c
	cd o/${HOSTTYPE}/GSC ; 		${CC} ${GAMBIT_CFLAGS} -o gsi+ gsi+_.c gsi+.c 			libmeroonV3.a ${GAMBIT_LIBRARY} -lm

# Install the gsi+ binary.

GSI.install : o/${HOSTTYPE}/GSC/gsi+
	${INSTALL} o/${HOSTTYPE}/GSC/gsi+ ${BINDIR}

# ##########################################
# Building gsc++ [UNTESTED for gsc2.4 as of Feb 12. 1997]

GSC.install : o/${HOSTTYPE}/GSC/gsc++
	${INSTALL} o/${HOSTTYPE}/GSC/gsc++ ${BINDIR}

# The first method is to compile every Meroon module separately and
# then to link them all. The second method is to concatenate all the
# sources of Meroon before compiling them in a single module. This was
# suggested by Brad Lucier. Choose your way with the
# GSC_SINGLE_MERON_MODULE macro but if you define it to 1 then you must
# have a *very* large virtual memory for the C compilation. Try 1 and
# then revert to 0 if problems.

# Copy from Gambit source directory, the modules composing gsc.

o/${HOSTTYPE}/GSC/gsc++.scm :
	-for f in ${GSC_MODULES} ; do 		if [ -f o/${HOSTTYPE}/GSC/$$f.c ] ; then true ; else 		gzip -d < ${GAMBIT_GSC_DIR}/$$f.cgz 			> o/${HOSTTYPE}/GSC/$$f.c ; fi 	done

	-cp ${GAMBIT_GSC_DIR}/gsc.scm o/${HOSTTYPE}/GSC/gsc++.scm

o/${HOSTTYPE}/GSC/gsc++.c : o/${HOSTTYPE}/GSC/gsc++.scm
	cd o/${HOSTTYPE}/GSC ; ${GAMBIT_COMPILER} gsc++.scm

o/${HOSTTYPE}/GSC/gsc++.o : o/${HOSTTYPE}/GSC/gsc++.c
	-for f in ${GSC_MODULES} ; do 		if [ -f o/${HOSTTYPE}/GSC/$$f.o ] ; then true ; else 		ln -s ${GAMBIT_GSC_DIR}/$$f.o o/${HOSTTYPE}/GSC ; fi 	done

	cd o/${HOSTTYPE}/GSC ; ${CC} ${GAMBIT_CFLAGS} -c gsc++.c

o/${HOSTTYPE}/GSC/gsc++ : o/${HOSTTYPE}/GSC/libmeroonV3.a
o/${HOSTTYPE}/GSC/gsc++ : o/${HOSTTYPE}/GSC/gsc++.o
o/${HOSTTYPE}/GSC/gsc++ : o/${HOSTTYPE}/GSC/gsc++_.c
	cd o/${HOSTTYPE}/GSC ; 	${CC} ${GAMBIT_CFLAGS} -o gsc++ gsc++_.c   		${GSC_MODULES_O} gsc++.o libmeroonV3.a ${GAMBIT_LIBRARY} -lm

# ## This the conditional part:

# Test the obtained gsi+ or gsc++ executables. They must interpret the
# test suite as gsi or gsc did. I also check that define-meroon-macro
# is really present (ie had been made pervasive). Don't use foo as the
# name of the macro since some generic functions in oo3.tst use 'foo'
# as name and this clashes.

test.gsi+ :
	${MAKE} test.gs+ GS=o/${HOSTTYPE}/GSC/gsi+

test.gsc++ :
	${MAKE} test.gs+ GS=o/${HOSTTYPE}/GSC/gsc++
	${MAKE} test.compile.with.gsc++

test.gs+ :
	if [ -z "${GS}" ] ; then echo "Unknown GS" ; exit 1 ; else exit 0 ; fi
	echo "						(load \"oo.gsi\")					(define-meroon-macro (footruc x) \`(quote (,x ,x)))	(and (equal? (footruc 33) '(33 33))			     (test-oo \"oo3.tst\")				     (exit) )						"		| ${TIME} ${GS}

# These are the files that must be included in the collection.

GSCPLUS_FLAGS = 	"macros" "macinst" "utils" "revision" "dsssl" "instance" "careless" 	"walker" "runtime" "option" "access" "dispatch" "handy" "definers" 	"alloc" "genes1" "genes2" "Basics" "fill" "coinst" "maker" "libgen" 	"Coercers" "anomaly" "multi" "show" "trace" "size" 	"unveil" "egal" "modify" "clone"

test.compile.with.gsc++ : o/${HOSTTYPE}/GSC/test
	o/${HOSTTYPE}/GSC/test
o/${HOSTTYPE}/GSC/test_.c : o/${HOSTTYPE}/GSC/test.scm
	cd o/${HOSTTYPE}/GSC ; gsc++ -link 		`for w in ${GSCPLUS_FLAGS} ; do echo $$w.c ; done` test.scm

o/${HOSTTYPE}/GSC/test : o/${HOSTTYPE}/GSC/test_.c
	cd o/${HOSTTYPE}/GSC ; ${CC} ${GAMBIT_CFLAGS} 		-o test test.c test_.c 		libmeroonV3.a /usr/local/lib/libgambc.a -lm

# NOTE: When a filename is indicated on the command line of gsc, the
# filename must end with the .scm extension, this is not necessary
# when calling directly the compile-file function.

o/${HOSTTYPE}/GSC/test.scm :
	echo "						(define-class Point Object (x y))			(display (make-Point 22 33))(newline)			(show (make-Point 44 55))(newline)			(define-method (show (o Point) . stream)		  (display (cons (Point-x o)(Point-y o)) stream)	  (newline stream) )					(define-generic (manhattan (o Point)) 42)		(show (manhattan (make-Point 11 22)))			(newline)						"			> o/${HOSTTYPE}/GSC/test.scm

# #############################################################################
#		Brad Lucier's compilation of Meroon with Gambit              #
# #############################################################################
# Here is another method described in README.GSC

safe-meroon-for-gambit : meroon-all-gsc.scm
	( echo '(declare (block) (standard-bindings) ' 		;	  echo '(extended-bindings) (fixnum))' 			;	  echo ';(declare (inline) (inlining-limit 500))' 	;	  cat meroon-all-gsc.scm 				;	) > safe_meroon.scm

meroon-all-gsc.scm :
	cat meroon.gsc macros.scm dsssl.scm macinst.scm careless.scm 	    utils.scm instance.scm revision.scm walker.scm runtime.scm 	    option.gsc access.scm dispatch.scm handy.scm definers.gsc 	    alloc.scm genes1.scm genes2.scm Basics.scm fill.scm coinst.scm 	    maker.scm view.scm libgen.scm Coercers.scm anomaly.scm multi.scm 	    show.scm trace.scm size.scm unveil.scm egal.scm clone.scm 	> meroon-all-gsc.scm

# ##############################################################################
#		Distribution						      #
# ##############################################################################

# ################################################### To floppy
# copy to a PC floppy (converting NL to CR-LF) all the files.

FLOPPYDIR	= /fd

TODIR	= ${FLOPPYDIR}/dea/meroon

to.pc :
	if [ "$$SITE" = blaye ] ; then exit 0 ; else exit 1 ; fi
	@echo -n "Insert PC 720K floppy. Continue (yes,no)[n]? "
	@read ans ; case X$$ans in X[yY]*) exit 0 ;; *) exit 1 ;; esac
	mountu -t pcfs /dev/fd0 ${FLOPPYDIR}
	grep " ${FLOPPYDIR}" /etc/mtab
	-mkdir ${FLOPPYDIR} ${FLOPPYDIR}/dea ${FLOPPYDIR}/dea/meroon
	@for f in oo3.tst tester.scm ${SOURCES} ${CUSTOM} README	;	do 	echo Copying $$f					;		nl2crlf.prl $$f > ${TODIR}/`file2pc.prl -lr $$f` 	;		done

	-@echo ; ls -lg ${TODIR} ; echo "Floppy written."
	umountfd
	eject

to.sunpc :
	if [ -d ${HOME}/pc ] ; then ${MAKE} FLOPPYDIR=${HOME}/pc to.pc ;	else echo No sunpc here ; exit 1 ; fi

# ################################################### Distribution
# Don't forget to increment revision.scm.
# To make a distribution: just paste something like:
#	( setenv DISTRIBUTION_NAME Noel+4 ; m distribution )

DIST_DIR	= MeroonV3

ADDITIONAL_FILES =	Imakefile				Makefile				rminit.prl				expand.bgl				ChangeLog				Examples/README					Examples/vsg.scm				Examples/vsg-bench.scm				Examples/vsg.tst				Examples/interp.scm				Examples/pinterp.scm				Examples/Bench.mkf				Examples/Imakefile				Examples/?*.gsc					tester.scm					oo3.tst						make_meroon					old-load.scm

DISTRIBUTION_DIRS = 	${DIST_DIR}					${DIST_DIR}/Doc 				${DIST_DIR}/Examples 				${DIST_DIR}/o 					${DIST_DIR}/o/HOSTTYPE	 			${DIST_DIR}/o/HOSTTYPE/SCC 			${DIST_DIR}/o/HOSTTYPE/GSC 			${DIST_DIR}/o/HOSTTYPE/BGL

distribution : meroon.gambc24
distribution : Doc/oopil.dvi Doc/oopil.ps
distribution : Doc/MeroonV3.dvi Doc/MeroonV3.ps
distribution : Doc/dispatch.dvi Doc/dispatch.ps
	@echo Build distribution with name $${DISTRIBUTION_NAME?}
	sed -e "/define meroon-distribution-name/s/\".*\"/\"$${DISTRIBUTION_NAME}\"/" 		< revision.scm > /tmp/revision.scm

	rm -f revision.scm && cp /tmp/revision.scm revision.scm
	cvs update .
	@echo -n "Do you want to commit everything (y,n) [n] ? "
	@read ans ; case $$ans in 						[yY]*)	cvs commit -m "$${DISTRIBUTION_NAME}" ;;			*) : ;; esac

	cvs rtag $${DISTRIBUTION_NAME} meroon
	${MAKE} do.distribution DIST_DIR=`date +MeroonV3-%y%h%d`
	${MAKE} update.all

do.distribution :
	-[ -d ${DIST_DIR} ] 		&& rm -rf ${DIST_DIR}
	-[ -f ${DIST_DIR}.tar ] 	&& rm -f ${DIST_DIR}.tar
	-[ -f ${DIST_DIR}.tar.gz ] 	&& rm -f ${DIST_DIR}.tar.gz
	mkdir ${DISTRIBUTION_DIRS}
	cd Examples ; m Bench.mkf
	for f in ${DOC_FILES} ${SOURCES} ${CUSTOM} ${ADDITIONAL_FILES} ;	do cp $$f ${DIST_DIR}/$$f ; done

	${MAKE} all.scc DEST_DIR=${DIST_DIR}/o/HOSTTYPE "BOOT_SCM=${BOOT_SCM}"
	${MAKE} all.bgl DEST_DIR=${DIST_DIR}/o/HOSTTYPE "BOOT_SCM=${BOOT_SCM}"
	${MAKE} all.BGL DEST_DIR=${DIST_DIR}/o/HOSTTYPE "BOOT_SCM=${BOOT_SCM}"
	-rm -f ${DIST_DIR}/Makefile
	${MAKE} DIST_DIR=${DIST_DIR} ${DIST_DIR}/Makefile
	tar -cvf ${DIST_DIR}.tar ${DIST_DIR}
	gzip ${DIST_DIR}.tar && ls -l ${DIST_DIR}.tar.gz
	rm -rf ${DIST_DIR}

${DIST_DIR}/Makefile : Imakefile
	@echo "#include INCLUDE_IMAKEFILE" >/tmp/Imake.tmpl
	@imake -v -T/tmp/Imake.tmpl -s ${DIST_DIR}/Makefile

update.all :
	${MAKE} update.file FILE=${HOME}/WWW/Meroon.html 		STAMP=MeroonV3 DATE=`date +-%Y%h%d`

	${MAKE} update.file FILE=${HOME}/bib/qnc.bib 		STAMP=MeroonV3 DATE=`date +-%Y%h%d`

	${MAKE} update.file FILE=${HOME}/admin/Exportations 		STAMP=MeroonV3 DATE=`date +-%Y%h%d`

# Instantaneous tarball.
instantaneous.tarball :
	m do.instantaneous.tarball DIST_DIR=`date +MeroonV3-%Y%h%d`
do.instantaneous.tarball :
	-[ -d ${DIST_DIR} ] 		&& rm -rf ${DIST_DIR}
	-[ -f ${DIST_DIR}.tar ] 	&& rm -f ${DIST_DIR}.tar
	-[ -f ${DIST_DIR}.tar.gz ] 	&& rm -f ${DIST_DIR}.tar.gz
	mkdir ${DISTRIBUTION_DIRS}
	cd Examples ; m Bench.mkf
	for f in ${DOC_FILES} ${SOURCES} ${CUSTOM} ${ADDITIONAL_FILES} ;	do cp $$f ${DIST_DIR}/$$f ; done

	${MAKE} DIST_DIR=${DIST_DIR} ${DIST_DIR}/Makefile
	tar -czvf ${DIST_DIR}.tgz ${DIST_DIR}
	rm -rf ${DIST_DIR}
	ls -l ${DIST_DIR}.tgz

# update.file is inherited from Imake.tmpl

show.man :
	nroff -man Doc/meroon.1 | more
print.man :
	ptroff -man Doc/meroon.1

# Copy this paper and regenerate their .ps versions.

Doc/dispatch.dvi :
	-cd Doc; ln -s ../../../themes/DISPATCH/dispatch.dvi .
Doc/dispatch.ps  : Doc/dispatch.dvi

Doc/oopil.ps : Doc/oopil.dvi
Doc/oopil.dvi :
	cd Doc ; ${MAKE} -f ../Makefile oopil.dvi

Doc/MeroonV3.ps : Doc/MeroonV3.dvi
Doc/MeroonV3.dvi :
	cd Doc ; ${MAKE} -f ../Makefile MeroonV3.dvi

# ####################################################### Miscellaneous entries.

tags : ;	etags *.scm *.s2c *.bigloo *.elk *.slib
clean :: ;	-rm TAGS o/${HOSTTYPE}/SCC/SC*
print : ;	${PRINT} ChangeLog FUTURE Imakefile README ${SOURCES}

# ## end of Imakefile

###################### Generic entries ####################################
# The generic entries that must be everywhere;
PROMPT	=	">>>>>>>>>>>>>>>>>"

# This one does nothing
nothing :

# Check-in back all files that are checked-out whether RCS or CVS
ckpt :
	@perl ${HOME}/perl/ckpt.prl .
rec.ckpt : ckpt
	@PWD=`pwd` ; export PWD                                 ; \
	for d in `find . -type d -print`                        ; \
	do ( cd $$d ; echo Checkpointing $$d                        ; \
	${MAKE} -f $$PWD/Makefile ckpt ) ; done

# Sanitize with respect to RCS or CVS (faster than old.notci)
notci sanitize :
	@perl ${HOME}/perl/sanitize.prl .
rec.notci : notci
	@PWD=`pwd` ; export PWD                                 ; \
	for d in `find . -type d -print`                        ; \
	do ( cd $$d ; echo Sanitizing $$d                        ; \
	${MAKE} -f $$PWD/Makefile notci ) ; done

# Erase useless files
clean ::
	-${RM} core *.BAK *~ .*.BAK .*~
rec.clean : clean
	@PWD=`pwd` ; export PWD                                 ; \
	for d in `find . -type d -print`                        ; \
	do ( cd $$d ; echo Cleaning $$d                        ; \
	${MAKE} -f $$PWD/Makefile clean ) ; done

# Erase useless files in a Tex, LaTeX, BibTeX contexts, ChangeBar files
cleantex ::
	-${RM} *.log *.aux *.lof *.lot *.toc
	-${RM} *.blg *.bbl
	-${RM} *.idx *.ilg *.ind
	-${RM} *.spell *.epelle
	-${RM} *.cb
cleandvi ::
	-${RM} *.dvi

# This entry maps a make entry on all subdirectories, the work to be
# done is held in the MAPWORK variable
MAPWORK=clean
mapdirectories ::
	@for d in `ls -F | sed -e '/\/\$$/s,.\$$,,p' -e d` 	; 	do ( cd $$d 						; 	     echo "			on $$d: m ${MAPWORK}" 	; 	     m ${MAKEFLAGS} "${MAPWORK}" ) 			; 	done

# This entry compresses all not yet compressed files of a directory. The
# makefile is not compressed in order to ease the reverse action.
compress ::
	@for f in `ls -AF`					; 	 do case $$f in *[mM]akefile|*/|*.Z) :			;;                         *) echo ${PACK} $$f ; ${PACK} $$f	;;             esac						;          done

# This entry removes the generated Makefile.
# Usually one uses it as                clean :: cleanMakefile
cleanMakefile :
	-@if [ -f Imakefile ] ; then ${RM} -f Makefile ; fi

# This entry depends on FILE, STAMP and DATE
# It changes all occurrences of STAMP...tar into STAMPDATE.tar
# This is used to keep track of files within html pages.

update.file :
	@if [ -z "${FILE}" ] ; then echo Define FILE first ; exit 1 ;		else exit 0 ; fi

	@if [ -z "${STAMP}" ] ; then echo Define STAMP first ; exit 1 ;		else exit 0 ; fi

	@if [ -z "${DATE}" ] ; then echo Define DATE first ; exit 1 ;		else exit 0 ; fi

	@echo
	@echo "	Updating ${FILE} ..."
	@echo
	if [ -f ${FILE}.BAK ]; then exit 0; else 	  mv ${FILE} ${FILE}.BAK ; cp ${FILE}.BAK ${FILE} ; fi

	$$HOME/perl/updatefile.prl -stamp="${STAMP}" -date="${DATE}" -- ${FILE}
	chmod u+w ${FILE}

