1 #!/usr/bin/make -f
2 # debian/rules for tig
3 #
4 # Written by Sebastian Harl <tokkee@debian.org>
6 # Uncomment this to turn on verbose mode.
7 #export DH_VERBOSE=1
9 # These are used for cross-compiling and for saving the configure script
10 # from having to guess our platform (since we know it already)
11 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
12 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
14 export DEB_BUILD_MAINT_OPTIONS=hardening=+all
16 CFLAGS = $(shell dpkg-buildflags --get CFLAGS)
17 CFLAGS += -Wall -g -I/usr/include/ncursesw
19 CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
21 LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
23 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
24 CFLAGS += -O0
25 else
26 CFLAGS += -O2
27 endif
29 config.status: configure
30 dh_testdir
31 ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
32 --prefix=/usr --mandir=\$${prefix}/share/man --sysconfdir=/etc \
33 CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
35 build: build-arch build-indep
37 build-arch: build-stamp
38 build-indep: build-stamp
40 build-stamp: config.status
41 dh_testdir
43 $(MAKE) all doc
45 touch build-stamp
47 clean:
48 dh_testdir
49 dh_testroot
50 rm -f build-stamp
52 $(MAKE) clean
54 rm -f config.h config.log config.make config.status
55 rm -rf doc/manual.html-chunked/
56 rm -f doc/manual.pdf doc/manual.html doc/manual.toc doc/manual.tex
57 rm -f doc/tigmanual.7
58 rm -f doc/tig.1 doc/tig.1.html doc/tigrc.5 doc/tigrc.5.html
59 rm -f INSTALL.html NEWS.html README.html
61 dh_clean
63 install: build
64 dh_testdir
65 dh_testroot
66 dh_prep
67 dh_installdirs
69 $(MAKE) install install-doc DESTDIR=$(CURDIR)/debian/tig
70 # don't ship install instructions; README only links to them
71 rm -f debian/tig/usr/share/doc/tig/INSTALL.html \
72 debian/tig/usr/share/doc/tig/README.html
74 mkdir -p debian/tig/usr/share/bash-completion/completions
75 cp contrib/tig-completion.bash debian/tig/usr/share/bash-completion/completions/tig
76 chmod 644 debian/tig/usr/share/bash-completion/completions/tig
78 binary-indep:
79 # nothing to do here
81 binary-arch: build install
82 dh_testdir
83 dh_testroot
84 dh_installchangelogs NEWS.adoc
85 dh_installdocs doc/manual.pdf
86 dh_installexamples contrib/*.tigrc
87 dh_link
88 dh_strip
89 dh_compress -X.pdf
90 dh_fixperms
91 dh_installdeb
92 dh_shlibdeps
93 dh_gencontrol
94 dh_md5sums
95 dh_builddeb
97 binary: binary-indep binary-arch
98 .PHONY: build clean binary-indep binary-arch binary install