# -*- 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