#############################################################
# 
# A part of Regexp/OCaml module.
# 
# (c) 2002-2003 Yutaka Oiwa. All Rights Reserved.
# 
# This file is distributed under the terms of the Q Public
# License version 1.0.
# 
#############################################################

OCAMLMAKEFILE = ../OCamlMakefile

SOURCES   = parse_regexp.mli parse_regexp.ml translator.ml
ADDITIONAL_SOURCES = ../common/version-filter.ml ../common/declare_once.ml ../common/declare_once.mli
RESULT    = pa_regexp_match
USE_CAMLP4 = 1

LIBINSTALL_FILES := $(RESULT).cma $(RESULT).cmo $(RESULT).cmi

all: byte-code-library pack-byte-code

install:	libinstall
uninstall:	libuninstall

libinstall: META

.PHONY: META
META:
	perl ../common/generate_meta.pl

clean:	clean-doc clean-test

test: all match-regexp-test \
      match-regexp-test2.ppo match-regexp-test3.ppo match-regexp-test4.ppo

TEST_MAKEOPTS=-f $(OCAMLMAKEFILE) SOURCES=match-regexp-test.ml \
	RESULT=match-regexp-test PACKS=pcre OCAMLLDFLAGS=

match-regexp-test: match-regexp-test.ml pa_regexp_match.cma
	rm -f match-regexp-test$(EXE)
	$(MAKE) $(TEST_MAKEOPTS) native-code

%.ppo: %.ml pa_regexp_match.cma
	camlp4o pr_o.cmo $*.ml > $*.ppo

clean-test:
	$(MAKE) $(TEST_MAKEOPTS) clean
	rm -f match-regexp-test?.ppo

-include $(OCAMLMAKEFILE)
-include ../common/Makefile.common
