Turn the build hardening on by default.
[donkey:pkg-debian.git] / rules
1 #!/usr/bin/make -f
2 # debhelper rules file for donkey, the One-Time-Password calculator
3
4 CFLAGS=         $(shell dpkg-buildflags --get CFLAGS)
5 CPPFLAGS=       $(shell dpkg-buildflags --get CPPFLAGS)
6 LDFLAGS=        $(shell dpkg-buildflags --get LDFLAGS)
7
8 CFLAGS_ADD=     -Wall -W -Wextra
9 ifneq (,$(filter werror,$(DEB_BUILD_OPTIONS)))
10         CFLAGS_ADD+=    -Werror
11 endif
12 ifeq (,$(filter nohardening,$(DEB_BUILD_OPTIONS)))
13 export DEB_BUILD_HARDENING=1
14 else
15 export DEB_BUILD_HARDENING=0
16 endif
17
18 export CFLAGS CPPFLAGS LDFLAGS
19
20 pkgname=donkey
21 sysname=$(shell uname -s| sed -e 's/\///')
22 revname=$(shell uname -r)
23 objdir=obj/$(sysname).$(revname)
24 instdir=$(CURDIR)/debian/$(pkgname)
25
26 override_dh_auto_configure:
27         mkdir obj
28         ./setup
29         cd $(objdir) && sh ./configure
30
31 override_dh_auto_build:
32         $(MAKE) -C $(objdir) CFLAGS="$(CFLAGS) $(CFLAGS_ADD)"
33
34 override_dh_auto_clean:
35         rm -rf obj
36
37 override_dh_auto_install:
38         $(MAKE) -C $(objdir) install BINDIR=$(instdir)/usr/bin
39
40 override_dh_installchangelogs:
41         dh_installchangelogs 00changes
42
43 %:
44         dh $@