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