summaryrefslogtreecommitdiffstats
path: root/debian/rules
blob: e91561b655b54353bcca5daf9fcd9903359b7569 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk

ifneq (,$(filter $(DEB_HOST_ARCH), armel x32))
	PLATFORM = --platform=unknown
endif

ifeq ($(DEB_HOST_ARCH),armhf)
	DEB_CFLAGS_MAINT_APPEND = -march=armv7-a+fp
	export DEB_CFLAGS_MAINT_APPEND
endif

ifeq ($(DEB_HOST_ARCH), i386)
	PLATFORM = --disable-sse
endif

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
	NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
else
	NUMJOBS = 1
endif

%:
	dh ${@}

execute_after_dh_auto_clean:
	# remove generated files
	rm -f doc/*.gz src/*.a src/*.so
	for FILE in $$(find . -type f -name "*.in"); \
	do \
		rm -f "$$(dirname "$${FILE}")"/"$$(basename "$${FILE}" .in)"; \
	done

override_dh_auto_configure:
	dh_auto_configure -- \
		--prefix=/usr \
		--libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
		--includedir=/usr/include \
		--mandir=/usr/share/man \
		--cores=2 \
		$(PLATFORM)

override_dh_auto_test:
ifneq (,$(filter $(DEB_HOST_ARCH), amd64 arm64 i386))
ifneq ($(NUMJOBS), 1)
	$(MAKE) -j1 check
endif
endif