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