File: rules

package info (click to toggle)
sweep 0.9.3-6
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 6,400 kB
  • sloc: ansic: 36,275; sh: 9,980; makefile: 688; yacc: 288; sed: 16
file content (85 lines) | stat: -rwxr-xr-x 2,124 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
#!/usr/bin/make -f

DEB_HOST_GNU_TYPE  := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
CFLAGS += -Wall

# if this is a linux-any architecture, give no option
# (currently the only way to enable alsa (--enable-alsa disables it))
# otherwise, give --disable-alsa, so configure succeeds without libasound
ALSA_FLAGS := $(shell dpkg-architecture -ilinux-any || printf "%s" "--disable-alsa")

ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
	CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
else
	CROSS= --build $(DEB_BUILD_GNU_TYPE)
endif

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	rm -f config.guess config.sub
	rm -f doc/sweep.1
	[ ! -f Makefile ] || $(MAKE) distclean
	dh_clean

config.status: configure
	dh_testdir
	cp -f /usr/share/misc/config.guess config.guess
	cp -f /usr/share/misc/config.sub config.sub
	./configure $(CROSS) --prefix=/usr --mandir=\$${prefix}/share/man \
		$(ALSA_FLAGS) \
		CPPFLAGS='$(CPPFLAGS)' CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)'

build-indep:
build-arch: build-stamp
build: build-stamp

build-stamp: config.status
	$(MAKE)
	touch build-stamp

install: build-stamp
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	$(MAKE) prefix=$(CURDIR)/debian/sweep/usr install
	mkdir -p debian/sweep-dev/usr
	mv debian/sweep/usr/include debian/sweep-dev/usr

binary: binary-arch binary-indep

binary-arch: install
	dh_testdir -a
	dh_testroot -a
	dh_installchangelogs -a ChangeLog
	dh_installdocs -a
	dh_install -a
	dh_installmenu -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary-indep: install
	dh_testdir -i
	dh_testroot -i
	dh_installchangelogs -i ChangeLog
	dh_installdocs -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

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