# Jam rules for the bigloo scheme compiler
# (c) 2003 Yann Dirson

# Usage:
#
# BiglooMain foo : foo.scm bar.scm ;
#
#  or:
#
# LINK = $(BIGLOO)
# Main foo : foo.scm bar.scm ;


# TODO:
# - header scanning
# - find a way to get rid of BiglooMain, whose sole purpose is to
# assign a correct value to LINK
# - many files are rebuilt several times with no apparent reason

BIGLOO ?= bigloo ;
BFLAGS ?= "" ;

rule BiglooMain
{
	Main $(<) : $(>) ;
	LINK on $(<) = $(BIGLOO) ;
}

rule Bigloo
{
	DEPENDS $(<) : $(>) ;
	Clean clean : $(<) $(<:S=.c) ;
}

actions Bigloo
{
	bigloo $(BFLAGS) -c -o $(<) $(>)
}

rule UserObject
{
	switch $(>)
	{
	case *.scm	: Bigloo $(<) : $(>) ;
	case *		: ECHO "unknown suffix on" $(>) ;
	}
}
