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