File: rules

package info (click to toggle)
rc 1.7.1-4
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 884 kB
  • sloc: ansic: 7,121; sh: 722; yacc: 124; makefile: 100
file content (71 lines) | stat: -rwxr-xr-x 1,436 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
#!/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)

configure_flags = --build $(DEB_BUILD_GNU_TYPE)
ifneq "$(DEB_BUILD_GNU_TYPE)" "$(DEB_HOST_GNU_TYPE)"
	configure_flags += --host $(DEB_HOST_GNU_TYPE)
endif

cflags = $(shell dpkg-buildflags --get CFLAGS)
cppflags = $(shell dpkg-buildflags --get CPPFLAGS)
ldflags = $(shell dpkg-buildflags --get LDFLAGS) -Wl,--as-needed

configure_flags += \
	--prefix=/usr \
	--mandir='$${prefix}/share/man' \
	--with-readline \
	--with-addon \
	CFLAGS='$(cflags)' \
	CPPFLAGS='$(cppflags)' \
	LDFLAGS='$(ldflags)' \

autoconf-stamp:
	dh_testdir
	autoreconf -vfi
	touch $(@)

obj/config.status: autoconf-stamp
	dh_testdir
	mkdir -p $(dir $@)
	cd obj && ../configure $(configure_flags) 

obj/build-stamp: obj/config.status
	dh_testdir
	$(MAKE) -C obj
	touch $(@)

.PHONY: build build-arch build-indep
build build-arch: obj/build-stamp

.PHONY: binary binary-arch binary-indep
binary binary-arch: obj/build-stamp
	dh_testdir
	dh_testroot
	dh_prep
	$(MAKE) -C obj DESTDIR=../debian/rc install
	dh_installdocs
	dh_installmenu
	dh_installman
	dh_installchangelogs
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

.PHONY: clean
clean:
	dh_testdir
	rm -rf obj/ autoconf-stamp
	dh_clean

.SECONDARY:
.NOTPARALLEL:

# vim:ts=4 sw=4 noet