2010-03-21 10:54:08 +01:00
|
|
|
# -*- makefile -*-
|
|
|
|
|
2010-03-10 19:59:57 +01:00
|
|
|
dir := emacs
|
2010-04-01 19:36:21 +02:00
|
|
|
emacs_sources := \
|
|
|
|
$(dir)/notmuch-lib.el \
|
2016-11-15 20:48:45 +01:00
|
|
|
$(dir)/notmuch-compat.el \
|
2013-06-01 02:40:06 +02:00
|
|
|
$(dir)/notmuch-parser.el \
|
2010-04-01 19:36:21 +02:00
|
|
|
$(dir)/notmuch.el \
|
2010-04-05 18:46:16 +02:00
|
|
|
$(dir)/notmuch-query.el \
|
2010-03-22 17:49:16 +01:00
|
|
|
$(dir)/notmuch-show.el \
|
2013-10-29 23:55:31 +01:00
|
|
|
$(dir)/notmuch-tree.el \
|
2010-04-22 10:27:33 +02:00
|
|
|
$(dir)/notmuch-wash.el \
|
2010-04-22 11:03:32 +02:00
|
|
|
$(dir)/notmuch-hello.el \
|
2010-04-22 11:03:43 +02:00
|
|
|
$(dir)/notmuch-mua.el \
|
2010-04-26 15:45:30 +02:00
|
|
|
$(dir)/notmuch-address.el \
|
2010-04-26 10:23:16 +02:00
|
|
|
$(dir)/notmuch-maildir-fcc.el \
|
2010-04-27 18:44:45 +02:00
|
|
|
$(dir)/notmuch-message.el \
|
2011-05-26 03:01:19 +02:00
|
|
|
$(dir)/notmuch-crypto.el \
|
2012-04-14 20:52:50 +02:00
|
|
|
$(dir)/notmuch-tag.el \
|
2012-01-18 09:00:21 +01:00
|
|
|
$(dir)/coolj.el \
|
2014-03-19 21:37:10 +01:00
|
|
|
$(dir)/notmuch-print.el \
|
2014-08-05 03:45:20 +02:00
|
|
|
$(dir)/notmuch-version.el \
|
|
|
|
$(dir)/notmuch-jump.el \
|
2016-11-13 15:08:48 +01:00
|
|
|
$(dir)/notmuch-company.el \
|
|
|
|
$(dir)/notmuch-draft.el
|
2014-03-19 21:37:10 +01:00
|
|
|
|
2016-11-19 18:44:29 +01:00
|
|
|
elpa_sources := ${emacs_sources} $(dir)/notmuch-pkg.el
|
|
|
|
|
2014-03-19 21:37:10 +01:00
|
|
|
$(dir)/notmuch-version.el: $(dir)/Makefile.local version.stamp
|
2014-04-12 13:59:46 +02:00
|
|
|
$(dir)/notmuch-version.el: $(srcdir)/$(dir)/notmuch-version.el.tmpl
|
2014-03-19 21:37:10 +01:00
|
|
|
@sed -e 's/%AG%/Generated file (from $(<F)) -- do not edit!/' \
|
|
|
|
-e 's/%VERSION%/"$(VERSION)"/' $< > $@
|
|
|
|
|
2016-11-11 12:46:50 +01:00
|
|
|
$(dir)/notmuch-pkg.el: $(srcdir)/$(dir)/notmuch-pkg.el.tmpl
|
|
|
|
@sed -e 's/%AG%/Generated file (from $(<F)) -- do not edit!/' \
|
|
|
|
-e 's/%VERSION%/"$(ELPA_VERSION)"/' $< > $@
|
|
|
|
|
|
|
|
all: $(dir)/notmuch-pkg.el
|
|
|
|
install-emacs: $(dir)/notmuch-pkg.el
|
2010-04-22 10:27:33 +02:00
|
|
|
|
2016-11-21 22:13:37 +01:00
|
|
|
emacs_mua := $(dir)/notmuch-emacs-mua
|
2016-11-21 22:13:38 +01:00
|
|
|
emacs_mua_desktop := $(dir)/notmuch-emacs-mua.desktop
|
2016-11-21 22:13:37 +01:00
|
|
|
|
2010-04-22 10:27:33 +02:00
|
|
|
emacs_images := \
|
2011-03-10 00:02:42 +01:00
|
|
|
$(srcdir)/$(dir)/notmuch-logo.png
|
2010-02-10 04:45:28 +01:00
|
|
|
|
2011-03-10 00:02:42 +01:00
|
|
|
emacs_bytecode = $(emacs_sources:.el=.elc)
|
2010-02-10 04:45:28 +01:00
|
|
|
|
2013-05-17 22:13:31 +02: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 21:00:47 +02:00
|
|
|
ifeq ($(HAVE_EMACS),1)
|
2013-05-17 22:13:31 +02: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-20 05:24:24 +01: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
|
2015-09-25 23:45:39 +02:00
|
|
|
|
|
|
|
# Add the one dependency make-deps.el does not have visibility to.
|
|
|
|
$(dir)/notmuch-lib.elc: $(dir)/notmuch-version.elc
|
|
|
|
|
2013-08-27 21:00:47 +02:00
|
|
|
endif
|
2014-02-20 05:24:24 +01:00
|
|
|
CLEAN+=$(dir)/.eldeps $(dir)/.eldeps.tmp $(dir)/.eldeps.x
|
2013-05-17 22:13:31 +02:00
|
|
|
|
2013-08-27 21:00:47 +02:00
|
|
|
ifeq ($(HAVE_EMACS),1)
|
2011-06-28 20:42:29 +02:00
|
|
|
%.elc: %.el $(global_deps)
|
2010-04-06 19:35:20 +02:00
|
|
|
$(call quiet,EMACS) --directory emacs -batch -f batch-byte-compile $<
|
2013-08-27 21:00:47 +02:00
|
|
|
endif
|
2010-04-06 19:35:20 +02:00
|
|
|
|
2016-11-19 18:44:29 +01:00
|
|
|
elpa: $(ELPA_FILE)
|
|
|
|
|
|
|
|
notmuch-emacs-%.tar: ${elpa_sources}
|
|
|
|
mkdir -p .elpa-build/notmuch-${ELPA_VERSION}
|
|
|
|
cp ${elpa_sources} .elpa-build/notmuch-${ELPA_VERSION}
|
|
|
|
tar -C .elpa-build -cf $@ notmuch-${ELPA_VERSION}
|
|
|
|
rm -r .elpa-build
|
|
|
|
|
2011-01-23 14:33:43 +01:00
|
|
|
ifeq ($(WITH_EMACS),1)
|
2010-04-06 19:35:20 +02:00
|
|
|
ifeq ($(HAVE_EMACS),1)
|
|
|
|
all: $(emacs_bytecode)
|
2013-08-27 21:00:47 +02:00
|
|
|
install-emacs: $(emacs_bytecode)
|
2010-04-06 19:35:20 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
install: install-emacs
|
2011-01-23 14:33:43 +01:00
|
|
|
endif
|
2010-02-10 04:45:28 +01:00
|
|
|
|
2010-04-05 21:59:06 +02:00
|
|
|
.PHONY: install-emacs
|
2014-05-10 23:36:43 +02:00
|
|
|
install-emacs: $(emacs_sources) $(emacs_images)
|
2011-01-26 14:29:15 +01:00
|
|
|
mkdir -p "$(DESTDIR)$(emacslispdir)"
|
|
|
|
install -m0644 $(emacs_sources) "$(DESTDIR)$(emacslispdir)"
|
2010-04-06 19:35:20 +02:00
|
|
|
ifeq ($(HAVE_EMACS),1)
|
2011-01-26 14:29:15 +01:00
|
|
|
install -m0644 $(emacs_bytecode) "$(DESTDIR)$(emacslispdir)"
|
2010-04-06 19:35:20 +02:00
|
|
|
endif
|
2011-10-25 10:07:02 +02:00
|
|
|
mkdir -p "$(DESTDIR)$(emacsetcdir)"
|
|
|
|
install -m0644 $(emacs_images) "$(DESTDIR)$(emacsetcdir)"
|
2016-11-21 22:13:37 +01:00
|
|
|
mkdir -p "$(DESTDIR)$(prefix)/bin/"
|
|
|
|
install $(emacs_mua) "$(DESTDIR)$(prefix)/bin"
|
2010-02-10 04:45:28 +01:00
|
|
|
|
2016-11-21 22:13:38 +01:00
|
|
|
.PHONY: install-desktop
|
|
|
|
install-desktop:
|
|
|
|
mkdir -p "$(DESTDIR)$(desktop_dir)"
|
|
|
|
desktop-file-install --mode 0644 --dir "$(DESTDIR)$(desktop_dir)" $(emacs_mua_desktop)
|
|
|
|
|
2016-11-11 12:46:50 +01:00
|
|
|
CLEAN := $(CLEAN) $(emacs_bytecode) $(dir)/notmuch-version.el $(dir)/notmuch-pkg.el
|