aboutsummaryrefslogtreecommitdiffstats
path: root/tools/ocaml/common.make
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-05-06 11:05:22 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-05-06 11:05:22 +0100
commitd236f2c2449bf963b80d08b6ce40d40be6e0529b (patch)
tree672a79b25cf7d0cd024b5f440220b684c7031950 /tools/ocaml/common.make
parentf44af660412c358c2fd8c9fd15496b4b6e0018d7 (diff)
downloadxen-d236f2c2449bf963b80d08b6ce40d40be6e0529b.tar.gz
xen-d236f2c2449bf963b80d08b6ce40d40be6e0529b.tar.bz2
xen-d236f2c2449bf963b80d08b6ce40d40be6e0529b.zip
ocaml: Add Makefile rules.
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
Diffstat (limited to 'tools/ocaml/common.make')
-rw-r--r--tools/ocaml/common.make28
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/ocaml/common.make b/tools/ocaml/common.make
new file mode 100644
index 0000000000..3b14dfbcc8
--- /dev/null
+++ b/tools/ocaml/common.make
@@ -0,0 +1,28 @@
+CC ?= gcc
+OCAMLOPT ?= ocamlopt
+OCAMLC ?= ocamlc
+OCAMLMKLIB ?= ocamlmklib
+OCAMLDEP ?= ocamldep
+OCAMLLEX ?= ocamllex
+OCAMLYACC ?= ocamlyacc
+
+CFLAGS ?= -Wall -fPIC -O2
+
+XEN_ROOT ?= $(TOPLEVEL)/../xen-unstable.hg
+XEN_DIST_ROOT ?= $(XEN_ROOT)/dist/install
+CFLAGS += -I$(XEN_DIST_ROOT)/usr/include
+
+OCAMLOPTFLAG_G := $(shell $(OCAMLOPT) -h 2>&1 | sed -n 's/^ *\(-g\) .*/\1/p')
+OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -cc $(CC) -w F -warn-error F
+OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F
+
+#LDFLAGS = -cclib -L./
+
+DESTDIR ?= /
+VERSION := echo 0.0
+
+OCAMLABI = $(shell $(OCAMLC) -version)
+OCAMLLIBDIR = $(shell $(OCAMLC) -where)
+OCAMLDESTDIR ?= $(OCAMLLIBDIR)
+
+o= >$@.new && mv -f $@.new $@