From: Stefano Lattarini Date: Tue, 7 Aug 2012 16:35:54 +0000 (+0200) Subject: [ng] elisp: use more GNU make features in recipes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ffe64f1c121d63e07f291db2eda5f52cb2f58112;p=thirdparty%2Fautomake.git [ng] elisp: use more GNU make features in recipes * lib/am/lisp.am (%.elc: %.el): Here, with the help of ... [%?FIRST%] (am.elisp.includes): ... this new internal variable. Signed-off-by: Stefano Lattarini --- diff --git a/lib/am/lisp.am b/lib/am/lisp.am index 538a6ca44..b4b850e24 100644 --- a/lib/am/lisp.am +++ b/lib/am/lisp.am @@ -22,6 +22,10 @@ endif %?INSTALL% ## Building. ## ## ---------- ## +if %?FIRST% +am.elisp.includes = -L $1 $(if $(filter-out .,$(srcdir)), -L $(srcdir)/$1) +endif + %.elc: %.el ## We add $(builddir) and $(srcdir) to load-path, so that any '.el' files ## that $< depends upon can be found (including generated ones). @@ -31,16 +35,12 @@ endif %?INSTALL% ## input (which would erronously put it in $(srcdir) in VPATH builds), ## so we override that, too. if test "$(EMACS)" != "no"; then \ - am__subdir_includes=''; \ - case $@ in */*) \ - am__dir=`echo '$@' | sed 's,/[^/]*$$,,'`; \ - am__subdir_includes="-L $$am__dir -L $(srcdir)/$$am__dir"; \ - esac; \ ## Emacs byte-compilation won't create this automatically, sadly. - test -d $$am__dir || $(MKDIR_P) $$am__dir || exit 1; \ + $(call am.cmd.ensure-dir-exists,$(@D)); \ $(EMACS) --batch \ $(AM_ELCFLAGS) $(ELCFLAGS) \ - $$am__subdir_includes -L $(builddir) -L $(srcdir) \ + $(if $(filter-out .,$(@D)),$(call am.elisp.includes,$(@D))) \ + $(call am.elisp.includes,.) \ --eval "(defun byte-compile-dest-file (f) \"$@\")" \ --eval "(unless (byte-compile-file \"$<\") (kill-emacs 1))"; \ else :; fi