From: Alexandre Duret-Lutz Date: Sun, 1 Feb 2004 12:18:02 +0000 (+0000) Subject: * automake.in (handle_emacs_lisp): Define $(ELCFILES) as X-Git-Tag: v1.10.2~604 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c4bc227523a48dac4bad173cf196cdf8963633d;p=platform%2Fupstream%2Fautomake.git * automake.in (handle_emacs_lisp): Define $(ELCFILES) as $(am__ELCFILES), and always push it on @all. Do not mention elc-stamp. * lib/am/lisp.am (.el.elc): Rewrite as ... ($(am__ELCFILES)): ... this, and depend on elc-stamp. (elc-stamp): Make sure elc-stamp is older that all .elc files, as explained in the manual entry below. --- diff --git a/ChangeLog b/ChangeLog index da0a60424..fa0676d2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2004-02-01 Alexandre Duret-Lutz + * automake.in (handle_emacs_lisp): Define $(ELCFILES) as + $(am__ELCFILES), and always push it on @all. Do not mention + elc-stamp. + * lib/am/lisp.am (.el.elc): Rewrite as ... + ($(am__ELCFILES)): ... this, and depend on elc-stamp. + (elc-stamp): Make sure elc-stamp is older that all .elc files, as + explained in the manual entry below. + * doc/automake.texi (multiple outputs): New node. 2004-01-31 Alexandre Duret-Lutz diff --git a/automake.in b/automake.in index 2591c76bf..c383d69c5 100755 --- a/automake.in +++ b/automake.in @@ -4328,24 +4328,14 @@ sub handle_emacs_lisp return if ! @elfiles; - # Generate .elc files. - my @elcfiles = map { $_->[1] . 'c' } @elfiles; - - define_pretty_variable ('ELCFILES', TRUE, INTERNAL, @elcfiles); define_pretty_variable ('am__ELFILES', TRUE, INTERNAL, map { $_->[1] } @elfiles); + define_pretty_variable ('am__ELCFILES', TRUE, INTERNAL, + '$(am__ELFILES:.el=.elc)'); + # This one can be overridden by users. + define_pretty_variable ('ELCFILES', TRUE, INTERNAL, '$(am__ELCFILES)'); - # Do not depend on the build rules if ELCFILES is empty. - # This is necessary because overriding ELCFILES= is a documented - # idiom to disable byte-compilation. - if (variable_value ('ELCFILES')) - { - # It's important that all depends on elc-stamp so that - # all .elc files get recompiled whenever a .el changes. - # It's important that all depends on $(ELCFILES) so that - # we can recover if any of them is deleted. - push (@all, 'elc-stamp', '$(ELCFILES)'); - } + push @all, '$(ELCFILES)'; require_variables ($elfiles[0][0], "Emacs Lisp sources seen", TRUE, 'EMACS', 'lispdir'); diff --git a/lib/am/lisp.am b/lib/am/lisp.am index 392ae6ced..a9232a8a2 100644 --- a/lib/am/lisp.am +++ b/lib/am/lisp.am @@ -27,6 +27,7 @@ endif %?INSTALL% elc-stamp: $(am__ELFILES) @echo 'WARNING: Warnings can be ignored. :-)' + @rm -f elc-temp && touch elc-temp if test "$(EMACS)" != no; then \ ## Make sure "$@" isn't empty initially. set x; \ @@ -40,15 +41,19 @@ elc-stamp: $(am__ELFILES) shift; \ EMACS="$(EMACS)" $(SHELL) $(elisp_comp) "$$@" || exit 1; \ else : ; fi - touch $@ + @mv -f elc-temp $@ -.el.elc: +## Do not use $(ELCFILES) as target, because it may have been emptied +## by the user (to disable byte-compilation), and POSIX does not allow +## an empty target. +$(am__ELCFILES): elc-stamp ## Recover from the removal of $@ @if test ! -f $@; then \ rm -f elc-stamp; \ $(MAKE) $(AM_MAKEFLAGS) elc-stamp; \ else : ; fi + ## ------------ ## ## Installing. ## ## ------------ ##