2010-03-21 09:54:08 +00:00
|
|
|
# -*- makefile -*-
|
|
|
|
|
2010-03-10 10:59:57 -08:00
|
|
|
dir := emacs
|
2010-04-01 18:36:21 +01:00
|
|
|
emacs_sources := \
|
|
|
|
$(dir)/notmuch-lib.el \
|
2013-05-31 20:40:06 -04:00
|
|
|
$(dir)/notmuch-parser.el \
|
2010-04-01 18:36:21 +01:00
|
|
|
$(dir)/notmuch.el \
|
2010-04-05 13:46:16 -03:00
|
|
|
$(dir)/notmuch-query.el \
|
2010-03-22 16:49:16 +00:00
|
|
|
$(dir)/notmuch-show.el \
|
2013-10-29 22:55:31 +00:00
|
|
|
$(dir)/notmuch-tree.el \
|
2010-04-22 09:27:33 +01:00
|
|
|
$(dir)/notmuch-wash.el \
|
2010-04-22 10:03:32 +01:00
|
|
|
$(dir)/notmuch-hello.el \
|
2010-04-22 10:03:43 +01:00
|
|
|
$(dir)/notmuch-mua.el \
|
2010-04-26 14:45:30 +01:00
|
|
|
$(dir)/notmuch-address.el \
|
2010-04-26 10:23:16 +02:00
|
|
|
$(dir)/notmuch-maildir-fcc.el \
|
2010-04-27 12:44:45 -04:00
|
|
|
$(dir)/notmuch-message.el \
|
2011-05-25 18:01:19 -07:00
|
|
|
$(dir)/notmuch-crypto.el \
|
2012-04-14 11:52:50 -07:00
|
|
|
$(dir)/notmuch-tag.el \
|
2012-01-18 08:00:21 +00:00
|
|
|
$(dir)/coolj.el \
|
|
|
|
$(dir)/notmuch-print.el
|
2010-04-22 09:27:33 +01:00
|
|
|
|
|
|
|
emacs_images := \
|
2011-03-09 15:02:42 -08:00
|
|
|
$(srcdir)/$(dir)/notmuch-logo.png
|
2010-02-09 23:45:28 -04:00
|
|
|
|
2011-03-09 15:02:42 -08:00
|
|
|
emacs_bytecode = $(emacs_sources:.el=.elc)
|
2010-02-09 23:45:28 -04:00
|
|
|
|
2013-05-17 16:13:31 -04:00
|
|
|
# Because of defmacro's and defsubst's, we have to account for load
|
|
|
|
# dependencies between Elisp files when byte compiling. Otherwise,
|
|
|
|
# the byte compiler may load an old .elc file when processing a
|
|
|
|
# "require" or we may fail to rebuild a .elc that depended on a macro
|
|
|
|
# from an updated file.
|
2013-08-27 22:00:47 +03:00
|
|
|
ifeq ($(HAVE_EMACS),1)
|
2013-05-17 16:13:31 -04:00
|
|
|
$(dir)/.eldeps: $(dir)/Makefile.local $(dir)/make-deps.el $(emacs_sources)
|
|
|
|
$(call quiet,EMACS) --directory emacs -batch -l make-deps.el \
|
|
|
|
-f batch-make-deps $(emacs_sources) > $@.tmp && \
|
2014-02-19 23:24:24 -05:00
|
|
|
mv $@.tmp $@
|
|
|
|
# We could include .eldeps directly, but that would cause a make
|
|
|
|
# restart whenever any .el file was modified, even if dependencies
|
|
|
|
# didn't change, because the mtime of .eldeps will change. Instead,
|
|
|
|
# we include a second file, .eldeps.x, which we ensure always has the
|
|
|
|
# same content as .eldeps, but its mtime only changes when dependency
|
|
|
|
# information changes, in which case a make restart is necessary
|
|
|
|
# anyway.
|
|
|
|
$(dir)/.eldeps.x: $(dir)/.eldeps
|
|
|
|
@cmp -s $^ $@ || cp $^ $@
|
|
|
|
-include $(dir)/.eldeps.x
|
2013-08-27 22:00:47 +03:00
|
|
|
endif
|
2014-02-19 23:24:24 -05:00
|
|
|
CLEAN+=$(dir)/.eldeps $(dir)/.eldeps.tmp $(dir)/.eldeps.x
|
2013-05-17 16:13:31 -04:00
|
|
|
|
2013-08-27 22:00:47 +03:00
|
|
|
ifeq ($(HAVE_EMACS),1)
|
2011-06-28 11:42:29 -07:00
|
|
|
%.elc: %.el $(global_deps)
|
2010-04-06 10:35:20 -07:00
|
|
|
$(call quiet,EMACS) --directory emacs -batch -f batch-byte-compile $<
|
2013-08-27 22:00:47 +03:00
|
|
|
endif
|
2010-04-06 10:35:20 -07:00
|
|
|
|
2011-01-23 14:33:43 +01:00
|
|
|
ifeq ($(WITH_EMACS),1)
|
2010-04-06 10:35:20 -07:00
|
|
|
ifeq ($(HAVE_EMACS),1)
|
|
|
|
all: $(emacs_bytecode)
|
2013-08-27 22:00:47 +03:00
|
|
|
install-emacs: $(emacs_bytecode)
|
2010-04-06 10:35:20 -07:00
|
|
|
endif
|
|
|
|
|
|
|
|
install: install-emacs
|
2011-01-23 14:33:43 +01:00
|
|
|
endif
|
2010-02-09 23:45:28 -04:00
|
|
|
|
2010-04-05 12:59:06 -07:00
|
|
|
.PHONY: install-emacs
|
2010-04-06 10:35:20 -07:00
|
|
|
install-emacs:
|
2011-01-26 23:29:15 +10:00
|
|
|
mkdir -p "$(DESTDIR)$(emacslispdir)"
|
|
|
|
install -m0644 $(emacs_sources) "$(DESTDIR)$(emacslispdir)"
|
2010-04-06 10:35:20 -07:00
|
|
|
ifeq ($(HAVE_EMACS),1)
|
2011-01-26 23:29:15 +10:00
|
|
|
install -m0644 $(emacs_bytecode) "$(DESTDIR)$(emacslispdir)"
|
2010-04-06 10:35:20 -07:00
|
|
|
endif
|
2011-10-25 10:07:02 +02:00
|
|
|
mkdir -p "$(DESTDIR)$(emacsetcdir)"
|
|
|
|
install -m0644 $(emacs_images) "$(DESTDIR)$(emacsetcdir)"
|
2010-02-09 23:45:28 -04:00
|
|
|
|
|
|
|
CLEAN := $(CLEAN) $(emacs_bytecode)
|