automake-ng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-NG] [FYI] [ng] elisp: use more GNU make features in recipes


From: Stefano Lattarini
Subject: [Automake-NG] [FYI] [ng] elisp: use more GNU make features in recipes
Date: Tue, 7 Aug 2012 18:36:18 +0200

* lib/am/lisp.am (%.elc: %.el): Here, with the help of ...
[%?FIRST%] (am.elisp.includes): ... this new internal variable.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 lib/am/lisp.am | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/am/lisp.am b/lib/am/lisp.am
index 538a6ca..b4b850e 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) \"address@hidden")" \
            --eval "(unless (byte-compile-file \"$<\") (kill-emacs 1))"; \
        else :; fi
-- 
1.7.12.rc0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]