chiark / gitweb /
debian/rules: Honour dpkg-buildflags.
[userv.git] / debian / rules
index 97bced17663819ef0f28f733e85f03d7059df542..67c5271261ee8be0febdcd6e932fbacf9331527b 100755 (executable)
@@ -11,12 +11,17 @@ else
        INSTOPTS= INSTALL_PROGRAM='install -c'
 endif
 
+makebuildargs := OPTIMISE= \
+ XCFLAGS="$(shell dpkg-buildflags --get CFLAGS)" \
+ XCPPFLAGS="$(shell dpkg-buildflags --get CPPFLAGS)" \
+ XLDFLAGS="$(shell dpkg-buildflags --get LDFLAGS)"
+
 build: build-arch build-indep
 
 build-arch:
        $(checkdir)
        ./configure --prefix=/usr
-       $(MAKE) all docs
+       $(MAKE) $(makebuildargs) all docs
        touch build-arch
 
 clean:
@@ -40,7 +45,7 @@ binary-arch:  checkroot build
        install -m 755 debian/{postinst,prerm,postrm} $t/DEBIAN/.
        install -m 644 debian/conffiles $t/DEBIAN/.
        install -m 755 debian/initd $t/etc/init.d/userv
-       $(MAKE) $(INSTOPTS) \
+       $(MAKE) $(INSTOPTS) $(makebuildargs) \
                prefix=$t/usr etcdir=$t/etc \
                docdir=$t/usr/share/doc/userv \
                mandir=$t/usr/share/man \