switched to dh
Dariusz Dwornikowski
8 years ago
0 | 0 | #!/usr/bin/make -f |
1 | 1 | |
2 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) | |
3 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) | |
4 | ||
5 | ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) | |
6 | CONFFLAGS = $(DEB_HOST_GNU_TYPE) | |
7 | else | |
8 | CONFFLAGS = --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) | |
9 | endif | |
10 | ||
11 | CFLAGS = -g | |
12 | ||
13 | ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) | |
14 | CFLAGS += -O2 | |
15 | endif | |
16 | ||
17 | configure: configure-stamp | |
18 | configure-stamp: | |
19 | dh_testdir | |
20 | ln -sf /usr/share/misc/config.sub . | |
21 | ln -sf /usr/share/misc/config.guess . | |
22 | CFLAGS="$(CFLAGS)" CXXFLAGS="$(CFLAGS)" \ | |
23 | ./configure $(CONFFLAGS) --prefix=/usr \ | |
24 | --bindir=\$${prefix}/games --mandir=\$${prefix}/share/man | |
25 | touch configure-stamp | |
26 | ||
27 | build: configure build-stamp | |
28 | build-stamp: | |
29 | dh_testdir | |
30 | $(MAKE) | |
31 | touch build-stamp | |
32 | ||
33 | clean: | |
34 | dh_testdir | |
35 | dh_testroot | |
36 | rm -f build-stamp configure-stamp | |
37 | -$(MAKE) distclean | |
38 | dh_clean src/level.cc config.guess config.sub config.status config.log | |
39 | ||
40 | install: build | |
41 | dh_testdir | |
42 | dh_testroot | |
43 | dh_clean -k | |
44 | dh_installdirs | |
45 | $(MAKE) install prefix=$(CURDIR)/debian/tmp/usr | |
46 | dh_install --sourcedir=debian/tmp --autodest | |
47 | ||
48 | binary-arch: configure build install | |
49 | dh_testdir -a | |
50 | dh_testroot -a | |
51 | dh_installchangelogs -a ChangeLog | |
52 | dh_installdocs -a | |
53 | dh_installmenu -a | |
54 | dh_link -a | |
55 | dh_strip -a | |
56 | dh_compress -a | |
57 | dh_fixperms -a | |
58 | dh_installdeb -a | |
59 | dh_shlibdeps -a | |
60 | dh_gencontrol -a | |
61 | dh_md5sums -a | |
62 | dh_builddeb -a | |
63 | ||
64 | binary-indep: configure build install | |
65 | dh_testdir -i | |
66 | dh_testroot -i | |
67 | dh_installchangelogs -i | |
68 | dh_installdocs -i | |
69 | dh_installmenu -i | |
70 | dh_link -i | |
71 | dh_strip -i | |
72 | dh_compress -i | |
73 | dh_fixperms -i | |
74 | dh_installdeb -i | |
75 | dh_shlibdeps -i | |
76 | dh_gencontrol -i | |
77 | dh_md5sums -i | |
78 | dh_builddeb -i | |
79 | ||
80 | binary: binary-indep binary-arch | |
81 | ||
82 | .PHONY: configure build clean install binary-arch binary-indep binary | |
2 | %: | |
3 | dh $@ --parallel |