5 $(dir)/notmuch-lib.el \
6 $(dir)/notmuch-compat.el \
7 $(dir)/notmuch-parser.el \
9 $(dir)/notmuch-query.el \
10 $(dir)/notmuch-show.el \
11 $(dir)/notmuch-tree.el \
12 $(dir)/notmuch-wash.el \
13 $(dir)/notmuch-hello.el \
14 $(dir)/notmuch-mua.el \
15 $(dir)/notmuch-address.el \
16 $(dir)/notmuch-maildir-fcc.el \
17 $(dir)/notmuch-message.el \
18 $(dir)/notmuch-crypto.el \
19 $(dir)/notmuch-tag.el \
21 $(dir)/notmuch-print.el \
22 $(dir)/notmuch-version.el \
23 $(dir)/notmuch-jump.el \
24 $(dir)/notmuch-company.el \
25 $(dir)/notmuch-draft.el
27 elpa_sources := ${emacs_sources} $(dir)/notmuch-pkg.el
29 $(dir)/notmuch-version.el: $(dir)/Makefile.local version.stamp
30 $(dir)/notmuch-version.el: $(srcdir)/$(dir)/notmuch-version.el.tmpl
31 @sed -e 's/%AG%/Generated file (from $(<F)) -- do not edit!/' \
32 -e 's/%VERSION%/"$(VERSION)"/' $< > $@
34 $(dir)/notmuch-pkg.el: $(srcdir)/$(dir)/notmuch-pkg.el.tmpl
35 @sed -e 's/%AG%/Generated file (from $(<F)) -- do not edit!/' \
36 -e 's/%VERSION%/"$(ELPA_VERSION)"/' $< > $@
38 all: $(dir)/notmuch-pkg.el
39 install-emacs: $(dir)/notmuch-pkg.el
41 emacs_mua := $(dir)/notmuch-emacs-mua
42 emacs_mua_desktop := $(dir)/notmuch-emacs-mua.desktop
45 $(srcdir)/$(dir)/notmuch-logo.png
47 emacs_bytecode = $(emacs_sources:.el=.elc)
49 # Because of defmacro's and defsubst's, we have to account for load
50 # dependencies between Elisp files when byte compiling. Otherwise,
51 # the byte compiler may load an old .elc file when processing a
52 # "require" or we may fail to rebuild a .elc that depended on a macro
53 # from an updated file.
54 ifeq ($(HAVE_EMACS),1)
55 $(dir)/.eldeps: $(dir)/Makefile.local $(dir)/make-deps.el $(emacs_sources)
56 $(call quiet,EMACS) --directory emacs -batch -l make-deps.el \
57 -f batch-make-deps $(emacs_sources) > $@.tmp && \
59 # We could include .eldeps directly, but that would cause a make
60 # restart whenever any .el file was modified, even if dependencies
61 # didn't change, because the mtime of .eldeps will change. Instead,
62 # we include a second file, .eldeps.x, which we ensure always has the
63 # same content as .eldeps, but its mtime only changes when dependency
64 # information changes, in which case a make restart is necessary
66 $(dir)/.eldeps.x: $(dir)/.eldeps
67 @cmp -s $^ $@ || cp $^ $@
68 -include $(dir)/.eldeps.x
70 # Add the one dependency make-deps.el does not have visibility to.
71 $(dir)/notmuch-lib.elc: $(dir)/notmuch-version.elc
74 CLEAN+=$(dir)/.eldeps $(dir)/.eldeps.tmp $(dir)/.eldeps.x
76 ifeq ($(HAVE_EMACS),1)
77 %.elc: %.el $(global_deps)
78 $(call quiet,EMACS) --directory emacs -batch -f batch-byte-compile $<
83 ELPA_DIR=.elpa-build/notmuch-${ELPA_VERSION}
84 notmuch-emacs-%.tar: ${elpa_sources} build-info
85 mkdir -p .elpa-build/notmuch-${ELPA_VERSION}
86 cp ${elpa_sources} ${ELPA_DIR}
87 ifeq ($(HAVE_SPHINX)$(HAVE_MAKEINFO)$(HAVE_INSTALL_INFO),111)
88 cp ${INFO_INFO_FILES} ${ELPA_DIR}
89 for file in ${INFO_INFO_FILES}; do install-info $$file ${ELPA_DIR}/dir; done
91 tar -C .elpa-build -cf $@ notmuch-${ELPA_VERSION}
94 ifeq ($(WITH_EMACS),1)
95 ifeq ($(HAVE_EMACS),1)
96 all: $(emacs_bytecode)
97 install-emacs: $(emacs_bytecode)
100 install: install-emacs
103 .PHONY: install-emacs
104 install-emacs: $(emacs_sources) $(emacs_images)
105 mkdir -p "$(DESTDIR)$(emacslispdir)"
106 install -m0644 $(emacs_sources) "$(DESTDIR)$(emacslispdir)"
107 ifeq ($(HAVE_EMACS),1)
108 install -m0644 $(emacs_bytecode) "$(DESTDIR)$(emacslispdir)"
110 mkdir -p "$(DESTDIR)$(emacsetcdir)"
111 install -m0644 $(emacs_images) "$(DESTDIR)$(emacsetcdir)"
112 mkdir -p "$(DESTDIR)$(prefix)/bin/"
113 install $(emacs_mua) "$(DESTDIR)$(prefix)/bin"
114 ifeq ($(WITH_DESKTOP),1)
115 mkdir -p "$(DESTDIR)$(desktop_dir)"
116 desktop-file-install --mode 0644 --dir "$(DESTDIR)$(desktop_dir)" $(emacs_mua_desktop)
117 -update-desktop-database "$(DESTDIR)$(desktop_dir)"
120 CLEAN := $(CLEAN) $(emacs_bytecode) $(dir)/notmuch-version.el $(dir)/notmuch-pkg.el