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