# $Id: /mirror/trunk/languages/forth/config/makefiles/root.in 28688 2008-06-23T00:33:41.905243Z coke  $

PARROT = ../../parrot@exe@
PERL   = @perl@
RM_RF  = @rm_rf@
RECONFIGURE   = $(PERL) @build_dir@/tools/dev/reconfigure.pl
#CONDITIONED_LINE(darwin):
#CONDITIONED_LINE(darwin):# MACOSX_DEPLOYMENT_TARGET must be defined for OS X compilation/linking
#CONDITIONED_LINE(darwin):export MACOSX_DEPLOYMENT_TARGET := @osx_version@

BUILD_DIR     = @build_dir@

DEPENDENCIES = \
    forth.pbc \
    tokenstream.pbc \
    variablestack.pbc \
    virtualstack.pbc


all: $(DEPENDENCIES)

# regenerate the Makefile
Makefile: config/makefiles/root.in
	cd $(BUILD_DIR) && $(RECONFIGURE) --step=gen::languages --languages=forth

prompt: all
	$(PARROT) forth.pbc

clean:
	$(RM_RF) $(DEPENDENCIES)

realclean: clean
	$(RM_RF) Makefile


forth.pbc: forth.pir words.pir
	$(PARROT) -o forth.pbc forth.pir

tokenstream.pbc: tokenstream.pir
	$(PARROT) -o tokenstream.pbc tokenstream.pir

variablestack.pbc: variablestack.pir
	$(PARROT) -o variablestack.pbc variablestack.pir

virtualstack.pbc: virtualstack.pir
	$(PARROT) -o virtualstack.pbc virtualstack.pir

test: all
	$(PERL) t/harness
