comparison src/make-src-depend @ 1303:f99d3d25df86

[xemacs-hg @ 2003-02-15 10:15:54 by ben] autoload fixes, make-doc speed improvements Makefile.in.in: Run update-elc-2 with -no-autoloads to avoid multiple autoload-loading problem. configure.usage: Document quick-build better. make-docfile.el: Use `message' (defined in this file) in place of `princ'/`print', and put in a terpri, so that we get correct newline behavior. Rewrite if-progn -> when and a few similar stylistic niceties. And the big change: Allow MS Windows to specify the object files directly and frob them into C files here (formerly this was done in xemacs.mak, and very slooooooooooooooooooowly). Due to line-length limitations in CMD, we need to use a "response file" to hold the arguments, so when we see a response file argument (preceded by an @), read in the args (a bit of trickiness to do this), and process recursively. Also frob .obj -> .c as mentioned earlier and handle other junk dependencies that need to be removed (NEEDTODUMP, make-docfile.exe). update-elc-2.el: Use :test `equal' in call to set-difference. update-elc.el: Put back commented out kill-emacs, update header comment. xemacs.mak: Delete old unused code that checks SATISFIED. Move update-elc-2 up to be near update-elc. Run update-elc-2 with -no-autoloads to avoid multiple autoload-loading problem. Don't compute make-docfile args ourselves. Pass the raw objects to make-docfile.el, which does the computation (much faster than we could). Don't delete the DOC file, split the invocation into two calls to make-docfile.exe (one direct, one through make-docfile.el), etc. In general, all we do is call make-docfile. Add proper dependencies for DOC-file rebuilding so it doesn't get done when not necessary. Implement quick-building here: not building the DOC file unless it doesn't exist, as the quick-build docs say. Makefile.in.in: Don't delete the DOC file. Implement quick-building here: not building the DOC file unless it doesn't exist, as the quick-build docs say. config.h.in, emacs.c: Nothing but niggly spacing changes -- one space before a paren starting a function-call arglist, please.
author ben
date Sat, 15 Feb 2003 10:16:14 +0000
parents 0784d089fdc9
children 579d37cb4395
comparison
equal deleted inserted replaced
1302:781dc6d5baba 1303:f99d3d25df86
1 : #-*- Perl -*- 1 : #-*- Perl -*-
2
3 ### make-src-depend --- update the Makefile dependency information for XEmacs
4
2 # Copyright (C) 1998 Free Software Foundation, Inc. 5 # Copyright (C) 1998 Free Software Foundation, Inc.
3 6
4 # This file is part of XEmacs. 7 ## Author: Martin Buchholz <martin@xemacs.org>
5 # 8 ## Maintainer: XEmacs Development Team
6 # XEmacs is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by the
8 # Free Software Foundation; either version 2, or (at your option) any
9 # later version.
10 #
11 # XEmacs is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with XEmacs; see the file COPYING. If not, write to
18 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 # Boston, MA 02111-1307, USA.
20 9
21 # Author: Martin Buchholz 10 ## This file is part of XEmacs.
11
12 ## XEmacs is free software; you can redistribute it and/or modify it
13 ## under the terms of the GNU General Public License as published by
14 ## the Free Software Foundation; either version 2, or (at your option)
15 ## any later version.
16
17 ## XEmacs is distributed in the hope that it will be useful, but
18 ## WITHOUT ANY WARRANTY; without even the implied warranty of
19 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 ## General Public License for more details.
21
22 ## You should have received a copy of the GNU General Public License
23 ## along with XEmacs; see the file COPYING. If not, write to the Free
24 ## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25 ## 02111-1307, USA.
26
22 eval 'exec perl -w -S $0 ${1+"$@"}' 27 eval 'exec perl -w -S $0 ${1+"$@"}'
23 if 0; 28 if 0;
24 29
25 use strict; 30 use strict;
26 my ($myName, $srcdir, %exists, %uses, %generated_header); 31 my ($myName, $srcdir, %exists, %uses, %generated_header);
27 32
28 ($myName = $0) =~ s@.*/@@; my $usage =" 33 ($myName = $0) =~ s@.*/@@; my $usage ="
29 Usage: $myName 34 Usage: $myName
30 35
31 Generates Makefile dependencies for the XEmacs src directory. 36 Generates Makefile dependencies for the XEmacs src directory.
32 The dependencies are written to stdout.\n"; 37 The dependencies are written to stdout.
38
39 If --quick-build, don't include config.h and lisp.h in the dependencies,
40 for faster rebuilding.
41 ";
33 42
34 die $usage if @ARGV; 43 die $usage if @ARGV;
35 44
36 ($srcdir = $0) =~ s@[^/]+$@@; 45 ($srcdir = $0) =~ s@[^/]+$@@;
37 $srcdir = "." if $srcdir eq ""; 46 $srcdir = "." if $srcdir eq "";
92 LISP_UNION_H=lisp-disunion.h 101 LISP_UNION_H=lisp-disunion.h
93 #endif 102 #endif
94 "; 103 ";
95 104
96 my @LISP_H = ('lisp.h', sort keys %{$uses{'lisp.h'}}); 105 my @LISP_H = ('lisp.h', sort keys %{$uses{'lisp.h'}});
97 print "LISP_H=@{[grep (!/lisp-(dis)?union\.h/, @LISP_H)]} \$(LISP_UNION_H)\n"; 106 print "
107 #if defined(QUICK_BUILD)
108 CONFIG_H=
109 LISP_H=
110 #else
111 CONFIG_H=config.h
112 LISP_H=@{[grep (!/lisp-(dis)?union\.h/, @LISP_H)]} \$(LISP_UNION_H)
113 #endif
114
115 ";
98 116
99 sub PrintDeps { 117 sub PrintDeps {
100 my $file = shift; 118 my $file = shift;
101 my $ofile = $file; $ofile =~ s/c$/o/; print "$ofile: "; 119 my $ofile = $file; $ofile =~ s/c$/o/; print "$ofile: ";
102 if (exists $uses{$file}{'lisp.h'}) { 120 if (exists $uses{$file}{'lisp.h'}) {
103 delete @{%{$uses{$file}}}{@LISP_H}; 121 delete @{%{$uses{$file}}}{@LISP_H};
104 $uses{$file}{'$(LISP_H)'} = 1; 122 $uses{$file}{'$(LISP_H)'} = 1;
123 }
124 # Note: If both config.h and lisp.h are dependencies, config.h got deleted
125 # by the last clause.
126 if (exists $uses{$file}{'config.h'}) {
127 delete $uses{$file}{'config.h'};
128 $uses{$file}{'$(CONFIG_H)'} = 1;
105 } 129 }
106 print "@{[sort keys %{$uses{$file}}]}\n"; 130 print "@{[sort keys %{$uses{$file}}]}\n";
107 } 131 }
108 132
109 sub PrintPatternDeps { 133 sub PrintPatternDeps {
115 } 139 }
116 print "#endif\n"; 140 print "#endif\n";
117 } 141 }
118 142
119 PrintPatternDeps ('-msw\\.', "HAVE_MS_WINDOWS"); 143 PrintPatternDeps ('-msw\\.', "HAVE_MS_WINDOWS");
120 PrintPatternDeps ('-x\\.', "HAVE_X_WINDOWS"); 144 PrintPatternDeps ('-xlike', "HAVE_XLIKE");
145 # X-specific files: *-x.c *-x-impl.h xgccache.c balloon_help.c x*.h Emacs*.[ch]
146 PrintPatternDeps ('-x\\.|xgccache|balloon_help|^Emacs', "HAVE_X_WINDOWS");
121 PrintPatternDeps ('-tty\\.', "HAVE_TTY"); 147 PrintPatternDeps ('-tty\\.', "HAVE_TTY");
122 PrintPatternDeps ('-gtk\\.', "HAVE_GTK"); 148 # GTK-specific files: *-gtk.[ch] *-gtk-*.[ch] gtk-*.[ch] emacs-marshals.c emacs-widget-accessors.c glade.c ui-byhand.c
149 PrintPatternDeps ('gtk|emacs-marshals|emacs-widget-accessors|glade|ui-byhand', "HAVE_GTK");
123 PrintPatternDeps ('^database', "HAVE_DATABASE"); 150 PrintPatternDeps ('^database', "HAVE_DATABASE");
124 PrintPatternDeps ('^mule', "MULE"); 151 PrintPatternDeps ('^mule', "MULE");
125 PrintPatternDeps ('^(?:External|extw-)', "EXTERNAL_WIDGET"); 152 PrintPatternDeps ('^(?:External|extw-)', "EXTERNAL_WIDGET");
126 153
127 for my $file (sort grep (/\.c$/, keys %uses)) { PrintDeps($file); } 154 for my $file (sort grep (/\.c$/, keys %uses)) { PrintDeps($file); }