Files
xen/tools/ocaml/libs/xs/Makefile
T
Juergen Gross bc23a49d13 tools: replace @xxx@ markers at build time
Use the apply-build-vars make macro to replace the @xxx@ markers in
most *.in files only at build time.

As some of the markers are local to tools/configure, introduce
config/Tools-paths.mk.in and add the related make variables to it.
Add Tools-paths to the PATH_FILES make variable in order to include
the definitions for replacing them in the *.in files.

Add the generated files to the distclean target.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2025-11-21 15:51:49 +00:00

56 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!
IN_TARGETS := paths.ml
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)
$(foreach file,$(IN_TARGETS),$(eval $(call apply-build-vars,$(file))))
$(OBJS): $(IN_TARGETS)
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
.PHONY: distclean
$(RM) $(IN_TARGETS)
include $(OCAML_TOPLEVEL)/Makefile.rules