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