Makefile 1.08 KB
Newer Older
1
TOPLEVEL=$(CURDIR)/../..
2
XEN_ROOT=$(TOPLEVEL)/../..
Keir Fraser's avatar
Keir Fraser committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
include $(TOPLEVEL)/common.make

OBJS = syslog log logs
INTF = log.cmi logs.cmi syslog.cmi
LIBS = log.cma log.cmxa

all: $(INTF) $(LIBS) $(PROGRAMS)

bins: $(PROGRAMS)

libs: $(LIBS)

log.cmxa: libsyslog_stubs.a $(foreach obj,$(OBJS),$(obj).cmx)
	$(call mk-caml-lib-native, $@, -cclib -lsyslog_stubs, $(foreach obj,$(OBJS),$(obj).cmx))

log.cma: $(foreach obj,$(OBJS),$(obj).cmo)
	$(call mk-caml-lib-bytecode, $@, -dllib dllsyslog_stubs.so -cclib -lsyslog_stubs, $(foreach obj,$(OBJS),$(obj).cmo))

syslog_stubs.a: syslog_stubs.o
	$(call mk-caml-stubs, $@, $+)

libsyslog_stubs.a: syslog_stubs.o
	$(call mk-caml-lib-stubs, $@, $+)

logs.mli : logs.ml
	$(OCAMLC) -i $(OCAMLCFLAGS) $< > $@

syslog.mli : syslog.ml
	$(OCAMLC) -i $< > $@

.PHONY: install
install: $(LIBS) META
Ian Campbell's avatar
Ian Campbell committed
35 36 37
	mkdir -p $(OCAMLDESTDIR)
	ocamlfind remove -destdir $(OCAMLDESTDIR) log
	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore log META $(INTF) $(LIBS) *.a *.so *.cmx
Keir Fraser's avatar
Keir Fraser committed
38 39 40

.PHONY: uninstall
uninstall:
Ian Campbell's avatar
Ian Campbell committed
41
	ocamlfind remove -destdir $(OCAMLDESTDIR) log
Keir Fraser's avatar
Keir Fraser committed
42 43 44

include $(TOPLEVEL)/Makefile.rules