.PHONY: clean check

################################################
# Configuration.  You may want to modify any of these configuration
# variables.
#

#
# This project requires ocamlfind (default - false).
#
USE_OCAMLFIND = true
#
OCAMLPACKS[] =
    oUnit
    extlib


if $(not $(OCAMLFIND_EXISTS))
   eprintln('This project requires ocamlfind, but is was not found.')
   eprintln('You need to install ocamlfind and run "omake --configure".')
   exit 1

#
# Include path
#
OCAMLINCLUDES += ../src/

#
# Compile native or byte code?
#
# The default values are defined as follows:
#
NATIVE_ENABLED = $(OCAMLOPT_EXISTS)
BYTE_ENABLED = true

#
# Various options
#

OCAMLPPFLAGS +=
OCAMLDEPFLAGS += $(OCAMLPPFLAGS)

################################################
# Build an OCaml program
#

FILES[] =
	testtbl
	util
	astUtil
	test_asm
	test_module
	test_ast
	test_base
	test_bytes
	test_bindcheck
	test_pset
	test_closuretrans
	test_clostrans
	test_codegen_expr
	test_codegen_klass
	test_codegen_stmt
	test_cpool
	test_hList
	test_lexer
	test_lisp
	test_sexp
	test_abc
	test_tuple
	test_varResolve
	test_interCode

OCAMLINCLUDES += ../../base/
OCAML_LIBS += ../../base/base

PROGRAM = runner
OCAML_LIBS += ../src/habc-scm

OCAML_OTHER_LIBS +=

OCamlProgram($(PROGRAM), $(FILES))

#############################################################
#
# PHONY Target
#
.DEFAULT: check

check: $(PROGRAM)$(EXE)
	./$(PROGRAM)$(EXE) | ounit-postproc

clean:
	ocaml-clean $(PROGRAM)
