[70d428e] | 1 | #!/usr/bin/make -f |
---|
[a061c14a] | 2 | # Based on public domain debhelper example rules.multi2 by Joey Hess. |
---|
[b462168] | 3 | # |
---|
[a061c14a] | 4 | # Copyright (C) 2005,2006 Olly Betts |
---|
[70d428e] | 5 | # |
---|
[a061c14a] | 6 | # GPL licensed. |
---|
| 7 | # |
---|
| 8 | # This is a multibinary package. You can build any of the binary packages |
---|
| 9 | # independently by using the appropriate binary-<package> target. |
---|
[70d428e] | 10 | |
---|
| 11 | # Uncomment this to turn on verbose mode. |
---|
| 12 | #export DH_VERBOSE=1 |
---|
| 13 | |
---|
| 14 | # This has to be exported to make some magic below work. |
---|
| 15 | export DH_OPTIONS |
---|
| 16 | |
---|
[b462168] | 17 | ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
---|
| 18 | CFLAGS += -O0 |
---|
[a061c14a] | 19 | CXXFLAGS += -O0 |
---|
[b462168] | 20 | else |
---|
| 21 | CFLAGS += -O2 |
---|
[a061c14a] | 22 | CXXFLAGS += -O2 |
---|
[b462168] | 23 | endif |
---|
| 24 | ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) |
---|
[a061c14a] | 25 | STRIP=/bin/true |
---|
[b462168] | 26 | endif |
---|
| 27 | |
---|
[a061c14a] | 28 | # Make sure DEB_BUILD_GNU_TYPE and DEB_HOST_GNU_TYPE are set even if |
---|
| 29 | # we aren't called from dpkg-buildpackage, but don't reset them if |
---|
| 30 | # they're already set so the caller can override dpkg-architecture. |
---|
| 31 | export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) |
---|
| 32 | export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) |
---|
| 33 | |
---|
[70d428e] | 34 | build: build-stamp |
---|
| 35 | build-stamp: |
---|
| 36 | dh_testdir |
---|
| 37 | |
---|
[a061c14a] | 38 | ./configure --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --enable-docdir=\$${prefix}/share/doc/survex CFLAGS=$(CFLAGS) CXXFLAGS=$(CXXFLAGS) STRIP=$(STRIP) |
---|
[70d428e] | 39 | $(MAKE) |
---|
[7ad2d31] | 40 | ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) |
---|
[50eb45d] | 41 | $(MAKE) check |
---|
[7ad2d31] | 42 | endif |
---|
[70d428e] | 43 | touch build-stamp |
---|
| 44 | |
---|
| 45 | clean: |
---|
| 46 | dh_testdir |
---|
| 47 | dh_testroot |
---|
| 48 | rm -f build-stamp |
---|
| 49 | |
---|
| 50 | -$(MAKE) distclean |
---|
| 51 | |
---|
| 52 | dh_clean |
---|
| 53 | |
---|
| 54 | install: DH_OPTIONS= |
---|
| 55 | install: build |
---|
| 56 | dh_testdir |
---|
| 57 | dh_testroot |
---|
| 58 | dh_clean -k |
---|
| 59 | dh_installdirs |
---|
| 60 | |
---|
[a061c14a] | 61 | $(MAKE) DESTDIR=`pwd`/debian/tmp install |
---|
[839db8b] | 62 | $(MAKE) -C vim DESTDIR=`pwd`/debian/tmp vimdir=/usr/share/vim/addons install |
---|
[70d428e] | 63 | |
---|
[a061c14a] | 64 | dh_install --fail-missing |
---|
[70d428e] | 65 | |
---|
| 66 | # This single target is used to build all the packages, all at once, or |
---|
| 67 | # one at a time. So keep in mind: any options passed to commands here will |
---|
| 68 | # affect _all_ packages. Anything you want to only affect one package |
---|
| 69 | # should be put in another target, such as the install target. |
---|
[a061c14a] | 70 | binary-common: |
---|
[1e5baa1] | 71 | # Avoid warning: |
---|
| 72 | # dpkg-gencontrol: warning: unknown substitution variable ${misc:Depends} |
---|
| 73 | echo 'misc:Depends=' > debian/survex.substvars |
---|
[70d428e] | 74 | dh_testdir |
---|
| 75 | dh_testroot |
---|
[a061c14a] | 76 | dh_installchangelogs |
---|
[70d428e] | 77 | dh_installdocs |
---|
| 78 | dh_installexamples |
---|
| 79 | dh_installmenu |
---|
[a061c14a] | 80 | # FIXME: investigate using dh_installmime |
---|
[70d428e] | 81 | # dh_installmime |
---|
| 82 | dh_strip |
---|
[a061c14a] | 83 | dh_link |
---|
[70d428e] | 84 | dh_compress |
---|
| 85 | dh_fixperms |
---|
| 86 | dh_installdeb |
---|
| 87 | dh_shlibdeps |
---|
| 88 | dh_gencontrol |
---|
| 89 | dh_md5sums |
---|
| 90 | dh_builddeb |
---|
| 91 | |
---|
[a061c14a] | 92 | # Build architecture independent packages using the common target. |
---|
| 93 | binary-indep: build install |
---|
[34c131f] | 94 | $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common |
---|
[70d428e] | 95 | |
---|
| 96 | # Build architecture dependant packages using the common target. |
---|
[a061c14a] | 97 | binary-arch: build install |
---|
[70d428e] | 98 | $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common |
---|
| 99 | |
---|
| 100 | # Any other binary targets build just one binary package at a time. |
---|
| 101 | binary-%: build install |
---|
| 102 | make -f debian/rules binary-common DH_OPTIONS=-p$* |
---|
| 103 | |
---|
[a061c14a] | 104 | binary: binary-indep binary-arch |
---|
| 105 | .PHONY: build clean binary-indep binary-arch binary-common binary install |
---|