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 CFLAGS = -Wall -g -I/usr/include/ncursesw
16 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
17 CFLAGS += -O0
18 else
19 CFLAGS += -O2
20 endif
22 config.status: configure
23 dh_testdir
24 ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
25 --prefix=/usr --mandir=\$${prefix}/share/man --sysconfdir=/etc \
26 CFLAGS="$(CFLAGS)"
28 build: build-arch build-indep
30 build-arch: build-stamp
31 build-indep: build-stamp
33 build-stamp: config.status
34 dh_testdir
36 $(MAKE) all doc
38 touch build-stamp
40 clean:
41 dh_testdir
42 dh_testroot
43 rm -f build-stamp
45 $(MAKE) clean
47 rm -f config.h config.log config.make config.status
48 rm -rf manual.html-chunked/
49 rm -f manual.pdf manual.html manual.toc
50 rm -f tig.1 tig.1.html tigrc.5 tigrc.5.html
51 rm -f NEWS.html README.html
53 dh_clean
55 install: build
56 dh_testdir
57 dh_testroot
58 dh_clean -k
59 dh_installdirs
61 $(MAKE) install install-doc DESTDIR=$(CURDIR)/debian/tig
63 mkdir -p debian/tig/etc/bash_completion.d
64 cp contrib/tig-completion.bash debian/tig/etc/bash_completion.d/tig
65 chmod 644 debian/tig/etc/bash_completion.d/tig
67 binary-indep:
68 # nothing to do here
70 binary-arch: build install
71 dh_testdir
72 dh_testroot
73 dh_installchangelogs NEWS
74 dh_installdocs BUGS manual.pdf
75 dh_installexamples contrib/tigrc
76 dh_link
77 dh_strip
78 dh_compress -X.pdf
79 dh_fixperms
80 dh_installdeb
81 dh_shlibdeps
82 dh_gencontrol
83 dh_md5sums
84 dh_builddeb
86 binary: binary-indep binary-arch
87 .PHONY: build clean binary-indep binary-arch binary install