]> git.notmuchmail.org Git - notmuch/blob - emacs/Makefile.local
emacs: Compute build dependencies to fix byte compile issues
[notmuch] / emacs / Makefile.local
1 # -*- makefile -*-
2
3 dir := emacs
4 emacs_sources := \
5         $(dir)/notmuch-lib.el \
6         $(dir)/notmuch.el \
7         $(dir)/notmuch-query.el \
8         $(dir)/notmuch-show.el \
9         $(dir)/notmuch-wash.el \
10         $(dir)/notmuch-hello.el \
11         $(dir)/notmuch-mua.el \
12         $(dir)/notmuch-address.el \
13         $(dir)/notmuch-maildir-fcc.el \
14         $(dir)/notmuch-message.el \
15         $(dir)/notmuch-crypto.el \
16         $(dir)/notmuch-tag.el \
17         $(dir)/coolj.el \
18         $(dir)/notmuch-print.el
19
20 emacs_images := \
21         $(srcdir)/$(dir)/notmuch-logo.png
22
23 emacs_bytecode = $(emacs_sources:.el=.elc)
24
25 # Because of defmacro's and defsubst's, we have to account for load
26 # dependencies between Elisp files when byte compiling.  Otherwise,
27 # the byte compiler may load an old .elc file when processing a
28 # "require" or we may fail to rebuild a .elc that depended on a macro
29 # from an updated file.
30 $(dir)/.eldeps: $(dir)/Makefile.local $(dir)/make-deps.el $(emacs_sources)
31         $(call quiet,EMACS) --directory emacs -batch -l make-deps.el \
32                 -f batch-make-deps $(emacs_sources) > $@.tmp && \
33                 (cmp -s $@.tmp $@ || mv $@.tmp $@)
34 -include $(dir)/.eldeps
35 CLEAN+=$(dir)/.eldeps $(dir)/.eldeps.tmp
36
37 %.elc: %.el $(global_deps)
38         $(call quiet,EMACS) --directory emacs -batch -f batch-byte-compile $<
39
40 ifeq ($(WITH_EMACS),1)
41 ifeq ($(HAVE_EMACS),1)
42 all: $(emacs_bytecode)
43 endif
44
45 install: install-emacs
46 endif
47
48 .PHONY: install-emacs
49 install-emacs:
50         mkdir -p "$(DESTDIR)$(emacslispdir)"
51         install -m0644 $(emacs_sources) "$(DESTDIR)$(emacslispdir)"
52 ifeq ($(HAVE_EMACS),1)
53         install -m0644 $(emacs_bytecode) "$(DESTDIR)$(emacslispdir)"
54 endif
55         mkdir -p "$(DESTDIR)$(emacsetcdir)"
56         install -m0644 $(emacs_images) "$(DESTDIR)$(emacsetcdir)"
57
58 CLEAN := $(CLEAN) $(emacs_bytecode)