#
# Makefile
#
# $Id: miniperl.in,v 1.5 2003/10/23 02:04:38 mrjoltcola Exp $
#

PERL=${perl}
DIR=languages/miniperl
TOOL_DIR=../..
IMCC=../../parrot${exe}
ASM=$(IMCC) -a --output-pbc
MINIPERLC=$(PERL) miniperlc
INTERP=./${test_prog}

#
# Default target:
#

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

foo: foo.mpl miniperlc
	$(MINIPERLC) foo.mpl > foo.pasm
	$(ASM) -o foo.pbc foo.pasm
	cd $(TOOL_DIR); $(INTERP) $(DIR)/foo.pbc
	cat foo.pasm

#
# Compilation:
#

test.pasm: test.mpl miniperlc
	$(MINIPERLC) test.mpl > test.pasm

and.pasm: and.mpl miniperlc
	$(MINIPERLC) and.mpl > and.pasm

foo.pasm: foo.mpl miniperlc
	$(MINIPERLC) foo.mpl > 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/*/*.mpl \
t/*/*.out

over:
	@make clean
	@make all

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