Files
xen/tools/ocaml/libs/xc/Makefile
T
Ian Jackson 006a69d25c tools/ocaml: Introduce xenctrl ABI build-time checks
c/s f089fddd94 broke the Ocaml ABI by renumering
XEN_SYSCTL_PHYSCAP_directio without adjusting the Ocaml
physinfo_cap_flag enumeration.

Add build machinery which will check the ABI correspondence.

This will result in a compile time failure whenever constants get
renumbered/added without a compatible adjustment to the Ocaml ABI.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <Andrew.Cooper3@citrix.com>
2019-09-10 14:44:33 +01:00

42 lines
969 B
Makefile

TOPLEVEL=$(CURDIR)/../..
XEN_ROOT=$(TOPLEVEL)/../..
include $(TOPLEVEL)/common.make
CFLAGS += -I../mmap $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
CFLAGS += $(APPEND_CFLAGS)
OCAMLINCLUDE += -I ../mmap
OBJS = xenctrl
INTF = xenctrl.cmi
LIBS = xenctrl.cma xenctrl.cmxa
LIBS_xenctrl = $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest)
xenctrl_OBJS = $(OBJS)
xenctrl_C_OBJS = xenctrl_stubs
OCAML_LIBRARY = xenctrl
all: $(INTF) $(LIBS)
libs: $(LIBS)
.PHONY: install
install: $(LIBS) META
mkdir -p $(OCAMLDESTDIR)
$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenctrl
$(OCAMLFIND) install -destdir $(OCAMLDESTDIR) -ldconf ignore xenctrl META $(INTF) $(LIBS) *.a *.so *.cmx
.PHONY: uninstall
uninstall:
$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenctrl
xenctrl_stubs.o: xenctrl_abi_check.h
xenctrl_abi_check.h: abi-check xenctrl_stubs.c xenctrl.ml
$(PERL) -w $^ >$@.tmp && mv -f $@.tmp $@
GENERATED_FILES += xenctrl_abi_check.h
include $(TOPLEVEL)/Makefile.rules