.PHONY: clean

########################################################################
# OCaml configuration.
#
#

#
# This project requires ocamlfind
#
USE_OCAMLFIND = true
OCAMLPACKS[] =
	extlib
	xml-light


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


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

#
# Various options
#
# OCAMLFLAGS    +=
# OCAMLCFLAGS   +=
# OCAMLOPTFLAGS +=
# OCAML_LINK_FLAGS +=
# OCAML_BYTE_LINK_FLAGS +=
# OCAML_NATIVE_LINK_FLAGS +=


################################################
#
# Camlp4 flags
#

CAMLP4FILES[] =
	../camlp4/pa_oo.cmo

OCAMLPPFLAGS  += -pp 'camlp4o ../camlp4/pa_oo.cmo'
OCAMLDEPFLAGS += $(OCAMLPPFLAGS)
.SCANNER: scan-ocaml-%.ml: %.ml $(CAMLP4FILES)

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

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

FILES[] =
	abc
	byte
	code
	disasm
	easyXml
	swfmill
	parsec
	code

PROGRAM = habc-xml

OCamlProgram($(PROGRAM), main $(FILES))
OCamlLibrary($(PROGRAM), $(FILES))

.DEFAULT: $(PROGRAM)$(EXE)

clean:
	ocaml-clean $(PROGRAM)$(EXE)
