File: rules

package info (click to toggle)
gpm 1.20.4-6.2
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 4,480 kB
  • ctags: 1,464
  • sloc: ansic: 9,447; yacc: 1,055; sh: 1,045; makefile: 449; cpp: 241; lisp: 222; awk: 79; sed: 6
file content (116 lines) | stat: -rwxr-xr-x 2,663 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/usr/bin/make -f
# debian/rules for gpm

include /usr/share/quilt/quilt.make

INSTALL=install
INSTALL_DATA=$(INSTALL) -m 644
INSTALL_PROGRAM=$(INSTALL) -m 755

export CFLAGS = -Wall -g -D_REENTRANT

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
lib := usr/lib/$(DEB_HOST_MULTIARCH)

ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
	confflags += --build $(DEB_HOST_GNU_TYPE)
	host_cc = gcc
else
	confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
	host_cc = $(DEB_HOST_GNU_TYPE)-gcc
endif

configure: patch configure.in
	autoconf

config.status: configure
	env CC=$(host_cc) ./configure $(confflags) --prefix=/usr --sysconfdir=/etc

# Serialize to support parallel make
pre-patch: patch
	$(RM) config.sub config.guess
	ln -s /usr/share/misc/config.sub /usr/share/misc/config.guess .
	$(MAKE) -f debian/rules config.status

build: build-arch build-indep
build-indep: pre-patch
build-arch: pre-patch
	dh_testdir

	# for gpm_has_mouse_control
	$(MAKE) -C contrib/control CC=$(host_cc)
	$(MAKE)

clean: unpatch clean-unpatched
clean-unpatched:
	dh_testdir

	[ ! -f Makefile ] || $(MAKE) clean
	$(RM) Makefile	
	$(RM) -r contrib/control
	$(RM) config.sub config.guess
	dh_clean

checkpo:
	debconf-updatepo
	@for i in debian/po/*.po; do \
	  echo -n "Checking: $$i "; \
	  msgfmt -o /dev/null -c --statistics $$i; \
	done

# No binary indep packages
binary-indep:

binary-arch: build
	dh_testdir
	dh_testroot
	dh_prep

	dh_installdirs
	dh_install

	$(INSTALL_PROGRAM) debian/gpm.apm \
	                   debian/gpm/etc/apm/event.d/gpm
	$(INSTALL_PROGRAM) src/prog/mouse-test \
	                   debian/gpm/usr/sbin/gpm-mouse-test
	$(INSTALL_PROGRAM) contrib/scripts/microtouch-setup \
	                   debian/gpm/usr/sbin/gpm-microtouch-setup

	mkdir -p debian/libgpm2/$(lib)
	$(INSTALL_DATA) src/lib/libgpm.so.2.0.0 debian/libgpm2/$(lib)/libgpm.so.2

	mkdir -p debian/libgpm-dev/$(lib)
	ln -s libgpm.so.2 debian/libgpm-dev/$(lib)/libgpm.so
	$(INSTALL_DATA) src/lib/libgpm.a debian/libgpm-dev/$(lib)/

	dh_installinfo
	dh_installman
	dh_installdocs
	dh_installchangelogs Changes
	dh_installexamples
	dh_installinit
	dh_installdebconf
	dh_lintian
	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 binary binary-arch binary-indep clean