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