| 1 |
#!/usr/bin/make -f |
| 2 |
# -*- makefile -*- |
| 3 |
# Sample debian/rules that uses debhelper. |
| 4 |
# |
| 5 |
# This file was originally written by Joey Hess and Craig Small. |
| 6 |
# As a special exception, when this file is copied by dh-make into a |
| 7 |
# dh-make output file, you may use that output file without restriction. |
| 8 |
# This special exception was added by Craig Small in version 0.37 of dh-make. |
| 9 |
# |
| 10 |
# Modified to make a template file for a multi-binary package with separated |
| 11 |
# build-arch and build-indep targets by Bill Allombert 2001 |
| 12 |
|
| 13 |
# Uncomment this to turn on verbose mode. |
| 14 |
#export DH_VERBOSE=1 |
| 15 |
|
| 16 |
# This has to be exported to make some magic below work. |
| 17 |
export DH_OPTIONS |
| 18 |
|
| 19 |
|
| 20 |
# These are used for cross-compiling and for saving the configure script |
| 21 |
# from having to guess our platform (since we know it already) |
| 22 |
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) |
| 23 |
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) |
| 24 |
|
| 25 |
|
| 26 |
CFLAGS = -Wall -g |
| 27 |
|
| 28 |
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
| 29 |
CFLAGS += -O0 |
| 30 |
else |
| 31 |
CFLAGS += -O2 |
| 32 |
endif |
| 33 |
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) |
| 34 |
INSTALL_PROGRAM += -s |
| 35 |
endif |
| 36 |
|
| 37 |
configure: configure-stamp |
| 38 |
configure-stamp: |
| 39 |
dh_testdir |
| 40 |
# Add here commands to configure the package. |
| 41 |
|
| 42 |
touch configure-stamp |
| 43 |
|
| 44 |
|
| 45 |
#Architecture |
| 46 |
build: build-arch build-indep |
| 47 |
|
| 48 |
build-arch: build-arch-stamp |
| 49 |
build-arch-stamp: configure-stamp |
| 50 |
|
| 51 |
# Add here commands to compile the arch part of the package. |
| 52 |
#$(MAKE) |
| 53 |
touch build-arch-stamp |
| 54 |
|
| 55 |
build-indep: build-indep-stamp |
| 56 |
build-indep-stamp: configure-stamp |
| 57 |
|
| 58 |
# Add here commands to compile the indep part of the package. |
| 59 |
#$(MAKE) doc |
| 60 |
perl Makefile.PL INSTALLDIRS=vendor |
| 61 |
$(MAKE) OPTIMIZE=$CFLAGS |
| 62 |
touch build-indep-stamp |
| 63 |
|
| 64 |
clean: |
| 65 |
dh_testdir |
| 66 |
dh_testroot |
| 67 |
rm -f build-arch-stamp build-indep-stamp #CONFIGURE-STAMP# |
| 68 |
|
| 69 |
# Add here commands to clean up after the build process. |
| 70 |
[ ! -f Makefile ] || $(MAKE) clean |
| 71 |
# remove old Makefile |
| 72 |
rm -f Makefile.old |
| 73 |
|
| 74 |
dh_clean |
| 75 |
|
| 76 |
install: install-indep install-arch |
| 77 |
install-indep: |
| 78 |
dh_testdir |
| 79 |
dh_testroot |
| 80 |
dh_prep |
| 81 |
dh_installdirs -i |
| 82 |
|
| 83 |
# Add here commands to install the indep part of the package into |
| 84 |
# debian/<package>-doc. |
| 85 |
#INSTALLDOC# |
| 86 |
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp |
| 87 |
|
| 88 |
dh_install -i --sourcedir=debian/tmp --fail-missing |
| 89 |
|
| 90 |
install-arch: |
| 91 |
|
| 92 |
binary-common: |
| 93 |
dh_testdir |
| 94 |
dh_testroot |
| 95 |
# do not use debian/changelog as upstream changelog |
| 96 |
# and ignore lintian complaints |
| 97 |
# dh_installchangelogs debian/changelog |
| 98 |
dh_installchangelogs |
| 99 |
dh_installdocs |
| 100 |
dh_installexamples |
| 101 |
# dh_installmenu |
| 102 |
# dh_installdebconf |
| 103 |
# dh_installlogrotate |
| 104 |
# dh_installemacsen |
| 105 |
# dh_installpam |
| 106 |
# dh_installmime |
| 107 |
# dh_installinit |
| 108 |
# dh_installcron |
| 109 |
# dh_installinfo |
| 110 |
dh_installman |
| 111 |
dh_link |
| 112 |
dh_strip |
| 113 |
dh_compress |
| 114 |
dh_fixperms |
| 115 |
dh_perl |
| 116 |
# dh_python |
| 117 |
dh_makeshlibs |
| 118 |
dh_installdeb |
| 119 |
dh_shlibdeps |
| 120 |
dh_gencontrol |
| 121 |
dh_md5sums |
| 122 |
dh_builddeb |
| 123 |
# Build architecture independant packages using the common target. |
| 124 |
binary-indep: build-indep install-indep |
| 125 |
$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common |
| 126 |
|
| 127 |
# Build architecture dependant packages using the common target. |
| 128 |
binary-arch: |
| 129 |
|
| 130 |
# we aren't building any arch-dependant code |
| 131 |
#binary: binary-arch binary-indep |
| 132 |
binary: binary-indep |
| 133 |
.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure |