#!/usr/bin/make -f include /usr/share/ocaml/ocamlvars.mk PKGNAME = libcamljava-ocaml-dev DESTDIR := $(CURDIR)/debian/$(PKGNAME)/$(OCAML_STDLIB_DIR)/camljava DEFJAVA_DIR = /usr/lib/jvm/default-java # /usr/lib/jvm/default-java/jre/lib/amd64/server/libjvm.so -> amd64 # XXX horrible way to retrieve Java arch, but unfortunately there is no # reliable mapping available yet (see #558109) JAVA_ARCH := $(shell find $(DEFJAVA_DIR)/ -path '*jre/lib/*/server/libjvm.so' | cut -f 8 -d /) BUILD_TARGET_FLAGS = JDKHOME=$(DEFJAVA_DIR) BUILD_TARGET_FLAGS += ARCH=$(JAVA_ARCH) DEB_MAKE_INSTALL_TARGET = install CAMLJAVALIB=$(DESTDIR) ifeq ($(OCAML_HAVE_OCAMLOPT),yes) DEB_MAKE_BUILD_TARGET = all $(BUILD_TARGET_FLAGS) else DEB_MAKE_BUILD_TARGET = byte $(BUILD_TARGET_FLAGS) endif %: dh $@ --with=ocaml override_dh_auto_build: $(MAKE) $(DEB_MAKE_BUILD_TARGET) override_dh_auto_install: $(MAKE) $(DEB_MAKE_INSTALL_TARGET)