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