1 #!/usr/bin/make -f
2 # debian/rules for tig
3 #
4 # Written by Sebastian Harl <sh@tokkee.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
16 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
17 CFLAGS += -O0
18 else
19 CFLAGS += -O2
20 endif
22 include /usr/share/dpatch/dpatch.make
24 config.status: configure
25 dh_testdir
26 ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
27 --prefix=/usr --mandir=\$${prefix}/share/man --sysconfdir=/etc \
28 CFLAGS="$(CFLAGS)"
30 build: build-stamp
32 build-stamp: config.status $(DPATCH_STAMPFN)
33 dh_testdir
35 $(MAKE) all doc
37 touch build-stamp
39 clean: unpatch
40 dh_testdir
41 dh_testroot
42 rm -f build-stamp
44 $(MAKE) clean
46 rm -f config.h config.log config.make config.status
47 rm -rf manual.html-chunked/
48 rm -f manual.pdf manual.html manual.toc
49 rm -f tig.1 tig.1.html tigrc.5 tigrc.5.html
50 rm -f NEWS.html README.html
52 dh_clean
54 install: build
55 dh_testdir
56 dh_testroot
57 dh_clean -k
58 dh_installdirs
60 $(MAKE) install install-doc DESTDIR=$(CURDIR)/debian/tig
62 mkdir -p debian/tig/etc/bash_completion.d
63 cp contrib/tig-completion.bash debian/tig/etc/bash_completion.d/tig
64 chmod 644 debian/tig/etc/bash_completion.d/tig
66 binary-indep:
67 # nothing to do here
69 binary-arch: build install
70 dh_testdir
71 dh_testroot
72 dh_installchangelogs
73 dh_installdocs NEWS BUGS TODO manual.pdf
74 dh_installexamples contrib/tigrc
75 dh_link
76 dh_strip
77 dh_compress -X.pdf
78 dh_fixperms
79 dh_installdeb
80 dh_shlibdeps
81 dh_gencontrol
82 dh_md5sums
83 dh_builddeb
85 binary: binary-indep binary-arch
86 .PHONY: build clean binary-indep binary-arch binary install patch unpatch