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