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