all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Richard Stallman <rms@gnu.org>
Cc: bug-cc-mode@gnu.org, Alan Mackenzie <alan.mackenzie_jwa@nxp.com>,
	emacs-devel@gnu.org
Subject: Re: Compilation order.  Tentative patch.
Date: Fri, 5 Oct 2007 21:54:43 +0000	[thread overview]
Message-ID: <20071005215443.GA27929@muc.de> (raw)
In-Reply-To: <E1IQeF8-0003Ov-6Z@fencepost.gnu.org>

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  <acm@muc.de>

	* 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).

  parent reply	other threads:[~2007-10-05 21:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-29  9:57 Compilation order. Help with makefiles, please! Alan Mackenzie_JWA
2007-08-30  7:15 ` Richard Stallman
2007-08-30 19:45   ` Stefan Monnier
2007-08-31  7:34     ` Richard Stallman
2007-08-31  8:57       ` Alan Mackenzie_JWA
2007-08-31 14:16         ` Stefan Monnier
2007-09-01  4:06         ` Richard Stallman
2007-10-05 21:54   ` Alan Mackenzie [this message]
2007-10-06  5:38     ` Compilation order. Tentative patch Mathias Megyei
2007-10-07  0:31     ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071005215443.GA27929@muc.de \
    --to=acm@muc.de \
    --cc=alan.mackenzie_jwa@nxp.com \
    --cc=bug-cc-mode@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.