5 # this variable seems to be needed to prevent lazy evaluation causing
6 # problems with $(dir) changing values.
7 MAIN_PAGE := $(dir)/man1/notmuch.1
11 $(dir)/man1/notmuch-config.1 \
12 $(dir)/man1/notmuch-count.1 \
13 $(dir)/man1/notmuch-dump.1 \
14 $(dir)/man1/notmuch-restore.1 \
15 $(dir)/man1/notmuch-insert.1 \
16 $(dir)/man1/notmuch-new.1 \
17 $(dir)/man1/notmuch-reply.1 \
18 $(dir)/man1/notmuch-search.1 \
19 $(dir)/man1/notmuch-show.1 \
20 $(dir)/man1/notmuch-tag.1
22 MAN5 := $(dir)/man5/notmuch-hooks.5
23 MAN7 := $(dir)/man7/notmuch-search-terms.7
25 MAN1_GZ := $(addsuffix .gz,$(MAN1))
26 MAN5_GZ := $(addsuffix .gz,$(MAN5))
27 MAN7_GZ := $(addsuffix .gz,$(MAN7))
29 MAN_SOURCE := $(MAN1) $(MAN5) $(MAN7)
30 MAN_BACKUP := $(addsuffix .bak,$(MAN_SOURCE))
31 COMPRESSED_MAN := $(MAN1_GZ) $(MAN5_GZ) $(MAN7_GZ)
36 .PHONY: install-man update-man-versions
38 install-man: $(COMPRESSED_MAN)
39 mkdir -p "$(DESTDIR)$(mandir)/man1"
40 mkdir -p "$(DESTDIR)$(mandir)/man5"
41 mkdir -p "$(DESTDIR)$(mandir)/man7"
42 install -m0644 $(MAN1_GZ) $(DESTDIR)/$(mandir)/man1
43 install -m0644 $(MAN5_GZ) $(DESTDIR)/$(mandir)/man5
44 install -m0644 $(MAN7_GZ) $(DESTDIR)/$(mandir)/man7
45 cd $(DESTDIR)/$(mandir)/man1 && ln -sf notmuch.1.gz notmuch-setup.1.gz
47 update-man-versions: $(MAN_SOURCE)
48 for file in $(MAN_SOURCE); do \
49 cp $$file $$file.bak ; \
50 sed "s/^.TH NOTMUCH\([^[:blank:]]*\) \([1-9]\) .*$$/.TH NOTMUCH\1 \2 ${DATE} \"Notmuch ${VERSION}\"/" \
51 < $$file.bak > $$file; \
54 CLEAN := $(CLEAN) $(COMPRESSED_MAN) $(MAN_BACKUP)