# Copyright (C) 2001-2005, The Perl Foundation.
# $Id: /mirror/trunk/languages/parrot_compiler/config/makefiles/root.in 28688 2008-06-23T00:33:41.905243Z coke  $

# Makefile for languages/parrot_compiler

# Set up commands
PERL          = @perl@
RM_F          = @rm_f@
PARROT        = ../../@test_prog@@exe@
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@

# Set up directories
BUILD_DIR     = @build_dir@

default: all
all : parrot.pbc parrot_compiler.pbc parrot_compiler.pasm

help :
	@echo ""
	@echo "Following targets are available for the user:"
	@echo ""
	@echo "  all:               parrot_compiler.pbc and other drivers"
	@echo "                     This is the default."
	@echo ""
	@echo "  test:              run the test suite,"
	@echo ""
	@echo "  clean:             clean up temporary files"
	@echo ""
	@echo "  realclean:         clean up generated files"
	@echo ""
	@echo "  help:              print this help message"

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

test : all
	cd .. && $(PERL) -I../lib parrot_compiler/t/harness

clean :
	$(RM_F) "*.pbc" parrot_compiler.pasm "t/*/*.code" "t/*/*.out" "t/*/*.pbc"

realclean : clean
	$(RM_F) Makefile core "*.pbc"

parrot.pbc : parrot.pasm
	$(PARROT) -o parrot.pbc parrot.pasm

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

parrot_compiler.pasm : parrot_compiler.pir
	$(PARROT) -o parrot_compiler.pasm parrot_compiler.pir

