| [15] | 1 | #!/usr/bin/make -f |
|---|
| 2 | # Sample debian/rules that uses debhelper. |
|---|
| 3 | # GNU copyright 1997 to 1999 by Joey Hess. |
|---|
| 4 | # |
|---|
| 5 | # Modified to make a template file for a multi-binary package with separated |
|---|
| 6 | # build-arch and build-indep targets by Bill Allombert 2001 |
|---|
| 7 | |
|---|
| 8 | # Uncomment this to turn on verbose mode. |
|---|
| 9 | #export DH_VERBOSE=1 |
|---|
| 10 | |
|---|
| 11 | # This is the debhelper compatibility version to use. |
|---|
| 12 | export DH_COMPAT=4 |
|---|
| 13 | |
|---|
| 14 | # This has to be exported to make some magic below work. |
|---|
| 15 | export DH_OPTIONS |
|---|
| 16 | |
|---|
| 17 | # These are used for cross-compiling and for saving the configure script |
|---|
| 18 | # from having to guess our platform (since we know it already) |
|---|
| 19 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) |
|---|
| 20 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) |
|---|
| 21 | |
|---|
| 22 | objdir = $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE) |
|---|
| 23 | |
|---|
| 24 | CFLAGS = -Wall -g |
|---|
| 25 | |
|---|
| 26 | ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
|---|
| 27 | CFLAGS += -O0 |
|---|
| 28 | else |
|---|
| 29 | CFLAGS += -O2 |
|---|
| 30 | endif |
|---|
| 31 | ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) |
|---|
| 32 | INSTALL_PROGRAM += -s |
|---|
| 33 | endif |
|---|
| 34 | |
|---|
| 35 | configure: configure-stamp |
|---|
| 36 | configure-stamp: |
|---|
| 37 | dh_testdir |
|---|
| 38 | |
|---|
| 39 | # make build directory |
|---|
| 40 | mkdir $(objdir) |
|---|
| 41 | |
|---|
| 42 | # run configure with build tree $(objdir) |
|---|
| 43 | # change ../configure to ../autogen.sh for CVS build |
|---|
| 44 | cd $(objdir) && \ |
|---|
| 45 | ../configure --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \ |
|---|
| 46 | --prefix=/usr --enable-static |
|---|
| 47 | |
|---|
| 48 | touch configure-stamp |
|---|
| 49 | |
|---|
| 50 | #Architecture |
|---|
| 51 | build: build-arch build-indep |
|---|
| 52 | |
|---|
| 53 | build-arch: build-arch-stamp |
|---|
| 54 | build-arch-stamp: configure-stamp |
|---|
| 55 | |
|---|
| 56 | cd $(objdir) && \ |
|---|
| 57 | $(MAKE) |
|---|
| 58 | |
|---|
| 59 | touch build-arch-stamp |
|---|
| 60 | |
|---|
| 61 | build-indep: build-indep-stamp |
|---|
| 62 | build-indep-stamp: configure-stamp |
|---|
| 63 | |
|---|
| 64 | # Add here commands to compile the indep part of the package. |
|---|
| 65 | #$(MAKE) doc |
|---|
| 66 | touch build-indep-stamp |
|---|
| 67 | |
|---|
| 68 | debian-clean: |
|---|
| 69 | dh_testdir |
|---|
| 70 | dh_testroot |
|---|
| 71 | |
|---|
| 72 | dh_clean |
|---|
| 73 | |
|---|
| 74 | clean: |
|---|
| 75 | dh_testdir |
|---|
| 76 | dh_testroot |
|---|
| 77 | rm -f build-arch-stamp build-indep-stamp configure-stamp |
|---|
| 78 | |
|---|
| 79 | # Remove build tree |
|---|
| 80 | rm -rf $(objdir) |
|---|
| 81 | |
|---|
| 82 | # if Makefile exists run distclean |
|---|
| 83 | if test -f Makefile; then \ |
|---|
| 84 | $(MAKE) distclean; \ |
|---|
| 85 | fi |
|---|
| 86 | |
|---|
| 87 | #if test -d CVS; then \ |
|---|
| 88 | $(MAKE) cvs-clean ;\ |
|---|
| 89 | fi |
|---|
| 90 | |
|---|
| 91 | dh_clean |
|---|
| 92 | |
|---|
| 93 | install: install-indep install-arch |
|---|
| 94 | install-indep: |
|---|
| 95 | dh_testdir |
|---|
| 96 | dh_testroot |
|---|
| 97 | # dh_clean -k -i |
|---|
| 98 | # dh_installdirs -i |
|---|
| 99 | |
|---|
| 100 | # dh_install -i --list-missing |
|---|
| 101 | |
|---|
| 102 | install-arch: |
|---|
| 103 | dh_testdir |
|---|
| 104 | dh_testroot |
|---|
| 105 | dh_clean -k -s |
|---|
| 106 | dh_installdirs -s |
|---|
| 107 | |
|---|
| 108 | cd $(objdir) && \ |
|---|
| 109 | $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp |
|---|
| 110 | |
|---|
| 111 | dh_install -s --list-missing |
|---|
| 112 | |
|---|
| 113 | # Must not depend on anything. This is to be called by |
|---|
| 114 | # binary-arch/binary-indep |
|---|
| 115 | # in another 'make' thread. |
|---|
| 116 | binary-common: |
|---|
| 117 | dh_testdir |
|---|
| 118 | dh_testroot |
|---|
| 119 | dh_installchangelogs |
|---|
| 120 | dh_installdocs |
|---|
| 121 | dh_installexamples |
|---|
| 122 | # dh_installmenu |
|---|
| 123 | # dh_installdebconf |
|---|
| 124 | # dh_installlogrotate |
|---|
| 125 | # dh_installemacsen |
|---|
| 126 | # dh_installpam |
|---|
| 127 | # dh_installmime |
|---|
| 128 | # dh_installinit |
|---|
| 129 | # dh_installcron |
|---|
| 130 | # dh_installinfo |
|---|
| 131 | dh_installman |
|---|
| 132 | dh_link |
|---|
| 133 | dh_strip |
|---|
| 134 | dh_compress |
|---|
| 135 | dh_fixperms |
|---|
| 136 | # dh_perl |
|---|
| 137 | # dh_python |
|---|
| 138 | dh_makeshlibs -V |
|---|
| 139 | dh_installdeb |
|---|
| 140 | dh_shlibdeps |
|---|
| 141 | dh_gencontrol |
|---|
| 142 | dh_md5sums |
|---|
| 143 | dh_builddeb |
|---|
| 144 | |
|---|
| 145 | # Build architecture independant packages using the common target. |
|---|
| 146 | binary-indep: build-indep install-indep |
|---|
| 147 | # $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common |
|---|
| 148 | |
|---|
| 149 | # Build architecture dependant packages using the common target. |
|---|
| 150 | binary-arch: build-arch install-arch |
|---|
| 151 | $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common |
|---|
| 152 | |
|---|
| 153 | binary: binary-arch binary-indep |
|---|
| 154 | .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure |
|---|