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