Generate *.cmx targets only if a native OCaml compiler exists

This commit is contained in:
Hilko Bengen
2014-09-14 21:21:25 +02:00
parent 50d5d4b723
commit 7039d0e7f6
8 changed files with 18 additions and 0 deletions

View File

@@ -185,8 +185,10 @@ endif
$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
.ml.cmo:
$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
if HAVE_OCAMLOPT
.ml.cmx:
$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -c $< -o $@
endif
# Manual pages and HTML files for the website.

View File

@@ -139,8 +139,10 @@ endif
$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
.ml.cmo:
$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
if HAVE_OCAMLOPT
.ml.cmx:
$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -c $< -o $@
endif
# automake will decide we don't need C support in this file. Really
# we do, so we have to provide it ourselves.

View File

@@ -118,8 +118,10 @@ endif
$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
.ml.cmo:
$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
if HAVE_OCAMLOPT
.ml.cmx:
$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -c $< -o $@
endif
# This OCaml module has to be generated by make (configure will put
# unexpanded prefix macro in).

View File

@@ -147,8 +147,10 @@ endif
$(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \
$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
if HAVE_OCAMLOPT
%.opt: %.cmx mlguestfs.cmxa
$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cmxa $< -o $@
endif
check-valgrind:
$(MAKE) VG="$(top_builddir)/run @VG@" check
@@ -160,10 +162,12 @@ guestfs.cmo: guestfs.ml
$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -package unix -c $< -o $@
%.cmo: %.ml mlguestfs.cma
$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -package unix -c $< -o $@
if HAVE_OCAMLOPT
guestfs.cmx: guestfs.ml
$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -package unix -c $< -o $@
%.cmx: %.ml mlguestfs.cmxa
$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -package unix -c $< -o $@
endif
depend: .depend

View File

@@ -94,8 +94,10 @@ endif
$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
.ml.cmo:
$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
if HAVE_OCAMLOPT
.ml.cmx:
$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -c $< -o $@
endif
# automake will decide we don't need C support in this file. Really
# we do, so we have to provide it ourselves.

View File

@@ -95,8 +95,10 @@ virt_sparsify_LINK = \
$(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
.ml.cmo:
$(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
if HAVE_OCAMLOPT
.ml.cmx:
$(OCAMLFIND) ocamlopt $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
endif
# Manual pages and HTML files for the website.

View File

@@ -155,8 +155,10 @@ endif
$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
.ml.cmo:
$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
if HAVE_OCAMLOPT
.ml.cmx:
$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -c $< -o $@
endif
# automake will decide we don't need C support in this file. Really
# we do, so we have to provide it ourselves.

View File

@@ -164,8 +164,10 @@ virt_v2v_LINK = \
$(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
.ml.cmo:
$(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
if HAVE_OCAMLOPT
.ml.cmx:
$(OCAMLFIND) ocamlopt $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
endif
# Data directory.