Import Debian changes 20180207-1
[hcoop/debian/mlton.git] / debian / rules
CommitLineData
a441e504
WT
1#!/usr/bin/make -f
2
3include /usr/share/cdbs/1/rules/debhelper.mk
4include /usr/share/cdbs/1/class/makefile.mk
5include /usr/share/cdbs/1/rules/patchsys-quilt.mk
6
7# MLton compiles optimized, debug, and pic versions on its own.
8DEB_MAKE_INVOKE = $(DEB_MAKE_ENVVARS) make -C $(DEB_BUILDDIR)
9
10# The MLton guide is html. Don't compress example .sml files.
11DEB_COMPRESS_EXCLUDE_ALL = mlton/guide .sml
12
13DEB_MAKE_CLEAN_TARGET = clean
14DEB_MAKE_BUILD_TARGET = all docs
15DEB_MAKE_INSTALL_TARGET = install DESTDIR=$(CURDIR)/debian/tmp/ PREFIX=/usr
16DEB_MAKE_CHECK_TARGET = check
17
18DEB_DH_STRIP_ARGS_DEFAULT = --no-automatic-dbgsym
19
20# Useful when inspecting build logs
21common-configure-arch::
22 free
23
24# Move MLton target to per-architecture path
25common-install-arch::
26 mv $(CURDIR)/debian/tmp/usr/lib/mlton/targets/self $(CURDIR)/debian/tmp/usr/lib/mlton/targets/$(DEB_HOST_MULTIARCH)
27 ln -s $(DEB_HOST_MULTIARCH) $(CURDIR)/debian/tmp/usr/lib/mlton/targets/self
28
29# Remove licenses and empty directories to appease lintian
30common-install-indep::
31 cp README.adoc README
32 rm -f $(CURDIR)/debian/tmp/usr/lib/mlton/sml/smlnj-lib/HTML4/helper.py # we don't need a python dependency for an unrelated helper script
33 rm -f $(CURDIR)/debian/tmp/usr/lib/mlton/sml/smlnj-lib/HTML4/tests/test001.html # would reveal user IP if loaded due to external validation image
34 find $(CURDIR)/debian/tmp -type d -empty -delete
35 if test -n "$(DEB_ISNATIVE)"; then mv \
36 $(CURDIR)/debian/tmp/usr/share/doc/mlton/changelog \
37 $(CURDIR)/debian/tmp/usr/share/doc/mlton/changelog.PreviousRelease; \
38 fi