File: rules

package info (click to toggle)
libmng 2.0.3%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,092 kB
  • sloc: ansic: 78,373; sh: 11,434; cpp: 2,624; pascal: 2,185; makefile: 186
file content (95 lines) | stat: -rwxr-xr-x 2,271 bytes parent folder | download
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH)

CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS)
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)

ifeq ($(ARCH),alpha)
  CFLAGS := $(patsubst -O%,-O0,$(CFLAGS))
  CXXFLAGS := $(patsubst -O%,-O0,$(CXXFLAGS))
endif

CFLAGS += -Wall -funroll-loops -fno-exceptions
CXXFLAGS += -Wall -funroll-loops -fno-exceptions

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

configure-stamp:
	dh_testdir
	dh_autoreconf
	rm -rf build
	mkdir -p build
	cd build && ../configure --prefix=/usr \
		CPPFLAGS="$(CPPFLAGS)" \
		CFLAGS="$(CFLAGS)" \
		CXXFLAGS="$(CXXFLAGS)" \
		LDFLAGS="$(LDFLAGS)"
	touch configure-stamp

build: configure-stamp build-stamp build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: configure-stamp
	dh_testdir
	$(MAKE) -C build
	touch build-stamp

clean:
	dh_testdir
	rm -f build-stamp configure-stamp
	rm -rf build
	[ ! -f Makefile ] || $(MAKE) distclean || echo "ignored"
	dh_autoreconf_clean
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_prep

	mkdir -p $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig

	$(MAKE) -C build install \
		DESTDIR=$(CURDIR)/debian/tmp

	#Multiarch fixes
	mv debian/tmp/usr/lib/libmng* debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)
	mv $(CURDIR)/debian/tmp/usr/lib/pkgconfig/libmng.pc \
		debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/

binary-indep: build install

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_install --sourcedir=debian/tmp -plibmng-dev -plibmng2
	dh_installman
	dh_installdocs
	dh_installexamples
	dh_installinfo
	dh_installchangelogs CHANGES
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
.PHONY: build build-indep build-arch clean binary-indep binary-arch binary install