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