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