.PHONY: all install clean uninstall

clean:
  rm -rf $(filter-proper-targets $(ls R, .))
  rm -rf *.omc

USE_OCAMLFIND = true
#
OCAMLPACKS[] = extlib
#    pack1
#    pack2
#
#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 +=

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

# MENHIR_ENABLED =true

# Various options

OCAMLFLAGS    += -g
OCAMLCFLAGS   += -g
# OCAMLOPTFLAGS +=
# OCAML_LINK_FLAGS +=
# OCAML_BYTE_LINK_FLAGS +=
# OCAML_NATIVE_LINK_FLAGS +=

################################################
# Generated files
#
# Workaround for the fact that ocamldep does not pay attention to .mll
# and .mly files.
#
OCamlGeneratedFiles(jdl_parser.ml jdl_lexer.ml)

FILES[] =
  jdl_lexer
  jdl_parser
  file_util
  syntax
  config
  lib
  cpp
  python
  ruby
  java
  parse
  main
  version


PROGRAM = jenerator
LIB = target
# OCAML_LIBS +=
# OCAML_CLIBS +=
OCAML_OTHER_LIBS += str unix
# OCAML_LIB_FLAGS +=
PREFIX = $(getenv PREFIX, /usr/local)

sh gen_version.sh

.DEFAULT: $(OCamlProgram $(PROGRAM), $(FILES))

OCamlLibrary($(LIB), $(FILES))

OCamlProgramInstall(install, $(PREFIX)/bin, $(PROGRAM), $(FILES))

uninstall:
  -rm $(PREFIX)/bin/$(PROGRAM)
