Source

cmigrep-fork / OMakefile

# How-to-build using OMake
#
# yes no | omake --install # to create OMakeroot for the first time

# If OMakeroot is here, include OMyMakefile
if $(file-exists OMakeroot)
   include OMyMakefile
   export

############
# OCaml source directory

# OCAML_SOURCE_DIR=WHERE_YOU_HAVE_THE_SOURCE_OF_OCAML
if $(not $(defined OCAML_SOURCE_DIR)):
    println(You need OCaml compiler source code and specify OCAML_SOURCE_DIR variable.)
    exit 2

############

.PHONY: all install clean

OCAMLFLAGS= -annot

DEPENDS1[]=
  misc
  tbl
  config
  clflags
  terminfo
  ccomp
  warnings
  consistbl
  linenum
  location
  longident
  syntaxerr
  parser
  lexer
  parse
  printast
  unused_var
  ident
  path
  primitive
  types
  btype
  oprint
  subst
  predef
  datarepr
  env
  typedtree
  ctype
  printtyp
  includeclass
  mtype
  includecore
  includemod
  parmatch

DEPENDS2[]=
  typetexp
  stypes
  typecore
  typedecl
  typeclass
  typemod

if $(not $(test -e "$(OCAML_SOURCE_DIR)/typing/spot.ml")):
  DEPENDS=$(DEPENDS1) spot $(DEPENDS2)
  export
else
  DEPENDS=$(DEPENDS1) $(DEPENDS2)
  export

OCAMLINCLUDES += $(OCAML_SOURCE_DIR)/parsing $(OCAML_SOURCE_DIR)/typing $(OCAML_SOURCE_DIR)/utils

# dirty workarounds
OCAMLLINK += $(addsuffix .cmo, $(DEPENDS))
OCAMLOPTLINK += $(addsuffix .cmx, $(DEPENDS))

OCAMLPACKS[]=
	pcre
	findlib
	unix

MyOCamlProgram(cmigrep, cmigrep)