summaryrefslogtreecommitdiff
path: root/debian/rules
blob: 0fe9e992cd9d9c7671d19c7754936824ceb212bd (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/make -f

include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/architecture.mk


multi_CC := -m32
multi_libdir := /usr/lib32
libdir := /usr/lib/$(DEB_HOST_MULTIARCH)

%:
	dh $@

override_dh_install:
	dh_install
	dh_install -p libelfg0 "$(libdir)/*.so.*"
	dh_install -p libelfg0-dev "$(libdir)/*.a" /usr/lib/$(DEB_HOST_MULTIARCH)/
	dh_install -p libelfg0-dev "$(libdir)/pkgconfig" /usr/lib/$(DEB_HOST_MULTIARCH)/
	dh_install -p libelfg0-dev "/usr/include"

override_dh_link:
	dh_link
	dh_link -p libelfg0-dev $(libdir)/libelf.so.0 \
		/usr/lib/$(DEB_HOST_MULTIARCH)/libelf.so

override_dh_installdocs:
	dh_installdocs --link-doc=libelfg0

override_dh_auto_configure: configure-stamp configure_multi-stamp
override_dh_auto_build: build-stamp build_multi-stamp
override_dh_auto_install: install-stamp install_multi-stamp
override_dh_auto_clean:
	rm -rf native multi

configure-stamp:
	dh_auto_configure -B native -- \
		--libdir=$(libdir) \
		--enable-shared \
		--enable-compat
	touch $@

configure_multi-stamp:
	CC="$(CC) $(multi_CC)" \
	dh_auto_configure -B multi -- \
		--libdir=$(multi_libdir) \
		--enable-shared \
		--enable-compat
	touch $@

build-stamp:
	dh_auto_build -B native
	touch $@

build_multi-stamp:
	dh_auto_build -B multi
	touch $@

install-stamp:
	cd native && $(MAKE) instroot=$(CURDIR)/debian/tmp install
	touch $@

install_multi-stamp:
	cd multi && $(MAKE) instroot=$(CURDIR)/debian/tmp install
	touch $@