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