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