# -*- mode: makefile -*- 

######################################################################
# HAS Flags
######################################################################

# If defined to non-empty value, compiles also the MPFR interface
HAS_MPFR=1

# If defined to non-empty value, generates dynamic libraries.
# Do not forget to add -fPIC to CFLAGS and CFLAGS_DEBUG
HAS_SHARED=1

######################################################################
# Directories
######################################################################

# Where to *INSTALL* the package ($MLGMPIDL_PREFIX)/lib)
MLGMPIDL_PREFIX = 

# Where to find GMP ($(GMP_PREFIX)/include, ($GMP_PREFIX)/lib)
#
GMP_PREFIX = /usr

# Where to find MPFR ($(MPFR_PREFIX)/include, ($MPFR_PREFIX)/lib
# (needed if HAS_MPFR=1)
MPFR_PREFIX = /usr

# Where to find OCAML ($(CAML_PREFIX)/bin, $(CAML_PREFIX)/lib/ocaml, ...)
#
CAML_PREFIX = /usr

# Where to find CAMLIDL ($(CAMLIDL_PREFIX)/bin, $(CAMLIDL_PREFIX)/lib/ocaml, ...)
#
CAMLIDL_PREFIX = /usr

######################################################################
# Tools and Flags
######################################################################

# if defined to 1, the C stub lib referenced by the OCaml library is dynamic.
MLGMPIDL_SHARED=1

# C compiler
CC = gcc

# C compilation flags 
CFLAGS = \
-Wcast-qual -Wswitch -Werror-implicit-function-declaration \
-Wall -Wextra -Wundef -Wbad-function-cast -Wcast-align -Wstrict-prototypes \
-Wno-unused \
-fPIC \
-std=c99 \
-O3 -UNDEBUG

# C compilation flags in debug (or profile) mode
CFLAGS_DEBUG = \
-Wcast-qual -Wswitch -Werror-implicit-function-declaration \
-Wall -Wextra -Wundef -Wbad-function-cast -Wcast-align -Wstrict-prototypes \
-Wno-unused \
-fPIC \
-std=c99 \
-g -O0 -DNDEBUG

AR = ar
RANLIB = ranlib
SED = sed
M4 = m4
INSTALL = install
INSTALLd = install -d


OCAMLC = $(CAML_PREFIX)/bin/ocamlc.opt
OCAMLOPT = $(CAML_PREFIX)/bin/ocamlopt.opt

# ocamlc compilation flags
OCAMLFLAGS = -annot -g
# ocamlopt compilation flags
OCAMLOPTFLAGS = -annot -inline 20

OCAMLDEP = $(CAML_PREFIX)/bin/ocamldep
OCAMLLEX = $(CAML_PREFIX)/bin/ocamllex.opt
OCAMLYACC = $(CAML_PREFIX)/bin/ocamlyacc
OCAMLDOC = $(CAML_PREFIX)/bin/ocamldoc.opt
OCAMLMKTOP = $(CAML_PREFIX)/bin/ocamlmktop

CAMLIDL = $(CAMLIDL_PREFIX)/bin/camlidl

LATEX=latex
DVIPDF=dvipdf
MAKEINDEX=makeindex
TEXI2DVI=texi2dvi
TEXI2HTML=texi2html

