#
# Makefile
#
# $Id: scheme.in,v 1.6 2003/08/12 15:36:16 scog Exp $
#

PERL = ${perl}
RM_F = ${rm_f}

DIR=languages/scheme
TOOL_DIR=../..
ASM = ../../parrot
SCHEMEC=$(PERL) schemec
INTERP=./${test_prog}

#
# Default target:
#

default: test
#	echo "make: Makefile: no default target"

foo: foo.scheme schemec
	$(SCHEMEC) foo.scheme > foo.pasm
	$(ASM) -o foo.pbc foo.pasm
	cd $(TOOL_DIR); $(INTERP) $(DIR)/foo.pbc
	cat foo.pasm

#
# Compilation:
#

test.pasm: test.scheme schemec
	$(SCHEMEC) test.scheme > test.pasm

and.pasm: and.scheme schemec
	$(SCHEMEC) and.scheme > and.pasm

foo.pasm: foo.scheme schemec
	$(SCHEMEC) foo.scheme > foo.pasm

#
# Assembly:
#

test.pbc: test.pasm
	$(ASM) -o $@ $?

and.pbc: and.pasm
	$(ASM) -o $@ $?

foo.pbc: foo.pasm
	$(ASM) -o $@ $?

#
# Other targets:
#

all: test.pbc and.pbc foo.pbc

clean:
	$(RM_F) foo.pasm foo.pbc \
	        t/*/*.pasm \
	        t/*/*.pbc \
	        t/*/*.scheme \
	        t/*/*.out

over:
	@$(MAKE) clean
	@$(MAKE) all

test:
	$(PERL) t/harness
#	cd $(TOOL_DIR); $(INTERP) $(DIR)/test.pbc
#	cd $(TOOL_DIR); $(INTERP) $(DIR)/and.pbc
#	cd $(TOOL_DIR); $(INTERP) $(DIR)/foo.pbc

#
# End of file.
#
