dir := emacs
emacs_sources := \
$(dir)/notmuch-lib.el \
+ $(dir)/notmuch-compat.el \
$(dir)/notmuch-parser.el \
$(dir)/notmuch.el \
$(dir)/notmuch-query.el \
$(dir)/notmuch-crypto.el \
$(dir)/notmuch-tag.el \
$(dir)/coolj.el \
- $(dir)/notmuch-print.el
+ $(dir)/notmuch-print.el \
+ $(dir)/notmuch-version.el \
+ $(dir)/notmuch-jump.el \
+ $(dir)/notmuch-company.el
+
+$(dir)/notmuch-version.el: $(dir)/Makefile.local version.stamp
+$(dir)/notmuch-version.el: $(srcdir)/$(dir)/notmuch-version.el.tmpl
+ @sed -e 's/%AG%/Generated file (from $(<F)) -- do not edit!/' \
+ -e 's/%VERSION%/"$(VERSION)"/' $< > $@
+
+$(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
emacs_images := \
$(srcdir)/$(dir)/notmuch-logo.png
$(dir)/.eldeps.x: $(dir)/.eldeps
@cmp -s $^ $@ || cp $^ $@
-include $(dir)/.eldeps.x
+
+# Add the one dependency make-deps.el does not have visibility to.
+$(dir)/notmuch-lib.elc: $(dir)/notmuch-version.elc
+
endif
CLEAN+=$(dir)/.eldeps $(dir)/.eldeps.tmp $(dir)/.eldeps.x
endif
.PHONY: install-emacs
-install-emacs:
+install-emacs: $(emacs_sources) $(emacs_images)
mkdir -p "$(DESTDIR)$(emacslispdir)"
install -m0644 $(emacs_sources) "$(DESTDIR)$(emacslispdir)"
ifeq ($(HAVE_EMACS),1)
mkdir -p "$(DESTDIR)$(emacsetcdir)"
install -m0644 $(emacs_images) "$(DESTDIR)$(emacsetcdir)"
-CLEAN := $(CLEAN) $(emacs_bytecode)
+CLEAN := $(CLEAN) $(emacs_bytecode) $(dir)/notmuch-version.el $(dir)/notmuch-pkg.el