Build with large file support.
[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 CPPFLAGS+=      -D_FILE_OFFSET_BITS=64
9
10 CFLAGS_ADD=     -Wall -W -Wextra
11 ifeq (,$(filter nowerror,$(DEB_BUILD_OPTIONS)))
12         CFLAGS_ADD+=    -Werror
13 endif
14
15 include /usr/share/hardening-includes/hardening.make
16 ifeq (,$(filter nohardening,$(DEB_BUILD_OPTIONS)))
17 CFLAGS+=        $(HARDENING_CFLAGS)
18 LDFLAGS+=       $(HARDENING_LDFLAGS)
19 endif
20
21 export CFLAGS CPPFLAGS LDFLAGS
22
23 pkgname=donkey
24 sysname=$(shell uname -s| sed -e 's/\///')
25 revname=$(shell uname -r)
26 objdir=obj/$(sysname).$(revname)
27 instdir=$(CURDIR)/debian/$(pkgname)
28
29 override_dh_auto_configure:
30         mkdir obj
31         ./setup
32         cd $(objdir) && sh ./configure
33
34 override_dh_auto_build:
35         $(MAKE) -C $(objdir) CFLAGS="$(CFLAGS) $(CFLAGS_ADD)"
36
37 override_dh_auto_clean:
38         rm -rf obj
39
40 override_dh_auto_install:
41         $(MAKE) -C $(objdir) install BINDIR=$(instdir)/usr/bin
42
43 override_dh_installchangelogs:
44         dh_installchangelogs 00changes
45
46 %:
47         dh $@