emacs-devel
[Top][All Lists]
Advanced

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

Re: Compilation order. Tentative patch.


From: Alan Mackenzie
Subject: Re: Compilation order. Tentative patch.
Date: Fri, 5 Oct 2007 21:54:43 +0000
User-agent: Mutt/1.5.9i

On Sat, 18 Aug 2007 at 20:44:52 -0400, Richard Stallman wrote:
> Can you fo something to make recompilation of the cc files reliable?
> We see problems due to recompilation order over and over.
>
> For instance, if you put the macros etc. into one file whose name
> comes alphabetically before the rest, maybe everything will work
> reliably.

And, a bit later in the thread.....

On Thu, Aug 30, 2007 at 03:15:06AM -0400, Richard Stallman wrote:
>     [ACM:]
>     Is "major" not an exaggeration?  The sort of change I suggested
>     (recording the precise dependencies between the cc-*.elc files)
>     would be fairly localised in effect.  It could set a precedent for
>     further changes, though.
> 
> Exactly.
> 
>     Thus changing cc-langs.el makes a recompiliation of
>     cc-{mode,engine}.el necessary.  I can't see how this can be done
>     sensibly within the CC Mode files.
> 
> That is a valid argument.  I guess we do need to put specific files in
> lisp/Makefile.in.  I wish it were not necessary, but it is.
> 
> Please write it, and show us what the code looks like.

OK, here is my tentative patch.  It works, but is lacking in elegance.
Suggestions for increasing the elegance would be welcome.


2007-10-05  Alan Mackenzie  <address@hidden>

        * Makefile.in: Rigorously specify the dependencies between the CC
        Mode files.elc.
        (CC-MODE): New target.


Index: Makefile.in
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/Makefile.in,v
retrieving revision 1.85.2.3
diff -c -r1.85.2.3 Makefile.in
*** Makefile.in 19 Aug 2007 00:24:55 -0000      1.85.2.3
--- Makefile.in 5 Oct 2007 21:12:56 -0000
***************
*** 213,225 ****
        $(emacs) --eval "(batch-byte-recompile-directory 0)" $(lisp)
  
  # CC Mode uses a compile time macro system which causes a compile time
! # dependency in cc-mode.elc on the macros in cc-langs.el and the
! # version string in cc-defs.el.
! $(lisp)/progmodes/cc-mode.elc: \
!       $(lisp)/progmodes/cc-mode.el \
!       $(lisp)/progmodes/cc-langs.el \
!       $(lisp)/progmodes/cc-defs.el
!       $(emacs) -f batch-byte-compile $(lisp)/progmodes/cc-mode.el
  
  # Update MH-E internal autoloads. These are not to be confused with
  # the autoloads for the MH-E entry points, which are already in
--- 213,246 ----
        $(emacs) --eval "(batch-byte-recompile-directory 0)" $(lisp)
  
  # CC Mode uses a compile time macro system which causes a compile time
! # dependency in cc-mode.elc, cc-engine.elc, and cc-fonts.elc on the "language
! # variables" in cc-langs.el.  A(lmost) all CC files depend on the macros in
! # cc-defs.elc and the bytecomp stuff in cc-bytecomp.el.
! pr=$(lisp)/progmodes
! .PHONY: CC-MODE
! CC-MODE: $(pr)/cc-align.elc $(pr)/cc-awk.elc $(pr)/cc-bytecomp.elc 
$(pr)/cc-cmds.elc $(pr)/cc-compat.elc $(pr)/cc-defs.elc $(pr)/cc-engine.elc 
$(pr)/cc-fonts.elc $(pr)/cc-langs.elc $(pr)/cc-mode.elc $(pr)/cc-menus.elc 
$(pr)/cc-styles.elc $(pr)/cc-subword.elc $(pr)/cc-vars.elc
! 
! # "Top level" CC Mode files:
! $(pr)/cc-align.elc \
! $(pr)/cc-awk.elc \
! $(pr)/cc-cmds.elc \
! $(pr)/cc-compat.elc \
! $(pr)/cc-menus.elc \
! $(pr)/cc-styles.elc \
! $(pr)/cc-subword.elc \
! $(pr)/cc-vars.elc: \
!     $(pr)/cc-defs.elc $(pr)/cc-bytecomp.elc
! 
! # CC Mode files which defvar, initialise, or use the "language variables":
! $(pr)/cc-mode.elc \
! $(pr)/cc-engine.elc \
! $(pr)/cc-fonts.elc: \
!      $(pr)/cc-langs.elc $(pr)/cc-defs.elc $(pr)/cc-bytecomp.elc
! 
! # CC Mode file which defines the language variables and their values:
! $(pr)/cc-langs.elc: $(pr)/cc-defs.elc $(pr)/cc-bytecomp.elc
! # CC Mode main macro definition file:
! $(pr)/cc-defs.elc: $(pr)/cc-bytecomp.elc
  
  # Update MH-E internal autoloads. These are not to be confused with
  # the autoloads for the MH-E entry points, which are already in

  
-- 
Alan Mackenzie (Ittersbach, Germany).




reply via email to

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