mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
They are two competiting spelling for the variable holding the path to
"tools/ocaml", $(TOPLEVEL) and $(OCAML_TOPLEVEL). The "Makefile.rules"
which is included in all ocaml Makefiles have one rule which make use
of that variable which is then sometime unset. When building
"ocaml/xenstored", make isn't capable of generating ".ocamldep.make"
because $(TOPLEVEL) isn't defined in this case.
This can fail with an error like this when paths.ml have been
regenerated:
Error: Files define.cmx and paths.cmx
make inconsistent assumptions over interface Paths
This patch fix ".ocamldep.make" rule by always spelling the variable
$(OCAML_TOPLEVEL).
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
52 lines
1.3 KiB
Makefile
52 lines
1.3 KiB
Makefile
OCAML_TOPLEVEL=$(CURDIR)/../..
|
|
XEN_ROOT=$(OCAML_TOPLEVEL)/../..
|
|
include $(OCAML_TOPLEVEL)/common.make
|
|
|
|
OCAMLINCLUDE += -I ../xb/
|
|
OCAMLOPTFLAGS += -for-pack Xenstore
|
|
|
|
.NOTPARALLEL:
|
|
# Ocaml is such a PITA!
|
|
|
|
PREINTF = xsraw.cmi xst.cmi
|
|
PREOBJS = queueop xsraw xst
|
|
PRELIBS = $(foreach obj, $(PREOBJS),$(obj).cmo) $(foreach obj,$(PREOJBS),$(obj).cmx)
|
|
OBJS = paths queueop xsraw xst xs
|
|
INTF = xsraw.cmi xst.cmi xs.cmi
|
|
LIBS = xenstore.cma xenstore.cmxa
|
|
|
|
all: $(PREINTF) $(PRELIBS) $(INTF) $(LIBS) $(PROGRAMS)
|
|
|
|
bins: $(PROGRAMS)
|
|
|
|
libs: $(LIBS)
|
|
|
|
xenstore_OBJS = xenstore
|
|
OCAML_NOC_LIBRARY = xenstore
|
|
|
|
xenstore.cmx : $(foreach obj, $(OBJS), $(obj).cmx)
|
|
$(E) " CMX $@"
|
|
$(Q)$(OCAMLOPT) -pack -o $@ $^
|
|
|
|
xenstore.cmo : $(foreach obj, $(OBJS), $(obj).cmo)
|
|
$(E) " CMO $@"
|
|
$(Q)$(OCAMLC) -pack -o $@ $^
|
|
|
|
|
|
.PHONY: install
|
|
install: $(LIBS) META
|
|
mkdir -p $(OCAMLDESTDIR)
|
|
$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenstore
|
|
$(OCAMLFIND) install -destdir $(OCAMLDESTDIR) -ldconf ignore xenstore META $(LIBS) xenstore.cmo xenstore.cmi xenstore.cmx *.a
|
|
|
|
.PHONY: uninstall
|
|
uninstall:
|
|
$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenstore
|
|
|
|
include $(OCAML_TOPLEVEL)/Makefile.rules
|
|
|
|
genpath-target = $(call buildmakevars2module,paths.ml)
|
|
$(eval $(genpath-target))
|
|
|
|
GENERATED_FILES += paths.ml
|