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