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