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