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