# $Id: /mirror/trunk/config/gen/makefiles/tge.in 35450 2009-01-11T16:06:27.204688Z fperrad  $

.SUFFIXES : .pir .pbc

# Setup some commands
PERL     = @perl@
RM_F     = @rm_f@
PARROT   = ../../parrot@exe@

# Where to put things
PARROT_LIBRARY    = ../../runtime/parrot/library
PERL6GRAMMAR      = $(PARROT_LIBRARY)/PGE/Perl6Grammar.pbc

# the default target
all: $(PARROT_LIBRARY)/TGE.pbc

$(PARROT_LIBRARY)/TGE.pbc: TGE.pir TGE/Rule.pbc TGE/Parser.pbc TGE/Grammar.pbc TGE/Compiler.pbc TGE/Tree.pbc
	$(PARROT) -o $(PARROT_LIBRARY)/TGE.pbc --output-pbc TGE.pir

.pir.pbc :
	$(PARROT) -o $@ --output-pbc $<

TGE/Parser.pir: TGE/Parser.pg
	$(PARROT) $(PERL6GRAMMAR) --output=TGE//Parser.pir TGE//Parser.pg

# This is a listing of all targets, that are meant to be called by users
help:
	@echo ""
	@echo "Following targets are available for the user:"
	@echo ""
	@echo "  all:               TGE.pbc"
	@echo "                     This is the default."
	@echo "Testing:"
	@echo "  test:              Run the test suite."
	@echo "  testclean:         Clean up test results."
	@echo ""
	@echo "Cleaning:"
	@echo "  clean:             Basic cleaning up."
	@echo "  realclean:         Removes also files generated by 'Configure.pl'"
	@echo "  distclean:         Removes also anything built, in theory"
	@echo ""
	@echo "Misc:"
	@echo "  help:              Print this help message."
	@echo ""

test: all
	prove -r ../../t/compilers/tge

testclean:
	$(RM_F) "../../t/compilers/tge/*.pir"

clean: testclean
	$(RM_F) TGE/Rule.pbc \
	    TGE/Parser.pir \
	    TGE/Parser.pbc \
	    TGE/Tree.pbc \
	    TGE/Grammar.pbc \
	    TGE/Compiler.pbc \
	    $(PARROT_LIBRARY)/TGE.pbc

realclean: clean
	$(RM_F) Makefile

distclean: realclean
