# Copyright (C) 2005, The Perl Foundation.
# $Id: root.in 17096 2007-02-20 20:20:48Z paultcochrane $

# Makefile for languages/regex

# Setup of some commands
PARROT = ..@slash@..@slash@parrot@exe@
PERL = @perl@
RM_F = @rm_f@
YAPP = yapp

all : lib/Regex/Grammar.pm regex-compiler.pbc

lib/Regex/Grammar.pm : lib/Regex/Grammar.y
	$(YAPP) -s -m Regex::Grammar -o $@ lib/Regex/Grammar.y

regex-compiler.pbc : regex-compiler.pir
	$(PARROT) -o regex-compiler.pbc regex-compiler.pir

# Note: These tend to be in the order of the latest thing I've been
# working on to the oldest, so that I see the failures quicker.
.PHONY: test
test :
	-$(PERL) test.pl t/basic/backopt.t
	-$(PERL) test.pl t/basic/quantindex.t
	-$(PERL) test.pl t/basic/literal.t
	-$(PERL) test.pl t/basic/optional.t
	-$(PERL) test.pl t/basic/group.t
	-$(PERL) test.pl t/basic/a.t
	-$(PERL) test.pl t/basic/star.t
	-$(PERL) test.pl t/basic/scanstar.t
	-$(PERL) test.pl t/basic/alt.t
	-$(PERL) test.pl t/basic/scanalt.t
	-$(PERL) test.pl t/basic/staralt.t
	-$(PERL) test.pl t/basic/plus.t
	-$(PERL) test.pl t/basic/example.t

# This is a TODO test -- currently, it loops forever. It will require
# adding a check to the matcher that it is making progress. Or
# something. I need to look at this again.
#
#	$(PERL) test.pl t/basic/infinite.t

CLEANERS = \
    "*.pbc" \
    test.pir

clean:
	$(RM_F) $(CLEANERS)

distclean: clean
	$(RM_F) Makefile

