]>
Commit | Line | Data |
---|---|---|
79d8453e | 1 | # Makefile for GNU C compiler. |
1496daef | 2 | # Copyright (C) 1987, 88, 90-96, 1997 Free Software Foundation, Inc. |
79d8453e RS |
3 | |
4 | #This file is part of GNU CC. | |
5 | ||
6 | #GNU CC is free software; you can redistribute it and/or modify | |
7 | #it under the terms of the GNU General Public License as published by | |
8 | #the Free Software Foundation; either version 2, or (at your option) | |
9 | #any later version. | |
10 | ||
11 | #GNU CC is distributed in the hope that it will be useful, | |
12 | #but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | #GNU General Public License for more details. | |
15 | ||
16 | #You should have received a copy of the GNU General Public License | |
17 | #along with GNU CC; see the file COPYING. If not, write to | |
940d9d63 RK |
18 | #the Free Software Foundation, 59 Temple Place - Suite 330, |
19 | #Boston MA 02111-1307, USA. | |
79d8453e RS |
20 | |
21 | # The targets for external use include: | |
22 | # all, doc, proto, install, install-cross, install-cross-rest, | |
f1908d70 | 23 | # uninstall, TAGS, mostlyclean, clean, distclean, maintainer-clean, |
79d8453e RS |
24 | # stage1, stage2, stage3, stage4. |
25 | ||
2e494f70 RS |
26 | # Suppress smart makes who think they know how to automake Yacc files |
27 | .y.c: | |
28 | ||
3c18ea24 RK |
29 | # Directory where sources are, from where we are. |
30 | srcdir = @srcdir@ | |
31 | VPATH = @srcdir@ | |
32 | ||
79d8453e RS |
33 | # Variables that exist for you to override. |
34 | # See below for how to change them for certain systems. | |
35 | ||
013a2ee0 DE |
36 | # List of language subdirectories. |
37 | # This is overridden by configure. | |
3c18ea24 | 38 | SUBDIRS =@subdirs@ |
013a2ee0 | 39 | |
79d8453e | 40 | # Selection of languages to be made. |
013a2ee0 | 41 | # This is overridden by configure. |
3379e8ef | 42 | LANGUAGES = c proto gcov @all_languages@ |
79d8453e | 43 | |
5e31e473 RK |
44 | # Selection of languages to be made during stage1 build. |
45 | # This is overridden by configure. | |
3c18ea24 | 46 | BOOT_LANGUAGES = c @all_boot_languages@ |
5e31e473 | 47 | |
79d8453e | 48 | ALLOCA = |
8d86aaea | 49 | ALLOCA_FLAGS = |
2a7bccbb | 50 | ALLOCA_FINISH = true |
79d8453e RS |
51 | |
52 | # Various ways of specifying flags for compilations: | |
53 | # CFLAGS is for the user to override to, e.g., do a bootstrap with -O2. | |
54 | # BOOT_CFLAGS is the value of CFLAGS to pass | |
55 | # to the stage2 and stage3 compilations | |
56 | # XCFLAGS is used for most compilations but not when using the GCC just built. | |
54577c52 | 57 | # TCFLAGS is used for compilations with the GCC just built. |
79d8453e | 58 | XCFLAGS = |
54577c52 | 59 | TCFLAGS = |
79d8453e | 60 | CFLAGS = -g |
e6493727 | 61 | BOOT_CFLAGS = -O2 $(CFLAGS) |
79d8453e RS |
62 | # These exists to be overridden by the x-* and t-* files, respectively. |
63 | X_CFLAGS = | |
64 | T_CFLAGS = | |
65 | ||
66 | X_CPPFLAGS = | |
67 | T_CPPFLAGS = | |
68 | ||
b614ee64 | 69 | CC = @CC@ |
79d8453e | 70 | BISON = bison |
0777e4c6 | 71 | BISONFLAGS = |
013a2ee0 DE |
72 | LEX = flex |
73 | LEXFLAGS = | |
79d8453e | 74 | AR = ar |
79d8453e | 75 | AR_FLAGS = rc |
e9a25f70 | 76 | LN = @symbolic_link@ |
b63b5db5 | 77 | DLLTOOL = dlltool |
79d8453e RS |
78 | SHELL = /bin/sh |
79 | # on sysV, define this as cp. | |
3c18ea24 | 80 | INSTALL = @INSTALL@ |
ac64120e JW |
81 | # Some systems may be missing symbolic links, regular links, or both. |
82 | # Allow configure to check this and use "ln -s", "ln", or "cp" as appropriate. | |
83 | LN=@LN@ | |
84 | LN_S=@LN_S@ | |
79d8453e | 85 | # These permit overriding just for certain files. |
fca9d4b0 MH |
86 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
87 | INSTALL_DATA = @INSTALL_DATA@ | |
fcd40e95 | 88 | MAKEINFO = makeinfo |
3ef4c269 | 89 | MAKEINFOFLAGS = |
d8984b6e | 90 | TEXI2DVI = texi2dvi |
013a2ee0 DE |
91 | # For GNUmake: let us decide what gets passed to recursive makes. |
92 | MAKEOVERRIDES = | |
3c18ea24 | 93 | @SET_MAKE@ |
79d8453e RS |
94 | |
95 | # Define this as & to perform parallel make on a Sequent. | |
96 | # Note that this has some bugs, and it seems currently necessary | |
97 | # to compile all the gen* files first by hand to avoid erroneous results. | |
98 | P = | |
99 | ||
100 | # How to invoke ranlib. | |
101 | RANLIB = ranlib | |
102 | # Test to use to see whether ranlib exists on the system. | |
103 | RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ] | |
104 | ||
105 | # Compiler to use for compiling libgcc1.a. | |
106 | # OLDCC should not be the GNU C compiler, | |
107 | # since that would compile typical libgcc1.a functions such as mulsi3 | |
108 | # into infinite recursions. | |
109 | OLDCC = cc | |
110 | ||
111 | # CFLAGS for use with OLDCC, for compiling libgcc1.a. | |
112 | # NOTE: -O does not work on some Unix systems! | |
113 | CCLIBFLAGS = -O | |
114 | ||
2e494f70 | 115 | # Version of ar to use when compiling libgcc1.a. |
79d8453e | 116 | OLDAR = ar |
b614ee64 | 117 | OLDAR_FLAGS = qc |
79d8453e | 118 | |
ba1811f1 ILT |
119 | # Target to use when installing include directory. Either |
120 | # install-headers-tar or install-headers-cpio. | |
3c18ea24 | 121 | INSTALL_HEADERS_DIR = @build_install_headers_dir@ |
ba1811f1 | 122 | |
d7371761 RK |
123 | # Header files that are made available under the same name |
124 | # to programs compiled with GCC. | |
125 | USER_H = $(srcdir)/ginclude/stdarg.h $(srcdir)/ginclude/stddef.h \ | |
126 | $(srcdir)/ginclude/varargs.h $(srcdir)/ginclude/va-alpha.h \ | |
127 | $(srcdir)/ginclude/va-h8300.h $(srcdir)/ginclude/va-i860.h \ | |
128 | $(srcdir)/ginclude/va-i960.h $(srcdir)/ginclude/va-mips.h \ | |
12ca7cc3 RK |
129 | $(srcdir)/ginclude/va-m88k.h $(srcdir)/ginclude/va-mn10200.h \ |
130 | $(srcdir)/ginclude/va-mn10300.h $(srcdir)/ginclude/va-pa.h \ | |
d7371761 RK |
131 | $(srcdir)/ginclude/va-pyr.h $(srcdir)/ginclude/va-sparc.h \ |
132 | $(srcdir)/ginclude/va-clipper.h $(srcdir)/ginclude/va-spur.h \ | |
5a01f362 | 133 | $(srcdir)/ginclude/va-m32r.h $(srcdir)/ginclude/va-sh.h \ |
b4d940a2 | 134 | $(srcdir)/ginclude/va-v850.h $(srcdir)/ginclude/va-arc.h \ |
d7371761 | 135 | $(srcdir)/ginclude/iso646.h $(srcdir)/ginclude/va-ppc.h \ |
5a01f362 | 136 | $(srcdir)/ginclude/proto.h $(EXTRA_HEADERS) \ |
f7055b09 | 137 | $(LANG_EXTRA_HEADERS) |
d7371761 RK |
138 | |
139 | # Target to use whe installing assert.h. Some systems may | |
140 | # want to set this empty. | |
141 | INSTALL_ASSERT_H = install-assert-h | |
142 | ||
a2d163c4 | 143 | # The GCC to use for compiling libgcc2.a, enquire, and libgcc1-test. |
bf428f48 | 144 | # Usually the one we just built. |
79d8453e | 145 | # Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS). |
f2e663b6 | 146 | GCC_FOR_TARGET = ./xgcc -B./ |
79d8453e RS |
147 | |
148 | # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET. | |
149 | # It omits XCFLAGS, and specifies -B./. | |
de9253a0 | 150 | # It also specifies -I./include to find, e.g., stddef.h. |
54577c52 | 151 | GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) -I./include $(TCFLAGS) |
79d8453e RS |
152 | |
153 | # Special flags for compiling enquire. | |
154 | # We disable optimization to make floating point more reliable. | |
0dbb682d | 155 | ENQUIRE_CFLAGS = -DNO_MEM -DNO_LONG_DOUBLE_IO -O0 |
79d8453e RS |
156 | ENQUIRE_LDFLAGS = $(LDFLAGS) |
157 | ||
338023d4 | 158 | # Sed command to transform gcc to installed name. Overwritten by configure. |
e6347456 | 159 | program_transform_name = @program_transform_name@ |
ef85603e | 160 | program_transform_cross_name = s,^,$(target_alias)-, |
338023d4 | 161 | |
79d8453e RS |
162 | # Tools to use when building a cross-compiler. |
163 | # These are used because `configure' appends `cross-make' | |
164 | # to the makefile when making a cross-compiler. | |
165 | ||
166 | TARGET_TOOLPREFIX = $(tooldir)/bin/ | |
167 | AR_FOR_TARGET = $(TARGET_TOOLPREFIX)ar | |
168 | AR_FOR_TARGET_FLAGS = rc | |
169 | RANLIB_FOR_TARGET = $(TARGET_TOOLPREFIX)ranlib | |
170 | RANLIB_TEST_FOR_TARGET = [ -f $(TARGET_TOOLPREFIX)ranlib ] | |
79d8453e | 171 | |
1402d22c RS |
172 | # Dir to search for system headers. Overridden by cross-make. |
173 | SYSTEM_HEADER_DIR = /usr/include | |
174 | ||
75b6984c RS |
175 | # Control whether to run fixproto. |
176 | STMP_FIXPROTO = stmp-fixproto | |
ac1284f9 | 177 | |
e9a25f70 JL |
178 | # Test to see whether <float.h> exists in the system header files, |
179 | # and is not derived from GCC. | |
180 | FLOAT_H_TEST = \ | |
181 | [ -f $(SYSTEM_HEADER_DIR)/float.h ] && \ | |
182 | if grep 'ifndef _FLOAT_H___' $(SYSTEM_HEADER_DIR)/float.h >/dev/null; \ | |
183 | then false; \ | |
184 | else :; fi | |
185 | ||
40dc28fc ILT |
186 | # Test to see whether <limits.h> exists in the system header files. |
187 | LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ] | |
188 | ||
20bd0ab1 RS |
189 | # There may be a premade insn-attrtab.c for this machine. |
190 | # (You could rebuild it with genattrtab as usual, but it takes a long time.) | |
191 | # PREMADE_ATTRTAB is the file name of the file to use. | |
192 | # PREMADE_ATTRTAB_MD is the md file it corresponds to. | |
193 | PREMADE_ATTRTAB_MD = Makefile # Guaranteed not to cmp equal to md. | |
194 | PREMADE_ATTRTAB = | |
195 | ||
3c18ea24 | 196 | target=@target@ |
6920c391 | 197 | target_alias=@target_alias@ |
3c18ea24 RK |
198 | xmake_file=@dep_host_xmake_file@ |
199 | tmake_file=@dep_tmake_file@ | |
200 | out_file=$(srcdir)/config/@out_file@ | |
201 | out_object_file=@out_object_file@ | |
202 | md_file=$(srcdir)/config/@md_file@ | |
203 | tm_file=@tm_file_list@ | |
204 | build_xm_file=@build_xm_file_list@ | |
205 | host_xm_file=@host_xm_file_list@ | |
206 | lang_specs_files=@lang_specs_files@ | |
207 | lang_options_files=@lang_options_files@ | |
f25270fc | 208 | GCC_THREAD_FILE=@thread_file@ |
f24af81b | 209 | GTHREAD_FLAGS=@gthread_flags@ |
3c18ea24 | 210 | version=@version@ |
1cf94605 | 211 | mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c` |
79d8453e | 212 | |
79d8453e RS |
213 | # Common prefix for installation directories. |
214 | # NOTE: This directory must exist when you start installation. | |
3c18ea24 | 215 | prefix = @prefix@ |
c844ddda RS |
216 | # Directory in which to put localized header files. On the systems with |
217 | # gcc as the native cc, `local_prefix' may not be `prefix' which is | |
218 | # `/usr'. | |
0b2fbcb2 | 219 | # NOTE: local_prefix *should not* default from prefix. |
3c18ea24 | 220 | local_prefix = @local_prefix@ |
2e494f70 | 221 | # Directory in which to put host dependent programs and libraries |
3c18ea24 | 222 | exec_prefix = @exec_prefix@ |
79d8453e | 223 | # Directory in which to put the executable for the command `gcc' |
3c18ea24 | 224 | bindir = @bindir@ |
79d8453e | 225 | # Directory in which to put the directories used by the compiler. |
3c18ea24 | 226 | libdir = @libdir@ |
79d8453e | 227 | # Directory in which the compiler finds executables, libraries, etc. |
8b06b20a | 228 | libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(version) |
89b3e3b4 | 229 | # Directory in which the compiler finds g++ includes. |
c975ddd5 | 230 | gxx_include_dir= @gxx_include_dir@ |
5d6be9c8 RK |
231 | # Directory in which the old g++ header files may be found. |
232 | old_gxx_include_dir= $(libdir)/g++-include | |
49ba557e | 233 | # Directory to search for site-specific includes. |
4b7179be | 234 | includedir = $(local_prefix)/include |
6204c24f | 235 | # assertdir is overridden in cross-make. |
7b4d5f42 RS |
236 | # (But this currently agrees with what is in cross-make.) |
237 | assertdir = $(tooldir)/include | |
0b2fbcb2 | 238 | # where the info files go |
3c18ea24 | 239 | infodir = @infodir@ |
79d8453e RS |
240 | # Extension (if any) to put in installed man-page filename. |
241 | manext = .1 | |
173712fb | 242 | objext = .o |
6e26218f ILT |
243 | exeext = @host_exeext@ |
244 | build_exeext = @build_exeext@ | |
173712fb | 245 | |
79d8453e | 246 | # Directory in which to put man pages. |
3c18ea24 | 247 | mandir = @mandir@/man1 |
79d8453e RS |
248 | # Directory in which to find other cross-compilation tools and headers. |
249 | # Used in install-cross. | |
8b06b20a | 250 | tooldir = $(exec_prefix)/$(target_alias) |
62c13b81 RS |
251 | # Dir for temp files. |
252 | tmpdir = /tmp | |
79d8453e RS |
253 | |
254 | # Additional system libraries to link with. | |
255 | CLIB= | |
256 | ||
257 | # Change this to a null string if obstacks are installed in the | |
258 | # system library. | |
259 | OBSTACK=obstack.o | |
260 | ||
b583eed8 DE |
261 | # Specify the rule for actually making libgcc.a, |
262 | LIBGCC = libgcc.a | |
263 | # and the rule for installing it. | |
264 | INSTALL_LIBGCC = install-libgcc | |
265 | ||
79d8453e | 266 | # Specify the rule for actually making libgcc1.a. |
2e494f70 RS |
267 | # The value may be empty; that means to do absolutely nothing |
268 | # with or for libgcc1.a. | |
79d8453e RS |
269 | LIBGCC1 = libgcc1.a |
270 | ||
b0bfa186 ILT |
271 | # Specify the rule for making libgcc1.a for a cross-compiler. |
272 | # The default rule assumes that libgcc1.a is supplied by the user. | |
273 | CROSS_LIBGCC1 = libgcc1.cross | |
274 | ||
79d8453e RS |
275 | # Specify the rule for actually making libgcc2.a. |
276 | LIBGCC2 = libgcc2.a | |
277 | ||
278 | # Options to use when compiling libgcc2.a. | |
279 | # -g1 causes output of debug info only for file-scope entities. | |
280 | # we use this here because that should be enough, and also | |
281 | # so that -g1 will be tested. | |
7337c67f JL |
282 | # |
283 | # -fexceptions is necessary for eh.o now that the exceptions are | |
284 | # the default for g++ only. | |
11f39cf4 | 285 | LIBGCC2_DEBUG_CFLAGS = -g1 |
f24af81b | 286 | LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -fexceptions @inhibit_libc@ |
56f9206d ILT |
287 | |
288 | # Additional options to use when compiling libgcc2.a. | |
289 | # Some targets override this to -Iinclude | |
290 | LIBGCC2_INCLUDES = | |
291 | ||
7bb7f3df RK |
292 | # Additional target-dependent options for compiling libgcc2.a. |
293 | TARGET_LIBGCC2_CFLAGS = | |
294 | ||
56f9206d ILT |
295 | # Things which must be built before building libgcc2.a. |
296 | # Some targets override this to stmp-int-hdrs | |
297 | LIBGCC2_DEPS = | |
79d8453e | 298 | |
0defb1d5 RS |
299 | # Enquire target (This is a variable so that a target can choose not to |
300 | # build it.) | |
301 | ENQUIRE = enquire | |
302 | ||
a2d163c4 DE |
303 | # libgcc1-test target (must also be overridable for a target) |
304 | LIBGCC1_TEST = libgcc1-test | |
0defb1d5 | 305 | |
79d8453e RS |
306 | # List of extra executables that should be compiled for this target machine |
307 | # that are used for compiling from source code to object code. | |
308 | # The rules for compiling them should be in the t-* file for the machine. | |
3c18ea24 | 309 | EXTRA_PASSES =@extra_passes@ |
79d8453e | 310 | |
2e494f70 | 311 | # Like EXTRA_PASSES, but these are used when linking. |
3c18ea24 | 312 | EXTRA_PROGRAMS = @extra_programs@ |
2e494f70 RS |
313 | |
314 | # List of extra object files that should be compiled for this target machine. | |
79d8453e | 315 | # The rules for compiling them should be in the t-* file for the machine. |
3c18ea24 | 316 | EXTRA_PARTS = @extra_parts@ |
79d8453e | 317 | |
2e494f70 RS |
318 | # List of extra object files that should be compiled and linked with |
319 | # compiler proper (cc1, cc1obj, cc1plus). | |
3c18ea24 | 320 | EXTRA_OBJS = @extra_objs@ |
2e494f70 | 321 | |
43554690 RK |
322 | # List of extra object files that should be compiled and linked with |
323 | # the gcc driver. | |
3c18ea24 | 324 | EXTRA_GCC_OBJS =@host_extra_gcc_objs@ |
43554690 | 325 | |
f780d21b RS |
326 | # List of additional header files to install. |
327 | # Often this is edited directly by `configure'. | |
3c18ea24 | 328 | EXTRA_HEADERS =@extra_headers_list@ |
f780d21b | 329 | |
47547081 | 330 | # Set this to `ld' to enable use of collect2. |
3c18ea24 | 331 | USE_COLLECT2 = @will_use_collect2@ |
f46fe00a | 332 | MAYBE_USE_COLLECT2 = @maybe_use_collect2@ |
47547081 RS |
333 | # It is convenient for configure to add the assignment at the beginning, |
334 | # so don't override it here. | |
aa32d841 | 335 | USE_COLLECT2 = ld |
47547081 | 336 | |
79d8453e RS |
337 | # List of extra C and assembler files to add to libgcc1.a. |
338 | # Assembler files should have names ending in `.asm'. | |
339 | LIB1FUNCS_EXTRA = | |
340 | ||
341 | # List of extra C and assembler files to add to libgcc2.a. | |
342 | # Assembler files should have names ending in `.asm'. | |
343 | LIB2FUNCS_EXTRA = | |
344 | ||
ba1811f1 | 345 | # Default float.h source to use for cross-compiler. |
956d6950 | 346 | # This is overridden by configure. |
3c18ea24 | 347 | CROSS_FLOAT_H=$(srcdir)/config/float-@float_format@.h |
ba1811f1 | 348 | |
79d8453e RS |
349 | # Program to convert libraries. |
350 | LIBCONVERT = | |
351 | ||
352 | # Control whether header files are installed. | |
79d8453e RS |
353 | INSTALL_HEADERS=install-headers |
354 | ||
0d4d8174 RS |
355 | # Options for tar when copying trees. So HPUX can override it. |
356 | TAROUTOPTS = xpBf | |
357 | ||
79d8453e | 358 | # Select which version of fixincludes to use (I.E. regular versus SVR4) |
98e4b835 | 359 | # This value is overridden directly by configure. |
3c18ea24 | 360 | FIXINCLUDES = @fixincludes@ |
79d8453e | 361 | |
66d7ffbf | 362 | # Additional directories of header files to run fixincludes on. |
4ab08223 RS |
363 | # These should be directories searched automatically by default |
364 | # just as /usr/include is. | |
365 | # *Do not* use this for directories that happen to contain | |
366 | # header files, but are not searched automatically by default. | |
66d7ffbf RS |
367 | # On most systems, this is empty. |
368 | OTHER_FIXINCLUDES_DIRS= | |
369 | ||
7c27f801 RK |
370 | # A list of all the language-specific executables. |
371 | # This is overridden by configure. | |
3379e8ef | 372 | COMPILERS = cc1$(exeext) @all_compilers@ |
7c27f801 | 373 | |
acbbf3d9 | 374 | # List of things which should already be built whenever we try to use xgcc |
79d8453e | 375 | # to compile anything (without linking). |
21f74c82 | 376 | GCC_PASSES=xgcc cc1 cpp $(EXTRA_PASSES) |
79d8453e | 377 | |
acbbf3d9 | 378 | # List of things which should already be built whenever we try to use xgcc |
79d8453e | 379 | # to link anything. |
b583eed8 | 380 | GCC_PARTS=$(GCC_PASSES) $(LIBGCC) $(EXTRA_PROGRAMS) $(USE_COLLECT2) $(EXTRA_PARTS) |
79d8453e | 381 | |
79d8453e RS |
382 | # Directory to link to, when using the target `maketest'. |
383 | DIR = ../gcc | |
384 | ||
c3efc7c4 | 385 | # Guaranteed to not exist when not passing md through cpp. |
aa90345a | 386 | # This value is overridden directly by configure. |
c3efc7c4 DE |
387 | MD_FILE = md-cpp-not-used |
388 | ||
79d8453e RS |
389 | # Flags to use when cross-building GCC. |
390 | # Prefix to apply to names of object files when using them | |
391 | # to run on the machine we are compiling on. | |
392 | HOST_PREFIX= | |
393 | # Prefix to apply to names of object files when compiling them | |
394 | # to run on the machine we are compiling on. | |
395 | # The default for this variable is chosen to keep these rules | |
396 | # out of the way of the other rules for compiling the same source files. | |
397 | HOST_PREFIX_1=loser- | |
398 | HOST_CC=$(CC) | |
399 | HOST_CFLAGS=$(ALL_CFLAGS) | |
2e494f70 | 400 | HOST_CLIB=$(CLIB) |
79d8453e RS |
401 | HOST_LDFLAGS=$(LDFLAGS) |
402 | HOST_CPPFLAGS=$(ALL_CPPFLAGS) | |
2e494f70 RS |
403 | HOST_ALLOCA=$(ALLOCA) |
404 | HOST_MALLOC=$(MALLOC) | |
405 | HOST_OBSTACK=$(OBSTACK) | |
79d8453e | 406 | |
338023d4 | 407 | # Actual name to use when installing a native compiler. |
ef85603e | 408 | GCC_INSTALL_NAME = `t='$(program_transform_name)'; echo gcc | sed -e $$t` |
338023d4 DE |
409 | |
410 | # Actual name to use when installing a cross-compiler. | |
ef85603e | 411 | GCC_CROSS_NAME = `t='$(program_transform_cross_name)'; echo gcc | sed -e $$t` |
338023d4 | 412 | |
79d8453e RS |
413 | # Choose the real default target. |
414 | ALL=all.internal | |
415 | ||
416 | # Choose the real install target. | |
ba1811f1 ILT |
417 | INSTALL_TARGET=install-normal |
418 | ||
419 | # Source for float.h. Overridden by cross-make. | |
420 | FLOAT_H=float.h-nat | |
79d8453e | 421 | |
e933cbe0 JL |
422 | # Setup the testing framework, if you have one |
423 | EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \ | |
424 | echo $${rootme}/../expect/expect ; \ | |
425 | else echo expect ; fi` | |
426 | ||
427 | RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \ | |
428 | echo $${srcdir}/../dejagnu/runtest ; \ | |
429 | else echo runtest; fi` | |
430 | RUNTESTFLAGS = | |
431 | ||
aefc3801 JM |
432 | # Extra symbols for fixproto to define when parsing headers. |
433 | FIXPROTO_DEFINES = | |
434 | ||
68d69835 JM |
435 | # Extra flags to use when compiling crt{begin,end}.o. |
436 | CRTSTUFF_T_CFLAGS = | |
437 | ||
522170ca RK |
438 | # Extra flags to use when compiling [m]crt0.o. |
439 | CRT0STUFF_T_CFLAGS = | |
440 | ||
e9a25f70 JL |
441 | # "t" or nothing, for building multilibbed versions of, say, crtbegin.o. |
442 | T = | |
443 | ||
79d8453e RS |
444 | # End of variables for you to override. |
445 | ||
446 | # Definition of `all' is here so that new rules inserted by sed | |
447 | # do not specify the default target. | |
448 | # The real definition is under `all.internal' (for native compilers) | |
449 | # or `all.cross' (for cross compilers). | |
2e494f70 | 450 | all: all.indirect |
79d8453e | 451 | |
be0d23ff RS |
452 | # This tells GNU Make version 3 not to put all variables in the environment. |
453 | .NOEXPORT: | |
454 | ||
79d8453e | 455 | # sed inserts variable overrides after the following line. |
60d00117 | 456 | ####target overrides |
3c18ea24 RK |
457 | @target_overrides@ |
458 | ||
60d00117 | 459 | ####host overrides |
3c18ea24 RK |
460 | @host_overrides@ |
461 | ||
60d00117 | 462 | ####cross overrides |
3c18ea24 RK |
463 | @cross_defines@ |
464 | @cross_overrides@ | |
465 | ||
057f494b | 466 | ####build overrides |
3c18ea24 | 467 | @build_overrides@ |
544eb21e | 468 | #\f |
79d8453e RS |
469 | # Now figure out from those variables how to compile and link. |
470 | ||
2e494f70 RS |
471 | all.indirect: $(ALL) |
472 | ||
eea77e5f JW |
473 | # IN_GCC tells obstack.h that we are using gcc's <stddef.h> file. |
474 | # ??? IN_GCC should be obsolete now. | |
e8066a5d | 475 | INTERNAL_CFLAGS = $(CROSS) -DIN_GCC @extra_c_flags@ |
79d8453e RS |
476 | |
477 | # This is the variable actually used when we compile. | |
d68b51ef | 478 | ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS) \ |
8c660648 | 479 | @DEFS@ $(SCHED_CFLAGS) |
79d8453e RS |
480 | |
481 | # Likewise. | |
482 | ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS) | |
483 | ||
484 | # Even if ALLOCA is set, don't use it if compiling with GCC. | |
3fe40e05 JL |
485 | USE_ALLOCA= ${ALLOCA} |
486 | USE_HOST_ALLOCA= ` case "${HOST_ALLOCA}" in ?*) echo ${HOST_PREFIX}${HOST_ALLOCA} ;; esac ` | |
2e494f70 RS |
487 | USE_HOST_MALLOC= ` case "${HOST_MALLOC}" in ?*) echo ${HOST_PREFIX}${HOST_MALLOC} ;; esac ` |
488 | USE_HOST_OBSTACK= ` case "${HOST_OBSTACK}" in ?*) echo ${HOST_PREFIX}${HOST_OBSTACK} ;; esac ` | |
79d8453e RS |
489 | |
490 | # Dependency on obstack, alloca, malloc or whatever library facilities | |
491 | # are not installed in the system libraries. | |
492 | # We don't use USE_ALLOCA because backquote expansion doesn't work in deps. | |
493 | LIBDEPS= $(OBSTACK) $(ALLOCA) $(MALLOC) | |
494 | ||
495 | # Likewise, for use in the tools that must run on this machine | |
496 | # even if we are cross-building GCC. | |
497 | # We don't use USE_ALLOCA because backquote expansion doesn't work in deps. | |
2e494f70 | 498 | HOST_LIBDEPS= $(HOST_PREFIX)$(HOST_OBSTACK) $(HOST_PREFIX)$(HOST_ALLOCA) $(HOST_PREFIX)$(HOST_MALLOC) |
79d8453e RS |
499 | |
500 | # How to link with both our special library facilities | |
501 | # and the system's installed libraries. | |
502 | LIBS = $(OBSTACK) $(USE_ALLOCA) $(MALLOC) $(CLIB) | |
503 | ||
504 | # Likewise, for use in the tools that must run on this machine | |
505 | # even if we are cross-building GCC. | |
2e494f70 RS |
506 | HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_ALLOCA) $(USE_HOST_MALLOC) \ |
507 | $(HOST_CLIB) | |
79d8453e RS |
508 | |
509 | HOST_RTL = $(HOST_PREFIX)rtl.o | |
510 | HOST_RTLANAL = $(HOST_PREFIX)rtlanal.o | |
d3614a37 | 511 | HOST_PRINT = $(HOST_PREFIX)print-rtl.o |
79d8453e RS |
512 | |
513 | # Specify the directories to be searched for header files. | |
514 | # Both . and srcdir are used, in that order, | |
515 | # so that tm.h and config.h will be found in the compilation | |
516 | # subdirectory rather than in the source directory. | |
517 | INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config | |
79d8453e RS |
518 | |
519 | # Always use -I$(srcdir)/config when compiling. | |
520 | .c.o: | |
521 | $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< | |
522 | ||
523 | # This tells GNU make version 3 not to export all the variables | |
524 | # defined in this file into the environment. | |
525 | .NOEXPORT: | |
544eb21e | 526 | #\f |
013a2ee0 DE |
527 | # Support for additional languages (other than c and objc). |
528 | # ??? objc can be supported this way too (leave for later). | |
529 | ||
530 | # These next lines are overridden by configure. | |
3c18ea24 RK |
531 | LANG_MAKEFILES = @all_lang_makefiles@ |
532 | LANG_STAGESTUFF = @all_stagestuff@ | |
533 | LANG_DIFF_EXCLUDES = @all_diff_excludes@ | |
534 | LANG_LIB2FUNCS = @all_lib2funcs@ | |
535 | LANG_EXTRA_HEADERS = @all_headers@ | |
013a2ee0 DE |
536 | |
537 | # Flags to pass to recursive makes. | |
538 | # CC is set by configure. Hosts without symlinks need special handling | |
539 | # because we need CC="stage1/xgcc -Bstage1/" to work in the language | |
540 | # subdirectories. | |
541 | # ??? The choices here will need some experimenting with. | |
542 | FLAGS_TO_PASS = \ | |
543 | "AR_FLAGS=$(AR_FLAGS)" \ | |
544 | "AR_FOR_TARGET=$(AR_FOR_TARGET)" \ | |
545 | "BISON=$(BISON)" \ | |
546 | "BISONFLAGS=$(BISONFLAGS)" \ | |
3c18ea24 | 547 | "CC=@cc_set_by_configure@" \ |
013a2ee0 | 548 | "CFLAGS=$(CFLAGS)" \ |
89c8019a | 549 | "CLIB=$(CLIB)" \ |
dc93cff0 | 550 | "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \ |
013a2ee0 DE |
551 | "LDFLAGS=$(LDFLAGS)" \ |
552 | "LEX=$(LEX)" \ | |
553 | "LEXFLAGS=$(LEXFLAGS)" \ | |
ac64120e JW |
554 | "LN=$(LN)" \ |
555 | "LN_S=$(LN_S)" \ | |
013a2ee0 DE |
556 | "MAKEINFO=$(MAKEINFO)" \ |
557 | "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \ | |
013a2ee0 DE |
558 | "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \ |
559 | "RANLIB_TEST_FOR_TARGET=$(RANLIB_TEST_FOR_TARGET)" \ | |
560 | "SHELL=$(SHELL)" \ | |
3c18ea24 | 561 | "STAGE_PREFIX=@stage_prefix_set_by_configure@" \ |
aab26e16 | 562 | "exeext=$(exeext)" \ |
6e26218f | 563 | "build_exeext=$(build_exeext)" \ |
aab26e16 | 564 | "objext=$(objext)" \ |
013a2ee0 DE |
565 | "exec_prefix=$(exec_prefix)" \ |
566 | "prefix=$(prefix)" \ | |
3bf810d8 PN |
567 | "local_prefix=$(local_prefix)" \ |
568 | "gxx_include_dir=$(gxx_include_dir)" \ | |
013a2ee0 DE |
569 | "tooldir=$(tooldir)" \ |
570 | "bindir=$(bindir)" \ | |
571 | "libsubdir=$(libsubdir)" | |
544eb21e | 572 | #\f |
79d8453e RS |
573 | # Lists of files for various purposes. |
574 | ||
3cb88565 PB |
575 | # Language-specific object files for C and Objective C. |
576 | C_AND_OBJC_OBJS = c-lex.o c-pragma.o c-decl.o c-typeck.o c-convert.o \ | |
577 | c-aux-info.o c-common.o c-iterate.o @extra_c_objs@ | |
578 | ||
79d8453e | 579 | # Language-specific object files for C. |
3cb88565 | 580 | C_OBJS = c-parse.o c-lang.o $(C_AND_OBJC_OBJS) |
e8066a5d | 581 | |
8c660648 JL |
582 | SCHED_PREFIX = @sched_prefix@ |
583 | SCHED_CFLAGS = @sched_cflags@ | |
584 | ||
79d8453e RS |
585 | # Language-independent object files. |
586 | OBJS = toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o \ | |
3d195391 | 587 | function.o stmt.o except.o expr.o calls.o expmed.o explow.o optabs.o \ |
3b80f6ca | 588 | varasm.o rtl.o print-rtl.o rtlanal.o emit-rtl.o genrtl.o real.o regmove.o \ |
8c660648 | 589 | dbxout.o sdbout.o dwarfout.o dwarf2out.o xcoffout.o bitmap.o alias.o \ |
79d8453e | 590 | integrate.o jump.o cse.o loop.o unroll.o flow.o stupid.o combine.o \ |
f0ec1f64 | 591 | regclass.o local-alloc.o global.o reload.o reload1.o caller-save.o \ |
8c660648 | 592 | insn-peep.o reorg.o $(SCHED_PREFIX)sched.o final.o recog.o reg-stack.o \ |
118bdbf8 | 593 | insn-opinit.o insn-recog.o insn-extract.o insn-output.o insn-emit.o \ |
b93a436e | 594 | profile.o insn-attrtab.o $(out_object_file) getpwd.o $(EXTRA_OBJS) convert.o |
79d8453e RS |
595 | |
596 | # GEN files are listed separately, so they can be built before doing parallel | |
597 | # makes for cc1 or cc1plus. Otherwise sequent parallel make attempts to load | |
598 | # them before rtl.o is compiled. | |
3b80f6ca RH |
599 | GEN= genemit genoutput genrecog genextract genflags gencodes genconfig \ |
600 | genpeep gengenrtl | |
79d8453e | 601 | |
59949f60 PB |
602 | CCCP=cccp |
603 | # Uncomment this line if you want to use cppmain (w/cpplib) as cpp. | |
604 | #CCCP=cppmain | |
605 | ||
79d8453e | 606 | # Files to be copied away after each stage in building. |
aab26e16 | 607 | STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \ |
79d8453e | 608 | insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \ |
8fad1c10 | 609 | insn-attr.h insn-attrtab.c insn-opinit.c \ |
961b7009 | 610 | stamp-flags stamp-config stamp-codes stamp-mlib \ |
79d8453e | 611 | stamp-output stamp-recog stamp-emit stamp-extract stamp-peep \ |
6c32c807 | 612 | stamp-attr stamp-attrtab stamp-opinit stamp-crt stamp-crtS stamp-crt0 \ |
6e26218f ILT |
613 | genemit$(build_exeext) genoutput$(build_exeext) genrecog$(build_exeext) \ |
614 | genextract$(build_exeext) genflags$(build_exeext) gencodes$(build_exeext) \ | |
615 | genconfig$(build_exeext) genpeep$(build_exeext) genattrtab$(build_exeext) \ | |
616 | genattr$(build_exeext) genopinit$(build_exeext) \ | |
2da63e2a | 617 | stamp-bcarity stamp-bcopcode stamp-bcopname \ |
6e26218f | 618 | bi-arity$(build_exeext) bi-opcode$(build_exeext) bi-opname$(build_exeext) \ |
21f74c82 RK |
619 | xgcc$(exeext) cc1$(exeext) cpp$(exeext) $(EXTRA_PASSES) \ |
620 | $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) \ | |
aab26e16 RK |
621 | $(CCCP)$(exeext) cc1obj$(exeext) enquire$(exeext) \ |
622 | protoize$(exeext) unprotoize$(exeext) \ | |
7ac16ba0 | 623 | specs collect2$(exeext) $(USE_COLLECT2) underscore.c \ |
59a64126 | 624 | gcov$(exeext) *.bp \ |
ed8a0e58 RK |
625 | *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop \ |
626 | *.dbr *.jump2 *.sched *.cse2 *.sched2 *.stack \ | |
627 | *.[si] \ | |
013a2ee0 | 628 | $(LANG_STAGESTUFF) |
79d8453e RS |
629 | |
630 | # Members of libgcc1.a. | |
631 | LIB1FUNCS = _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \ | |
b6eb802a | 632 | _lshrsi3 _ashrsi3 _ashlsi3 \ |
79d8453e RS |
633 | _divdf3 _muldf3 _negdf2 _adddf3 _subdf3 \ |
634 | _fixdfsi _fixsfsi _floatsidf _floatsisf _truncdfsf2 _extendsfdf2 \ | |
635 | _addsf3 _negsf2 _subsf3 _mulsf3 _divsf3 \ | |
636 | _eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2 \ | |
637 | _eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2 | |
638 | ||
639 | # Library members defined in libgcc2.c. | |
640 | LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \ | |
b6eb802a | 641 | _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2 \ |
3af18470 | 642 | _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \ |
79d8453e | 643 | _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \ |
3971e415 | 644 | _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi \ |
d1b4b7c1 | 645 | _fixtfdi _fixunstfdi _floatditf \ |
ced78d8b JM |
646 | __gcc_bcmp _varargs __dummy _eprintf \ |
647 | _bb _shtab _clear_cache _trampoline __main _exit \ | |
c4124c29 | 648 | _ctors _eh _pure |
79d8453e | 649 | |
5198352e JL |
650 | FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \ |
651 | _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \ | |
652 | _lt_sf _le_sf _si_to_sf _sf_to_si _negate_sf _make_sf \ | |
653 | _sf_to_df | |
654 | ||
655 | DPBIT_FUNCS = _pack_df _unpack_df _addsub_df _mul_df _div_df \ | |
656 | _fpcmp_parts_df _compare_df _eq_df _ne_df _gt_df _ge_df \ | |
657 | _lt_df _le_df _si_to_df _df_to_si _negate_df _make_df \ | |
658 | _df_to_sf | |
659 | ||
79d8453e RS |
660 | # The files that "belong" in CONFIG_H are deliberately omitted |
661 | # because having them there would not be useful in actual practice. | |
662 | # All they would do is cause complete recompilation every time | |
663 | # one of the machine description files is edited. | |
664 | # That may or may not be what one wants to do. | |
665 | # If it is, rm *.o is an easy way to do it. | |
7ac16ba0 | 666 | # CONFIG_H = $(host_xm_file) $(tm_file) |
79d8453e | 667 | CONFIG_H = |
3b80f6ca RH |
668 | RTL_BASE_H = rtl.h rtl.def gansidecl.h machmode.h machmode.def |
669 | RTL_H = $(RTL_BASE_H) genrtl.h | |
956d6950 | 670 | TREE_H = tree.h real.h tree.def gansidecl.h machmode.h machmode.def |
8b8b2c1c | 671 | BASIC_BLOCK_H = basic-block.h bitmap.h |
956d6950 JL |
672 | DEMANGLE_H = demangle.h gansidecl.h |
673 | RECOG_H = recog.h gansidecl.h | |
544eb21e | 674 | #\f |
013a2ee0 DE |
675 | # Language makefile fragments. |
676 | ||
677 | # The following targets define the interface between us and the languages. | |
678 | # | |
679 | # all.build, all.cross, start.encap, rest.encap, | |
680 | # info, dvi, | |
681 | # install-normal, install-common, install-info, install-man, | |
682 | # uninstall, distdir, | |
f1908d70 | 683 | # mostlyclean, clean, distclean, extraclean, maintainer-clean, |
013a2ee0 DE |
684 | # stage1, stage2, stage3, stage4 |
685 | # | |
686 | # Each language is linked in with a series of hooks (since we can't use `::' | |
687 | # targets). The name of each hooked is "lang.${target_name}" (eg: lang.info). | |
688 | # Configure computes and adds these here. | |
689 | ||
690 | ####language hooks | |
3c18ea24 | 691 | @language_hooks@ |
013a2ee0 DE |
692 | |
693 | # sed inserts language fragments after the following line. | |
694 | ####language fragments | |
3c18ea24 | 695 | @language_fragments@ |
013a2ee0 DE |
696 | |
697 | # End of language makefile fragments. | |
544eb21e | 698 | #\f |
79d8453e RS |
699 | # Avoid a lot of time thinking about remaking Makefile.in and *.def. |
700 | .SUFFIXES: .in .def | |
701 | ||
7c0ae5f1 | 702 | Makefile: $(srcdir)/Makefile.in config.status $(srcdir)/version.c \ |
d232dfa4 DE |
703 | $(xmake_file) $(tmake_file) $(LANG_MAKEFILES) |
704 | $(SHELL) $(srcdir)/configure.frag $(srcdir) "$(SUBDIRS)" \ | |
705 | "$(xmake_file)" "$(tmake_file)" | |
173712fb RK |
706 | cp config.status config.run |
707 | $(SHELL) config.run | |
da0d7cb1 | 708 | rm -f config.run |
79d8453e | 709 | |
723778b0 | 710 | $(srcdir)/configure: $(srcdir)/configure.in |
3c18ea24 RK |
711 | cd $(srcdir); autoconf |
712 | ||
da7ece9a | 713 | # cstamp-h.in controls rebuilding of config.in. |
7c0ae5f1 DE |
714 | # It is named cstamp-h.in and not stamp-h.in so the mostlyclean rule doesn't |
715 | # delete it. A stamp file is needed as autoheader won't update the file if | |
716 | # nothing has changed. | |
da7ece9a DE |
717 | # It remains in the source directory and is part of the distribution. |
718 | # This follows what is done in shellutils, fileutils, etc. | |
5408f8d0 DE |
719 | # "echo timestamp" is used instead of touch to be consistent with other |
720 | # packages that use autoconf (??? perhaps also to avoid problems with patch?). | |
da7ece9a DE |
721 | # ??? Newer versions have a maintainer mode that may be useful here. |
722 | $(srcdir)/config.in: $(srcdir)/cstamp-h.in | |
723 | $(srcdir)/cstamp-h.in: $(srcdir)/configure.in $(srcdir)/acconfig.h | |
60ee2a7a | 724 | cd $(srcdir) && autoheader |
5408f8d0 | 725 | echo timestamp > $(srcdir)/cstamp-h.in |
e9a25f70 | 726 | auto-config.h: cstamp-h ; @true |
da7ece9a | 727 | cstamp-h: config.in config.status |
e9a25f70 | 728 | CONFIG_HEADERS=auto-config.h:config.in $(SHELL) config.status |
d68b51ef | 729 | |
7c0ae5f1 DE |
730 | # Really, really stupid make features, such as SUN's KEEP_STATE, may force |
731 | # a target to build even if it is up-to-date. So we must verify that | |
732 | # config.status does not exist before failing. | |
4f91a0f8 | 733 | config.status: configure version.c |
7c0ae5f1 DE |
734 | @if [ ! -f config.status ] ; then \ |
735 | echo You must configure gcc. Look at the INSTALL file for details.; \ | |
736 | false; \ | |
737 | else \ | |
738 | $(SHELL) config.status --recheck; \ | |
739 | fi | |
740 | ||
79d8453e RS |
741 | all.internal: start.encap rest.encap |
742 | # This is what to compile if making a cross-compiler. | |
013a2ee0 | 743 | # Note that we can compile enquire using the cross-compiler just built, |
42396e97 | 744 | # although we can't run it on this machine. |
013a2ee0 | 745 | all.cross: native gcc-cross specs stmp-headers $(LIBGCC) $(STMP_FIXPROTO) \ |
a2d163c4 | 746 | $(LIBGCC1_TEST) $(EXTRA_PARTS) lang.all.cross |
057f494b | 747 | # This is what to compile if making gcc with a cross-compiler. |
013a2ee0 | 748 | all.build: native xgcc $(EXTRA_PARTS) lang.all.build |
79d8453e | 749 | # This is what must be made before installing GCC and converting libraries. |
013a2ee0 | 750 | start.encap: native xgcc specs $(LIBGCC1) xlimits.h lang.start.encap |
eea77e5f | 751 | # These can't be made until after GCC can run. |
013a2ee0 | 752 | rest.encap: stmp-headers $(LIBGCC) $(STMP_FIXPROTO) $(EXTRA_PARTS) lang.rest.encap |
79d8453e RS |
753 | # This is what is made with the host's compiler |
754 | # whether making a cross compiler or not. | |
e9a25f70 | 755 | native: config.status auto-config.h cpp $(LANGUAGES) \ |
88393a07 | 756 | $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2) |
79d8453e RS |
757 | |
758 | # Define the names for selecting languages in LANGUAGES. | |
759 | C c: cc1 | |
79d8453e RS |
760 | PROTO: proto |
761 | ||
bff3fc41 | 762 | # Tell GNU make these are phony targets. |
3379e8ef | 763 | .PHONY: C c PROTO proto |
bff3fc41 | 764 | |
3aa072f2 RS |
765 | # On the target machine, finish building a cross compiler. |
766 | # This does the things that can't be done on the host machine. | |
b583eed8 | 767 | rest.cross: $(LIBGCC) gfloat.h specs |
3aa072f2 | 768 | |
a2d163c4 | 769 | # Verify that it works to compile and link libgcc1-test. |
e97ed334 | 770 | # If it does, then there are sufficient replacements for libgcc1.a. |
a2d163c4 | 771 | libgcc1-test: libgcc1-test.o native $(GCC_PARTS) |
8f28aa33 | 772 | @echo "Testing libgcc1. Ignore linker warning messages." |
a2d163c4 | 773 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) libgcc1-test.o -o libgcc1-test \ |
fda92428 | 774 | -nostartfiles -nostdlib `$(GCC_FOR_TARGET) --print-libgcc-file-name` |
a2d163c4 DE |
775 | libgcc1-test.o: libgcc1-test.c native xgcc |
776 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -c $(srcdir)/libgcc1-test.c | |
e97ed334 | 777 | |
3aa072f2 RS |
778 | # Recompile all the language-independent object files. |
779 | # This is used only if the user explicitly asks for it. | |
79d8453e RS |
780 | compilations: ${OBJS} |
781 | ||
6c1cc7fa DE |
782 | # Create a list of the language-independent object files so the language |
783 | # subdirectories needn't mention their names explicitly. | |
b93a436e JL |
784 | stamp-objlist: $(OBJS) |
785 | echo " $(OBJS)" | sed -e 's, \([a-z0-9]\), ../\1,g' -e 's/\.o/$(objext)/g' >stamp-objlist | |
6c1cc7fa | 786 | |
acbbf3d9 RS |
787 | # We call this executable `xgcc' rather than `gcc' |
788 | # to avoid confusion if the current directory is in the path | |
789 | # and CC is `gcc'. It is renamed to `gcc' when it is installed. | |
e9a25f70 JL |
790 | xgcc: gcc.o version.o choose-temp.o pexecute.o prefix.o version.o \ |
791 | $(LIBDEPS) $(EXTRA_GCC_OBJS) | |
792 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o prefix.o version.o \ | |
c6e087c5 | 793 | choose-temp.o pexecute.o $(EXTRA_GCC_OBJS) $(LIBS) |
3aa072f2 RS |
794 | |
795 | # Dump a specs file to make -B./ read these specs over installed ones. | |
43554690 | 796 | specs: xgcc |
d521a023 RK |
797 | $(GCC_FOR_TARGET) -dumpspecs > tmp-specs |
798 | mv tmp-specs specs | |
79d8453e | 799 | |
acbbf3d9 | 800 | # We do want to create an executable named `xgcc', so we can use it to |
79d8453e RS |
801 | # compile libgcc2.a. |
802 | # Also create gcc-cross, so that install-common will install properly. | |
acbbf3d9 | 803 | gcc-cross: xgcc |
aab26e16 | 804 | cp xgcc$(exeext) gcc-cross$(exeext) |
79d8453e | 805 | |
b93a436e JL |
806 | cc1: $(P) $(C_OBJS) $(OBJS) $(LIBDEPS) |
807 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) $(OBJS) $(LIBS) | |
79d8453e | 808 | |
ba1811f1 | 809 | # Copy float.h from its source. |
42118350 | 810 | gfloat.h: $(FLOAT_H) |
5a00de6f | 811 | -rm -f gfloat.h |
42118350 | 812 | cp $(FLOAT_H) gfloat.h |
ba1811f1 ILT |
813 | |
814 | # Create float.h source for the native machine. | |
e9a25f70 | 815 | # Make it empty if we can use the system float.h without changes. |
ba1811f1 | 816 | float.h-nat: enquire |
1e558d35 | 817 | -./enquire -f > tmp-float.h |
956d6950 | 818 | grep '#define [^_]' tmp-float.h >/dev/null || true > tmp-float.h |
1e558d35 | 819 | mv tmp-float.h float.h-nat |
ba1811f1 ILT |
820 | |
821 | # Create a dummy float.h source for a cross-compiler. | |
67446ffe DE |
822 | # ??? This isn't used anymore. Should we create config/float-unkn.h |
823 | # and make that the default float_format in configure? | |
ba1811f1 | 824 | float.h-cross: |
54577c52 RK |
825 | echo "#ifndef __GCC_FLOAT_NOT_NEEDED" > t-float.h-cross |
826 | echo "#error float.h values not known for cross-compiler" >> t-float.h-cross | |
827 | echo "#endif" >> t-float.h-cross | |
d521a023 | 828 | mv t-float.h-cross float.h-cross |
79d8453e RS |
829 | |
830 | # Used to compile enquire with standard cc, but have forgotten why. | |
831 | # Let's try with GCC. | |
832 | enquire: enquire.o $(GCC_PARTS) | |
aab26e16 | 833 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ENQUIRE_LDFLAGS) enquire.o -o $@ |
94b7bf21 | 834 | enquire.o: $(srcdir)/enquire.c $(GCC_PASSES) stmp-int-hdrs |
e9a25f70 JL |
835 | rm -f include/float.h |
836 | if $(FLOAT_H_TEST); then \ | |
837 | SYS_FLOAT_H_WRAP=1; \ | |
838 | else :; \ | |
839 | SYS_FLOAT_H_WRAP=0; \ | |
840 | fi; \ | |
841 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(ENQUIRE_CFLAGS) \ | |
842 | -DSYS_FLOAT_H_WRAP=$$SYS_FLOAT_H_WRAP \ | |
843 | -I. -c $(srcdir)/enquire.c | |
1402d22c RS |
844 | |
845 | # Build the version of limits.h that we will install. | |
846 | xlimits.h: glimits.h limitx.h limity.h | |
40dc28fc | 847 | if $(LIMITS_H_TEST) ; then \ |
d521a023 | 848 | cat $(srcdir)/limitx.h $(srcdir)/glimits.h $(srcdir)/limity.h > tmp-xlimits.h; \ |
1402d22c | 849 | else \ |
d521a023 | 850 | cat $(srcdir)/glimits.h > tmp-xlimits.h; \ |
1402d22c | 851 | fi |
d521a023 | 852 | mv tmp-xlimits.h xlimits.h |
544eb21e | 853 | #\f |
79d8453e RS |
854 | # Build libgcc.a. |
855 | # This is done in two parts because some functions, in libgcc1.c, | |
acbbf3d9 RS |
856 | # must be compiled with something other than GCC, |
857 | # while the rest, in libgcc2.c, must be compiled with xgcc. | |
858 | # That means we can't do libgcc2.c until after xgcc, cc1, etc. | |
79d8453e RS |
859 | |
860 | # Use this as value of LIBGCC1 to cause conversion to GNU library format. | |
861 | # LIBCONVERT should put its output in libgcc1.conv. | |
862 | libgcc1.conv: libgcc1.a | |
863 | $(LIBCONVERT) libgcc1.a libgcc1.conv | |
864 | ||
865 | # Use this as value of LIBGCC1 to inhibit use of libgcc1.c entirely. | |
866 | # Make an empty file instead. | |
57cd2ea1 | 867 | libgcc1.null: $(GCC_PASSES) |
79d8453e RS |
868 | echo "__foo () {}" > dummy.c |
869 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) -c dummy.c | |
aab26e16 RK |
870 | $(OLDAR) $(OLDAR_FLAGS) libgcc1.null dummy$(objext) |
871 | rm -f dummy$(objext) dummy.c | |
79d8453e | 872 | |
b7ac21e3 RS |
873 | # This is $(LIBGCC1) for a cross-compiler. |
874 | # We have no automatic way of building libgcc1.a, | |
875 | # so it's up to the installer to find a way to do that. | |
876 | # This rule deliberately does not depend on libgcc1.a | |
877 | # so that it will fail if the installer hasn't provided it. | |
878 | libgcc1.cross: | |
879 | mv libgcc1.a libgcc1.cross || (echo You must find a way to make libgcc1.a; false) | |
880 | ||
79d8453e | 881 | # Compile the library of arithmetic subroutines with the native compiler. |
acbbf3d9 | 882 | # Don't compile it with GCC! |
79d8453e | 883 | # (That would cause most arithmetic functions to call themselves.) |
38b3fa08 RK |
884 | # |
885 | # NOTE: If you modify these rules substantially, please be sure to | |
886 | # check at least config/i386/t-sco5 and possibly other makefile | |
887 | # fragments. | |
79d8453e RS |
888 | libgcc1.a: libgcc1.c $(CONFIG_H) $(LIB1FUNCS_EXTRA) config.status |
889 | -rm -f tmplibgcc1.a | |
890 | # Actually build it in tmplibgcc1.a, then rename at end, | |
891 | # so that libgcc1.a itself remains nonexistent if compilation is aborted. | |
892 | # -e causes any failing command to make this rule fail. | |
893 | # -e doesn't work in certain shells, so we test $$? as well. | |
432fde52 JW |
894 | # lynx has a broken ar, it always complains when the initial library is |
895 | # empty, thus this command works only if we don't do -e | |
896 | # There is a trailing backslash (\) deleted from the following line. | |
897 | # set -e; | |
79d8453e RS |
898 | for name in $(LIB1FUNCS); \ |
899 | do \ | |
900 | echo $${name}; \ | |
aab26e16 | 901 | rm -f $${name}$(objext); \ |
38b3fa08 | 902 | $(OLDCC) -DIN_LIBGCC1 $(CCLIBFLAGS) $(INCLUDES) -c -DL$${name} $(srcdir)/libgcc1.c; \ |
79d8453e | 903 | if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ |
aab26e16 RK |
904 | mv libgcc1$(objext) $${name}$(objext); \ |
905 | $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}$(objext); \ | |
906 | rm -f $${name}$(objext); \ | |
79d8453e RS |
907 | done |
908 | # Some shells crash when a loop has no items. | |
909 | # So make sure there is always at least one--`..'. | |
910 | # Then ignore it. | |
911 | # We don't use -e here because there are if statements | |
912 | # that should not make the command give up when the if condition is false. | |
913 | # Instead, we test for failure after each command where it matters. | |
49041557 | 914 | for file in .. $(LIB1FUNCS_EXTRA); \ |
79d8453e RS |
915 | do \ |
916 | if [ x$${file} != x.. ]; then \ | |
5918c853 | 917 | name=`echo $${file} | sed -e 's/[.][cS]$$//' -e 's/[.]asm$$//'`; \ |
79d8453e RS |
918 | echo $${name}; \ |
919 | if [ $${name}.asm = $${file} ]; then \ | |
62c13b81 | 920 | cp $${file} $${name}.s || exit 1; file=$${name}.s; \ |
79d8453e | 921 | else true; fi; \ |
38b3fa08 | 922 | $(OLDCC) -DIN_LIBGCC1 $(CCLIBFLAGS) $(INCLUDES) -c $${file}; \ |
79d8453e | 923 | if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ |
aab26e16 | 924 | $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}$(objext); \ |
79d8453e | 925 | if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ |
aab26e16 | 926 | rm -f $${name}.s $${name}$(objext); \ |
79d8453e RS |
927 | else true; \ |
928 | fi; \ | |
929 | done | |
3ff34537 | 930 | -if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc1.a; else true; fi |
79d8453e RS |
931 | mv tmplibgcc1.a libgcc1.a |
932 | ||
44d65d84 DE |
933 | # Build libgcc1.a from assembler source. LIB1ASMFUNCS is the list of |
934 | # functions. LIB1ASMSRC is the name of the source file in the config | |
935 | # subdirectory. | |
936 | libgcc1-asm.a: libgcc2.ready config.status $(srcdir)/config/$(LIB1ASMSRC) | |
937 | -rm -f tmplibgcc1.a libgcc1.S | |
938 | cp $(srcdir)/config/$(LIB1ASMSRC) libgcc1.S | |
939 | # Actually build it in tmplibgcc1.a, then rename at end, | |
940 | # so that libgcc1-asm.a itself remains nonexistent if compilation is aborted. | |
941 | # -e causes any failing command to make this rule fail. | |
942 | # -e doesn't work in certain shells, so we test $$? as well. | |
943 | # lynx has a broken ar, it always complains when the initial library is | |
944 | # empty, thus this command works only if we don't do -e | |
945 | # There is a trailing backslash (\) deleted from the following line. | |
946 | # set -e; | |
947 | for name in $(LIB1ASMFUNCS); \ | |
948 | do \ | |
949 | echo $${name}; \ | |
950 | $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} libgcc1.S; \ | |
951 | if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ | |
aab26e16 RK |
952 | mv libgcc1$(objext) $${name}$(objext); \ |
953 | $(AR) $(AR_FLAGS) tmplibgcc1.a $${name}$(objext); \ | |
954 | rm -f $${name}$(objext); \ | |
44d65d84 DE |
955 | done |
956 | -rm -f libgcc1.S | |
957 | mv tmplibgcc1.a libgcc1-asm.a | |
958 | ||
a2ab7f2b DE |
959 | # Generate assembly versions of the functions required for libgcc1. |
960 | # You'll still need to massage the code by hand (possibly hacking | |
961 | # underscores and local labels) but this will get you started. | |
962 | libgcc1.S: libgcc1.c $(CONFIG_H) config.status | |
963 | -rm -f libgcc1.S | |
964 | touch libgcc1.S | |
965 | for name in $(LIB1FUNCS); \ | |
966 | do \ | |
967 | echo $${name}; \ | |
38b3fa08 | 968 | $(OLDCC) -DIN_LIBGCC1 $(CCLIBFLAGS) $(INCLUDES) -S -DL$${name} $(srcdir)/libgcc1.c; \ |
a2ab7f2b DE |
969 | if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ |
970 | echo '#ifdef ' L$${name} >> libgcc1.S; \ | |
971 | cat libgcc1.s >> libgcc1.S; \ | |
972 | echo '#endif /*' L$${name} '*/' >> libgcc1.S; \ | |
973 | echo "" >> libgcc1.S; \ | |
974 | done | |
975 | ||
79d8453e RS |
976 | # Compiling libgcc2.a requires making sure that cc1, etc. have been compiled. |
977 | # But recompiling cc1 should not force recompilation of libgcc2.a. | |
978 | # If you want to force recompilation, delete libgcc2.a. | |
cce7aea7 | 979 | libgcc2.ready: $(GCC_PASSES) $(LIBGCC2_DEPS) stmp-int-hdrs |
79d8453e RS |
980 | -if [ -f libgcc2.ready ] ; then \ |
981 | true; \ | |
982 | else \ | |
983 | touch libgcc2.ready; \ | |
984 | fi | |
985 | ||
ca55abae | 986 | LIB2ADD = $(srcdir)/frame.c $(LIB2FUNCS_EXTRA) $(LANG_LIB2FUNCS) |
5198352e | 987 | libgcc2.a: libgcc2.c libgcc2.ready $(CONFIG_H) $(FPBIT) $(DPBIT) $(LIB2ADD) \ |
956d6950 | 988 | machmode.h longlong.h frame.h gansidecl.h gbl-ctors.h config.status |
79d8453e RS |
989 | # Actually build it in tmplibgcc2.a, then rename at end, |
990 | # so that libgcc2.a itself remains nonexistent if compilation is aborted. | |
991 | -rm -f tmplibgcc2.a | |
992 | # -e causes any failing command to make this rule fail. | |
993 | # -e doesn't work in certain shells, so we test $$? as well. | |
432fde52 JW |
994 | # lynx has a broken ar, it always complains when the initial library is |
995 | # empty, thus this command works only if we don't do -e | |
996 | # There is a trailing backslash (\) deleted from the following line. | |
997 | # set -e; | |
79d8453e RS |
998 | for name in $(LIB2FUNCS); \ |
999 | do \ | |
1000 | echo $${name}; \ | |
2e494f70 | 1001 | $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \ |
aab26e16 | 1002 | $(srcdir)/libgcc2.c -o $${name}$(objext); \ |
79d8453e | 1003 | if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ |
aab26e16 RK |
1004 | $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}$(objext); \ |
1005 | rm -f $${name}$(objext); \ | |
79d8453e | 1006 | done |
5198352e JL |
1007 | if [ x$(FPBIT) != x ]; then \ |
1008 | for name in $(FPBIT_FUNCS); \ | |
1009 | do \ | |
1010 | echo $${name}; \ | |
1011 | $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \ | |
1012 | -DFINE_GRAINED_LIBRARIES $(FPBIT) -o $${name}$(objext); \ | |
1013 | if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ | |
1014 | $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}$(objext); \ | |
1015 | rm -f $${name}$(objext); \ | |
1016 | done; \ | |
1017 | else true; fi; | |
1018 | if [ x$(DPBIT) != x ]; then \ | |
1019 | for name in $(DPBIT_FUNCS); \ | |
1020 | do \ | |
1021 | echo $${name}; \ | |
1022 | $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \ | |
1023 | -DFINE_GRAINED_LIBRARIES $(DPBIT) -o $${name}$(objext); \ | |
1024 | if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ | |
1025 | $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}$(objext); \ | |
1026 | rm -f $${name}$(objext); \ | |
1027 | done; \ | |
1028 | else true; fi; | |
79d8453e RS |
1029 | # Some shells crash when a loop has no items. |
1030 | # So make sure there is always at least one--`..'. | |
1031 | # Then ignore it. | |
1032 | # We don't use -e here because there are if statements | |
1033 | # that should not make the command give up when the if condition is false. | |
1034 | # Instead, we test for failure after each command where it matters. | |
ca55abae JM |
1035 | for file in $(LIB2ADD); do \ |
1036 | name=`echo $${file} | sed -e 's/[.][cSo]$$//' -e 's/[.]asm$$//' -e 's/[.]txt$$//'`; \ | |
1037 | oname=` echo $${name} | sed -e 's,.*/,,'`; \ | |
1038 | if [ $${name}.txt = $${file} ]; then \ | |
1039 | for f in .. `cat $${file}`; do if [ x$${f} != x.. ]; then \ | |
1040 | $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \ | |
1041 | AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" CC="$(CC)" \ | |
1042 | CFLAGS="$(CFLAGS)" HOST_PREFIX="$(HOST_PREFIX)" \ | |
1043 | HOST_PREFIX_1="$(HOST_PREFIX_1)" \ | |
1044 | LANGUAGES="$(LANGUAGES)" \ | |
1045 | LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" $${f}; \ | |
f7055b09 | 1046 | if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ |
ca55abae JM |
1047 | $(AR) $(AR_FLAGS) tmplibgcc2.a $${f}; \ |
1048 | rm -f $${f}; \ | |
1049 | else true; \ | |
1050 | fi; done; \ | |
1051 | else \ | |
1052 | echo $${name}; \ | |
1053 | if [ $${name}.asm = $${file} ]; then \ | |
1054 | cp $${file} $${name}.s || exit 1; file=$${name}.s; \ | |
1055 | else true; fi; \ | |
1056 | $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \ | |
1057 | if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ | |
1058 | $(AR) $(AR_FLAGS) tmplibgcc2.a $${oname}$(objext); \ | |
1059 | rm -f $${name}.s $${oname}$(objext); \ | |
79d8453e RS |
1060 | fi; \ |
1061 | done | |
1062 | mv tmplibgcc2.a libgcc2.a | |
1063 | # These lines were deleted from above the mv command | |
1064 | # because ranlibing libgcc.a itself should suffice. | |
1065 | # -if [ x${HPUX_GAS} = x ] ; then \ | |
f9a32908 | 1066 | # if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc2.a; else true; fi; \ |
79d8453e RS |
1067 | # else true; fi |
1068 | ||
1069 | # Combine the various libraries into a single library, libgcc.a. | |
1070 | libgcc.a: $(LIBGCC1) $(LIBGCC2) | |
1071 | -rm -rf tmplibgcc.a libgcc.a tmpcopy | |
1072 | mkdir tmpcopy | |
2e494f70 RS |
1073 | -if [ x$(LIBGCC1) != x ]; \ |
1074 | then (cd tmpcopy; $(AR) x ../$(LIBGCC1)); \ | |
1075 | else true; \ | |
1076 | fi | |
2516bc12 JW |
1077 | # Some versions of ar (specifically the one in RISC/os 5.x), create an |
1078 | # unwritable table of contents file, and then print an error message when | |
1079 | # the second ar command tries to overwrite this file. To avoid the error | |
1080 | # message from ar, we make sure all files are writable. | |
cfc327a2 | 1081 | -(cd tmpcopy; chmod +w * > /dev/null 2>&1) |
79d8453e | 1082 | (cd tmpcopy; $(AR) x ../$(LIBGCC2)) |
aab26e16 | 1083 | (cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *$(objext)) |
79d8453e RS |
1084 | rm -rf tmpcopy |
1085 | -if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc.a; else true; fi | |
1086 | # Actually build it in tmplibgcc.a, then rename at end, | |
1087 | # so that libgcc.a itself remains nonexistent if compilation is aborted. | |
1088 | mv tmplibgcc.a libgcc.a | |
1089 | ||
f6cdc7ea DE |
1090 | # Use the genmultilib shell script to generate the information the gcc |
1091 | # driver program needs to select the library directory based on the | |
1092 | # switches. | |
961b7009 MM |
1093 | multilib.h: stamp-mlib; @true |
1094 | stamp-mlib: $(srcdir)/genmultilib Makefile | |
1095 | $(SHELL) $(srcdir)/genmultilib \ | |
1096 | "$(MULTILIB_OPTIONS)" \ | |
1097 | "$(MULTILIB_DIRNAMES)" \ | |
1098 | "$(MULTILIB_MATCHES)" \ | |
1099 | "$(MULTILIB_EXCEPTIONS)" \ | |
1100 | "$(MULTILIB_EXTRA_OPTS)" > tmp-mlib.h | |
1101 | $(srcdir)/move-if-change tmp-mlib.h multilib.h | |
1102 | touch stamp-mlib | |
f6cdc7ea DE |
1103 | |
1104 | # Build multiple copies of libgcc.a, one for each target switch. | |
1105 | stmp-multilib: $(LIBGCC1) libgcc2.c libgcc2.ready $(CONFIG_H) \ | |
956d6950 | 1106 | frame.h gansidecl.h \ |
ca55abae | 1107 | $(LIB2ADD) machmode.h longlong.h gbl-ctors.h config.status |
f6cdc7ea DE |
1108 | for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \ |
1109 | dir=`echo $$i | sed -e 's/;.*$$//'`; \ | |
1110 | flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \ | |
f6cdc7ea | 1111 | $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \ |
32e2dec7 | 1112 | AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" CC="$(CC)" CFLAGS="$(CFLAGS)" \ |
ad3a9224 | 1113 | RANLIB="$(RANLIB)" RANLIB_TEST="$(RANLIB_TEST)" \ |
71abb567 | 1114 | LANGUAGES="$(LANGUAGES)" \ |
f6cdc7ea | 1115 | HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \ |
ad3a9224 | 1116 | LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS) $${flags}" \ |
47a22692 | 1117 | MULTILIB_CFLAGS="$${flags}" \ |
ad3a9224 DE |
1118 | LIBGCC1="$(LIBGCC1)" LIBGCC2="$(LIBGCC2)" \ |
1119 | dir="$${dir}" stmp-multilib-sub; \ | |
bff3fc41 | 1120 | if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ |
f6cdc7ea DE |
1121 | done |
1122 | touch stmp-multilib | |
1123 | ||
ad3a9224 DE |
1124 | # Subroutine of stmp-multilib so make -n works. |
1125 | stmp-multilib-sub: | |
47a22692 JM |
1126 | rm -f $(LIBGCC2) |
1127 | if [ -d $(dir) ]; then \ | |
1128 | cd $(dir); \ | |
1129 | rm -f libgcc.a $(EXTRA_MULTILIB_PARTS); \ | |
88029ff8 | 1130 | else true; \ |
47a22692 | 1131 | fi |
ad3a9224 | 1132 | $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \ |
32e2dec7 | 1133 | AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" CC="$(CC)" CFLAGS="$(CFLAGS)" \ |
ad3a9224 | 1134 | HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \ |
71abb567 | 1135 | LANGUAGES="$(LANGUAGES)" \ |
ad3a9224 DE |
1136 | LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" $(LIBGCC2) |
1137 | if [ x$(LIBGCC1) != xlibgcc1-asm.a ]; \ | |
1138 | then true; \ | |
1139 | else rm -f $(LIBGCC1); \ | |
1140 | fi | |
1141 | if [ x$(LIBGCC1) != xlibgcc1-asm.a ]; \ | |
1142 | then true; \ | |
1143 | else \ | |
1144 | $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \ | |
32e2dec7 | 1145 | AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" CC="$(CC)" CFLAGS="$(CFLAGS)" \ |
ad3a9224 | 1146 | HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \ |
71abb567 | 1147 | LANGUAGES="$(LANGUAGES)" \ |
ad3a9224 DE |
1148 | LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" $(LIBGCC1); \ |
1149 | fi | |
1150 | rm -rf tmplibgcc.a tmpcopy | |
1151 | mkdir tmpcopy | |
1152 | if [ x$(LIBGCC1) != x ]; \ | |
1153 | then (cd tmpcopy; $(AR) x ../$(LIBGCC1)); \ | |
1154 | else true; \ | |
1155 | fi | |
1156 | (cd tmpcopy; $(AR) x ../$(LIBGCC2)) | |
7a7e1cfb | 1157 | (cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *$(objext)) |
ad3a9224 DE |
1158 | rm -rf libgcc2.a tmpcopy |
1159 | if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc.a; else true; fi | |
1160 | if [ -d $(dir) ]; then true; else mkdir $(dir); fi | |
1161 | mv tmplibgcc.a $(dir)/libgcc.a | |
47a22692 JM |
1162 | for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \ |
1163 | $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \ | |
1164 | AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" CC="$(CC)" CFLAGS="$(CFLAGS)" \ | |
1165 | HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \ | |
1c4c5851 | 1166 | LANGUAGES="$(LANGUAGES)" \ |
47a22692 JM |
1167 | MULTILIB_CFLAGS="$(MULTILIB_CFLAGS)" T="t" t$${f}; \ |
1168 | mv t$${f} $(dir)/$${f}; \ | |
88029ff8 | 1169 | else true; \ |
47a22692 | 1170 | fi; done |
ad3a9224 | 1171 | |
79d8453e | 1172 | # Compile two additional files that are linked with every program |
32988c4a RM |
1173 | # linked using GCC on systems using COFF or ELF, for the sake of C++ |
1174 | # constructors. | |
956d6950 JL |
1175 | $(T)crtbegin.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \ |
1176 | defaults.h frame.h gbl-ctors.h | |
a94dbf2c | 1177 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \ |
ca55abae | 1178 | -finhibit-size-directive -fno-inline-functions -fno-exceptions $(CRTSTUFF_T_CFLAGS) \ |
a94dbf2c | 1179 | -c $(srcdir)/crtstuff.c -DCRT_BEGIN -o $(T)crtbegin$(objext) |
47a22692 | 1180 | |
956d6950 JL |
1181 | $(T)crtend.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \ |
1182 | defaults.h frame.h gbl-ctors.h | |
a94dbf2c | 1183 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \ |
ca55abae | 1184 | -finhibit-size-directive -fno-inline-functions -fno-exceptions $(CRTSTUFF_T_CFLAGS) \ |
a94dbf2c | 1185 | -c $(srcdir)/crtstuff.c -DCRT_END -o $(T)crtend$(objext) |
32988c4a RM |
1186 | |
1187 | # On some systems we also want to install versions of these files | |
1188 | # compiled using PIC for use in shared libraries. | |
1189 | crtbeginS.o crtendS.o: stamp-crtS ; @true | |
1190 | ||
956d6950 JL |
1191 | stamp-crtS: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \ |
1192 | defaults.h frame.h gbl-ctors.h | |
38b3fa08 | 1193 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS_S) \ |
32988c4a | 1194 | -DCRT_BEGIN -finhibit-size-directive -fno-inline-functions \ |
38b3fa08 | 1195 | -g0 -c $(srcdir)/crtstuff.c |
32988c4a | 1196 | mv crtstuff$(objext) crtbeginS$(objext) |
38b3fa08 | 1197 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS_S) \ |
32988c4a | 1198 | -DCRT_END -finhibit-size-directive -fno-inline-functions \ |
21d4969d | 1199 | -g0 -c $(srcdir)/crtstuff.c -o crtendS$(objext) |
32988c4a | 1200 | touch stamp-crtS |
522170ca RK |
1201 | |
1202 | # Compile the start modules crt0.o and mcrt0.o that are linked with every program | |
1203 | crt0.o: stamp-crt0 ; @true | |
1204 | mcrt0.o: stamp-crt0; @true | |
1205 | ||
1206 | stamp-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H) | |
1207 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \ | |
1208 | -o crt0.o -c $(CRT0_S) | |
1209 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \ | |
1210 | -o mcrt0.o -c $(MCRT0_S) | |
1211 | touch stamp-crt0 | |
544eb21e | 1212 | #\f |
79d8453e RS |
1213 | # Compiling object files from source files. |
1214 | ||
1215 | # Note that dependencies on obstack.h are not written | |
1216 | # because that file is not part of GCC. | |
79d8453e RS |
1217 | |
1218 | # C language specific files. | |
1219 | ||
44dbcb17 RK |
1220 | c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h \ |
1221 | $(srcdir)/c-parse.h c-tree.h input.h flags.h | |
79d8453e | 1222 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c |
a1fa1e22 DE |
1223 | $(srcdir)/c-parse.h: $(srcdir)/c-parse.c |
1224 | $(srcdir)/c-parse.c: $(srcdir)/c-parse.y | |
26095868 | 1225 | cd $(srcdir); $(BISON) $(BISONFLAGS) -d c-parse.y -o c-parse.c |
3ff34537 | 1226 | $(srcdir)/c-parse.y: c-parse.in |
49381011 | 1227 | echo '/*WARNING: This file is automatically generated!*/' >tmp-c-parse.y |
1c48d17e RS |
1228 | sed -e "/^ifobjc$$/,/^end ifobjc$$/d" \ |
1229 | -e "/^ifc$$/d" -e "/^end ifc$$/d" \ | |
49381011 | 1230 | $(srcdir)/c-parse.in >>tmp-c-parse.y |
2c33b8c2 | 1231 | $(srcdir)/move-if-change tmp-c-parse.y $(srcdir)/c-parse.y |
1c48d17e | 1232 | |
3ff34537 | 1233 | $(srcdir)/c-gperf.h: c-parse.gperf |
f137e7dc | 1234 | gperf -p -j1 -i 1 -g -o -t -G -N is_reserved_word -k1,3,$$ \ |
2c33b8c2 TG |
1235 | $(srcdir)/c-parse.gperf >tmp-gperf.h |
1236 | $(srcdir)/move-if-change tmp-gperf.h $(srcdir)/c-gperf.h | |
f137e7dc | 1237 | |
ad0ad213 RK |
1238 | c-decl.o : c-decl.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h flags.h output.h |
1239 | c-typeck.o : c-typeck.c $(CONFIG_H) $(TREE_H) c-tree.h flags.h output.h | |
79d8453e | 1240 | c-lang.o : c-lang.c $(CONFIG_H) $(TREE_H) |
3b80f6ca RH |
1241 | c-lex.o : c-lex.c $(CONFIG_H) $(TREE_H) $(RTL_H) c-lex.h c-tree.h \ |
1242 | $(srcdir)/c-parse.h input.h flags.h $(srcdir)/c-gperf.h c-pragma.h | |
79d8453e RS |
1243 | c-aux-info.o : c-aux-info.c $(CONFIG_H) $(TREE_H) c-tree.h flags.h |
1244 | c-convert.o : c-convert.c $(CONFIG_H) $(TREE_H) flags.h | |
89c8019a RK |
1245 | c-pragma.o: c-pragma.c $(CONFIG_H) $(TREE_H) except.h function.h \ |
1246 | defaults.h c-pragma.h | |
f10fec92 | 1247 | c-iterate.o: c-iterate.c $(CONFIG_H) $(TREE_H) $(RTL_H) c-tree.h flags.h |
79d8453e | 1248 | |
47547081 RS |
1249 | # To make a configuration always use collect2, set USE_COLLECT2 to ld. |
1250 | ld: collect2 | |
173712fb | 1251 | rm -f ld$(exeext) |
ac64120e | 1252 | $(LN) collect2$(exeext) ld$(exeext) |
47547081 | 1253 | |
aa32d841 | 1254 | collect2: collect2.o tlink.o hash.o cplus-dem.o underscore.o version.o \ |
dae14688 | 1255 | choose-temp.o $(LIBDEPS) |
057f494b | 1256 | # Don't try modifying collect2 (aka ld) in place--it might be linking this. |
aab26e16 | 1257 | -rm -f collect2$(exeext) |
aa32d841 | 1258 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ collect2.o tlink.o hash.o \ |
dae14688 | 1259 | cplus-dem.o underscore.o version.o choose-temp.o $(LIBS) |
79d8453e | 1260 | |
956d6950 | 1261 | collect2.o : collect2.c $(CONFIG_H) gansidecl.h gstab.h obstack.h $(DEMANGLE_H) |
b7b08dcd | 1262 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ |
8b06b20a | 1263 | -DTARGET_MACHINE=\"$(target_alias)\" $(MAYBE_USE_COLLECT2) \ |
b7b08dcd | 1264 | -c `echo $(srcdir)/collect2.c | sed 's,^\./,,'` |
79d8453e | 1265 | |
956d6950 | 1266 | tlink.o: tlink.c $(DEMANGLE_H) hash.h $(CONFIG_H) |
aa32d841 | 1267 | hash.o: hash.c hash.h |
956d6950 | 1268 | cplus-dem.o: cplus-dem.c $(DEMANGLE_H) |
a3184468 | 1269 | |
7af4e697 RK |
1270 | underscore.c: stamp-under ; @true |
1271 | ||
1272 | stamp-under: $(GCC_PASSES) | |
7ac16ba0 RK |
1273 | echo "int xxy_us_dummy;" >tmp-dum.c |
1274 | $(GCC_FOR_TARGET) -S tmp-dum.c | |
1275 | echo '/*WARNING: This file is automatically generated!*/' >tmp-under.c | |
1276 | if grep _xxy_us_dummy tmp-dum.s > /dev/null ; then \ | |
1277 | echo "int prepends_underscore = 1;" >>tmp-under.c; \ | |
a3184468 | 1278 | else \ |
7ac16ba0 | 1279 | echo "int prepends_underscore = 0;" >>tmp-under.c; \ |
a3184468 | 1280 | fi |
7ac16ba0 RK |
1281 | $(srcdir)/move-if-change tmp-under.c underscore.c |
1282 | -rm -f tmp-dum.c tmp-dum.s | |
7af4e697 | 1283 | touch stamp-under |
a3184468 | 1284 | |
79d8453e RS |
1285 | # A file used by all variants of C. |
1286 | ||
1287 | c-common.o : c-common.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h flags.h | |
1288 | ||
1289 | # Language-independent files. | |
1290 | ||
610c62ac | 1291 | DRIVER_DEFINES = \ |
79d8453e | 1292 | -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \ |
2e494f70 | 1293 | -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \ |
964ceda1 | 1294 | -DDEFAULT_TARGET_VERSION=\"$(version)\" \ |
8b06b20a | 1295 | -DDEFAULT_TARGET_MACHINE=\"$(target_alias)\" \ |
610c62ac | 1296 | -DTOOLDIR_BASE_PREFIX=\"$(exec_prefix)/\" |
956d6950 | 1297 | gcc.o: gcc.c $(CONFIG_H) gansidecl.h multilib.h Makefile $(lang_specs_files) |
610c62ac BK |
1298 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ |
1299 | $(DRIVER_DEFINES) \ | |
79d8453e RS |
1300 | -c `echo $(srcdir)/gcc.c | sed 's,^\./,,'` |
1301 | ||
1302 | dumpvers: dumpvers.c | |
1303 | ||
1304 | version.o: version.c | |
956d6950 JL |
1305 | obstack.o: obstack.c $(CONFIG_H) |
1306 | choose-temp.o: choose-temp.c $(CONFIG_H) gansidecl.h | |
1307 | pexecute.o: pexecute.c $(CONFIG_H) gansidecl.h | |
1308 | prefix.o: prefix.c $(CONFIG_H) gansidecl.h Makefile | |
e9a25f70 JL |
1309 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ |
1310 | -DPREFIX=\"$(prefix)\" \ | |
1311 | -c `echo $(srcdir)/prefix.c | sed 's,^\./,,'` | |
79d8453e | 1312 | |
c5d3565c BK |
1313 | convert.o: convert.c $(CONFIG_H) $(TREE_H) flags.h convert.h |
1314 | ||
eea77e5f | 1315 | tree.o : tree.c $(CONFIG_H) $(TREE_H) flags.h function.h |
79d8453e | 1316 | print-tree.o : print-tree.c $(CONFIG_H) $(TREE_H) |
566cdc73 | 1317 | stor-layout.o : stor-layout.c $(CONFIG_H) $(TREE_H) flags.h function.h |
79d8453e | 1318 | fold-const.o : fold-const.c $(CONFIG_H) $(TREE_H) flags.h |
b93a436e | 1319 | toplev.o : toplev.c $(CONFIG_H) $(TREE_H) $(RTL_H) \ |
c40d5de4 RK |
1320 | flags.h input.h insn-attr.h xcoffout.h defaults.h output.h \ |
1321 | $(lang_options_files) | |
9c6e68c2 | 1322 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(MAYBE_USE_COLLECT2) \ |
8b06b20a | 1323 | -DTARGET_NAME=\"$(target_alias)\" \ |
b7ac21e3 | 1324 | -c `echo $(srcdir)/toplev.c | sed 's,^\./,,'` |
79d8453e RS |
1325 | |
1326 | rtl.o : rtl.c $(CONFIG_H) $(RTL_H) | |
1327 | ||
1328 | print-rtl.o : print-rtl.c $(CONFIG_H) $(RTL_H) | |
1329 | rtlanal.o : rtlanal.c $(CONFIG_H) $(RTL_H) | |
1330 | ||
88e71d24 | 1331 | varasm.o : varasm.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h function.h \ |
ad0ad213 | 1332 | defaults.h insn-codes.h expr.h hard-reg-set.h regs.h xcoffout.h \ |
b93a436e | 1333 | output.h c-pragma.h |
79d8453e RS |
1334 | function.o : function.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h \ |
1335 | insn-flags.h insn-codes.h expr.h regs.h hard-reg-set.h insn-config.h \ | |
b93a436e | 1336 | $(RECOG_H) output.h |
79d8453e | 1337 | stmt.o : stmt.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h \ |
3d195391 | 1338 | insn-flags.h insn-config.h insn-codes.h hard-reg-set.h expr.h except.h \ |
b93a436e | 1339 | loop.h $(RECOG_H) |
3d195391 MS |
1340 | except.o : except.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h \ |
1341 | insn-flags.h insn-codes.h expr.h regs.h hard-reg-set.h insn-config.h \ | |
956d6950 | 1342 | $(RECOG_H) output.h except.h |
8309a1bc | 1343 | expr.o : expr.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h regs.h \ |
956d6950 | 1344 | insn-flags.h insn-codes.h expr.h insn-config.h $(RECOG_H) output.h \ |
b93a436e | 1345 | typeclass.h modemap.def hard-reg-set.h |
79d8453e | 1346 | calls.o : calls.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h expr.h insn-codes.h \ |
e9a25f70 | 1347 | insn-flags.h regs.h |
79d8453e | 1348 | expmed.o : expmed.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \ |
956d6950 | 1349 | insn-flags.h insn-config.h insn-codes.h expr.h $(RECOG_H) real.h |
79d8453e | 1350 | explow.o : explow.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h hard-reg-set.h \ |
956d6950 | 1351 | insn-config.h expr.h $(RECOG_H) insn-flags.h insn-codes.h |
79d8453e | 1352 | optabs.o : optabs.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \ |
956d6950 | 1353 | insn-flags.h insn-config.h insn-codes.h expr.h $(RECOG_H) reload.h |
79d8453e | 1354 | dbxout.o : dbxout.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h regs.h \ |
6aa4e0b4 | 1355 | insn-config.h reload.h gstab.h xcoffout.h defaults.h output.h |
33aeec28 RK |
1356 | sdbout.o : sdbout.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h except.h \ |
1357 | function.h expr.h output.h hard-reg-set.h regs.h defaults.h real.h \ | |
b93a436e | 1358 | insn-config.h obstack.h xcoffout.h c-pragma.h |
79d8453e | 1359 | dwarfout.o : dwarfout.c $(CONFIG_H) $(TREE_H) $(RTL_H) dwarf.h flags.h \ |
8b7ec00c | 1360 | insn-config.h reload.h output.h defaults.h |
1d7cf143 | 1361 | dwarf2out.o : dwarf2out.c $(CONFIG_H) $(TREE_H) $(RTL_H) dwarf2.h flags.h \ |
229558ee | 1362 | insn-config.h reload.h output.h defaults.h hard-reg-set.h regs.h expr.h |
47547081 | 1363 | xcoffout.o : xcoffout.c $(CONFIG_H) $(TREE_H) $(RTL_H) xcoffout.h flags.h |
e9a25f70 | 1364 | emit-rtl.o : emit-rtl.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h except.h \ |
b93a436e | 1365 | function.h regs.h insn-config.h $(RECOG_H) real.h expr.h obstack.h |
ee7e5441 | 1366 | real.o : real.c $(CONFIG_H) $(TREE_H) |
2e494f70 | 1367 | getpwd.o : getpwd.c $(CONFIG_H) |
79d8453e RS |
1368 | |
1369 | integrate.o : integrate.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h integrate.h \ | |
0e75bea2 | 1370 | insn-flags.h insn-config.h insn-codes.h expr.h real.h regs.h function.h \ |
b93a436e | 1371 | output.h $(RECOG_H) except.h |
79d8453e RS |
1372 | |
1373 | jump.o : jump.c $(CONFIG_H) $(RTL_H) flags.h hard-reg-set.h regs.h \ | |
956d6950 | 1374 | insn-config.h insn-flags.h $(RECOG_H) expr.h real.h except.h |
79d8453e RS |
1375 | stupid.o : stupid.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h |
1376 | ||
1377 | cse.o : cse.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h real.h \ | |
956d6950 | 1378 | insn-config.h $(RECOG_H) expr.h |
59a64126 | 1379 | profile.o : profile.c $(CONFIG_H) $(RTL_H) flags.h insn-flags.h gcov-io.h \ |
956d6950 | 1380 | $(TREE_H) output.h regs.h |
79d8453e | 1381 | loop.o : loop.c $(CONFIG_H) $(RTL_H) flags.h loop.h insn-config.h \ |
956d6950 | 1382 | insn-flags.h insn-codes.h regs.h hard-reg-set.h $(RECOG_H) expr.h real.h |
e9a25f70 | 1383 | unroll.o : unroll.c $(CONFIG_H) $(RTL_H) insn-config.h integrate.h regs.h \ |
956d6950 | 1384 | $(RECOG_H) flags.h expr.h loop.h |
79d8453e | 1385 | flow.o : flow.c $(CONFIG_H) $(RTL_H) flags.h insn-config.h \ |
8b8b2c1c | 1386 | $(BASIC_BLOCK_H) regs.h hard-reg-set.h output.h |
eea77e5f | 1387 | combine.o : combine.c $(CONFIG_H) $(RTL_H) flags.h \ |
79d8453e | 1388 | insn-config.h insn-flags.h insn-codes.h insn-attr.h regs.h expr.h \ |
956d6950 | 1389 | $(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h |
79d8453e | 1390 | regclass.o : regclass.c $(CONFIG_H) $(RTL_H) hard-reg-set.h flags.h \ |
b93a436e | 1391 | $(BASIC_BLOCK_H) regs.h insn-config.h $(RECOG_H) reload.h real.h |
8b8b2c1c | 1392 | local-alloc.o : local-alloc.c $(CONFIG_H) $(RTL_H) flags.h $(BASIC_BLOCK_H) \ |
956d6950 | 1393 | regs.h hard-reg-set.h insn-config.h $(RECOG_H) output.h |
8b8b2c1c | 1394 | bitmap.o : bitmap.c $(CONFIG_H) $(RTL_H) flags.h $(BASIC_BLOCK_H) regs.h |
f0ec1f64 | 1395 | global.o : global.c $(CONFIG_H) $(RTL_H) flags.h \ |
8b8b2c1c | 1396 | $(BASIC_BLOCK_H) regs.h hard-reg-set.h insn-config.h output.h |
79d8453e | 1397 | |
7dee9e6a | 1398 | reload.o : reload.c $(CONFIG_H) $(RTL_H) flags.h output.h expr.h\ |
956d6950 | 1399 | reload.h $(RECOG_H) hard-reg-set.h insn-config.h insn-codes.h regs.h real.h |
c6e11279 | 1400 | reload1.o : reload1.c $(CONFIG_H) $(RTL_H) real.h flags.h expr.h \ |
79d8453e | 1401 | reload.h regs.h hard-reg-set.h insn-config.h insn-flags.h insn-codes.h \ |
956d6950 | 1402 | $(BASIC_BLOCK_H) $(RECOG_H) output.h |
79d8453e | 1403 | caller-save.o : caller-save.c $(CONFIG_H) $(RTL_H) flags.h \ |
956d6950 | 1404 | regs.h hard-reg-set.h insn-codes.h insn-config.h $(BASIC_BLOCK_H) $(RECOG_H) \ |
6136d594 | 1405 | reload.h expr.h |
79d8453e | 1406 | reorg.o : reorg.c $(CONFIG_H) $(RTL_H) conditions.h hard-reg-set.h \ |
956d6950 | 1407 | $(BASIC_BLOCK_H) regs.h insn-config.h insn-attr.h insn-flags.h $(RECOG_H) \ |
51549d76 | 1408 | flags.h output.h expr.h |
9ae8ffe7 JL |
1409 | alias.o : alias.c $(CONFIG_H) $(RTL_H) flags.h hard-reg-set.h regs.h \ |
1410 | insn-codes.h | |
8c660648 JL |
1411 | regmove.o : regmove.c $(CONFIG_H) $(RTL_H) insn-config.h recog.h output.h \ |
1412 | reload.h regs.h hard-reg-set.h flags.h expr.h insn-flags.h | |
1413 | $(SCHED_PREFIX)sched.o : $(SCHED_PREFIX)sched.c $(CONFIG_H) $(RTL_H) $(BASIC_BLOCK_H) regs.h hard-reg-set.h \ | |
79d8453e | 1414 | flags.h insn-config.h insn-attr.h |
eea77e5f | 1415 | final.o : final.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h regs.h \ |
956d6950 | 1416 | $(RECOG_H) conditions.h insn-config.h insn-attr.h except.h real.h output.h \ |
b7ac21e3 | 1417 | hard-reg-set.h insn-flags.h insn-codes.h gstab.h xcoffout.h defaults.h |
79d8453e | 1418 | recog.o : recog.c $(CONFIG_H) $(RTL_H) \ |
956d6950 | 1419 | regs.h $(RECOG_H) hard-reg-set.h flags.h insn-config.h insn-attr.h \ |
79d8453e RS |
1420 | insn-flags.h insn-codes.h real.h |
1421 | reg-stack.o : reg-stack.c $(CONFIG_H) $(RTL_H) $(TREE_H) \ | |
e3068d6f | 1422 | regs.h hard-reg-set.h flags.h insn-config.h insn-flags.h |
dcfedcd0 | 1423 | |
b4978ce7 | 1424 | $(out_object_file): $(out_file) $(CONFIG_H) $(TREE_H) \ |
79d8453e RS |
1425 | $(RTL_H) regs.h hard-reg-set.h real.h insn-config.h conditions.h \ |
1426 | insn-flags.h output.h insn-attr.h insn-codes.h | |
9c6e68c2 | 1427 | $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(out_file) |
79d8453e | 1428 | |
4e0db2ce RK |
1429 | # Build auxiliary files that support ecoff format. |
1430 | mips-tfile: mips-tfile.o version.o $(LIBDEPS) | |
aab26e16 | 1431 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tfile.o version.o $(LIBS) |
4e0db2ce RK |
1432 | |
1433 | mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H) | |
1434 | ||
1435 | mips-tdump: mips-tdump.o version.o $(LIBDEPS) | |
aab26e16 | 1436 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tdump.o version.o $(LIBS) |
4e0db2ce RK |
1437 | |
1438 | mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) | |
1439 | ||
579d0ecf RK |
1440 | # Build file to support OSF/rose half-pic format. |
1441 | halfpic.o: halfpic.c $(CONFIG_H) $(RTL_H) $(TREE_H) | |
1442 | ||
79d8453e RS |
1443 | # Normally this target is not used; but it is used if you |
1444 | # define ALLOCA=alloca.o. In that case, you must get a suitable alloca.c | |
1445 | # from the GNU Emacs distribution. | |
79d8453e | 1446 | alloca.o: alloca.c |
79d8453e | 1447 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(ALLOCA_FLAGS) \ |
1d839079 | 1448 | -c `echo $(srcdir)/alloca.c | sed 's,^\./,,'` |
79d8453e | 1449 | $(ALLOCA_FINISH) |
544eb21e | 1450 | #\f |
79d8453e RS |
1451 | # Generate header and source files from the machine description, |
1452 | # and compile them. | |
1453 | ||
1454 | .PRECIOUS: insn-config.h insn-flags.h insn-codes.h \ | |
1455 | insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c \ | |
1456 | insn-attr.h insn-attrtab.c | |
1457 | ||
1458 | # The following pair of rules has this effect: | |
1459 | # genconfig is run only if the md has changed since genconfig was last run; | |
1460 | # but the file insn-config.h is touched only when its contents actually change. | |
1461 | ||
1462 | # Each of the other insn-* files is handled by a similar pair of rules. | |
1463 | ||
1402d22c RS |
1464 | # This causes an anomaly in the results of make -n |
1465 | # because insn-* is older than stamp-* | |
1466 | # and thus make -n thinks that insn-* will be updated | |
1467 | # and force recompilation of things that depend on it. | |
424aa086 | 1468 | # We use move-if-change precisely to avoid such recompilation. |
1402d22c RS |
1469 | # But there is no way to teach make -n that it will be avoided. |
1470 | ||
79d8453e RS |
1471 | # Each of the insn-*.[ch] rules has a semicolon at the end, |
1472 | # for otherwise the system Make on SunOS 4.1 never tries | |
7bd95cc1 BK |
1473 | # to recompile insn-*.o. To avoid problems and extra noise from |
1474 | # versions of make which don't like empty commands (nothing after the | |
1475 | # trailing `;'), we call true for each. | |
79d8453e | 1476 | |
d960abef | 1477 | insn-config.h: stamp-config ; @true |
7ac16ba0 RK |
1478 | stamp-config : $(md_file) genconfig $(srcdir)/move-if-change |
1479 | ./genconfig $(md_file) > tmp-config.h | |
79d8453e RS |
1480 | $(srcdir)/move-if-change tmp-config.h insn-config.h |
1481 | touch stamp-config | |
1482 | ||
d960abef | 1483 | insn-flags.h: stamp-flags ; @true |
7ac16ba0 RK |
1484 | stamp-flags : $(md_file) genflags $(srcdir)/move-if-change |
1485 | ./genflags $(md_file) > tmp-flags.h | |
79d8453e RS |
1486 | $(srcdir)/move-if-change tmp-flags.h insn-flags.h |
1487 | touch stamp-flags | |
1488 | ||
d960abef | 1489 | insn-codes.h: stamp-codes ; @true |
7ac16ba0 RK |
1490 | stamp-codes : $(md_file) gencodes $(srcdir)/move-if-change |
1491 | ./gencodes $(md_file) > tmp-codes.h | |
79d8453e RS |
1492 | $(srcdir)/move-if-change tmp-codes.h insn-codes.h |
1493 | touch stamp-codes | |
1494 | ||
1495 | insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) expr.h real.h output.h \ | |
1496 | insn-config.h insn-flags.h insn-codes.h | |
1497 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c | |
1498 | ||
d960abef | 1499 | insn-emit.c: stamp-emit ; @true |
7ac16ba0 RK |
1500 | stamp-emit : $(md_file) genemit $(srcdir)/move-if-change |
1501 | ./genemit $(md_file) > tmp-emit.c | |
79d8453e RS |
1502 | $(srcdir)/move-if-change tmp-emit.c insn-emit.c |
1503 | touch stamp-emit | |
1504 | ||
956d6950 | 1505 | insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h $(RECOG_H) \ |
79d8453e RS |
1506 | real.h output.h flags.h |
1507 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-recog.c | |
1508 | ||
d960abef | 1509 | insn-recog.c: stamp-recog ; @true |
7ac16ba0 RK |
1510 | stamp-recog : $(md_file) genrecog $(srcdir)/move-if-change |
1511 | ./genrecog $(md_file) > tmp-recog.c | |
79d8453e RS |
1512 | $(srcdir)/move-if-change tmp-recog.c insn-recog.c |
1513 | touch stamp-recog | |
1514 | ||
118bdbf8 | 1515 | insn-opinit.o : insn-opinit.c $(CONFIG_H) $(RTL_H) insn-codes.h insn-flags.h \ |
956d6950 | 1516 | insn-config.h flags.h $(RECOG_H) expr.h reload.h |
118bdbf8 RK |
1517 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-opinit.c |
1518 | ||
1519 | insn-opinit.c: stamp-opinit ; @true | |
7ac16ba0 RK |
1520 | stamp-opinit : $(md_file) genopinit $(srcdir)/move-if-change |
1521 | ./genopinit $(md_file) > tmp-opinit.c | |
118bdbf8 RK |
1522 | $(srcdir)/move-if-change tmp-opinit.c insn-opinit.c |
1523 | touch stamp-opinit | |
1524 | ||
79d8453e RS |
1525 | insn-extract.o : insn-extract.c $(CONFIG_H) $(RTL_H) |
1526 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-extract.c | |
1527 | ||
d960abef | 1528 | insn-extract.c: stamp-extract ; @true |
7ac16ba0 RK |
1529 | stamp-extract : $(md_file) genextract $(srcdir)/move-if-change |
1530 | ./genextract $(md_file) > tmp-extract.c | |
79d8453e RS |
1531 | $(srcdir)/move-if-change tmp-extract.c insn-extract.c |
1532 | touch stamp-extract | |
1533 | ||
1534 | insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) regs.h output.h real.h | |
1535 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-peep.c | |
1536 | ||
d960abef | 1537 | insn-peep.c: stamp-peep ; @true |
7ac16ba0 RK |
1538 | stamp-peep : $(md_file) genpeep $(srcdir)/move-if-change |
1539 | ./genpeep $(md_file) > tmp-peep.c | |
79d8453e RS |
1540 | $(srcdir)/move-if-change tmp-peep.c insn-peep.c |
1541 | touch stamp-peep | |
1542 | ||
1543 | insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(RTL_H) regs.h real.h output.h \ | |
1544 | insn-attr.h insn-config.h | |
1545 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-attrtab.c | |
1546 | ||
d960abef | 1547 | insn-attr.h: stamp-attr ; @true |
7ac16ba0 RK |
1548 | stamp-attr : $(md_file) genattr $(srcdir)/move-if-change |
1549 | ./genattr $(md_file) > tmp-attr.h | |
79d8453e RS |
1550 | $(srcdir)/move-if-change tmp-attr.h insn-attr.h |
1551 | touch stamp-attr | |
1552 | ||
d960abef | 1553 | insn-attrtab.c: stamp-attrtab ; @true |
7ac16ba0 RK |
1554 | stamp-attrtab : $(md_file) genattrtab $(srcdir)/move-if-change |
1555 | if cmp -s $(PREMADE_ATTRTAB_MD) $(md_file); \ | |
20bd0ab1 RS |
1556 | then \ |
1557 | echo Using $(PREMADE_ATTRTAB); \ | |
2e0b13db | 1558 | cp $(PREMADE_ATTRTAB) tmp-attrtab.c; \ |
20bd0ab1 | 1559 | else \ |
7ac16ba0 | 1560 | ./genattrtab $(md_file) > tmp-attrtab.c; \ |
20bd0ab1 | 1561 | fi |
79d8453e RS |
1562 | $(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c |
1563 | touch stamp-attrtab | |
1564 | ||
1565 | insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) regs.h real.h conditions.h \ | |
956d6950 | 1566 | hard-reg-set.h insn-config.h insn-flags.h insn-attr.h output.h $(RECOG_H) \ |
79d8453e RS |
1567 | insn-codes.h |
1568 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c | |
1569 | ||
d960abef | 1570 | insn-output.c: stamp-output ; @true |
7ac16ba0 RK |
1571 | stamp-output : $(md_file) genoutput $(srcdir)/move-if-change |
1572 | ./genoutput $(md_file) > tmp-output.c | |
79d8453e RS |
1573 | $(srcdir)/move-if-change tmp-output.c insn-output.c |
1574 | touch stamp-output | |
3b80f6ca RH |
1575 | |
1576 | genrtl.o : genrtl.c $(CONFIG_H) $(RTL_H) | |
1577 | genrtl.c genrtl.h : stamp-genrtl | |
a3f80023 AS |
1578 | @true # force gnu make to recheck modification times. |
1579 | ||
3b80f6ca RH |
1580 | stamp-genrtl: gengenrtl $(srcdir)/move-if-change $(RTL_BASE_H) |
1581 | ./gengenrtl tmp-genrtl.h tmp-genrtl.c | |
1582 | $(srcdir)/move-if-change tmp-genrtl.h genrtl.h | |
1583 | $(srcdir)/move-if-change tmp-genrtl.c genrtl.c | |
1584 | touch stamp-genrtl | |
1585 | ||
544eb21e | 1586 | #\f |
79d8453e RS |
1587 | # Compile the programs that generate insn-* from the machine description. |
1588 | # They are compiled with $(HOST_CC), and associated libraries, | |
1589 | # since they need to run on this machine | |
1590 | # even if GCC is being compiled to run on some other machine. | |
1591 | ||
1592 | # $(CONFIG_H) is omitted from the deps of the gen*.o | |
1593 | # because these programs don't really depend on anything | |
1594 | # about the target machine. They do depend on config.h itself, | |
1595 | # since that describes the host machine. | |
1596 | ||
c3efc7c4 | 1597 | # Pass the md file through cpp if the target requests it. |
aa90345a RK |
1598 | $(MD_FILE): $(MD_DEPS) |
1599 | rm -f $@ | |
7ac16ba0 | 1600 | $(MD_CPP) $(MD_CPPFLAGS) $(md_file) | sed 's/^# /; /g' > tmp-$@ |
d521a023 | 1601 | mv tmp-$@ $@ |
c3efc7c4 | 1602 | |
79d8453e | 1603 | genconfig : genconfig.o $(HOST_RTL) $(HOST_LIBDEPS) |
aab26e16 | 1604 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ |
79d8453e RS |
1605 | genconfig.o $(HOST_RTL) $(HOST_LIBS) |
1606 | ||
7ac16ba0 | 1607 | genconfig.o : genconfig.c $(RTL_H) $(build_xm_file) |
79d8453e RS |
1608 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c |
1609 | ||
1610 | genflags : genflags.o $(HOST_RTL) $(HOST_LIBDEPS) | |
aab26e16 | 1611 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ |
79d8453e RS |
1612 | genflags.o $(HOST_RTL) $(HOST_LIBS) |
1613 | ||
7ac16ba0 | 1614 | genflags.o : genflags.c $(RTL_H) $(build_xm_file) |
79d8453e RS |
1615 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c |
1616 | ||
1617 | gencodes : gencodes.o $(HOST_RTL) $(HOST_LIBDEPS) | |
aab26e16 | 1618 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ |
79d8453e RS |
1619 | gencodes.o $(HOST_RTL) $(HOST_LIBS) |
1620 | ||
7ac16ba0 | 1621 | gencodes.o : gencodes.c $(RTL_H) $(build_xm_file) |
79d8453e RS |
1622 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c |
1623 | ||
1624 | genemit : genemit.o $(HOST_RTL) $(HOST_LIBDEPS) | |
aab26e16 | 1625 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ |
79d8453e RS |
1626 | genemit.o $(HOST_RTL) $(HOST_LIBS) |
1627 | ||
7ac16ba0 | 1628 | genemit.o : genemit.c $(RTL_H) $(build_xm_file) |
79d8453e RS |
1629 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c |
1630 | ||
118bdbf8 | 1631 | genopinit : genopinit.o $(HOST_RTL) $(HOST_LIBDEPS) |
aab26e16 | 1632 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ |
118bdbf8 RK |
1633 | genopinit.o $(HOST_RTL) $(HOST_LIBS) |
1634 | ||
7ac16ba0 | 1635 | genopinit.o : genopinit.c $(RTL_H) $(build_xm_file) |
118bdbf8 RK |
1636 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genopinit.c |
1637 | ||
79d8453e | 1638 | genrecog : genrecog.o $(HOST_RTL) $(HOST_LIBDEPS) |
aab26e16 | 1639 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ |
79d8453e RS |
1640 | genrecog.o $(HOST_RTL) $(HOST_LIBS) |
1641 | ||
7ac16ba0 | 1642 | genrecog.o : genrecog.c $(RTL_H) $(build_xm_file) |
79d8453e RS |
1643 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c |
1644 | ||
1645 | genextract : genextract.o $(HOST_RTL) $(HOST_LIBDEPS) | |
aab26e16 | 1646 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ |
79d8453e RS |
1647 | genextract.o $(HOST_RTL) $(HOST_LIBS) |
1648 | ||
7ac16ba0 | 1649 | genextract.o : genextract.c $(RTL_H) $(build_xm_file) insn-config.h |
79d8453e RS |
1650 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c |
1651 | ||
1652 | genpeep : genpeep.o $(HOST_RTL) $(HOST_LIBDEPS) | |
aab26e16 | 1653 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ |
79d8453e RS |
1654 | genpeep.o $(HOST_RTL) $(HOST_LIBS) |
1655 | ||
7ac16ba0 | 1656 | genpeep.o : genpeep.c $(RTL_H) $(build_xm_file) |
79d8453e RS |
1657 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c |
1658 | ||
1659 | genattr : genattr.o $(HOST_RTL) $(HOST_LIBDEPS) | |
aab26e16 | 1660 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ |
79d8453e RS |
1661 | genattr.o $(HOST_RTL) $(HOST_LIBS) |
1662 | ||
7ac16ba0 | 1663 | genattr.o : genattr.c $(RTL_H) $(build_xm_file) |
79d8453e RS |
1664 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c |
1665 | ||
d3614a37 | 1666 | genattrtab : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBDEPS) |
aab26e16 | 1667 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ |
d3614a37 | 1668 | genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBS) |
79d8453e | 1669 | |
7ac16ba0 | 1670 | genattrtab.o : genattrtab.c $(RTL_H) $(build_xm_file) insn-config.h |
79d8453e RS |
1671 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c |
1672 | ||
1673 | genoutput : genoutput.o $(HOST_RTL) $(HOST_LIBDEPS) | |
aab26e16 | 1674 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ |
79d8453e RS |
1675 | genoutput.o $(HOST_RTL) $(HOST_LIBS) |
1676 | ||
7ac16ba0 | 1677 | genoutput.o : genoutput.c $(RTL_H) $(build_xm_file) |
79d8453e | 1678 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c |
3b80f6ca RH |
1679 | |
1680 | gengenrtl : gengenrtl.o $(HOST_LIBDEPS) | |
1681 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ | |
1682 | gengenrtl.o $(HOST_LIBS) | |
1683 | ||
1684 | gengenrtl.o : gengenrtl.c $(RTL_BASE_H) | |
1685 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gengenrtl.c | |
1686 | ||
544eb21e | 1687 | #\f |
79d8453e RS |
1688 | # Compile the libraries to be used by gen*. |
1689 | # If we are not cross-building, gen* use the same .o's that cc1 will use, | |
1690 | # and HOST_PREFIX_1 is `foobar', just to ensure these rules don't conflict | |
1691 | # with the rules for rtl.o, alloca.o, etc. | |
1692 | $(HOST_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(CONFIG_H) $(RTL_H) | |
1693 | rm -f $(HOST_PREFIX)rtl.c | |
057f494b | 1694 | sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtl.c > $(HOST_PREFIX)rtl.c |
79d8453e RS |
1695 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtl.c |
1696 | ||
d3614a37 RS |
1697 | $(HOST_PREFIX_1)print-rtl.o: $(srcdir)/print-rtl.c $(CONFIG_H) $(RTL_H) |
1698 | rm -f $(HOST_PREFIX)print-rtl.c | |
057f494b | 1699 | sed -e 's/config[.]h/hconfig.h/' $(srcdir)/print-rtl.c > $(HOST_PREFIX)print-rtl.c |
d3614a37 RS |
1700 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)print-rtl.c |
1701 | ||
79d8453e RS |
1702 | $(HOST_PREFIX_1)rtlanal.o: $(srcdir)/rtlanal.c $(CONFIG_H) $(RTL_H) |
1703 | rm -f $(HOST_PREFIX)rtlanal.c | |
057f494b | 1704 | sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtlanal.c > $(HOST_PREFIX)rtlanal.c |
79d8453e RS |
1705 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtlanal.c |
1706 | ||
1707 | $(HOST_PREFIX_1)alloca.o: alloca.c | |
1708 | rm -f $(HOST_PREFIX)alloca.c | |
1709 | cp $(srcdir)/alloca.c $(HOST_PREFIX)alloca.c | |
1710 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)alloca.c | |
1711 | ||
1712 | $(HOST_PREFIX_1)obstack.o: obstack.c | |
1713 | rm -f $(HOST_PREFIX)obstack.c | |
057f494b | 1714 | sed -e 's/config[.]h/hconfig.h/' $(srcdir)/obstack.c > $(HOST_PREFIX)obstack.c |
79d8453e RS |
1715 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)obstack.c |
1716 | ||
1717 | $(HOST_PREFIX_1)malloc.o: malloc.c | |
1718 | rm -f $(HOST_PREFIX)malloc.c | |
057f494b | 1719 | sed -e 's/config[.]h/hconfig.h/' $(srcdir)/malloc.c > $(HOST_PREFIX)malloc.c |
79d8453e RS |
1720 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)malloc.c |
1721 | ||
1722 | # This satisfies the dependency that we get if you cross-compile a compiler | |
1723 | # that does not need to compile alloca, malloc or whatever. | |
1724 | $(HOST_PREFIX_1): | |
1725 | touch $(HOST_PREFIX_1) | |
ca695ac9 | 1726 | |
544eb21e | 1727 | #\f |
79d8453e RS |
1728 | # Remake cpp and protoize. |
1729 | ||
1730 | # Making the preprocessor | |
59949f60 | 1731 | cpp: $(CCCP) |
173712fb | 1732 | -rm -f cpp$(exeext) |
ac64120e | 1733 | $(LN) $(CCCP)$(exeext) cpp$(exeext) |
e9a25f70 JL |
1734 | cccp: cccp.o cexp.o version.o prefix.o $(LIBDEPS) |
1735 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ cccp.o cexp.o prefix.o \ | |
aab26e16 | 1736 | version.o $(LIBS) |
3ff34537 | 1737 | cexp.o: $(srcdir)/cexp.c $(CONFIG_H) |
79d8453e RS |
1738 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/cexp.c |
1739 | $(srcdir)/cexp.c: $(srcdir)/cexp.y | |
1740 | cd $(srcdir); $(BISON) -o cexp.c cexp.y | |
aab26e16 | 1741 | |
5c539087 | 1742 | cccp.o: cccp.c $(CONFIG_H) pcp.h version.c config.status |
79d8453e RS |
1743 | # The reason we use $(libdir)/g++-include rather than using libsubdir |
1744 | # is for compatibility with the current version of libg++. | |
1745 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ | |
2e494f70 | 1746 | -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \ |
89b3e3b4 | 1747 | -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \ |
5d6be9c8 | 1748 | -DOLD_GPLUSPLUS_INCLUDE_DIR=\"$(old_gxx_include_dir)\" \ |
3d5e2367 | 1749 | -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \ |
2e494f70 | 1750 | -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \ |
14b18068 | 1751 | -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \ |
79d8453e RS |
1752 | -c `echo $(srcdir)/cccp.c | sed 's,^\./,,'` |
1753 | ||
59949f60 | 1754 | cppmain: cppmain.o cpplib.o cpphash.o cppalloc.o cpperror.o cppexp.o \ |
e9a25f70 | 1755 | prefix.o version.o $(LIBDEPS) |
aab26e16 | 1756 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ cppmain.o cpplib.o cpphash.o \ |
e9a25f70 | 1757 | cppalloc.o cpperror.o cppexp.o prefix.o version.o $(LIBS) |
59949f60 | 1758 | |
66334b64 RK |
1759 | cppmain.o: cppmain.c $(CONFIG_H) cpplib.h |
1760 | ||
594f6fc5 | 1761 | cpplib.o: cpplib.c $(CONFIG_H) cpplib.h cpphash.h config.status |
59949f60 PB |
1762 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ |
1763 | -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \ | |
1764 | -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \ | |
5d6be9c8 | 1765 | -DOLD_GPLUSPLUS_INCLUDE_DIR=\"$(old_gxx_include_dir)\" \ |
59949f60 PB |
1766 | -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \ |
1767 | -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \ | |
1768 | -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \ | |
1769 | -c `echo $(srcdir)/cpplib.c | sed 's,^\./,,'` | |
1770 | ||
594f6fc5 RK |
1771 | cpperror.o: cpperror.c $(CONFIG_H) cpplib.h |
1772 | ||
1773 | cppexp.o: cppexp.c $(CONFIG_H) cpplib.h | |
1774 | ||
1775 | cpphash.o: cpphash.c cpplib.h cpphash.h | |
1776 | ||
293af484 RK |
1777 | cppalloc.o: cppalloc.c $(CONFIG_H) |
1778 | ||
7bd95cc1 BK |
1779 | # Note for the stamp targets, we run the program `true' instead of |
1780 | # having an empty command (nothing following the semicolon). | |
1781 | ||
cce7aea7 | 1782 | proto: config.status protoize unprotoize SYSCALLS.c.X |
79d8453e | 1783 | |
c6e087c5 DE |
1784 | protoize: protoize.o getopt.o getopt1.o getpwd.o version.o \ |
1785 | pexecute.o choose-temp.o $(LIBDEPS) | |
aab26e16 | 1786 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ |
c6e087c5 DE |
1787 | protoize.o getopt.o getopt1.o getpwd.o version.o \ |
1788 | pexecute.o choose-temp.o $(LIBS) | |
2e0b13db | 1789 | |
c6e087c5 DE |
1790 | unprotoize: unprotoize.o getopt.o getopt1.o getpwd.o version.o \ |
1791 | pexecute.o choose-temp.o $(LIBDEPS) | |
aab26e16 | 1792 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ |
c6e087c5 DE |
1793 | unprotoize.o getopt.o getopt1.o getpwd.o version.o \ |
1794 | pexecute.o choose-temp.o $(LIBS) | |
2e0b13db | 1795 | |
6c32c807 | 1796 | protoize.o: protoize.c getopt.h $(CONFIG_H) |
79d8453e RS |
1797 | $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ |
1798 | -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \ | |
89b3e3b4 | 1799 | -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \ |
79d8453e | 1800 | -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \ |
14b18068 | 1801 | -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \ |
3d5e2367 | 1802 | -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \ |
79d8453e | 1803 | -DSTD_PROTO_DIR=\"$(libsubdir)\" \ |
6c32c807 BH |
1804 | $(srcdir)/protoize.c |
1805 | ||
1806 | unprotoize.o: unprotoize.c protoize.c getopt.h $(CONFIG_H) | |
79d8453e RS |
1807 | $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ |
1808 | -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \ | |
89b3e3b4 | 1809 | -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \ |
79d8453e | 1810 | -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \ |
14b18068 | 1811 | -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \ |
3d5e2367 | 1812 | -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \ |
79d8453e | 1813 | -DSTD_PROTO_DIR=\"$(libsubdir)\" \ |
6c32c807 | 1814 | $(srcdir)/unprotoize.c |
79d8453e | 1815 | |
aab26e16 | 1816 | getopt.o: getopt.c getopt.h |
79d8453e | 1817 | $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/getopt.c |
aab26e16 | 1818 | getopt1.o: getopt1.c getopt.h |
79d8453e RS |
1819 | $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/getopt1.c |
1820 | ||
79d8453e | 1821 | # This info describes the target machine, so compile with GCC just built. |
aab26e16 RK |
1822 | SYSCALLS.c.X: $(srcdir)/sys-types.h $(srcdir)/sys-protos.h $(GCC_PASSES) \ |
1823 | stmp-int-hdrs | |
c21cf0a7 | 1824 | -rm -f SYSCALLS.c tmp-SYSCALLS.s |
47547081 | 1825 | cat $(srcdir)/sys-types.h $(srcdir)/sys-protos.h > SYSCALLS.c |
79d8453e | 1826 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ |
c21cf0a7 RS |
1827 | -aux-info $@ -S -o tmp-SYSCALLS.s SYSCALLS.c |
1828 | -rm -f SYSCALLS.c tmp-SYSCALLS.s | |
9c0022f6 | 1829 | |
ac1284f9 | 1830 | |
9c0022f6 | 1831 | test-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES) |
4803a34a | 1832 | -rm -f tmp-proto.[cso] |
d3614a37 RS |
1833 | cp $(srcdir)/protoize.c tmp-proto.c |
1834 | chmod u+w tmp-proto.c | |
4803a34a RK |
1835 | ./protoize -N -B ./ -x getopt.h -c "-B./ -Wall -Wwrite-strings \ |
1836 | $(CFLAGS) $(INCLUDES) \ | |
9c0022f6 RS |
1837 | -DGCC_INCLUDE_DIR=0 \ |
1838 | -DGPLUSPLUS_INCLUDE_DIR=0 \ | |
1839 | -DCROSS_INCLUDE_DIR=0 \ | |
14b18068 | 1840 | -DTOOL_INCLUDE_DIR=0 \ |
d3614a37 | 1841 | -DSTD_PROTO_DIR=0" tmp-proto.c |
e3e873d2 | 1842 | @echo '**********' Expect 400 lines of differences. |
4803a34a RK |
1843 | -diff $(srcdir)/protoize.c tmp-proto.c > tmp-proto.diff |
1844 | -wc -l tmp-proto.diff | |
1845 | ./unprotoize -N -x getopt.h -c "-B./ -Wall -Wwrite-strings \ | |
1846 | $(CFLAGS) $(INCLUDES) \ | |
9c0022f6 RS |
1847 | -DGCC_INCLUDE_DIR=0 \ |
1848 | -DGPLUSPLUS_INCLUDE_DIR=0 \ | |
1849 | -DCROSS_INCLUDE_DIR=0 \ | |
14b18068 | 1850 | -DTOOL_INCLUDE_DIR=0 \ |
d3614a37 | 1851 | -DSTD_PROTO_DIR=0" tmp-proto.c |
9c0022f6 | 1852 | @echo Expect zero differences. |
d3614a37 | 1853 | diff $(srcdir)/protoize.c tmp-proto.c | cat |
aab26e16 | 1854 | -rm -f tmp-proto.[cs] tmp-proto$(objext) |
59a64126 DE |
1855 | |
1856 | gcov.o: gcov.c gcov-io.h | |
1857 | ||
1858 | gcov: gcov.o $(LIBDEPS) | |
1859 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) gcov.o $(LIBS) -o $@ | |
544eb21e | 1860 | #\f |
ba1811f1 ILT |
1861 | # Build the include directory. The stamp files are stmp-* rather than |
1862 | # stamp-* so that mostlyclean does not force the include directory to | |
1863 | # be rebuilt. | |
1864 | ||
56f9206d ILT |
1865 | # Build the include directory except for float.h (which depends upon |
1866 | # enquire). | |
3379e8ef | 1867 | stmp-int-hdrs: stmp-fixinc $(USER_H) xlimits.h |
ba1811f1 ILT |
1868 | # Copy in the headers provided with gcc. |
1869 | # The sed command gets just the last file name component; | |
1870 | # this is necessary because VPATH could add a dirname. | |
1871 | # Using basename would be simpler, but some systems don't have it. | |
c85f7c16 | 1872 | # The touch command is here to workaround an AIX/Linux NFS bug. |
d7371761 RK |
1873 | for file in .. $(USER_H); do \ |
1874 | if [ X$$file != X.. ]; then \ | |
1875 | realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \ | |
c85f7c16 | 1876 | touch include/$$realfile; \ |
ae678a13 JW |
1877 | rm -f include/$$realfile; \ |
1878 | cp $$file include; \ | |
1879 | chmod a+r include/$$realfile; \ | |
d7371761 | 1880 | fi; \ |
ba1811f1 | 1881 | done |
1f050b9b | 1882 | rm -f include/limits.h |
ba1811f1 ILT |
1883 | cp xlimits.h include/limits.h |
1884 | chmod a+r include/limits.h | |
ba1811f1 | 1885 | # Install the README |
1f050b9b | 1886 | rm -f include/README |
ba1811f1 ILT |
1887 | cp $(srcdir)/README-fixinc include/README |
1888 | chmod a+r include/README | |
56f9206d ILT |
1889 | touch stmp-int-hdrs |
1890 | ||
e9a25f70 | 1891 | # Build the complete include directory, including float.h. |
56f9206d ILT |
1892 | stmp-headers: stmp-int-hdrs gfloat.h |
1893 | rm -f include/float.h | |
e9a25f70 JL |
1894 | if [ -s gfloat.h ]; then \ |
1895 | cp gfloat.h include/float.h && \ | |
1896 | chmod a+r include/float.h; \ | |
1897 | else :; fi | |
ba1811f1 ILT |
1898 | touch stmp-headers |
1899 | ||
1900 | # Build fixed copies of system files. | |
aab26e16 | 1901 | stmp-fixinc: $(FIXINCLUDES) gsyslimits.h |
ba1811f1 ILT |
1902 | rm -rf include |
1903 | mkdir include | |
b82a0ad9 | 1904 | if [ x$(FIXINCLUDES) != xMakefile.in ]; \ |
98e4b835 RS |
1905 | then \ |
1906 | for dir in $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS); do \ | |
1907 | if [ -d $$dir ]; \ | |
1908 | then \ | |
eb3af43c | 1909 | $(SHELL) $(srcdir)/$(FIXINCLUDES) include $$dir; \ |
98e4b835 | 1910 | else true; fi; \ |
b82a0ad9 | 1911 | done; \ |
98e4b835 RS |
1912 | else true; \ |
1913 | fi | |
3dc4a939 RK |
1914 | rm -f include/syslimits.h |
1915 | if [ -f include/limits.h ]; then \ | |
1916 | mv include/limits.h include/syslimits.h; \ | |
1917 | else \ | |
1918 | cp $(srcdir)/gsyslimits.h include/syslimits.h; \ | |
1919 | fi | |
1920 | chmod a+r include/syslimits.h | |
49b6e255 | 1921 | touch stmp-fixinc |
469778e2 | 1922 | |
ac1284f9 PB |
1923 | # Files related to the fixproto script. |
1924 | ||
74bb4fdf | 1925 | deduced.h: $(GCC_PASSES) $(srcdir)/scan-types.sh stmp-int-hdrs |
4fc15c03 | 1926 | CC="$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -I. -I$(srcdir) -Iinclude -I${SYSTEM_HEADER_DIR}"; \ |
ac1284f9 | 1927 | export CC; \ |
9cfb5dd6 | 1928 | $(SHELL) $(srcdir)/scan-types.sh "$(srcdir)" >tmp-deduced.h |
ac1284f9 PB |
1929 | mv tmp-deduced.h deduced.h |
1930 | ||
b3ca463c | 1931 | gen-protos: gen-protos.o scan.o cppalloc.o $(HOST_LIBDEPS) |
aab26e16 | 1932 | ${HOST_CC} $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ |
b3ca463c | 1933 | gen-protos.o scan.o cppalloc.o $(HOST_LIBS) |
ac1284f9 | 1934 | |
7ac16ba0 | 1935 | gen-protos.o: gen-protos.c scan.h $(build_xm_file) |
c192da27 RK |
1936 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gen-protos.c |
1937 | ||
7ac16ba0 | 1938 | scan.o: scan.c scan.h $(build_xm_file) |
c192da27 | 1939 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/scan.c |
7b41f815 | 1940 | |
74bb4fdf | 1941 | xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h gen-protos Makefile |
d521a023 RK |
1942 | cat deduced.h $(srcdir)/sys-protos.h > tmp-fixtmp.c |
1943 | mv tmp-fixtmp.c fixtmp.c | |
c061c5d7 | 1944 | $(GCC_FOR_TARGET) fixtmp.c -w -U__SIZE_TYPE__ -U__PTRDIFF_TYPE__ -U__WCHAR_TYPE__ -E \ |
c1b9947f | 1945 | | sed -e 's/ / /g' -e 's/ *(/ (/g' -e 's/ [ ]*/ /g' -e 's/( )/()/' \ |
d521a023 RK |
1946 | | ./gen-protos >xsys-protos.hT |
1947 | mv xsys-protos.hT xsys-protos.h | |
d7a58f93 | 1948 | rm -rf fixtmp.c |
ac1284f9 | 1949 | |
aab26e16 | 1950 | fix-header: fix-header.o scan-decls.o scan.o xsys-protos.h $(HOST_LIBDEPS) \ |
e9a25f70 | 1951 | cpplib.o cpphash.o cppalloc.o cppexp.o cpperror.o prefix.o version.o |
aab26e16 | 1952 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ fix-header.o \ |
e9a25f70 JL |
1953 | scan-decls.o scan.o cpplib.o cpphash.o cppalloc.o prefix.o \ |
1954 | version.o cppexp.o $(HOST_LIBS) | |
ac1284f9 | 1955 | |
0de9e56a | 1956 | fix-header.o: fix-header.c obstack.h scan.h xsys-protos.h $(build_xm_file) |
c192da27 RK |
1957 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/fix-header.c |
1958 | ||
44e62a7a | 1959 | scan-decls.o: scan-decls.c scan.h cpplib.h $(build_xm_file) |
c192da27 | 1960 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/scan-decls.c |
ac1284f9 | 1961 | |
74bb4fdf RS |
1962 | # stmp-fixproto depends on this, not on fix-header directly. |
1963 | # The idea is to make sure fix-header gets built, | |
1964 | # but not rerun fixproto after each stage | |
1965 | # just because fix-header's mtime has changed. | |
1966 | fixhdr.ready: fix-header | |
1967 | -if [ -f fixhdr.ready ] ; then \ | |
1968 | true; \ | |
1969 | else \ | |
1970 | touch fixhdr.ready; \ | |
1971 | fi | |
1972 | ||
ccaf7a07 | 1973 | # stmp-headers is to make sure fixincludes has already finished. |
700ba19c RS |
1974 | # The if statement is so that we don't run fixproto a second time |
1975 | # if it has already been run on the files in `include'. | |
c28464ad | 1976 | stmp-fixproto: fixhdr.ready fixproto stmp-headers |
db4e119f | 1977 | @echo "Various warnings and error messages from fixproto are normal" |
70fbceee | 1978 | -if [ -d include ] ; then true; else mkdir include; fi |
6e5bea54 | 1979 | -if [ -f include/fixed ] ; then true; \ |
700ba19c | 1980 | else \ |
b1f99e2f | 1981 | : This line works around a 'make' bug in BSDI 1.1.; \ |
b3ca463c PB |
1982 | FIXPROTO_DEFINES="$(FIXPROTO_DEFINES)"; export FIXPROTO_DEFINES; \ |
1983 | $(SHELL) ${srcdir}/fixproto include include $(SYSTEM_HEADER_DIR); \ | |
700ba19c RS |
1984 | touch include/fixed; \ |
1985 | fi | |
ac1284f9 | 1986 | touch stmp-fixproto |
544eb21e | 1987 | #\f |
79d8453e RS |
1988 | # Remake the info files. |
1989 | ||
8dbda01e | 1990 | doc: info |
8be52aaa | 1991 | info: cpp.info gcc.info lang.info |
79d8453e | 1992 | |
8be52aaa JL |
1993 | cpp.info: $(srcdir)/cpp.texi |
1994 | $(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) $(srcdir)/cpp.texi -o cpp.info | |
79d8453e | 1995 | |
8be52aaa JL |
1996 | gcc.info: $(srcdir)/gcc.texi $(srcdir)/extend.texi $(srcdir)/install.texi \ |
1997 | $(srcdir)/invoke.texi $(srcdir)/md.texi $(srcdir)/rtl.texi \ | |
1998 | $(srcdir)/tm.texi $(srcdir)/gcov.texi | |
1999 | $(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) $(srcdir)/gcc.texi -o gcc.info | |
f780d21b | 2000 | |
8be52aaa | 2001 | dvi: gcc.dvi cpp.dvi lang.dvi |
8dbda01e | 2002 | |
dd08cdda | 2003 | # This works with GNU Make's default rule. |
8be52aaa JL |
2004 | gcc.dvi: $(srcdir)/gcc.texi $(srcdir)/extend.texi $(srcdir)/install.texi \ |
2005 | $(srcdir)/invoke.texi $(srcdir)/md.texi $(srcdir)/rtl.texi \ | |
2006 | $(srcdir)/tm.texi $(srcdir)/gcov.texi | |
2007 | TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex gcc.texi | |
2008 | texindex gcc.?? | |
2009 | TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex gcc.texi | |
2010 | ||
2011 | cpp.dvi: $(srcdir)/cpp.texi | |
2012 | TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex cpp.texi | |
2013 | texindex cpp.?? | |
2014 | TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex cpp.texi | |
2015 | ||
2016 | ||
2017 | INSTALL: $(srcdir)/install1.texi $(srcdir)/install.texi | |
2018 | $(MAKEINFO) -D INSTALLONLY --no-header --no-split \ | |
2019 | $(srcdir)/install1.texi -o INSTALL | |
544eb21e | 2020 | #\f |
79d8453e RS |
2021 | # Deletion of files made during compilation. |
2022 | # There are four levels of this: | |
f1908d70 | 2023 | # `mostlyclean', `clean', `distclean' and `maintainer-clean'. |
79d8453e | 2024 | # `mostlyclean' is useful while working on a particular type of machine. |
2e494f70 | 2025 | # It deletes most, but not all, of the files made by compilation. |
79d8453e | 2026 | # It does not delete libgcc.a or its parts, so it won't have to be recompiled. |
2e494f70 | 2027 | # `clean' deletes everything made by running `make all'. |
47547081 | 2028 | # `distclean' also deletes the files made by config. |
f1908d70 | 2029 | # `maintainer-clean' also deletes everything that could be regenerated |
63d9b81c RK |
2030 | # automatically, except for `configure'. |
2031 | # We remove as much from the language subdirectories as we can | |
013a2ee0 | 2032 | # (less duplicated code). |
79d8453e | 2033 | |
47547081 | 2034 | |
b93a436e | 2035 | mostlyclean: lang.mostlyclean |
79d8453e RS |
2036 | -rm -f $(STAGESTUFF) |
2037 | # Delete the temporary source copies for cross compilation. | |
2038 | -rm -f $(HOST_PREFIX_1)rtl.c $(HOST_PREFIX_1)rtlanal.c | |
2039 | -rm -f $(HOST_PREFIX_1)alloca.c $(HOST_PREFIX_1)malloc.c | |
2040 | -rm -f $(HOST_PREFIX_1)obstack.c | |
2041 | # Delete the temp files made in the course of building libgcc.a. | |
ee291069 | 2042 | -rm -f tmplibgcc* tmpcopy xlimits.h libgcc1-test |
79d8453e RS |
2043 | for name in $(LIB1FUNCS); do rm -f $${name}.c; done |
2044 | # Delete other temporary files. | |
cadb41d5 | 2045 | -rm -f tmp-float.h tmp-gcc.xtar.gz |
c21cf0a7 | 2046 | -rm -f tmp-foo1 tmp-foo2 tmp-proto.* tmp-unproto.1 tmp-SYSCALLS.s |
3379e8ef | 2047 | -rm -f tmp-c-parse.y tmp-gperf.h |
d521a023 RK |
2048 | -rm -f tmp-specs t-float.h-cross tmp-xlimits.h |
2049 | -rm -f tmp-fixtmp.c xsys-protos.hT | |
79d8453e RS |
2050 | # Delete the stamp files. |
2051 | -rm -f stamp-* tmp-* | |
013a2ee0 | 2052 | -rm -f */stamp-* */tmp-* |
2e494f70 | 2053 | # Delete debugging dump files. |
79d8453e | 2054 | -rm -f *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop |
e9a25f70 | 2055 | -rm -f *.dbr *.jump2 *.sched *.cse2 *.sched2 *.stack *.addressof *.regmove |
013a2ee0 DE |
2056 | -rm -f */*.greg */*.lreg */*.combine */*.flow */*.cse */*.jump */*.rtl |
2057 | -rm -f */*.tree */*.loop */*.dbr */*.jump2 */*.sched */*.cse2 | |
6662a38d | 2058 | -rm -f */*.sched2 */*.stack */*.regmove |
2e494f70 | 2059 | # Delete some files made during installation. |
42118350 | 2060 | -rm -f specs gfloat.h float.h-* enquire SYSCALLS.c.X SYSCALLS.c |
813fc11c | 2061 | -rm -f collect collect2 mips-tfile mips-tdump alloca.s |
ac1284f9 | 2062 | # Delete files generated for fixproto |
1162b3a6 | 2063 | -rm -rf fix-header xsys-protos.h deduced.h tmp-deduced.h \ |
02521409 | 2064 | gen-protos fixproto.list fixtmp.* fixhdr.ready |
2e494f70 RS |
2065 | # Delete unwanted output files from TeX. |
2066 | -rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg | |
013a2ee0 | 2067 | -rm -f */*.toc */*.log */*.vr */*.fn */*.cp */*.tp */*.ky */*.pg |
47547081 RS |
2068 | # Delete sorted indices we don't actually use. |
2069 | -rm -f gcc.vrs gcc.kys gcc.tps gcc.pgs gcc.fns | |
2e494f70 | 2070 | # Delete core dumps. |
013a2ee0 | 2071 | -rm -f core */core |
59a64126 | 2072 | -rm -f *.bp */*.bp |
79d8453e | 2073 | |
47547081 RS |
2074 | # Delete all files made by compilation |
2075 | # that don't exist in the distribution. | |
b93a436e | 2076 | clean: mostlyclean lang.clean |
20bd0ab1 RS |
2077 | # It may not be quite desirable to delete unprotoize.c here, |
2078 | # but the spec for `make clean' requires it. | |
2079 | # Using unprotoize.c is not quite right in the first place, | |
2080 | # but what better way is there? | |
8521c499 | 2081 | -rm -f libgcc.a libgcc1.a libgcc1-asm.a libgcc2.a libgcc2.ready |
43554690 | 2082 | -rm -f libgcc1.null |
be0d23ff | 2083 | -rm -f *.dvi |
013a2ee0 | 2084 | -rm -f */*.dvi |
c3efc7c4 DE |
2085 | -if [ -f md.pre-cpp ]; then \ |
2086 | rm -f md ; \ | |
2087 | fi | |
ba1811f1 | 2088 | # Delete the include directory. |
3379e8ef | 2089 | -rm -rf stmp-* include |
013a2ee0 | 2090 | -rm -f */stmp-* |
75ed5d8b | 2091 | # Delete files used by the "multilib" facility (including libgcc subdirs). |
f6cdc7ea | 2092 | -rm -f multilib.h tmpmultilib* |
75ed5d8b DE |
2093 | -if [ "x$(MULTILIB_DIRNAMES)" != x ] ; then \ |
2094 | rm -rf $(MULTILIB_DIRNAMES); \ | |
2095 | else if [ "x$(MULTILIB_OPTIONS)" != x ] ; then \ | |
2096 | rm -rf `echo $(MULTILIB_OPTIONS) | sed -e 's/\// /g'`; \ | |
2097 | fi ; fi | |
5768f211 | 2098 | -rm -fr stage1 stage2 stage3 stage4 |
79d8453e | 2099 | |
47547081 RS |
2100 | # Delete all files that users would normally create |
2101 | # while building and installing GCC. | |
b93a436e | 2102 | distclean: clean lang.distclean |
e9a25f70 | 2103 | -rm -f tm.h config.h auto-config.h tconfig.h hconfig.h md cstamp-h |
63d9b81c | 2104 | -rm -f config.status config.run config.cache config.bak |
d232dfa4 | 2105 | -rm -f Make-lang Make-hooks Make-host Make-target |
c40d5de4 | 2106 | -rm -f Makefile specs.h options.h *.oaux |
f24af81b | 2107 | -rm -f gthr-default.h |
26f887e5 | 2108 | -rm -f */stage1 */stage2 */stage3 */stage4 */include |
3dab45b7 | 2109 | -rm -f c-parse.output |
338023d4 | 2110 | -rm -f *.asm |
67446ffe | 2111 | -rm -f float.h |
a051ad3a JL |
2112 | -rm -f site.exp site.bak testsuite/site.exp testsuite/site.bak |
2113 | -rm -f testsuite/{gcc,g++}.{log,sum} | |
2e494f70 RS |
2114 | |
2115 | # Delete anything likely to be found in the source directory | |
2116 | # that shouldn't be in the distribution. | |
013a2ee0 | 2117 | extraclean: distclean lang.extraclean |
fb92d909 | 2118 | -rm -rf =* ./"#"* *~* config/=* config/"#"* config/*~* |
be0d23ff | 2119 | -rm -f patch* *.orig *.rej config/patch* config/*.orig config/*.rej |
3dab45b7 RS |
2120 | -rm -f config/*/=* config/*/"#"* config/*/*~* |
2121 | -rm -f config/*/*.orig config/*/*.rej | |
d72a7857 | 2122 | -rm -f *.dvi *.ps *.oaux *.d *.[zZ] *.gz |
184be4bf | 2123 | -rm -f *.tar *.xtar *diff *.diff.* *.tar.* *.xtar.* *diffs |
3dab45b7 | 2124 | -rm -f *lose config/*lose config/*/*lose |
32e6e69a | 2125 | -rm -f *.s *.s[0-9] *.i install1.texi config/ChangeLog |
013a2ee0 DE |
2126 | -rm -f */=* */"#"* */*~* |
2127 | -rm -f */patch* */*.orig */*.rej | |
2128 | -rm -f */*.dvi */*.oaux */*.d */*.[zZ] */*.gz | |
2129 | -rm -f */*.tar */*.xtar */*diff */*.diff.* */*.tar.* */*.xtar.* */*diffs | |
2130 | -rm -f */*lose */*.s */*.s[0-9] */*.i | |
79d8453e | 2131 | |
63d9b81c | 2132 | # Get rid of every file that's generated from some other file, except for `configure'. |
79d8453e | 2133 | # Most of these files ARE PRESENT in the GCC distribution. |
63d9b81c RK |
2134 | maintainer-clean: |
2135 | @echo 'This command is intended for maintainers to use; it' | |
2136 | @echo 'deletes files that may need special tools to rebuild.' | |
b93a436e | 2137 | $(MAKE) distclean lang.maintainer-clean |
3379e8ef | 2138 | -rm -f c-parse.y c-gperf.h |
79d8453e RS |
2139 | -rm -f c-parse.c c-parse.h c-parse.output |
2140 | -rm -f cexp.c cexp.output TAGS | |
2e494f70 RS |
2141 | -rm -f cpp.info* cpp.??s cpp.*aux |
2142 | -rm -f gcc.info* gcc.??s gcc.*aux | |
544eb21e | 2143 | #\f |
79d8453e | 2144 | # Entry points `install' and `uninstall'. |
2e494f70 | 2145 | # Also use `install-collect2' to install collect2 when the config files don't. |
79d8453e | 2146 | |
1402d22c | 2147 | # The semicolon is to prevent the install.sh -> install default rule |
7bd95cc1 BK |
2148 | # from doing anything. Having it run true helps avoid problems and |
2149 | # noise from versions of make which don't like to have null commands. | |
d960abef | 2150 | install: $(INSTALL_TARGET) ; @true |
79d8453e | 2151 | |
ba1811f1 | 2152 | # Copy the compiler files into directories where they will be run. |
aab26e16 RK |
2153 | # Install the driver last so that the window when things are |
2154 | # broken is small. | |
b583eed8 | 2155 | install-normal: install-common $(INSTALL_HEADERS) $(INSTALL_LIBGCC) \ |
3379e8ef | 2156 | install-man install-info lang.install-normal install-driver |
79d8453e | 2157 | |
057f494b RS |
2158 | # Do nothing while making gcc with a cross-compiler. The person who |
2159 | # makes gcc for the target machine has to know how to put a complete | |
2160 | # gcc together by hand. | |
2161 | install-build: force | |
2162 | @echo You have to install gcc on your target machine by hand. | |
2163 | ||
79d8453e RS |
2164 | # Run this on the target machine |
2165 | # to finish installation of cross compiler. | |
2166 | install-cross-rest: install-float-h-cross | |
2167 | ||
2168 | # Install float.h for cross compiler. | |
2169 | # Run this on the target machine! | |
69cbb85a | 2170 | install-float-h-cross: installdirs |
3f7531db RS |
2171 | # if [ -f enquire ] ; then true; else false; fi |
2172 | # Note: don't use -. We should fail right away if enquire was not made. | |
2173 | ./enquire -f > $(tmpdir)/float.h | |
79d8453e | 2174 | -rm -f $(libsubdir)/include/float.h |
62c13b81 RS |
2175 | $(INSTALL_DATA) $(tmpdir)/float.h $(libsubdir)/include/float.h |
2176 | -rm -f $(tmpdir)/float.h | |
79d8453e RS |
2177 | chmod a-x $(libsubdir)/include/float.h |
2178 | ||
69cbb85a RK |
2179 | # Create the installation directories. |
2180 | installdirs: | |
2181 | -if [ -d $(prefix) ] ; then true ; else mkdir $(prefix) ; chmod a+rx $(prefix) ; fi | |
2182 | -if [ -d $(exec_prefix) ] ; then true ; else mkdir $(exec_prefix) ; chmod a+rx $(exec_prefix) ; fi | |
394fa7c8 JW |
2183 | -if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; chmod a+rx $(libdir) ; fi |
2184 | -if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib ; chmod a+rx $(libdir)/gcc-lib ; fi | |
9eb91772 | 2185 | # This dir isn't currently searched by cpp. |
394fa7c8 | 2186 | # -if [ -d $(libdir)/gcc-lib/include ] ; then true ; else mkdir $(libdir)/gcc-lib/include ; chmod a+rx $(libdir)/gcc-lib/include ; fi |
8b06b20a RK |
2187 | -if [ -d $(libdir)/gcc-lib/$(target_alias) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias) ; chmod a+rx $(libdir)/gcc-lib/$(target_alias) ; fi |
2188 | -if [ -d $(libdir)/gcc-lib/$(target_alias)/$(version) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias)/$(version) ; chmod a+rx $(libdir)/gcc-lib/$(target_alias)/$(version) ; fi | |
2189 | -if [ -d $(libdir)/gcc-lib/$(target_alias)/$(version)/include ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias)/$(version)/include ; chmod a+rx $(libdir)/gcc-lib/$(target_alias)/$(version)/include ; fi | |
394fa7c8 JW |
2190 | -if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; chmod a+rx $(bindir) ; fi |
2191 | -if [ -d $(includedir) ] ; then true ; else mkdir $(includedir) ; chmod a+rx $(includedir) ; fi | |
2192 | -if [ -d $(tooldir) ] ; then true ; else mkdir $(tooldir) ; chmod a+rx $(tooldir) ; fi | |
2193 | -if [ -d $(assertdir) ] ; then true ; else mkdir $(assertdir) ; chmod a+rx $(assertdir) ; fi | |
2194 | -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; chmod a+rx $(infodir) ; fi | |
79d8453e RS |
2195 | # We don't use mkdir -p to create the parents of mandir, |
2196 | # because some systems don't support it. | |
2197 | # Instead, we use this technique to create the immediate parent of mandir. | |
935e11b0 | 2198 | -parent=`echo $(mandir)|sed -e 's@/[^/]*$$@@'`; \ |
394fa7c8 JW |
2199 | if [ -d $$parent ] ; then true ; else mkdir $$parent ; chmod a+rx $$parent ; fi |
2200 | -if [ -d $(mandir) ] ; then true ; else mkdir $(mandir) ; chmod a+rx $(mandir) ; fi | |
79d8453e RS |
2201 | |
2202 | # Install the compiler executables built during cross compilation. | |
69cbb85a | 2203 | install-common: native installdirs $(EXTRA_PARTS) lang.install-common |
79d8453e RS |
2204 | for file in $(COMPILERS); do \ |
2205 | if [ -f $$file ] ; then \ | |
2206 | rm -f $(libsubdir)/$$file; \ | |
2207 | $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \ | |
2208 | else true; \ | |
2209 | fi; \ | |
2210 | done | |
2fe8d2d6 | 2211 | for file in $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2) ..; do \ |
79d8453e RS |
2212 | if [ x"$$file" != x.. ]; then \ |
2213 | rm -f $(libsubdir)/$$file; \ | |
2214 | $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \ | |
2215 | else true; fi; \ | |
2216 | done | |
2fe8d2d6 RK |
2217 | for file in $(EXTRA_PARTS) ..; do \ |
2218 | if [ x"$$file" != x.. ]; then \ | |
2219 | rm -f $(libsubdir)/$$file; \ | |
2220 | $(INSTALL_DATA) $$file $(libsubdir)/$$file; \ | |
e9a25f70 | 2221 | chmod a-x $(libsubdir)/$$file; \ |
2fe8d2d6 RK |
2222 | else true; fi; \ |
2223 | done | |
f0ec1f64 | 2224 | # Don't mess with specs if it doesn't exist yet. |
2a7bccbb TG |
2225 | -if [ -f specs ] ; then \ |
2226 | rm -f $(libsubdir)/specs; \ | |
f0ec1f64 | 2227 | $(INSTALL_DATA) specs $(libsubdir)/specs; \ |
e9a25f70 | 2228 | chmod a-x $(libsubdir)/specs; \ |
f0ec1f64 | 2229 | fi |
aab26e16 RK |
2230 | # Install protoize if it was compiled. |
2231 | -if [ -f protoize$(exeext) ]; \ | |
2232 | then \ | |
2233 | rm -f $(bindir)/protoize$(exeext); \ | |
2234 | $(INSTALL_PROGRAM) protoize$(exeext) $(bindir)/protoize$(exeext); \ | |
2235 | rm -f $(bindir)/unprotoize$(exeext); \ | |
2236 | $(INSTALL_PROGRAM) unprotoize$(exeext) $(bindir)/unprotoize$(exeext); \ | |
2237 | rm -f $(libsubdir)/SYSCALLS.c.X; \ | |
2238 | $(INSTALL_DATA) SYSCALLS.c.X $(libsubdir)/SYSCALLS.c.X; \ | |
2239 | chmod a-x $(libsubdir)/SYSCALLS.c.X; \ | |
2240 | fi | |
2241 | -rm -f $(libsubdir)/cpp$(exeext) | |
2242 | $(INSTALL_PROGRAM) cpp$(exeext) $(libsubdir)/cpp$(exeext) | |
ca363bb6 | 2243 | # Install gcov if it was compiled. |
59a64126 DE |
2244 | -if [ -f gcov$(exeext) ]; \ |
2245 | then \ | |
2246 | rm -f $(bindir)/gcov$(exeext); \ | |
2247 | $(INSTALL_PROGRAM) gcov$(exeext) $(bindir)/gcov$(exeext); \ | |
2248 | chmod a+x $(bindir)/gcov$(exeext); \ | |
2249 | fi | |
aab26e16 | 2250 | |
8b06b20a | 2251 | # Install the driver program as $(target_alias)-gcc |
79d8453e | 2252 | # and also as either gcc (if native) or $(tooldir)/bin/gcc. |
aab26e16 | 2253 | install-driver: xgcc |
173712fb RK |
2254 | -if [ -f gcc-cross$(exeext) ] ; then \ |
2255 | rm -f $(bindir)/$(GCC_CROSS_NAME)$(exeext); \ | |
94a8b9fe | 2256 | $(INSTALL_PROGRAM) gcc-cross$(exeext) $(bindir)/$(GCC_CROSS_NAME)$(exeext); \ |
79d8453e | 2257 | if [ -d $(tooldir)/bin/. ] ; then \ |
173712fb RK |
2258 | rm -f $(tooldir)/bin/gcc$(exeext); \ |
2259 | $(INSTALL_PROGRAM) gcc-cross$(exeext) $(tooldir)/bin/gcc$(exeext); \ | |
79d8453e RS |
2260 | else true; fi; \ |
2261 | else \ | |
173712fb RK |
2262 | rm -f $(bindir)/$(GCC_INSTALL_NAME)$(exeext); \ |
2263 | $(INSTALL_PROGRAM) xgcc$(exeext) $(bindir)/$(GCC_INSTALL_NAME)$(exeext); \ | |
8b06b20a | 2264 | rm -f $(bindir)/$(target_alias)-gcc-1$(exeext); \ |
ac64120e | 2265 | $(LN) $(bindir)/$(GCC_INSTALL_NAME)$(exeext) $(bindir)/$(target_alias)-gcc-1$(exeext); \ |
8b06b20a | 2266 | mv $(bindir)/$(target_alias)-gcc-1$(exeext) $(bindir)/$(target_alias)-gcc$(exeext); \ |
79d8453e | 2267 | fi |
79d8453e | 2268 | |
0b2fbcb2 | 2269 | # Install the info files. |
feb9ea1a JW |
2270 | # $(INSTALL_DATA) might be a relative pathname, so we can't cd into srcdir |
2271 | # to do the install. The sed rule was copied from stmp-int-hdrs. | |
69cbb85a | 2272 | install-info: doc installdirs lang.install-info |
0b2fbcb2 | 2273 | -rm -f $(infodir)/cpp.info* $(infodir)/gcc.info* |
8be52aaa | 2274 | for f in cpp.info* gcc.info*; do \ |
feb9ea1a JW |
2275 | realfile=`echo $$f | sed -e 's|.*/\([^/]*\)$$|\1|'`; \ |
2276 | $(INSTALL_DATA) $$f $(infodir)/$$realfile; \ | |
2277 | done | |
0b2fbcb2 RS |
2278 | -chmod a-x $(infodir)/cpp.info* $(infodir)/gcc.info* |
2279 | ||
79d8453e | 2280 | # Install the man pages. |
69cbb85a | 2281 | install-man: installdirs $(srcdir)/gcc.1 $(srcdir)/cccp.1 lang.install-man |
e9a25f70 | 2282 | -if [ -f gcc-cross$(exeext) ] ; then \ |
338023d4 DE |
2283 | rm -f $(mandir)/$(GCC_CROSS_NAME)$(manext); \ |
2284 | $(INSTALL_DATA) $(srcdir)/gcc.1 $(mandir)/$(GCC_CROSS_NAME)$(manext); \ | |
2285 | chmod a-x $(mandir)/$(GCC_CROSS_NAME)$(manext); \ | |
2286 | else \ | |
2287 | rm -f $(mandir)/$(GCC_INSTALL_NAME)$(manext); \ | |
2288 | $(INSTALL_DATA) $(srcdir)/gcc.1 $(mandir)/$(GCC_INSTALL_NAME)$(manext); \ | |
2289 | chmod a-x $(mandir)/$(GCC_INSTALL_NAME)$(manext); \ | |
2290 | fi | |
2e494f70 | 2291 | -rm -f $(mandir)/cccp$(manext) |
2e0b13db RS |
2292 | -$(INSTALL_DATA) $(srcdir)/cccp.1 $(mandir)/cccp$(manext) |
2293 | -chmod a-x $(mandir)/cccp$(manext) | |
79d8453e RS |
2294 | |
2295 | # Install the library. | |
69cbb85a | 2296 | install-libgcc: libgcc.a installdirs |
79d8453e RS |
2297 | -if [ -f libgcc.a ] ; then \ |
2298 | rm -f $(libsubdir)/libgcc.a; \ | |
2299 | $(INSTALL_DATA) libgcc.a $(libsubdir)/libgcc.a; \ | |
2300 | if $(RANLIB_TEST) ; then \ | |
2301 | (cd $(libsubdir); $(RANLIB) libgcc.a); else true; fi; \ | |
2302 | chmod a-x $(libsubdir)/libgcc.a; \ | |
2303 | else true; fi | |
2304 | ||
f6cdc7ea | 2305 | # Install multiple versions of libgcc.a. |
69cbb85a | 2306 | install-multilib: stmp-multilib installdirs |
f6cdc7ea DE |
2307 | for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \ |
2308 | dir=`echo $$i | sed -e 's/;.*$$//'`; \ | |
2309 | if [ -d $(libsubdir)/$${dir} ]; then true; else mkdir $(libsubdir)/$${dir}; fi; \ | |
47a22692 JM |
2310 | for f in libgcc.a $(EXTRA_MULTILIB_PARTS); do \ |
2311 | rm -f $(libsubdir)/$${dir}/$${f}; \ | |
2312 | $(INSTALL_DATA) $${dir}/$${f} $(libsubdir)/$${dir}/$${f}; \ | |
2313 | done; \ | |
f6cdc7ea DE |
2314 | if $(RANLIB_TEST); then \ |
2315 | (cd $(libsubdir)/$${dir}; $(RANLIB) libgcc.a); else true; fi; \ | |
2316 | chmod a-x $(libsubdir)/$${dir}/libgcc.a; \ | |
2317 | done | |
2318 | ||
ba1811f1 | 2319 | # Install all the header files built in the include subdirectory. |
d7371761 | 2320 | install-headers: install-include-dir $(INSTALL_HEADERS_DIR) $(INSTALL_ASSERT_H) |
ba1811f1 ILT |
2321 | # Fix symlinks to absolute paths in the installed include directory to |
2322 | # point to the installed directory, not the build directory. | |
ac64120e | 2323 | # Don't need to use LN_S here since we really do need ln -s and no substitutes. |
ba1811f1 ILT |
2324 | -files=`cd $(libsubdir)/include; find . -type l -print 2>/dev/null`; \ |
2325 | if [ $$? -eq 0 ]; then \ | |
2326 | dir=`cd include; pwd`; \ | |
2327 | for i in $$files; do \ | |
2328 | dest=`ls -ld $(libsubdir)/include/$$i | sed -n 's/.*-> //p'`; \ | |
2329 | if expr "$$dest" : "$$dir.*" > /dev/null; then \ | |
2330 | rm -f $(libsubdir)/include/$$i; \ | |
44735512 | 2331 | ln -s `echo $$i | sed "s|/[^/]*|/..|g" | sed 's|/..$$||'``echo "$$dest" | sed "s|$$dir||"` $(libsubdir)/include/$$i; \ |
ba1811f1 ILT |
2332 | fi; \ |
2333 | done; \ | |
2334 | fi | |
79d8453e | 2335 | |
ba1811f1 | 2336 | # Create or recreate the gcc private include file directory. |
69cbb85a | 2337 | install-include-dir: installdirs |
ba1811f1 ILT |
2338 | -rm -rf $(libsubdir)/include |
2339 | mkdir $(libsubdir)/include | |
2340 | -chmod a+rx $(libsubdir)/include | |
2341 | ||
2342 | # Install the include directory using tar. | |
ac1284f9 | 2343 | install-headers-tar: stmp-headers $(STMP_FIXPROTO) install-include-dir |
78ea9cda | 2344 | (cd include; \ |
6e5bea54 | 2345 | tar -cf - .; exit 0) | (cd $(libsubdir)/include; tar $(TAROUTOPTS) - ) |
e6431ec5 RS |
2346 | # /bin/sh on some systems returns the status of the first tar, |
2347 | # and that can lose with GNU tar which always writes a full block. | |
2348 | # So use `exit 0' to ignore its exit status. | |
ba1811f1 ILT |
2349 | |
2350 | # Install the include directory using cpio. | |
ac1284f9 | 2351 | install-headers-cpio: stmp-headers $(STMP_FIXPROTO) install-include-dir |
609f7031 | 2352 | (cd include; find . -print) | (cd include; cpio -pdum $(libsubdir)/include) |
79d8453e | 2353 | |
49ba557e RS |
2354 | # Put assert.h where it won't override GNU libc's assert.h. |
2355 | # It goes in a dir that is searched after GNU libc's headers; | |
2356 | # thus, the following conditionals are no longer needed. | |
2357 | # But it's not worth deleting them now. | |
2358 | ## Don't replace the assert.h already there if it is not from GCC. | |
2359 | ## This code would be simpler if it tested for -f ... && ! grep ... | |
2360 | ## but supposedly the ! operator is missing in sh on some systems. | |
69cbb85a | 2361 | install-assert-h: assert.h installdirs |
c9d929d7 RS |
2362 | if [ -f $(assertdir)/assert.h ]; \ |
2363 | then \ | |
998812ac | 2364 | if grep "__eprintf" $(assertdir)/assert.h >/dev/null; \ |
396f9edb | 2365 | then \ |
c9d929d7 RS |
2366 | rm -f $(assertdir)/assert.h; \ |
2367 | $(INSTALL_DATA) $(srcdir)/assert.h $(assertdir)/assert.h; \ | |
0cd4060d | 2368 | chmod a-x $(assertdir)/assert.h; \ |
c9d929d7 RS |
2369 | else true; \ |
2370 | fi; \ | |
9fcedbef | 2371 | else \ |
6204c24f RS |
2372 | rm -f $(assertdir)/assert.h; \ |
2373 | $(INSTALL_DATA) $(srcdir)/assert.h $(assertdir)/assert.h; \ | |
0cd4060d | 2374 | chmod a-x $(assertdir)/assert.h; \ |
9fcedbef | 2375 | fi |
79d8453e | 2376 | |
2e494f70 | 2377 | # Use this target to install the program `collect2' under the name `ld'. |
69cbb85a | 2378 | install-collect2: collect2 installdirs |
173712fb | 2379 | $(INSTALL_PROGRAM) collect2$(exeext) $(libsubdir)/ld$(exeext) |
2e494f70 | 2380 | # Install the driver program as $(libsubdir)/gcc for collect2. |
173712fb | 2381 | $(INSTALL_PROGRAM) xgcc$(exeext) $(libsubdir)/gcc$(exeext) |
2e494f70 | 2382 | |
79d8453e | 2383 | # Cancel installation by deleting the installed files. |
013a2ee0 | 2384 | uninstall: lang.uninstall |
79d8453e | 2385 | -rm -rf $(libsubdir) |
173712fb RK |
2386 | -rm -rf $(bindir)/$(GCC_INSTALL_NAME)$(exeext) |
2387 | -rm -rf $(bindir)/$(GCC_CROSS_NAME)$(exeext) | |
2388 | -rm -rf $(bindir)/protoize$(exeext) | |
2389 | -rm -rf $(bindir)/unprotoize$(exeext) | |
338023d4 DE |
2390 | -rm -rf $(mandir)/$(GCC_INSTALL_NAME)$(manext) |
2391 | -rm -rf $(mandir)/$(GCC_CROSS_NAME)$(manext) | |
2e494f70 | 2392 | -rm -rf $(mandir)/cccp$(manext) |
79d8453e RS |
2393 | -rm -rf $(mandir)/protoize$(manext) |
2394 | -rm -rf $(mandir)/unprotoize$(manext) | |
544eb21e | 2395 | #\f |
e933cbe0 JL |
2396 | # These targets are for the dejagnu testsuites. The file site.exp |
2397 | # contains global variables that all the testsuites will use. | |
2398 | ||
2399 | # Set to $(target_alias)/ for cross. | |
2400 | target_subdir = @target_subdir@ | |
2401 | ||
2402 | site.exp: ./config.status Makefile | |
2403 | @echo "Making a new config file..." | |
2404 | -@rm -f ./tmp? | |
2405 | @touch site.exp | |
2406 | -@mv site.exp site.bak | |
2407 | @echo "## these variables are automatically generated by make ##" > ./tmp0 | |
2408 | @echo "# Do not edit here. If you wish to override these values" >> ./tmp0 | |
2409 | @echo "# add them to the last section" >> ./tmp0 | |
2410 | @echo "set rootme \"`pwd`\"" >> ./tmp0 | |
2411 | @echo "set srcdir \"`cd ${srcdir}; pwd`\"" >> ./tmp0 | |
2412 | @echo "set host_triplet $(host_canonical)" >> ./tmp0 | |
2413 | @echo "set build_triplet $(build_canonical)" >> ./tmp0 | |
2414 | @echo "set target_triplet $(target)" >> ./tmp0 | |
2415 | @echo "set target_alias $(target_alias)" >> ./tmp0 | |
2416 | # CFLAGS is set even though it's empty to show we reserve the right to set it. | |
2417 | @echo "set CFLAGS \"\"" >> ./tmp0 | |
2418 | @echo "set CXXFLAGS \"-I$(objdir)/../$(target_subdir)libio -I\$$srcdir/../libg++/src -I\$$srcdir/../libio -I\$$srcdir/../libstdc++ -I\$$srcdir/../libstdc++/stl -L$(objdir)/../$(target_subdir)libg++ -L$(objdir)/../$(target_subdir)libstdc++\"" >> ./tmp0 | |
2419 | # If newlib has been configured, we need to pass -B to gcc so it can find | |
2420 | # newlib's crt0.o if it exists. This will cause a "path prefix not used" | |
2421 | # message if it doesn't, but the testsuite is supposed to ignore the message - | |
2422 | # it's too difficult to tell when to and when not to pass -B (not all targets | |
2423 | # have crt0's). We could only add the -B if ../newlib/crt0.o exists, but that | |
2424 | # seems like too selective a test. | |
2425 | # ??? Another way to solve this might be to rely on linker scripts. Then | |
2426 | # theoretically the -B won't be needed. | |
2427 | # We also need to pass -L ../ld so that the linker can find ldscripts. | |
2428 | @if [ -d $(objdir)/../$(target_subdir)newlib ] ; then \ | |
2429 | echo "set newlib_cflags \"-I$(objdir)/../$(target_subdir)newlib/targ-include -I\$$srcdir/../newlib/libc/include\"" >> ./tmp0; \ | |
2430 | echo "set newlib_ldflags \"-B$(objdir)/../$(target_subdir)newlib/\"" >> ./tmp0; \ | |
2431 | echo "append CFLAGS \" \$$newlib_cflags\"" >> ./tmp0; \ | |
2432 | echo "append CXXFLAGS \" \$$newlib_cflags\"" >> ./tmp0; \ | |
2433 | echo "append LDFLAGS \" \$$newlib_ldflags\"" >> ./tmp0; \ | |
2434 | else true; \ | |
2435 | fi | |
2436 | @if [ -d $(objdir)/../ld ] ; then \ | |
2437 | echo "append LDFLAGS \" -L$(objdir)/../ld\"" >> ./tmp0; \ | |
2438 | else true; \ | |
2439 | fi | |
2440 | @if [ $(build_canonical) != $(host_canonical) ] ; then \ | |
2441 | echo "set tmpdir /tmp" >> ./tmp0 ; \ | |
2442 | else echo "set tmpdir $(objdir)/testsuite" >> ./tmp0 ; \ | |
2443 | fi | |
2444 | @echo "set srcdir \"\$${srcdir}/testsuite\"" >> ./tmp0 | |
2445 | @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0 | |
2446 | @cat ./tmp0 > site.exp | |
2447 | @cat site.bak | sed \ | |
2448 | -e '1,/^## All variables above are.*##/ d' >> site.exp | |
2449 | -@rm -f ./tmp? | |
2450 | ||
dc84d7bc | 2451 | CHECK_TARGETS = check-gcc check-g++ check-g77 |
e933cbe0 JL |
2452 | |
2453 | check: $(CHECK_TARGETS) | |
2454 | ||
3979dfb8 | 2455 | testsuite/site.exp: site.exp |
e933cbe0 JL |
2456 | if [ -d testsuite ]; then \ |
2457 | true; \ | |
2458 | else \ | |
2459 | mkdir testsuite; \ | |
2460 | fi | |
2461 | rm -rf testsuite/site.exp | |
2462 | cp site.exp testsuite/site.exp | |
3979dfb8 JW |
2463 | |
2464 | check-g++: testsuite/site.exp | |
2465 | -rootme=`pwd`; export rootme; \ | |
e933cbe0 JL |
2466 | srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \ |
2467 | cd testsuite; \ | |
2468 | EXPECT=${EXPECT} ; export EXPECT ; \ | |
2469 | if [ -f $${rootme}/../expect/expect ] ; then \ | |
2470 | TCL_LIBRARY=$${srcdir}/../tcl/library ; \ | |
2471 | export TCL_LIBRARY ; fi ; \ | |
2472 | $(RUNTEST) --tool g++ $(RUNTESTFLAGS) | |
2473 | ||
3979dfb8 JW |
2474 | check-gcc: testsuite/site.exp |
2475 | -rootme=`pwd`; export rootme; \ | |
e933cbe0 JL |
2476 | srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \ |
2477 | cd testsuite; \ | |
2478 | EXPECT=${EXPECT} ; export EXPECT ; \ | |
2479 | if [ -f $${rootme}/../expect/expect ] ; then \ | |
2480 | TCL_LIBRARY=$${srcdir}/../tcl/library ; \ | |
2481 | export TCL_LIBRARY ; fi ; \ | |
2482 | $(RUNTEST) --tool gcc $(RUNTESTFLAGS) | |
2483 | ||
dc84d7bc JL |
2484 | check-g77: testsuite/site.exp |
2485 | -rootme=`pwd`; export rootme; \ | |
2486 | srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \ | |
2487 | cd testsuite; \ | |
2488 | EXPECT=${EXPECT} ; export EXPECT ; \ | |
2489 | if [ -f $${rootme}/../expect/expect ] ; then \ | |
2490 | TCL_LIBRARY=$${srcdir}/../tcl/library ; \ | |
2491 | export TCL_LIBRARY ; fi ; \ | |
2492 | $(RUNTEST) --tool g77 $(RUNTESTFLAGS) | |
2493 | ||
79d8453e RS |
2494 | # These exist for maintenance purposes. |
2495 | ||
2496 | # Update the tags table. | |
2497 | TAGS: force | |
2498 | cd $(srcdir); \ | |
2499 | mkdir temp; \ | |
e9a25f70 | 2500 | mv -f c-parse.[ch] cexp.c =*.[chy] temp; \ |
79d8453e RS |
2501 | etags *.y *.h *.c; \ |
2502 | mv temp/* .; \ | |
2503 | rmdir temp | |
2504 | ||
2505 | # Create the distribution tar file. | |
cadb41d5 RS |
2506 | #dist: gcc-$(version).tar.gz |
2507 | dist: gcc.xtar.gz | |
79d8453e | 2508 | |
cadb41d5 | 2509 | gcc.xtar.gz: gcc.xtar |
80bdd32a | 2510 | gzip --best < gcc.xtar > tmp-gcc.xtar.gz |
cadb41d5 | 2511 | mv tmp-gcc.xtar.gz gcc.xtar.gz |
79d8453e | 2512 | |
cadb41d5 RS |
2513 | #gcc-$(version).tar.gz: gcc-$(version).tar |
2514 | # gzip < gcc-$(version).tar > gcc-$(version).tar.gz | |
79d8453e RS |
2515 | |
2516 | #gcc-$(version).tar: | |
7d27b36c RS |
2517 | gcc.xtar: distdir |
2518 | # Make the distribution. | |
6e5bea54 | 2519 | tar -chf gcc.xtar gcc-$(version) |
7d27b36c | 2520 | |
013a2ee0 DE |
2521 | # This target exists to do the initial work before the language specific |
2522 | # stuff gets done. | |
3ff34537 | 2523 | distdir-start: doc $(srcdir)/INSTALL $(srcdir)/c-parse.y $(srcdir)/c-gperf.h \ |
956d6950 | 2524 | $(srcdir)/c-parse.c $(srcdir)/cexp.c $(srcdir)/config.in |
db4e119f | 2525 | @if grep -s "for version ${mainversion}" gcc.texi > /dev/null; \ |
f780d21b | 2526 | then true; \ |
96b5daff | 2527 | else echo "You must update the version number in \`gcc.texi'"; sleep 10;\ |
f780d21b | 2528 | fi |
be0d23ff RS |
2529 | # Update the version number in README |
2530 | awk '$$1 " " $$2 " " $$3 == "This directory contains" \ | |
2531 | { $$6 = version; print $$0 } \ | |
2532 | $$1 " " $$2 " " $$3 != "This directory contains"' \ | |
2533 | version=$(version) README > tmp.README | |
2534 | mv tmp.README README | |
2e494f70 | 2535 | -rm -rf gcc-$(version) tmp |
79d8453e RS |
2536 | # Put all the files in a temporary subdirectory |
2537 | # which has the name that we want to have in the tar file. | |
2e494f70 RS |
2538 | mkdir tmp |
2539 | mkdir tmp/config | |
eb3a6507 | 2540 | mkdir tmp/ginclude |
2e494f70 | 2541 | for file in *[0-9a-zA-Z+]; do \ |
ac64120e | 2542 | $(LN) $$file tmp; \ |
2e494f70 RS |
2543 | done |
2544 | cd config; \ | |
2545 | for file in *[0-9a-zA-Z+]; do \ | |
f95640cc | 2546 | if test -d $$file && test "$$file" != RCS; then \ |
e52114f8 RM |
2547 | mkdir ../tmp/config/$$file; \ |
2548 | cd $$file; \ | |
2549 | for subfile in *[0-9a-zA-Z+]; do \ | |
ac64120e | 2550 | $(LN) $$subfile ../../tmp/config/$$file; \ |
e52114f8 RM |
2551 | done; \ |
2552 | cd ..; \ | |
2553 | else \ | |
ac64120e | 2554 | $(LN) $$file ../tmp/config; \ |
e52114f8 | 2555 | fi; \ |
79d8453e | 2556 | done |
eb3a6507 RK |
2557 | cd ginclude; \ |
2558 | for file in *[0-9a-zA-Z+]; do \ | |
ac64120e | 2559 | $(LN) $$file ../tmp/ginclude; \ |
eb3a6507 | 2560 | done |
ea727bbf RS |
2561 | cd objc; \ |
2562 | for file in *[0-9a-zA-Z+]; do \ | |
ac64120e | 2563 | $(LN) $$file ../tmp/objc; \ |
ea727bbf | 2564 | done |
ac64120e | 2565 | $(LN) .gdbinit tmp |
013a2ee0 DE |
2566 | |
2567 | # Finish making `distdir', after the languages have done their thing. | |
2568 | distdir-finish: | |
2e494f70 | 2569 | mv tmp gcc-$(version) |
eb3a6507 RK |
2570 | # Get rid of everything we don't want in the distribution. We'd want |
2571 | # this to use Makefile.in, but it doesn't have the `lang.foo' targets | |
2572 | # expanded. | |
2573 | cd gcc-$(version); make extraclean | |
79d8453e | 2574 | |
013a2ee0 DE |
2575 | distdir: distdir-start lang.distdir distdir-finish |
2576 | ||
db4e119f RS |
2577 | # make diff oldversion=M.N |
2578 | # creates a diff file between an older distribution and this one. | |
2579 | # The -P option assumes this is GNU diff. | |
2580 | diff: | |
f137e7dc | 2581 | diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h \ |
013a2ee0 | 2582 | -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c \ |
faca415c | 2583 | -x bi-parser.h -x TAGS \ |
013a2ee0 DE |
2584 | -x "gcc.??" -x "gcc.??s" -x gcc.aux -x "gcc.info*" \ |
2585 | -x "cpp.??" -x "cpp.??s" -x cpp.aux -x "cpp.info*" \ | |
2586 | $(LANG_DIFF_EXCLUDES) \ | |
db4e119f RS |
2587 | gcc-$(oldversion) gcc-$(version) > diffs |
2588 | ||
361e618f | 2589 | bootstrap bootstrap-lean: force |
9c4614c3 TW |
2590 | # Only build the C compiler for stage1, because that is the only one that |
2591 | # we can guarantee will build with the native compiler, and also it is the | |
2592 | # only thing useful for building stage2. | |
5e31e473 | 2593 | $(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)" |
79d8453e | 2594 | $(MAKE) stage1 |
2e494f70 RS |
2595 | # This used to define ALLOCA as empty, but that would lead to bad results |
2596 | # for a subsequent `make install' since that would not have ALLOCA empty. | |
2597 | # To prevent `make install' from compiling alloca.o and then relinking cc1 | |
2598 | # because alloca.o is newer, we permit these recursive makes to compile | |
2599 | # alloca.o. Then cc1 is newer, so it won't have to be relinked. | |
648300d7 | 2600 | $(MAKE) CC="stage1/xgcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)" |
79d8453e | 2601 | $(MAKE) stage2 |
361e618f | 2602 | -if test $@ = bootstrap-lean; then rm -rf stage1; else true; fi |
b1e3ddfd AJ |
2603 | $(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)" |
2604 | ||
79d8453e | 2605 | bootstrap2: force |
648300d7 | 2606 | $(MAKE) CC="stage1/xgcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)" |
79d8453e | 2607 | $(MAKE) stage2 |
648300d7 | 2608 | $(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)" |
79d8453e RS |
2609 | |
2610 | bootstrap3: force | |
648300d7 | 2611 | $(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)" |
79d8453e | 2612 | |
361e618f MH |
2613 | bootstrap4: force |
2614 | $(MAKE) CC="stage3/xgcc -Bstage3/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage3/ LANGUAGES="$(LANGUAGES)" | |
2615 | ||
dcfedcd0 RK |
2616 | # Compare the object files in the current directory with those in the |
2617 | # stage2 directory. | |
2618 | ||
9825189b | 2619 | # ./ avoids bug in some versions of tail. |
e85988b5 | 2620 | compare compare3 compare4 compare-lean compare3-lean compare4-lean: force |
3fb2f401 | 2621 | -rm -f .bad_compare |
e85988b5 | 2622 | case "$@" in compare | compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^compare\([0-9][0-9]*\).*,\1,'` ;; esac; \ |
aab26e16 | 2623 | for file in *$(objext); do \ |
9825189b | 2624 | tail +16c ./$$file > tmp-foo1; \ |
e85988b5 | 2625 | tail +16c stage$$stage/$$file > tmp-foo2 \ |
3fb2f401 | 2626 | && (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \ |
dcfedcd0 | 2627 | done |
e85988b5 | 2628 | case "$@" in compare | compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^compare\([0-9][0-9]*\).*,\1,'` ;; esac; \ |
013a2ee0 | 2629 | for dir in tmp-foo $(SUBDIRS); do \ |
aab26e16 RK |
2630 | if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \ |
2631 | for file in $$dir/*$(objext); do \ | |
013a2ee0 | 2632 | tail +16c ./$$file > tmp-foo1; \ |
e85988b5 | 2633 | tail +16c stage$$stage/$$file > tmp-foo2 \ |
3fb2f401 | 2634 | && (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \ |
094ecbb0 RK |
2635 | done; \ |
2636 | fi; \ | |
013a2ee0 | 2637 | done |
dcfedcd0 | 2638 | -rm -f tmp-foo* |
4931312c | 2639 | case "$@" in compare | compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^compare\([0-9][0-9]*\).*,\1,'` ;; esac; \ |
3fb2f401 JL |
2640 | if [ -f .bad_compare ]; then \ |
2641 | echo "Bootstrap comparison failure!"; \ | |
2642 | cat .bad_compare; \ | |
2643 | exit 1; \ | |
e85988b5 MH |
2644 | else \ |
2645 | case "$@" in \ | |
2646 | *-lean ) rm -rf stage$$stage ;; \ | |
25b76cc1 | 2647 | *) ;; \ |
e85988b5 | 2648 | esac; true; \ |
3fb2f401 | 2649 | fi |
dcfedcd0 | 2650 | |
e85988b5 MH |
2651 | # Compare the object files in the current directory with those in the |
2652 | # stage2 directory. Use gnu cmp (diffutils v2.4 or later) to avoid | |
2653 | # running tail and the overhead of twice copying each object file. | |
2654 | ||
2655 | gnucompare gnucompare3 gnucompare4 gnucompare-lean gnucompare3-lean gnucompare4-lean: force | |
b1e3ddfd | 2656 | -rm -f .bad_compare |
e85988b5 | 2657 | case "$@" in gnucompare | gnucompare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^gnucompare\([0-9][0-9]*\).*,\1,'` ;; esac; \ |
b1e3ddfd | 2658 | for file in *$(objext); do \ |
e85988b5 | 2659 | (cmp --ignore-initial=16 $$file stage$$stage/$$file > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \ |
b1e3ddfd | 2660 | done |
e85988b5 | 2661 | case "$@" in gnucompare | gnucompare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^gnucompare\([0-9][0-9]*\).*,\1,'` ;; esac; \ |
b1e3ddfd AJ |
2662 | for dir in tmp-foo $(SUBDIRS); do \ |
2663 | if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \ | |
2664 | for file in $$dir/*$(objext); do \ | |
e85988b5 | 2665 | (cmp --ignore-initial=16 $$file stage$$stage/$$file > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \ |
b1e3ddfd AJ |
2666 | done; \ |
2667 | fi; \ | |
2668 | done | |
4931312c | 2669 | case "$@" in gnucompare | gnucompare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^gnucompare\([0-9][0-9]*\).*,\1,'` ;; esac; \ |
b1e3ddfd AJ |
2670 | if [ -f .bad_compare ]; then \ |
2671 | echo "Bootstrap comparison failure!"; \ | |
2672 | cat .bad_compare; \ | |
2673 | exit 1; \ | |
e85988b5 MH |
2674 | else \ |
2675 | case "$@" in \ | |
2676 | *-lean ) rm -rf stage$$stage ;; \ | |
2677 | esac; true; \ | |
b1e3ddfd AJ |
2678 | fi |
2679 | ||
79d8453e | 2680 | # Copy the object files from a particular stage into a subdirectory. |
013a2ee0 | 2681 | stage1-start: |
2e494f70 | 2682 | -if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi |
013a2ee0 DE |
2683 | -for dir in . $(SUBDIRS) ; \ |
2684 | do \ | |
9a517e7b | 2685 | if [ -d stage1/$$dir ] ; then true ; else mkdir stage1/$$dir ; fi ; \ |
013a2ee0 | 2686 | done |
79d8453e | 2687 | -mv $(STAGESTUFF) stage1 |
338023d4 DE |
2688 | # Copy as/ld if they exist to stage dir, so that running xgcc from the stage |
2689 | # dir will work properly. | |
ac64120e JW |
2690 | -if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage1 ; else true ; fi |
2691 | -if [ -f ld$(exeext) ] ; then $(LN_S) ../ld$(exeext) stage1 ; else true ; fi | |
2692 | -if [ -f collect-ld$(exeext) ] ; then $(LN_S) ../collect-ld$(exeext) stage1 ; else true ; fi | |
79d8453e RS |
2693 | -rm -f stage1/libgcc.a |
2694 | -cp libgcc.a stage1 | |
2695 | -if $(RANLIB_TEST) ; then $(RANLIB) stage1/libgcc.a; else true; fi | |
04e95620 JM |
2696 | -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \ |
2697 | cp stage1/$${f} . ; \ | |
db814993 | 2698 | else true; \ |
04e95620 | 2699 | fi; done |
013a2ee0 | 2700 | stage1: force stage1-start lang.stage1 |
79d8453e | 2701 | |
013a2ee0 | 2702 | stage2-start: |
2e494f70 | 2703 | -if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi |
013a2ee0 DE |
2704 | -for dir in . $(SUBDIRS) ; \ |
2705 | do \ | |
9a517e7b | 2706 | if [ -d stage2/$$dir ] ; then true ; else mkdir stage2/$$dir ; fi ; \ |
013a2ee0 | 2707 | done |
79d8453e | 2708 | -mv $(STAGESTUFF) stage2 |
338023d4 DE |
2709 | # Copy as/ld if they exist to stage dir, so that running xgcc from the stage |
2710 | # dir will work properly. | |
ac64120e JW |
2711 | -if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage2 ; else true ; fi |
2712 | -if [ -f ld$(exeext) ] ; then $(LN_S) ../ld$(exeext) stage2 ; else true ; fi | |
2713 | -if [ -f collect-ld ] ; then $(LN_S) ../collect-ld$(exeext) stage2 ; else true ; fi | |
79d8453e RS |
2714 | -rm -f stage2/libgcc.a |
2715 | -cp libgcc.a stage2 | |
2716 | -if $(RANLIB_TEST) ; then $(RANLIB) stage2/libgcc.a; else true; fi | |
04e95620 JM |
2717 | -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \ |
2718 | cp stage2/$${f} . ; \ | |
db814993 | 2719 | else true; \ |
04e95620 | 2720 | fi; done |
013a2ee0 | 2721 | stage2: force stage2-start lang.stage2 |
79d8453e | 2722 | |
013a2ee0 | 2723 | stage3-start: |
935e11b0 | 2724 | -if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi |
013a2ee0 DE |
2725 | -for dir in . $(SUBDIRS) ; \ |
2726 | do \ | |
9a517e7b | 2727 | if [ -d stage3/$$dir ] ; then true ; else mkdir stage3/$$dir ; fi ; \ |
013a2ee0 | 2728 | done |
79d8453e | 2729 | -mv $(STAGESTUFF) stage3 |
338023d4 DE |
2730 | # Copy as/ld if they exist to stage dir, so that running xgcc from the stage |
2731 | # dir will work properly. | |
ac64120e JW |
2732 | -if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage3 ; else true ; fi |
2733 | -if [ -f ld$(exeext) ] ; then $(LN_S) ../ld$(exeext) stage3 ; else true ; fi | |
2734 | -if [ -f collect-ld$(exeext) ] ; then $(LN_S) ../collect-ld$(exeext) stage3 ; else true ; fi | |
79d8453e RS |
2735 | -rm -f stage3/libgcc.a |
2736 | -cp libgcc.a stage3 | |
2737 | -if $(RANLIB_TEST) ; then $(RANLIB) stage3/libgcc.a; else true; fi | |
04e95620 JM |
2738 | -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \ |
2739 | cp stage3/$${f} . ; \ | |
db814993 | 2740 | else true; \ |
04e95620 | 2741 | fi; done |
013a2ee0 | 2742 | stage3: force stage3-start lang.stage3 |
79d8453e | 2743 | |
013a2ee0 | 2744 | stage4-start: |
935e11b0 | 2745 | -if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi |
013a2ee0 DE |
2746 | -for dir in . $(SUBDIRS) ; \ |
2747 | do \ | |
9a517e7b | 2748 | if [ -d stage4/$$dir ] ; then true ; else mkdir stage4/$$dir ; fi ; \ |
013a2ee0 | 2749 | done |
79d8453e | 2750 | -mv $(STAGESTUFF) stage4 |
338023d4 DE |
2751 | # Copy as/ld if they exist to stage dir, so that running xgcc from the stage |
2752 | # dir will work properly. | |
ac64120e JW |
2753 | -if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage4 ; else true ; fi |
2754 | -if [ -f ld$(exeext) ] ; then $(LN_S) ../ld$(exeext) stage4 ; else true ; fi | |
2755 | -if [ -f collect-ld$(exeext) ] ; then $(LN_S) ../collect-ld$(exeext) stage4 ; else true ; fi | |
79d8453e RS |
2756 | -rm -f stage4/libgcc.a |
2757 | -cp libgcc.a stage4 | |
2758 | -if $(RANLIB_TEST) ; then $(RANLIB) stage4/libgcc.a; else true; fi | |
04e95620 JM |
2759 | -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \ |
2760 | cp stage4/$${f} . ; \ | |
db814993 | 2761 | else true; \ |
04e95620 | 2762 | fi; done |
013a2ee0 | 2763 | stage4: force stage4-start lang.stage4 |
79d8453e RS |
2764 | |
2765 | # Copy just the executable files from a particular stage into a subdirectory, | |
2766 | # and delete the object files. Use this if you're just verifying a version | |
2767 | # that is pretty sure to work, and you are short of disk space. | |
aab26e16 | 2768 | risky-stage1: stage1 |
003455d9 | 2769 | -make clean |
79d8453e | 2770 | |
aab26e16 | 2771 | risky-stage2: stage2 |
79d8453e RS |
2772 | -make clean |
2773 | ||
aab26e16 | 2774 | risky-stage3: stage3 |
79d8453e RS |
2775 | -make clean |
2776 | ||
aab26e16 | 2777 | risky-stage4: stage4 |
79d8453e RS |
2778 | -make clean |
2779 | ||
2780 | #In GNU Make, ignore whether `stage*' exists. | |
f1908d70 | 2781 | .PHONY: stage1 stage2 stage3 stage4 clean maintainer-clean TAGS bootstrap |
79d8453e RS |
2782 | .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4 |
2783 | ||
2784 | force: |