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