1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
| | # -*- makefile -*-
dir := info
man_texi := $(dir)/notmuch.texi $(dir)/notmuch-search-terms.texi
man_info := $(man_texi:.texi=.info)
man_entry := $(man_texi:.texi=.entry)
texi_sources := $(dir)/notmuch-emacs.texi
emacs_info := $(texi_sources:.texi=.info)
info := $(emacs_info) $(man_info)
ifeq ($(HAVE_MAKEINFO),1)
all: $(info)
endif
ifeq ($(HAVE_INSTALLINFO),1)
install: install-info
endif
%.entry: ../pod/%.pod
printf "@dircategory Notmuch\n@direntry\n" > $@
printf "* %s: (%s). " $(*F) $(*F) >> $@
podselect -section Name $< | \
perl -n -e 's/notmuch.* - (.*)/\u\L$$1/ && print' >> $@
printf "@end direntry\n" >> $@
%.info: %.texi %.entry
makeinfo --no-split -o $@ $<
$(dir)/notmuch-emacs.info: $(dir)/notmuch-emacs.texi $(dir)/version.texi
%.texi: ../pod/%.pod
# a nasty hack, but the nicer ways seem to have bugs.
pod2texi $< | \
sed 's/@node Top/@include $(*F).entry\n@node Top/' > $@
.PHONY: $(dir)/version.texi
$(dir)/version.texi: version
printf "@set VERSION ${VERSION}\n" > $@
.PHONY: install-info
install-info: ${info}
mkdir -p "$(DESTDIR)$(INFODIR)"
install -m0644 $(info) "$(DESTDIR)$(INFODIR)"
install-info --section=Notmuch --info-dir=${DESTDIR}${INFODIR} $(emacs_info)
for ifile in $(man_info); do \
install-info --info-dir=${DESTDIR}${INFODIR} $${ifile}; \
done
CLEAN := $(CLEAN) $(info) $(man_entry) $(dir)/version.texi
|