]> git.notmuchmail.org Git - notmuch/blob - emacs/Makefile.local
Merge tag 'debian/0.18.1-2'
[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-tree.el \
11         $(dir)/notmuch-wash.el \
12         $(dir)/notmuch-hello.el \
13         $(dir)/notmuch-mua.el \
14         $(dir)/notmuch-address.el \
15         $(dir)/notmuch-maildir-fcc.el \
16         $(dir)/notmuch-message.el \
17         $(dir)/notmuch-crypto.el \
18         $(dir)/notmuch-tag.el \
19         $(dir)/coolj.el \
20         $(dir)/notmuch-print.el \
21         $(dir)/notmuch-version.el \
22         $(dir)/notmuch-jump.el \
23
24 $(dir)/notmuch-version.el: $(dir)/Makefile.local version.stamp
25 $(dir)/notmuch-version.el: $(srcdir)/$(dir)/notmuch-version.el.tmpl
26         @sed -e 's/%AG%/Generated file (from $(<F)) -- do not edit!/' \
27              -e 's/%VERSION%/"$(VERSION)"/' $< > $@
28
29
30 emacs_images := \
31         $(srcdir)/$(dir)/notmuch-logo.png
32
33 emacs_bytecode = $(emacs_sources:.el=.elc)
34
35 # Because of defmacro's and defsubst's, we have to account for load
36 # dependencies between Elisp files when byte compiling.  Otherwise,
37 # the byte compiler may load an old .elc file when processing a
38 # "require" or we may fail to rebuild a .elc that depended on a macro
39 # from an updated file.
40 ifeq ($(HAVE_EMACS),1)
41 $(dir)/.eldeps: $(dir)/Makefile.local $(dir)/make-deps.el $(emacs_sources)
42         $(call quiet,EMACS) --directory emacs -batch -l make-deps.el \
43                 -f batch-make-deps $(emacs_sources) > $@.tmp && \
44                 mv $@.tmp $@
45 # We could include .eldeps directly, but that would cause a make
46 # restart whenever any .el file was modified, even if dependencies
47 # didn't change, because the mtime of .eldeps will change.  Instead,
48 # we include a second file, .eldeps.x, which we ensure always has the
49 # same content as .eldeps, but its mtime only changes when dependency
50 # information changes, in which case a make restart is necessary
51 # anyway.
52 $(dir)/.eldeps.x: $(dir)/.eldeps
53         @cmp -s $^ $@ || cp $^ $@
54 -include $(dir)/.eldeps.x
55 endif
56 CLEAN+=$(dir)/.eldeps $(dir)/.eldeps.tmp $(dir)/.eldeps.x
57
58 ifeq ($(HAVE_EMACS),1)
59 %.elc: %.el $(global_deps)
60         $(call quiet,EMACS) --directory emacs -batch -f batch-byte-compile $<
61 endif
62
63 ifeq ($(WITH_EMACS),1)
64 ifeq ($(HAVE_EMACS),1)
65 all: $(emacs_bytecode)
66 install-emacs: $(emacs_bytecode)
67 endif
68
69 install: install-emacs
70 endif
71
72 .PHONY: install-emacs
73 install-emacs: $(emacs_sources) $(emacs_images)
74         mkdir -p "$(DESTDIR)$(emacslispdir)"
75         install -m0644 $(emacs_sources) "$(DESTDIR)$(emacslispdir)"
76 ifeq ($(HAVE_EMACS),1)
77         install -m0644 $(emacs_bytecode) "$(DESTDIR)$(emacslispdir)"
78 endif
79         mkdir -p "$(DESTDIR)$(emacsetcdir)"
80         install -m0644 $(emacs_images) "$(DESTDIR)$(emacsetcdir)"
81
82 CLEAN := $(CLEAN) $(emacs_bytecode) $(dir)/notmuch-version.el