OCAMLFIND = @OCAMLFIND@
-ifneq ($(OCAMLFIND),)
OCAMLCPACKAGES := -package unix -I ../libvirt
OCAMLCFLAGS := -g
OCAMLCLIBS := -linkpkg
OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
OCAMLOPTFLAGS :=
OCAMLOPTLIBS := $(OCAMLCLIBS)
-else
-OCAMLCINCS := -I ../libvirt
-OCAMLCFLAGS := -g
-OCAMLCLIBS := unix.cma
-OCAMLOPTINCS := $(OCAMLCINCS)
-OCAMLOPTFLAGS :=
-OCAMLOPTLIBS := unix.cmxa
-endif
export LIBRARY_PATH=../libvirt
export LD_LIBRARY_PATH=../libvirt
BYTE_TARGETS := list_domains node_info
-OPT_TARGETS := list_domains.opt node_info.opt
+OPT_TARGETS := $(BYTE_TARGETS:%=%.opt)
all: $(BYTE_TARGETS)
opt: $(OPT_TARGETS)
-ifneq ($(OCAMLFIND),)
list_domains: list_domains.cmo
$(OCAMLFIND) ocamlc \
$(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
$(OCAMLFIND) ocamlopt \
$(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
../libvirt/mllibvirt.cmxa -o $@ $<
-else
-list_domains: list_domains.cmo
- $(OCAMLC) \
- $(OCAMLCINCS) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
- ../libvirt/mllibvirt.cma -o $@ $<
-
-list_domains.opt: list_domains.cmx
- $(OCAMLOPT) \
- $(OCAMLOPTINCS) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
- ../libvirt/mllibvirt.cmxa -o $@ $<
-
-node_info: node_info.cmo
- $(OCAMLC) \
- $(OCAMLCINCS) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
- ../libvirt/mllibvirt.cma -o $@ $<
-
-node_info.opt: node_info.cmx
- $(OCAMLOPT) \
- $(OCAMLOPTINCS) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
- ../libvirt/mllibvirt.cmxa -o $@ $<
-endif
install: