1 2 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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1
include /usr/share/dpkg/architecture.mk
include /usr/share/ocaml/ocamlvars.mk
%:
dh $@ --with ocaml
# to test a bytecode build on an architecture with ocamlopt, set this to "yes"
BYTECODE = $(shell [ -x /usr/bin/ocamlopt ] || echo yes)
OCAML_NATIVE = $(if $(BYTECODE),false,true)
OCAMLBUILD_CFG = \
OCAMLBUILD_PREFIX=/usr \
OCAMLBUILD_BINDIR=/usr/bin \
OCAMLBUILD_LIBDIR=$(OCAML_STDLIB_DIR) \
OCAMLBUILD_MANDIR=/usr/share/man
# these variables from your shell can interfere with tests. it should not be
# necessary for buildds, but do it here for convenience.
unexport OCAMLPARAM
unexport OCAML_TOPLEVEL_PATH
ifeq ($(DEB_HOST_ARCH),powerpc)
# Suppress "bss-plt forced" warnings from ld
# see https://github.com/ocaml/ocamlbuild/issues/254
export PATH := $(CURDIR)/debian/bin:$(PATH)
endif
override_dh_auto_configure:
$(MAKE) $(OCAMLBUILD_CFG) OCAML_NATIVE=$(OCAML_NATIVE) configure
override_dh_auto_install:
dh_auto_install -- CHECK_IF_PREINSTALLED=false
cd debian/ocamlbuild/usr/bin && rm -f ocamlbuild.byte ocamlbuild.native
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
mkdir -p _tmp
cp plugin-lib/* bin/*.cm* $(wildcard bin/*.o) _tmp
$(MAKE) test
rm -rf _tmp
endif
override_dh_ocaml:
dh_ocaml --runtime-map=ocamlbuild
|