File: rules

package info (click to toggle)
sopwith 1.7.4-6
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 1,512 kB
  • sloc: ansic: 9,750; sh: 2,770; makefile: 132
file content (76 lines) | stat: -rwxr-xr-x 2,082 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
#!/usr/bin/make -f

TARGETDIR=$(CURDIR)/debian/tmp

# Support cross-compiling, per /usr/share/doc/autotools-dev/README.Debian.gz
export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
  CONFFLAGS += $(DEB_HOST_GNU_TYPE)
else
  $(error Cannot cross-compile this package out-of-the-box)
endif

binary: binary-arch

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_install --list-missing --sourcedir=$(TARGETDIR)
	dh_installmenu
	dh_installman
	dh_installchangelogs ChangeLog
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb
	rm -f config.log config.status             # remove so patches can be reverted

binary-indep: 

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	$(MAKE) install DESTDIR=$(TARGETDIR)
	rm -f $(TARGETDIR)/usr/share/man/man6/*    # installed via dh_installman
	rm -f $(TARGETDIR)/usr/share/doc/sopwith/* # installed via dh_installdoc
	cp debian/sopwith.desktop $(TARGETDIR)     # so dh_install can pick it up
	cp debian/sopwith.png $(TARGETDIR)         # so dh_install can pick it up

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

configure: configure-stamp
configure-stamp: 
	dh_testdir
	cp /usr/share/misc/config.sub autotools/   # per autotools-dev/README.Debian.gz
	cp /usr/share/misc/config.guess autotools/ # per autotools-dev/README.Debian.gz
	rm -f config.cache
	$(shell dpkg-buildflags --export=configure) ./configure $(CONFFLAGS) \
	    --disable-gtktest \
	    --prefix=/usr \
	    --mandir=\$${prefix}/share/man \
	    --infodir=\$${prefix}/share/info \
	    --program-prefix=""
	touch configure-stamp

clean:
	dh_testdir
	dh_testroot
	-if [ -e Makefile ]; then $(MAKE) -i distclean; fi
	rm -f build-stamp configure-stamp
	dh_clean

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