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-compact.1 \
12 $(dir)/man1/notmuch-config.1 \
13 $(dir)/man1/notmuch-count.1 \
14 $(dir)/man1/notmuch-dump.1 \
15 $(dir)/man1/notmuch-restore.1 \
16 $(dir)/man1/notmuch-insert.1 \
17 $(dir)/man1/notmuch-new.1 \
18 $(dir)/man1/notmuch-reply.1 \
19 $(dir)/man1/notmuch-search.1 \
20 $(dir)/man1/notmuch-show.1 \
21 $(dir)/man1/notmuch-tag.1
23 MAN5 := $(dir)/man5/notmuch-hooks.5
24 MAN7 := $(dir)/man7/notmuch-search-terms.7
26 MAN1_GZ := $(addsuffix .gz,$(MAN1))
27 MAN5_GZ := $(addsuffix .gz,$(MAN5))
28 MAN7_GZ := $(addsuffix .gz,$(MAN7))
30 MAN_SOURCE := $(MAN1) $(MAN5) $(MAN7)
31 MAN_BACKUP := $(addsuffix .bak,$(MAN_SOURCE))
32 COMPRESSED_MAN := $(MAN1_GZ) $(MAN5_GZ) $(MAN7_GZ)
37 .PHONY: install-man update-man-versions
39 install-man: $(COMPRESSED_MAN)
40 mkdir -p "$(DESTDIR)$(mandir)/man1"
41 mkdir -p "$(DESTDIR)$(mandir)/man5"
42 mkdir -p "$(DESTDIR)$(mandir)/man7"
43 install -m0644 $(MAN1_GZ) $(DESTDIR)/$(mandir)/man1
44 install -m0644 $(MAN5_GZ) $(DESTDIR)/$(mandir)/man5
45 install -m0644 $(MAN7_GZ) $(DESTDIR)/$(mandir)/man7
46 cd $(DESTDIR)/$(mandir)/man1 && ln -sf notmuch.1.gz notmuch-setup.1.gz
48 update-man-versions: $(MAN_SOURCE)
49 for file in $(MAN_SOURCE); do \
50 cp $$file $$file.bak ; \
51 sed "s/^.TH NOTMUCH\([^[:blank:]]*\) \([1-9]\) .*$$/.TH NOTMUCH\1 \2 ${DATE} \"Notmuch ${VERSION}\"/" \
52 < $$file.bak > $$file; \
55 CLEAN := $(CLEAN) $(COMPRESSED_MAN) $(MAN_BACKUP)