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