From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Compilation order. Tentative patch. Date: Fri, 5 Oct 2007 21:54:43 +0000 Message-ID: <20071005215443.GA27929@muc.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1191621042 1523 80.91.229.12 (5 Oct 2007 21:50:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 5 Oct 2007 21:50:42 +0000 (UTC) Cc: bug-cc-mode@gnu.org, Alan Mackenzie , emacs-devel@gnu.org To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 05 23:50:39 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Idv4A-0005Sl-Pg for ged-emacs-devel@m.gmane.org; Fri, 05 Oct 2007 23:50:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Idv45-0002AB-N0 for ged-emacs-devel@m.gmane.org; Fri, 05 Oct 2007 17:50:33 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Idv40-00026K-FS for emacs-devel@gnu.org; Fri, 05 Oct 2007 17:50:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Idv3w-0001yC-1j for emacs-devel@gnu.org; Fri, 05 Oct 2007 17:50:27 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Idv3v-0001xx-Kz for emacs-devel@gnu.org; Fri, 05 Oct 2007 17:50:23 -0400 Original-Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Idv3u-0001G9-UJ for emacs-devel@gnu.org; Fri, 05 Oct 2007 17:50:23 -0400 Original-Received: (qmail 97945 invoked by uid 3782); 5 Oct 2007 21:50:18 -0000 Original-Received: from acm.muc.de (p57B1FAAC.dip.t-dialin.net [87.177.250.172]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Fri, 05 Oct 2007 23:50:14 +0200 Original-Received: (qmail 28409 invoked by uid 1000); 5 Oct 2007 21:54:43 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-Detected-Kernel: FreeBSD 4.6-4.9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:80310 Archived-At: 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 * 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).