summaryrefslogtreecommitdiff
path: root/debian/rules
blob: b9419d7d359c69154ec739e29136367f907dc03d (plain)
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
#!/usr/bin/make -f
# -*- makefile -*-

# Build for multiarch.
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

# Avoid overlinking and reduce library dependencies.
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

# Harden SML executables.
export MLTONARGS := \
	-cc-opt "$(shell dpkg-buildflags --get CPPFLAGS) \
		$(shell dpkg-buildflags --get CFLAGS)" \
	-link-opt "$(shell dpkg-buildflags --get LDFLAGS)"

%:
	dh $@ --parallel --with autoreconf

.PHONY: override_dh_auto_configure
override_dh_auto_configure:
	LIB=/usr/lib/$(DEB_HOST_MULTIARCH) \
		SRCLIB=/usr/share/urweb dh_auto_configure --

.PHONY: override_dh_auto_build
override_dh_auto_build:
	make

.PHONY: override_dh_auto_build-indep
override_dh_auto_build-indep:
	cd doc && make manual.pdf

.PHONY: override_dh_builddeb
override_dh_builddeb:
	dh_builddeb -- -Zxz -z9