2 # Debian rules file for gzip, requires the debhelper package.
3 # Crafted by Bdale Garbee, bdale@gag.com, 5 November 2000
4 # Cleanup by Thorsten Glaser, tg@debian.org, 20 June 2012
5 # based on the rules file of the jupp package
7 # Comment this to turn off debhelper verbose mode.
10 shellescape='$(subst ','\'',$(1))'
11 shellexport=$(1)=$(call shellescape,${$(1)})
13 include /usr/share/dpkg/architecture.mk
15 # Automatic ${CC} selection for cross-compiles
17 # is ${CC} defined anywhere (other than implicit rules?)
18 ifneq (,$(findstring $(origin CC),default undefined))
19 # no - then default to gcc (or cross-gcc)
20 ifneq (${DEB_BUILD_ARCH},${DEB_HOST_ARCH})
21 CC= ${DEB_HOST_GNU_TYPE}-gcc
27 export DEFS=NO_ASM # Avoid TEXTRELs on i386
28 DEB_CFLAGS_MAINT_APPEND := -Wall
29 DEB_CPPFLAGS_MAINT_APPEND := -DUNALIGNED_OK
31 # Automatic dpkg-buildflags selection, backport-friendly
33 # maybe turn this on later
34 #DEB_BUILD_MAINT_OPTIONS=hardening=+all
35 include /usr/share/dpkg/buildflags.mk
37 # maybe turn this on later
38 #ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
39 #NUMJOBS= $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
40 #MAKEFLAGS+= -j${NUMJOBS}
43 # whitespace-safe path to source directory
44 _topdir=$(call shellescape,$(shell pwd))
46 CONFIGURE_ARGS= --prefix=/usr \
48 --infodir=${_topdir}/debian/gzip/usr/share/info \
49 --mandir=${_topdir}/debian/gzip/usr/share/man \
50 --disable-silent-rules
52 ifneq (${DEB_BUILD_ARCH},${DEB_HOST_ARCH})
53 CONFIGURE_ARGS+= --host=${DEB_HOST_GNU_TYPE}
57 cp -f /usr/share/misc/config.sub build-aux/config.sub
58 cp -f /usr/share/misc/config.guess build-aux/config.guess
62 configure: configure-stamp
63 configure-stamp: reconf-stamp
67 $(foreach i,CC CFLAGS CPPFLAGS LDFLAGS,$(call shellexport,$i)) \
68 CONFIG_SHELL=/bin/sh GREP=grep ../configure ${CONFIGURE_ARGS}
71 configure-indep: configure-indep-stamp
72 configure-indep-stamp: reconf-stamp
74 mkdir -p builddir-indep
75 cd builddir-indep && ../configure --host=i686-w64-mingw32 \
76 LIBS="-Wl,--as-needed -lssp" --disable-silent-rules
79 build: build-stamp build-indep-stamp
81 build-arch: build-stamp
82 build-stamp: configure-stamp
85 ifeq (,$(filter nocheck,${DEB_BUILD_OPTIONS}))
86 ifeq (${DEB_BUILD_ARCH},${DEB_HOST_ARCH})
87 ${MAKE} -C builddir check
92 build-indep: build-indep-stamp
93 build-indep-stamp: configure-indep-stamp
95 ${MAKE} -C builddir-indep
101 -rm -f build-stamp build-indep-stamp configure-stamp configure-indep-stamp reconf-stamp
102 -rm -rf builddir builddir-indep
105 binary: binary-arch binary-indep
107 binary-indep: build-indep-stamp
112 i686-w64-mingw32-strip builddir-indep/gzip.exe
113 install -m 0755 builddir-indep/gzip.exe \
114 debian/gzip-win32/usr/share/win32/
115 dh_installdocs -i README* TODO NEWS
116 dh_installchangelogs -i ChangeLog
125 binary-arch: build-stamp
130 ${MAKE} -C builddir install \
131 prefix=${_topdir}/debian/gzip/usr \
132 bindir=${_topdir}/debian/gzip/bin
135 dh_installdocs -a README* TODO NEWS
137 dh_installinfo -a doc/gzip.info
138 dh_installchangelogs -a ChangeLog
143 ln -s gunzip.1.gz debian/gzip/usr/share/man/man1/uncompress.1.gz
144 ln -s zgrep.1.gz debian/gzip/usr/share/man/man1/zegrep.1.gz
145 ln -s zgrep.1.gz debian/gzip/usr/share/man/man1/zfgrep.1.gz
146 rm -f ${_topdir}/debian/gzip/usr/share/info/dir.gz
155 .PHONY: binary binary-arch binary-indep build build-arch build-indep clean
156 .PHONY: configure configure-indep