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