]>
Commit | Line | Data |
---|---|---|
79d8453e | 1 | # Makefile for GNU C compiler. |
517cbe13 JL |
2 | # Copyright (C) 1987, 1988, 1990, 1991, 1992, 1993, 1994, 1995 |
3 | # 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. | |
79d8453e RS |
4 | |
5 | #This file is part of GNU CC. | |
6 | ||
7 | #GNU CC is free software; you can redistribute it and/or modify | |
8 | #it under the terms of the GNU General Public License as published by | |
9 | #the Free Software Foundation; either version 2, or (at your option) | |
10 | #any later version. | |
11 | ||
12 | #GNU CC is distributed in the hope that it will be useful, | |
13 | #but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | #GNU General Public License for more details. | |
16 | ||
17 | #You should have received a copy of the GNU General Public License | |
18 | #along with GNU CC; see the file COPYING. If not, write to | |
940d9d63 RK |
19 | #the Free Software Foundation, 59 Temple Place - Suite 330, |
20 | #Boston MA 02111-1307, USA. | |
79d8453e RS |
21 | |
22 | # The targets for external use include: | |
23 | # all, doc, proto, install, install-cross, install-cross-rest, | |
f1908d70 | 24 | # uninstall, TAGS, mostlyclean, clean, distclean, maintainer-clean, |
79d8453e RS |
25 | # stage1, stage2, stage3, stage4. |
26 | ||
2e494f70 RS |
27 | # Suppress smart makes who think they know how to automake Yacc files |
28 | .y.c: | |
29 | ||
3c18ea24 RK |
30 | # Directory where sources are, from where we are. |
31 | srcdir = @srcdir@ | |
32 | VPATH = @srcdir@ | |
33 | ||
490cab72 GRK |
34 | # Pointer to the GCC Project website |
35 | website=http://gcc.gnu.org | |
36 | ||
79d8453e RS |
37 | # Variables that exist for you to override. |
38 | # See below for how to change them for certain systems. | |
39 | ||
013a2ee0 DE |
40 | # List of language subdirectories. |
41 | # This is overridden by configure. | |
3c18ea24 | 42 | SUBDIRS =@subdirs@ |
013a2ee0 | 43 | |
79d8453e | 44 | # Selection of languages to be made. |
013a2ee0 | 45 | # This is overridden by configure. |
71205e0b | 46 | CONFIG_LANGUAGES = @all_languages@ |
28fe2fb7 | 47 | LANGUAGES = c gcov$(exeext) $(CONFIG_LANGUAGES) |
79d8453e | 48 | |
a6374b58 AO |
49 | # Languages should create dependencies of $(INTL_TARGETS) on generated |
50 | # sources in Make-lang.in. Example: | |
51 | # $(INTL_TARGETS): $(srcdir)/cp/parse.c | |
52 | INTL_TARGETS = intl.all intl.install intl.distdir | |
53 | ||
5e31e473 RK |
54 | # Selection of languages to be made during stage1 build. |
55 | # This is overridden by configure. | |
3c18ea24 | 56 | BOOT_LANGUAGES = c @all_boot_languages@ |
5e31e473 | 57 | |
79d8453e | 58 | ALLOCA = |
8d86aaea | 59 | ALLOCA_FLAGS = |
2a7bccbb | 60 | ALLOCA_FINISH = true |
79d8453e | 61 | |
4c457b6b | 62 | # Various ways of specifying flags for compilations: |
79d8453e | 63 | # CFLAGS is for the user to override to, e.g., do a bootstrap with -O2. |
5b67ad6f DA |
64 | # BOOT_CFLAGS is the value of CFLAGS to pass to the stage2 and stage3 |
65 | # compilations. | |
66 | # WARN1_CFLAGS are the warning flags to use for most compilations in stage1. | |
67 | # WARN2_CFLAGS are the warning flags to pass to stage2, stage3, etc. | |
68 | # The warning flags are separate from BOOT_CFLAGS because people tend to | |
69 | # override optimization flags and we'd like them to still have warnings | |
70 | # turned on. These flags are also used to pass other stage dependent | |
71 | # flags from configure. The user is free to explicitly turn these flags | |
72 | # off if they wish. | |
6bed14c7 JM |
73 | # LOOSE_CFLAGS are the CFLAGS to use when compiling something which is only |
74 | # compiled with gcc, such as libgcc and the frontends other than C. | |
79d8453e | 75 | # XCFLAGS is used for most compilations but not when using the GCC just built. |
54577c52 | 76 | # TCFLAGS is used for compilations with the GCC just built. |
79d8453e | 77 | XCFLAGS = |
54577c52 | 78 | TCFLAGS = |
5b67ad6f | 79 | CFLAGS = -g |
e6493727 | 80 | BOOT_CFLAGS = -O2 $(CFLAGS) |
5b67ad6f DA |
81 | WARN1_CFLAGS = @stage1_warn_cflags@ |
82 | WARN2_CFLAGS = @stage2_warn_cflags@ | |
83 | WARN_CFLAGS = $(WARN1_CFLAGS) | |
84 | LOOSE_CFLAGS = `echo $(CFLAGS) $(WARN2_CFLAGS)|sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'` | |
79d8453e RS |
85 | # These exists to be overridden by the x-* and t-* files, respectively. |
86 | X_CFLAGS = | |
87 | T_CFLAGS = | |
88 | ||
89 | X_CPPFLAGS = | |
90 | T_CPPFLAGS = | |
91 | ||
ab87f8c8 | 92 | AWK = @AWK@ |
b614ee64 | 93 | CC = @CC@ |
b0ccd8de JL |
94 | # srcdir might be a relative pathname which won't be valid in a subdirectory, |
95 | # so we must use objdir/srcdir instead to make it safe. objdir is always | |
96 | # a full pathname. | |
97 | BISON = `if [ -f $(objdir)/../bison/bison ] ; then case $(srcdir) in \ | |
98 | /*) echo $(objdir)/../bison/bison -L $(srcdir)/../bison/ ;; \ | |
99 | *) echo $(objdir)/../bison/bison -L $(objdir)/$(srcdir)/../bison/ ;; \ | |
0a682bea | 100 | esac; else echo bison ; fi` |
0777e4c6 | 101 | BISONFLAGS = |
b0ccd8de | 102 | LEX = `if [ -f $(objdir)/../flex/flex ] ; then echo $(objdir)/../flex/flex ; else echo flex ; fi` |
013a2ee0 | 103 | LEXFLAGS = |
79d8453e | 104 | AR = ar |
79d8453e | 105 | AR_FLAGS = rc |
b63b5db5 | 106 | DLLTOOL = dlltool |
79d8453e RS |
107 | SHELL = /bin/sh |
108 | # on sysV, define this as cp. | |
3c18ea24 | 109 | INSTALL = @INSTALL@ |
ac64120e JW |
110 | # Some systems may be missing symbolic links, regular links, or both. |
111 | # Allow configure to check this and use "ln -s", "ln", or "cp" as appropriate. | |
112 | LN=@LN@ | |
113 | LN_S=@LN_S@ | |
79d8453e | 114 | # These permit overriding just for certain files. |
fca9d4b0 MH |
115 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
116 | INSTALL_DATA = @INSTALL_DATA@ | |
09fa0705 | 117 | MAKEINFO = @MAKEINFO@ |
3ef4c269 | 118 | MAKEINFOFLAGS = |
d8984b6e | 119 | TEXI2DVI = texi2dvi |
013a2ee0 DE |
120 | # For GNUmake: let us decide what gets passed to recursive makes. |
121 | MAKEOVERRIDES = | |
3c18ea24 | 122 | @SET_MAKE@ |
79d8453e RS |
123 | |
124 | # Define this as & to perform parallel make on a Sequent. | |
4c457b6b | 125 | # Note that this has some bugs, and it seems currently necessary |
79d8453e RS |
126 | # to compile all the gen* files first by hand to avoid erroneous results. |
127 | P = | |
128 | ||
129 | # How to invoke ranlib. | |
130 | RANLIB = ranlib | |
131 | # Test to use to see whether ranlib exists on the system. | |
8f25d5cd JW |
132 | RANLIB_TEST = \ |
133 | [ -f $(RANLIB) ] \ | |
b6c8f0b7 | 134 | || [ -f /usr/bin/ranlib -o -f /bin/ranlib ] |
f6c2a93c | 135 | |
e256b8b6 DA |
136 | # Substitution type for target's getgroups 2nd arg. |
137 | TARGET_GETGROUPS_T = @TARGET_GETGROUPS_T@ | |
138 | ||
79d8453e RS |
139 | # Compiler to use for compiling libgcc1.a. |
140 | # OLDCC should not be the GNU C compiler, | |
141 | # since that would compile typical libgcc1.a functions such as mulsi3 | |
142 | # into infinite recursions. | |
143 | OLDCC = cc | |
144 | ||
145 | # CFLAGS for use with OLDCC, for compiling libgcc1.a. | |
146 | # NOTE: -O does not work on some Unix systems! | |
147 | CCLIBFLAGS = -O | |
148 | ||
2e494f70 | 149 | # Version of ar to use when compiling libgcc1.a. |
79d8453e | 150 | OLDAR = ar |
b614ee64 | 151 | OLDAR_FLAGS = qc |
79d8453e | 152 | |
ba1811f1 ILT |
153 | # Target to use when installing include directory. Either |
154 | # install-headers-tar or install-headers-cpio. | |
3c18ea24 | 155 | INSTALL_HEADERS_DIR = @build_install_headers_dir@ |
ba1811f1 | 156 | |
d7371761 RK |
157 | # Header files that are made available under the same name |
158 | # to programs compiled with GCC. | |
159 | USER_H = $(srcdir)/ginclude/stdarg.h $(srcdir)/ginclude/stddef.h \ | |
5c9f708d | 160 | $(srcdir)/ginclude/varargs.h $(srcdir)/ginclude/proto.h \ |
4c457b6b UD |
161 | $(srcdir)/ginclude/stdbool.h $(srcdir)/ginclude/iso646.h \ |
162 | $(EXTRA_HEADERS) $(LANG_EXTRA_HEADERS) | |
d7371761 RK |
163 | |
164 | # Target to use whe installing assert.h. Some systems may | |
165 | # want to set this empty. | |
166 | INSTALL_ASSERT_H = install-assert-h | |
167 | ||
c190ed67 | 168 | # The GCC to use for compiling libgcc.a, enquire, and libgcc1-test. |
bf428f48 | 169 | # Usually the one we just built. |
79d8453e | 170 | # Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS). |
fff14bb3 | 171 | GCC_FOR_TARGET = ./xgcc -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include |
79d8453e RS |
172 | |
173 | # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET. | |
174 | # It omits XCFLAGS, and specifies -B./. | |
3c9a2b55 | 175 | # It also specifies -isystem ./include to find, e.g., stddef.h. |
6bed14c7 | 176 | GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(LOOSE_CFLAGS) -isystem ./include $(TCFLAGS) |
79d8453e | 177 | |
7441a352 NS |
178 | # Specify the abi to use when building the c++ runtime |
179 | GXX_ABI_FLAG=@GXX_ABI_FLAG@ | |
180 | ||
338023d4 | 181 | # Sed command to transform gcc to installed name. Overwritten by configure. |
e6347456 | 182 | program_transform_name = @program_transform_name@ |
ef85603e | 183 | program_transform_cross_name = s,^,$(target_alias)-, |
338023d4 | 184 | |
88111b26 JL |
185 | build_canonical = @build_canonical@ |
186 | host_canonical = @host_canonical@ | |
187 | ||
79d8453e RS |
188 | # Tools to use when building a cross-compiler. |
189 | # These are used because `configure' appends `cross-make' | |
190 | # to the makefile when making a cross-compiler. | |
191 | ||
7e717196 JL |
192 | # Use the tools from the build tree, if they are available. |
193 | ||
194 | # objdir is set by configure. | |
195 | objdir = @objdir@ | |
196 | ||
197 | AR_FOR_TARGET = ` \ | |
198 | if [ -f $(objdir)/../binutils/ar ] ; then \ | |
199 | echo $(objdir)/../binutils/ar ; \ | |
200 | else \ | |
201 | if [ "$(host_canonical)" = "$(target)" ] ; then \ | |
202 | echo ar; \ | |
203 | else \ | |
35f86a50 | 204 | t='$(program_transform_cross_name)'; echo ar | sed -e $$t ; \ |
7e717196 JL |
205 | fi; \ |
206 | fi` | |
7bde2862 GK |
207 | AR_FLAGS_FOR_TARGET = |
208 | AR_CREATE_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) rc | |
209 | AR_EXTRACT_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) x | |
7e717196 JL |
210 | RANLIB_FOR_TARGET = ` \ |
211 | if [ -f $(objdir)/../binutils/ranlib ] ; then \ | |
212 | echo $(objdir)/../binutils/ranlib ; \ | |
213 | else \ | |
214 | if [ "$(host_canonical)" = "$(target)" ] ; then \ | |
215 | echo ranlib; \ | |
216 | else \ | |
35f86a50 | 217 | t='$(program_transform_cross_name)'; echo ranlib | sed -e $$t ; \ |
7e717196 JL |
218 | fi; \ |
219 | fi` | |
220 | RANLIB_TEST_FOR_TARGET = \ | |
221 | [ -f $(RANLIB_FOR_TARGET) ] \ | |
222 | || ( [ "$(host_canonical)" = "$(target)" ] \ | |
223 | && [ -f /usr/bin/ranlib -o -f /bin/ranlib ] ) | |
224 | ||
1402d22c RS |
225 | # Dir to search for system headers. Overridden by cross-make. |
226 | SYSTEM_HEADER_DIR = /usr/include | |
227 | ||
4e872036 AS |
228 | # Where to find some libiberty headers. |
229 | HASHTAB_H = $(srcdir)/../include/hashtab.h | |
230 | OBSTACK_H = $(srcdir)/../include/obstack.h | |
5193cc6d | 231 | SPLAY_TREE_H= $(srcdir)/../include/splay-tree.h |
4e872036 | 232 | |
512b62fb JM |
233 | # Default cross SYSTEM_HEADER_DIR, to be overridden by targets. |
234 | CROSS_SYSTEM_HEADER_DIR = $(tooldir)/sys-include | |
235 | ||
f95e46b9 | 236 | # Control whether to run fixproto and fixincludes. |
75b6984c | 237 | STMP_FIXPROTO = stmp-fixproto |
f95e46b9 | 238 | STMP_FIXINC = stmp-fixinc |
ac1284f9 | 239 | |
40dc28fc ILT |
240 | # Test to see whether <limits.h> exists in the system header files. |
241 | LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ] | |
242 | ||
3c18ea24 | 243 | target=@target@ |
6920c391 | 244 | target_alias=@target_alias@ |
3c18ea24 RK |
245 | xmake_file=@dep_host_xmake_file@ |
246 | tmake_file=@dep_tmake_file@ | |
247 | out_file=$(srcdir)/config/@out_file@ | |
248 | out_object_file=@out_object_file@ | |
249 | md_file=$(srcdir)/config/@md_file@ | |
250 | tm_file=@tm_file_list@ | |
251 | build_xm_file=@build_xm_file_list@ | |
252 | host_xm_file=@host_xm_file_list@ | |
253 | lang_specs_files=@lang_specs_files@ | |
254 | lang_options_files=@lang_options_files@ | |
3103b7db | 255 | lang_tree_files=@lang_tree_files@ |
f25270fc | 256 | GCC_THREAD_FILE=@thread_file@ |
d8bb17c8 | 257 | OBJC_BOEHM_GC=@objc_boehm_gc@ |
f24af81b | 258 | GTHREAD_FLAGS=@gthread_flags@ |
f1943b77 MH |
259 | # Be prepared for gcc2 merges. |
260 | gcc_version=@gcc_version@ | |
261 | gcc_version_trigger=@gcc_version_trigger@ | |
262 | version=$(gcc_version) | |
4746ee26 | 263 | mainversion=`grep version_string $(srcdir)/version.c | sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/'` |
79d8453e | 264 | |
79d8453e RS |
265 | # Common prefix for installation directories. |
266 | # NOTE: This directory must exist when you start installation. | |
3c18ea24 | 267 | prefix = @prefix@ |
c844ddda RS |
268 | # Directory in which to put localized header files. On the systems with |
269 | # gcc as the native cc, `local_prefix' may not be `prefix' which is | |
270 | # `/usr'. | |
0b2fbcb2 | 271 | # NOTE: local_prefix *should not* default from prefix. |
3c18ea24 | 272 | local_prefix = @local_prefix@ |
2e494f70 | 273 | # Directory in which to put host dependent programs and libraries |
3c18ea24 | 274 | exec_prefix = @exec_prefix@ |
79d8453e | 275 | # Directory in which to put the executable for the command `gcc' |
3c18ea24 | 276 | bindir = @bindir@ |
79d8453e | 277 | # Directory in which to put the directories used by the compiler. |
3c18ea24 | 278 | libdir = @libdir@ |
79d8453e | 279 | # Directory in which the compiler finds executables, libraries, etc. |
8b06b20a | 280 | libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(version) |
91c7bd9b | 281 | # Used to produce a relative $(gcc_tooldir) in gcc.o |
1f72bfca | 282 | unlibsubdir = ../../.. |
d062c304 | 283 | # Directory in which to find other cross-compilation tools and headers. |
4c112cda | 284 | dollar = @dollar@ |
d062c304 JL |
285 | # Used in install-cross. |
286 | gcc_tooldir = @gcc_tooldir@ | |
287 | # Since tooldir does not exist at build-time, use -B$(build_tooldir)/bin/ | |
288 | build_tooldir = $(exec_prefix)/$(target_alias) | |
89b3e3b4 | 289 | # Directory in which the compiler finds g++ includes. |
8f8d3278 | 290 | gcc_gxx_include_dir= @gcc_gxx_include_dir@ |
49ba557e | 291 | # Directory to search for site-specific includes. |
4b7179be | 292 | includedir = $(local_prefix)/include |
6204c24f | 293 | # assertdir is overridden in cross-make. |
7b4d5f42 | 294 | # (But this currently agrees with what is in cross-make.) |
91c7bd9b | 295 | assertdir = $(gcc_tooldir)/include |
0b2fbcb2 | 296 | # where the info files go |
3c18ea24 | 297 | infodir = @infodir@ |
587a4ba6 L |
298 | # Where cpp should go besides $prefix/bin if necessary |
299 | cpp_install_dir = @cpp_install_dir@ | |
ab87f8c8 JL |
300 | # where the locale files go |
301 | datadir = $(prefix)/@DATADIRNAME@ | |
302 | localedir = $(datadir)/locale | |
79d8453e RS |
303 | # Extension (if any) to put in installed man-page filename. |
304 | manext = .1 | |
173712fb | 305 | objext = .o |
6e26218f ILT |
306 | exeext = @host_exeext@ |
307 | build_exeext = @build_exeext@ | |
173712fb | 308 | |
79d8453e | 309 | # Directory in which to put man pages. |
a76b6b40 MH |
310 | mandir = @mandir@ |
311 | man1dir = $(mandir)/man1 | |
62c13b81 RS |
312 | # Dir for temp files. |
313 | tmpdir = /tmp | |
79d8453e | 314 | |
ab87f8c8 JL |
315 | # Top build directory, relative to here. |
316 | top_builddir = . | |
317 | ||
318 | # Whether we were configured with NLS. | |
319 | USE_NLS = @USE_NLS@ | |
320 | ||
321 | # Internationalization library. | |
322 | INTLLIBS = @INTLLIBS@ | |
323 | ||
324 | # List of internationalization subdirectories. | |
325 | POSUB = @POSUB@ | |
326 | INTL_SUBDIRS = intl $(POSUB) | |
327 | ||
79d8453e RS |
328 | # Additional system libraries to link with. |
329 | CLIB= | |
330 | ||
331 | # Change this to a null string if obstacks are installed in the | |
332 | # system library. | |
333 | OBSTACK=obstack.o | |
334 | ||
0a25f1f5 | 335 | # The GC method to be used on this system. |
81bf3d9e | 336 | GGC=@GGC@.o |
0a25f1f5 RH |
337 | |
338 | # If a supplementary library is being used for the GC. | |
339 | GGC_LIB= | |
340 | ||
76b4b31e KG |
341 | # Configure will set these if you need vfprintf and possibly _doprnt support. |
342 | VFPRINTF=@vfprintf@ | |
343 | DOPRINT=@doprint@ | |
344 | ||
b583eed8 DE |
345 | # Specify the rule for actually making libgcc.a, |
346 | LIBGCC = libgcc.a | |
347 | # and the rule for installing it. | |
348 | INSTALL_LIBGCC = install-libgcc | |
349 | ||
79d8453e | 350 | # Specify the rule for actually making libgcc1.a. |
2e494f70 RS |
351 | # The value may be empty; that means to do absolutely nothing |
352 | # with or for libgcc1.a. | |
79d8453e RS |
353 | LIBGCC1 = libgcc1.a |
354 | ||
b0bfa186 ILT |
355 | # Specify the rule for making libgcc1.a for a cross-compiler. |
356 | # The default rule assumes that libgcc1.a is supplied by the user. | |
357 | CROSS_LIBGCC1 = libgcc1.cross | |
358 | ||
79d8453e RS |
359 | # Options to use when compiling libgcc2.a. |
360 | # -g1 causes output of debug info only for file-scope entities. | |
361 | # we use this here because that should be enough, and also | |
362 | # so that -g1 will be tested. | |
7337c67f | 363 | # |
11f39cf4 | 364 | LIBGCC2_DEBUG_CFLAGS = -g1 |
4c457b6b | 365 | LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED @inhibit_libc@ |
56f9206d ILT |
366 | |
367 | # Additional options to use when compiling libgcc2.a. | |
3c9a2b55 | 368 | # Some targets override this to -isystem include |
56f9206d ILT |
369 | LIBGCC2_INCLUDES = |
370 | ||
7bb7f3df | 371 | # Additional target-dependent options for compiling libgcc2.a. |
4c457b6b | 372 | TARGET_LIBGCC2_CFLAGS = |
7bb7f3df | 373 | |
ce152ef8 AM |
374 | # Addition sources to handle exceptions; overridden by some targets. |
375 | LIB2ADDEH = $(srcdir)/frame-dwarf2.c | |
376 | ||
a2d163c4 DE |
377 | # libgcc1-test target (must also be overridable for a target) |
378 | LIBGCC1_TEST = libgcc1-test | |
0defb1d5 | 379 | |
79d8453e RS |
380 | # List of extra executables that should be compiled for this target machine |
381 | # that are used for compiling from source code to object code. | |
382 | # The rules for compiling them should be in the t-* file for the machine. | |
3c18ea24 | 383 | EXTRA_PASSES =@extra_passes@ |
79d8453e | 384 | |
2e494f70 | 385 | # Like EXTRA_PASSES, but these are used when linking. |
3c18ea24 | 386 | EXTRA_PROGRAMS = @extra_programs@ |
2e494f70 RS |
387 | |
388 | # List of extra object files that should be compiled for this target machine. | |
79d8453e | 389 | # The rules for compiling them should be in the t-* file for the machine. |
3c18ea24 | 390 | EXTRA_PARTS = @extra_parts@ |
79d8453e | 391 | |
2e494f70 RS |
392 | # List of extra object files that should be compiled and linked with |
393 | # compiler proper (cc1, cc1obj, cc1plus). | |
3c18ea24 | 394 | EXTRA_OBJS = @extra_objs@ |
2e494f70 | 395 | |
43554690 RK |
396 | # List of extra object files that should be compiled and linked with |
397 | # the gcc driver. | |
3c18ea24 | 398 | EXTRA_GCC_OBJS =@host_extra_gcc_objs@ |
43554690 | 399 | |
f780d21b RS |
400 | # List of additional header files to install. |
401 | # Often this is edited directly by `configure'. | |
3c18ea24 | 402 | EXTRA_HEADERS =@extra_headers_list@ |
f780d21b | 403 | |
10da1131 | 404 | # Set this to `collect2' to enable use of collect2. |
3c18ea24 | 405 | USE_COLLECT2 = @will_use_collect2@ |
657be7af JL |
406 | # If we might be using collect2, then this variable will be set to |
407 | # -DUSE_COLLECT2. toplev.c, collect2.c and libgcc2.c all need to | |
408 | # if we may be using collect2. | |
f46fe00a | 409 | MAYBE_USE_COLLECT2 = @maybe_use_collect2@ |
47547081 RS |
410 | # It is convenient for configure to add the assignment at the beginning, |
411 | # so don't override it here. | |
10da1131 | 412 | USE_COLLECT2 = collect2$(exeext) |
47547081 | 413 | |
79d8453e RS |
414 | # List of extra C and assembler files to add to libgcc1.a. |
415 | # Assembler files should have names ending in `.asm'. | |
4c457b6b | 416 | LIB1FUNCS_EXTRA = |
79d8453e RS |
417 | |
418 | # List of extra C and assembler files to add to libgcc2.a. | |
419 | # Assembler files should have names ending in `.asm'. | |
4c457b6b | 420 | LIB2FUNCS_EXTRA = |
79d8453e | 421 | |
587a4ba6 L |
422 | # Handle cpp installation. |
423 | INSTALL_CPP= | |
424 | UNINSTALL_CPP= | |
425 | ||
e7f62ad3 MH |
426 | # We do not try to build float.h anymore. Let configure select the |
427 | # appropriate pre-built float.h file for the target. | |
027ea2a7 | 428 | FLOAT_H=@float_h_file@ |
e7f62ad3 | 429 | |
79d8453e | 430 | # Program to convert libraries. |
4c457b6b | 431 | LIBCONVERT = |
79d8453e RS |
432 | |
433 | # Control whether header files are installed. | |
79d8453e RS |
434 | INSTALL_HEADERS=install-headers |
435 | ||
09fa0705 ZW |
436 | # Control whether Info documentation is built and installed. |
437 | BUILD_INFO = @BUILD_INFO@ | |
438 | INSTALL_INFO = @INSTALL_INFO@ | |
439 | ||
66d7ffbf | 440 | # Additional directories of header files to run fixincludes on. |
4ab08223 RS |
441 | # These should be directories searched automatically by default |
442 | # just as /usr/include is. | |
4c457b6b | 443 | # *Do not* use this for directories that happen to contain |
4ab08223 | 444 | # header files, but are not searched automatically by default. |
66d7ffbf RS |
445 | # On most systems, this is empty. |
446 | OTHER_FIXINCLUDES_DIRS= | |
447 | ||
7c27f801 RK |
448 | # A list of all the language-specific executables. |
449 | # This is overridden by configure. | |
3379e8ef | 450 | COMPILERS = cc1$(exeext) @all_compilers@ |
7c27f801 | 451 | |
acbbf3d9 | 452 | # List of things which should already be built whenever we try to use xgcc |
79d8453e | 453 | # to compile anything (without linking). |
d9fe00bb | 454 | GCC_PASSES=xgcc$(exeext) cc1$(exeext) cpp0$(exeext) specs $(EXTRA_PASSES) |
79d8453e | 455 | |
acbbf3d9 | 456 | # List of things which should already be built whenever we try to use xgcc |
79d8453e | 457 | # to link anything. |
b583eed8 | 458 | GCC_PARTS=$(GCC_PASSES) $(LIBGCC) $(EXTRA_PROGRAMS) $(USE_COLLECT2) $(EXTRA_PARTS) |
79d8453e | 459 | |
79d8453e RS |
460 | # Directory to link to, when using the target `maketest'. |
461 | DIR = ../gcc | |
462 | ||
c3efc7c4 | 463 | # Guaranteed to not exist when not passing md through cpp. |
aa90345a | 464 | # This value is overridden directly by configure. |
c3efc7c4 DE |
465 | MD_FILE = md-cpp-not-used |
466 | ||
79d8453e RS |
467 | # Flags to use when cross-building GCC. |
468 | # Prefix to apply to names of object files when using them | |
469 | # to run on the machine we are compiling on. | |
470 | HOST_PREFIX= | |
471 | # Prefix to apply to names of object files when compiling them | |
472 | # to run on the machine we are compiling on. | |
4c457b6b | 473 | # The default for this variable is chosen to keep these rules |
79d8453e RS |
474 | # out of the way of the other rules for compiling the same source files. |
475 | HOST_PREFIX_1=loser- | |
476 | HOST_CC=$(CC) | |
477 | HOST_CFLAGS=$(ALL_CFLAGS) | |
2e494f70 | 478 | HOST_CLIB=$(CLIB) |
79d8453e RS |
479 | HOST_LDFLAGS=$(LDFLAGS) |
480 | HOST_CPPFLAGS=$(ALL_CPPFLAGS) | |
2e494f70 RS |
481 | HOST_ALLOCA=$(ALLOCA) |
482 | HOST_MALLOC=$(MALLOC) | |
483 | HOST_OBSTACK=$(OBSTACK) | |
76b4b31e KG |
484 | HOST_VFPRINTF=$(VFPRINTF) |
485 | HOST_DOPRINT=$(DOPRINT) | |
79d8453e | 486 | |
338023d4 | 487 | # Actual name to use when installing a native compiler. |
ef85603e | 488 | GCC_INSTALL_NAME = `t='$(program_transform_name)'; echo gcc | sed -e $$t` |
922cf99e | 489 | CPP_INSTALL_NAME = `t='$(program_transform_name)'; echo cpp | sed -e $$t` |
225695a4 JW |
490 | PROTOIZE_INSTALL_NAME = `t='$(program_transform_name)'; echo protoize | sed -e $$t` |
491 | UNPROTOIZE_INSTALL_NAME = `t='$(program_transform_name)'; echo unprotoize | sed -e $$t` | |
23473647 | 492 | GCOV_INSTALL_NAME = `t='$(program_transform_name)'; echo gcov | sed -e $$t` |
e4476d1c | 493 | GCCBUG_INSTALL_NAME = `t='$(program_transform_name)'; echo gccbug | sed -e $$t` |
338023d4 DE |
494 | |
495 | # Actual name to use when installing a cross-compiler. | |
ef85603e | 496 | GCC_CROSS_NAME = `t='$(program_transform_cross_name)'; echo gcc | sed -e $$t` |
9799e470 | 497 | CPP_CROSS_NAME = `t='$(program_transform_cross_name)'; echo cpp | sed -e $$t` |
225695a4 JW |
498 | PROTOIZE_CROSS_NAME = `t='$(program_transform_cross_name)'; echo protoize | sed -e $$t` |
499 | UNPROTOIZE_CROSS_NAME = `t='$(program_transform_cross_name)'; echo unprotoize | sed -e $$t` | |
338023d4 | 500 | |
79d8453e RS |
501 | # Choose the real default target. |
502 | ALL=all.internal | |
503 | ||
504 | # Choose the real install target. | |
ba1811f1 ILT |
505 | INSTALL_TARGET=install-normal |
506 | ||
e933cbe0 JL |
507 | # Setup the testing framework, if you have one |
508 | EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \ | |
509 | echo $${rootme}/../expect/expect ; \ | |
510 | else echo expect ; fi` | |
511 | ||
512 | RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \ | |
513 | echo $${srcdir}/../dejagnu/runtest ; \ | |
514 | else echo runtest; fi` | |
515 | RUNTESTFLAGS = | |
516 | ||
aefc3801 | 517 | # Extra symbols for fixproto to define when parsing headers. |
4c457b6b | 518 | FIXPROTO_DEFINES = |
aefc3801 | 519 | |
68d69835 | 520 | # Extra flags to use when compiling crt{begin,end}.o. |
4c457b6b | 521 | CRTSTUFF_T_CFLAGS = |
68d69835 | 522 | |
522170ca | 523 | # Extra flags to use when compiling [m]crt0.o. |
4c457b6b | 524 | CRT0STUFF_T_CFLAGS = |
522170ca | 525 | |
e9a25f70 JL |
526 | # "t" or nothing, for building multilibbed versions of, say, crtbegin.o. |
527 | T = | |
528 | ||
79d8453e RS |
529 | # End of variables for you to override. |
530 | ||
531 | # Definition of `all' is here so that new rules inserted by sed | |
532 | # do not specify the default target. | |
533 | # The real definition is under `all.internal' (for native compilers) | |
534 | # or `all.cross' (for cross compilers). | |
2e494f70 | 535 | all: all.indirect |
79d8453e | 536 | |
be0d23ff RS |
537 | # This tells GNU Make version 3 not to put all variables in the environment. |
538 | .NOEXPORT: | |
539 | ||
79d8453e | 540 | # sed inserts variable overrides after the following line. |
60d00117 | 541 | ####target overrides |
3c18ea24 RK |
542 | @target_overrides@ |
543 | ||
60d00117 | 544 | ####host overrides |
3c18ea24 RK |
545 | @host_overrides@ |
546 | ||
60d00117 | 547 | ####cross overrides |
3c18ea24 RK |
548 | @cross_defines@ |
549 | @cross_overrides@ | |
550 | ||
057f494b | 551 | ####build overrides |
3c18ea24 | 552 | @build_overrides@ |
544eb21e | 553 | #\f |
79d8453e RS |
554 | # Now figure out from those variables how to compile and link. |
555 | ||
2e494f70 RS |
556 | all.indirect: $(ALL) |
557 | ||
2bdfeefa | 558 | # IN_GCC tells various files that system.h, toplev.c, etc are available. |
7b5efe21 | 559 | INTERNAL_CFLAGS = $(CROSS) -DIN_GCC @extra_c_flags@ |
79d8453e RS |
560 | |
561 | # This is the variable actually used when we compile. | |
2df8df36 JW |
562 | # If you change this line, you probably also need to change the definition |
563 | # of HOST_CFLAGS in build-make to match. | |
5b67ad6f | 564 | ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(WARN_CFLAGS) $(XCFLAGS) @DEFS@ |
79d8453e RS |
565 | |
566 | # Likewise. | |
567 | ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS) | |
568 | ||
569 | # Even if ALLOCA is set, don't use it if compiling with GCC. | |
3fe40e05 JL |
570 | USE_ALLOCA= ${ALLOCA} |
571 | USE_HOST_ALLOCA= ` case "${HOST_ALLOCA}" in ?*) echo ${HOST_PREFIX}${HOST_ALLOCA} ;; esac ` | |
2e494f70 RS |
572 | USE_HOST_MALLOC= ` case "${HOST_MALLOC}" in ?*) echo ${HOST_PREFIX}${HOST_MALLOC} ;; esac ` |
573 | USE_HOST_OBSTACK= ` case "${HOST_OBSTACK}" in ?*) echo ${HOST_PREFIX}${HOST_OBSTACK} ;; esac ` | |
76b4b31e KG |
574 | USE_HOST_VFPRINTF= ` case "${HOST_VFPRINTF}" in ?*) echo ${HOST_PREFIX}${HOST_VFPRINTF} ;; esac ` |
575 | USE_HOST_DOPRINT= ` case "${HOST_DOPRINT}" in ?*) echo ${HOST_PREFIX}${HOST_DOPRINT} ;; esac ` | |
79d8453e RS |
576 | |
577 | # Dependency on obstack, alloca, malloc or whatever library facilities | |
578 | # are not installed in the system libraries. | |
579 | # We don't use USE_ALLOCA because backquote expansion doesn't work in deps. | |
ab87f8c8 | 580 | LIBDEPS= $(INTLLIBS) $(OBSTACK) $(ALLOCA) $(MALLOC) $(VFPRINTF) $(DOPRINT) |
79d8453e RS |
581 | |
582 | # Likewise, for use in the tools that must run on this machine | |
583 | # even if we are cross-building GCC. | |
584 | # We don't use USE_ALLOCA because backquote expansion doesn't work in deps. | |
e5ec2402 | 585 | HOST_LIBDEPS= $(HOST_PREFIX)$(HOST_OBSTACK) $(HOST_PREFIX)$(HOST_ALLOCA) $(HOST_PREFIX)$(HOST_MALLOC) $(HOST_PREFIX)$(HOST_VFPRINTF) $(HOST_PREFIX)$(HOST_DOPRINT) |
79d8453e RS |
586 | |
587 | # How to link with both our special library facilities | |
588 | # and the system's installed libraries. | |
ab87f8c8 | 589 | LIBS = $(OBSTACK) $(USE_ALLOCA) $(MALLOC) $(INTLLIBS) @LIBS@ $(VFPRINTF) $(DOPRINT) $(CLIB) ../libiberty/libiberty.a |
79d8453e RS |
590 | |
591 | # Likewise, for use in the tools that must run on this machine | |
592 | # even if we are cross-building GCC. | |
2e494f70 | 593 | HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_ALLOCA) $(USE_HOST_MALLOC) \ |
e5ec2402 | 594 | $(USE_HOST_VFPRINTF) $(USE_HOST_DOPRINT) $(HOST_CLIB) |
79d8453e | 595 | |
c88c0d42 | 596 | HOST_RTL = $(HOST_PREFIX)rtl.o $(HOST_PREFIX)bitmap.o \ |
3916d6d8 | 597 | $(HOST_PREFIX)ggc-none.o gensupport.o |
c88c0d42 | 598 | |
d3614a37 | 599 | HOST_PRINT = $(HOST_PREFIX)print-rtl.o |
f8b6598e | 600 | HOST_ERRORS = $(HOST_PREFIX)errors.o |
79d8453e RS |
601 | |
602 | # Specify the directories to be searched for header files. | |
603 | # Both . and srcdir are used, in that order, | |
604 | # so that tm.h and config.h will be found in the compilation | |
605 | # subdirectory rather than in the source directory. | |
8cfa5320 | 606 | INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config -I$(srcdir)/../include |
79d8453e RS |
607 | |
608 | # Always use -I$(srcdir)/config when compiling. | |
609 | .c.o: | |
610 | $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< | |
611 | ||
612 | # This tells GNU make version 3 not to export all the variables | |
613 | # defined in this file into the environment. | |
614 | .NOEXPORT: | |
544eb21e | 615 | #\f |
013a2ee0 DE |
616 | # Support for additional languages (other than c and objc). |
617 | # ??? objc can be supported this way too (leave for later). | |
618 | ||
619 | # These next lines are overridden by configure. | |
3c18ea24 RK |
620 | LANG_MAKEFILES = @all_lang_makefiles@ |
621 | LANG_STAGESTUFF = @all_stagestuff@ | |
622 | LANG_DIFF_EXCLUDES = @all_diff_excludes@ | |
623 | LANG_LIB2FUNCS = @all_lib2funcs@ | |
624 | LANG_EXTRA_HEADERS = @all_headers@ | |
013a2ee0 DE |
625 | |
626 | # Flags to pass to recursive makes. | |
627 | # CC is set by configure. Hosts without symlinks need special handling | |
628 | # because we need CC="stage1/xgcc -Bstage1/" to work in the language | |
629 | # subdirectories. | |
630 | # ??? The choices here will need some experimenting with. | |
e6980e1b | 631 | ORDINARY_FLAGS_TO_PASS = \ |
8f25d5cd | 632 | "AR_FLAGS_FOR_TARGET=$(AR_FLAGS_FOR_TARGET)" \ |
7bde2862 GK |
633 | "AR_CREATE_FOR_TARGET=$(AR_CREATE_FOR_TARGET)" \ |
634 | "AR_EXTRACT_FOR_TARGET=$(AR_EXTRACT_FOR_TARGET)" \ | |
013a2ee0 DE |
635 | "AR_FOR_TARGET=$(AR_FOR_TARGET)" \ |
636 | "BISON=$(BISON)" \ | |
637 | "BISONFLAGS=$(BISONFLAGS)" \ | |
5b67ad6f | 638 | "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \ |
89c8019a | 639 | "CLIB=$(CLIB)" \ |
dc93cff0 | 640 | "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \ |
013a2ee0 DE |
641 | "LDFLAGS=$(LDFLAGS)" \ |
642 | "LEX=$(LEX)" \ | |
643 | "LEXFLAGS=$(LEXFLAGS)" \ | |
ac64120e JW |
644 | "LN=$(LN)" \ |
645 | "LN_S=$(LN_S)" \ | |
013a2ee0 DE |
646 | "MAKEINFO=$(MAKEINFO)" \ |
647 | "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \ | |
013a2ee0 DE |
648 | "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \ |
649 | "RANLIB_TEST_FOR_TARGET=$(RANLIB_TEST_FOR_TARGET)" \ | |
650 | "SHELL=$(SHELL)" \ | |
3c18ea24 | 651 | "STAGE_PREFIX=@stage_prefix_set_by_configure@" \ |
aab26e16 | 652 | "exeext=$(exeext)" \ |
6e26218f | 653 | "build_exeext=$(build_exeext)" \ |
aab26e16 | 654 | "objext=$(objext)" \ |
013a2ee0 DE |
655 | "exec_prefix=$(exec_prefix)" \ |
656 | "prefix=$(prefix)" \ | |
3bf810d8 | 657 | "local_prefix=$(local_prefix)" \ |
8f8d3278 | 658 | "gxx_include_dir=$(gcc_gxx_include_dir)" \ |
013a2ee0 | 659 | "tooldir=$(tooldir)" \ |
91c7bd9b | 660 | "gcc_tooldir=$(gcc_tooldir)" \ |
013a2ee0 | 661 | "bindir=$(bindir)" \ |
ab87f8c8 JL |
662 | "libsubdir=$(libsubdir)" \ |
663 | "datadir=$(datadir)" \ | |
664 | "distdir=../tmp/\$$(subdir)" \ | |
665 | "localedir=$(localedir)" | |
e6980e1b | 666 | FLAGS_TO_PASS = $(ORDINARY_FLAGS_TO_PASS) "CC=@cc_set_by_configure@" |
ab87f8c8 JL |
667 | PREPEND_DOTDOT_TO_RELATIVE_PATHS = sed \ |
668 | -e 's|^ *[^ /][^ /]*/|%&|' \ | |
669 | -e 's| -B| -B%|g' \ | |
670 | -e 's|% *[^- /]|%&|g' \ | |
671 | -e 's|%% *|../|g' \ | |
672 | -e 's|%||g' | |
673 | SUBDIR_FLAGS_TO_PASS = $(ORDINARY_FLAGS_TO_PASS) \ | |
6bed14c7 JM |
674 | "CC=`echo @quoted_cc_set_by_configure@ | $(PREPEND_DOTDOT_TO_RELATIVE_PATHS)`" |
675 | # Flags to pass when recursing into a frontend subdirectory. | |
676 | LANG_FLAGS_TO_PASS = $(SUBDIR_FLAGS_TO_PASS) \ | |
677 | "CFLAGS=$(LOOSE_CFLAGS)" | |
544eb21e | 678 | #\f |
79d8453e RS |
679 | # Lists of files for various purposes. |
680 | ||
3cb88565 | 681 | # Language-specific object files for C and Objective C. |
b9161f44 | 682 | C_AND_OBJC_OBJS = c-errors.o c-lex.o c-pragma.o c-decl.o c-typeck.o \ |
83bab8db | 683 | c-convert.o c-aux-info.o c-common.o c-semantics.o @extra_c_objs@ |
3cb88565 | 684 | |
79d8453e | 685 | # Language-specific object files for C. |
3cb88565 | 686 | C_OBJS = c-parse.o c-lang.o $(C_AND_OBJC_OBJS) |
e8066a5d | 687 | |
79d8453e | 688 | # Language-independent object files. |
a36556a8 ZW |
689 | |
690 | OBJS = diagnostic.o version.o tree.o print-tree.o stor-layout.o fold-const.o \ | |
cd306eed AS |
691 | function.o stmt.o except.o expr.o calls.o expmed.o explow.o optabs.o real.o \ |
692 | builtins.o intl.o varasm.o rtl.o print-rtl.o rtlanal.o emit-rtl.o genrtl.o \ | |
693 | dbxout.o sdbout.o dwarfout.o dwarf2out.o xcoffout.o bitmap.o alias.o gcse.o \ | |
5527bf14 | 694 | integrate.o jump.o cse.o loop.o doloop.o unroll.o flow.o combine.o varray.o \ |
ab87f8c8 | 695 | regclass.o regmove.o local-alloc.o global.o reload.o reload1.o caller-save.o \ |
cd306eed AS |
696 | insn-peep.o reorg.o haifa-sched.o final.o recog.o reg-stack.o regrename.o \ |
697 | insn-opinit.o insn-recog.o insn-extract.o insn-output.o insn-emit.o lcm.o \ | |
698 | profile.o insn-attrtab.o $(out_object_file) $(EXTRA_OBJS) convert.o \ | |
699 | mbchar.o splay-tree.o graph.o sbitmap.o resource.o hash.o predict.o \ | |
700 | lists.o ggc-common.o $(GGC) simplify-rtx.o ssa.o bb-reorder.o \ | |
d061bc1e | 701 | sibcall.o conflict.o timevar.o ifcvt.o dependence.o dce.o |
79d8453e | 702 | |
a36556a8 ZW |
703 | BACKEND = toplev.o libbackend.a |
704 | ||
79d8453e RS |
705 | # GEN files are listed separately, so they can be built before doing parallel |
706 | # makes for cc1 or cc1plus. Otherwise sequent parallel make attempts to load | |
707 | # them before rtl.o is compiled. | |
3b80f6ca | 708 | GEN= genemit genoutput genrecog genextract genflags gencodes genconfig \ |
8376d400 | 709 | genpeep gengenrtl gencheck |
79d8453e RS |
710 | |
711 | # Files to be copied away after each stage in building. | |
aab26e16 | 712 | STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \ |
79d8453e | 713 | insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \ |
ab87f8c8 | 714 | insn-attr.h insn-attrtab.c insn-opinit.c tree-check.h \ |
e7f731a7 | 715 | s-flags s-config s-codes s-mlib s-under s-genrtl \ |
9ec36da5 | 716 | s-output s-recog s-emit s-extract s-peep s-check \ |
a9e6777f | 717 | s-attr s-attrtab s-opinit s-crt0 \ |
6e26218f ILT |
718 | genemit$(build_exeext) genoutput$(build_exeext) genrecog$(build_exeext) \ |
719 | genextract$(build_exeext) genflags$(build_exeext) gencodes$(build_exeext) \ | |
720 | genconfig$(build_exeext) genpeep$(build_exeext) genattrtab$(build_exeext) \ | |
206ae7cf | 721 | genattr$(build_exeext) genopinit$(build_exeext) gengenrtl$(build_exeext) \ |
fa9c7493 | 722 | gencheck$(build_exeext) genrtl.c genrtl.h \ |
4871239e | 723 | xgcc$(exeext) cpp$(exeext) cc1$(exeext) cpp0$(exeext) $(EXTRA_PASSES) \ |
86702e31 ZW |
724 | $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) cc1obj$(exeext) \ |
725 | enquire$(exeext) protoize$(exeext) unprotoize$(exeext) \ | |
4871239e | 726 | specs collect2$(exeext) $(USE_COLLECT2) underscore.c tradcpp0$(exeext) \ |
4993ddc1 | 727 | gcov$(exeext) *.[0-9][0-9].* *.[si] libcpp.a libbackend.a libgcc.mk \ |
013a2ee0 | 728 | $(LANG_STAGESTUFF) |
79d8453e RS |
729 | |
730 | # Members of libgcc1.a. | |
731 | LIB1FUNCS = _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \ | |
b6eb802a | 732 | _lshrsi3 _ashrsi3 _ashlsi3 \ |
79d8453e RS |
733 | _divdf3 _muldf3 _negdf2 _adddf3 _subdf3 \ |
734 | _fixdfsi _fixsfsi _floatsidf _floatsisf _truncdfsf2 _extendsfdf2 \ | |
735 | _addsf3 _negsf2 _subsf3 _mulsf3 _divsf3 \ | |
736 | _eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2 \ | |
737 | _eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2 | |
738 | ||
739 | # Library members defined in libgcc2.c. | |
740 | LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \ | |
b6eb802a | 741 | _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2 \ |
3af18470 | 742 | _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \ |
79d8453e | 743 | _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \ |
3971e415 | 744 | _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi \ |
d1b4b7c1 | 745 | _fixtfdi _fixunstfdi _floatditf \ |
ced78d8b JM |
746 | __gcc_bcmp _varargs __dummy _eprintf \ |
747 | _bb _shtab _clear_cache _trampoline __main _exit \ | |
624a8b3a JL |
748 | _ctors _pure |
749 | ||
750 | LIB2FUNCS_EH = _eh | |
79d8453e | 751 | |
5198352e JL |
752 | FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \ |
753 | _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \ | |
1eb8759b | 754 | _lt_sf _le_sf _unord_sf _si_to_sf _sf_to_si _negate_sf _make_sf \ |
dfaf3cdb | 755 | _sf_to_df _thenan_sf _sf_to_usi _usi_to_sf |
5198352e JL |
756 | |
757 | DPBIT_FUNCS = _pack_df _unpack_df _addsub_df _mul_df _div_df \ | |
758 | _fpcmp_parts_df _compare_df _eq_df _ne_df _gt_df _ge_df \ | |
1eb8759b | 759 | _lt_df _le_df _unord_df _si_to_df _df_to_si _negate_df _make_df \ |
dfaf3cdb | 760 | _df_to_sf _thenan_df _df_to_usi _usi_to_df |
5198352e | 761 | |
79d8453e RS |
762 | # The files that "belong" in CONFIG_H are deliberately omitted |
763 | # because having them there would not be useful in actual practice. | |
764 | # All they would do is cause complete recompilation every time | |
765 | # one of the machine description files is edited. | |
766 | # That may or may not be what one wants to do. | |
767 | # If it is, rm *.o is an easy way to do it. | |
7ac16ba0 | 768 | # CONFIG_H = $(host_xm_file) $(tm_file) |
79d8453e | 769 | CONFIG_H = |
1eb14644 KG |
770 | MACHMODE_H = machmode.h machmode.def |
771 | RTL_BASE_H = rtl.h rtl.def $(MACHMODE_H) | |
3b80f6ca | 772 | RTL_H = $(RTL_BASE_H) genrtl.h |
cb1072f4 | 773 | TREE_H = tree.h real.h tree.def $(MACHMODE_H) tree-check.h version.h builtins.def |
a6873608 | 774 | BASIC_BLOCK_H = basic-block.h bitmap.h sbitmap.h varray.h |
2bfdc2d4 | 775 | DEMANGLE_H = $(srcdir)/../include/demangle.h |
0056a9b5 | 776 | RECOG_H = recog.h |
50793ea3 | 777 | EXPR_H = expr.h insn-codes.h |
1eb14644 | 778 | REGS_H = regs.h varray.h $(MACHMODE_H) |
6165fb6b | 779 | INTEGRATE_H = integrate.h varray.h |
efc9bd41 | 780 | LOOP_H = loop.h varray.h bitmap.h |
4746ee26 | 781 | GCC_H = gcc.h version.h |
bedda2da | 782 | GGC_H = ggc.h varray.h |
614f6bc1 | 783 | TIMEVAR_H = timevar.h timevar.def |
9d98a694 | 784 | INSN_ATTR_H = insn-attr.h $(srcdir)/insn-addr.h $(srcdir)/varray.h |
8f17b5c5 MM |
785 | C_COMMON_H = c-common.h $(SPLAY_TREE_H) |
786 | C_TREE_H = c-tree.h $(C_COMMON_H) | |
787 | ||
544eb21e | 788 | #\f |
013a2ee0 DE |
789 | # Language makefile fragments. |
790 | ||
791 | # The following targets define the interface between us and the languages. | |
792 | # | |
793 | # all.build, all.cross, start.encap, rest.encap, | |
794 | # info, dvi, | |
795 | # install-normal, install-common, install-info, install-man, | |
796 | # uninstall, distdir, | |
f1908d70 | 797 | # mostlyclean, clean, distclean, extraclean, maintainer-clean, |
013a2ee0 DE |
798 | # stage1, stage2, stage3, stage4 |
799 | # | |
800 | # Each language is linked in with a series of hooks (since we can't use `::' | |
801 | # targets). The name of each hooked is "lang.${target_name}" (eg: lang.info). | |
802 | # Configure computes and adds these here. | |
803 | ||
804 | ####language hooks | |
3c18ea24 | 805 | @language_hooks@ |
013a2ee0 DE |
806 | |
807 | # sed inserts language fragments after the following line. | |
808 | ####language fragments | |
3c18ea24 | 809 | @language_fragments@ |
013a2ee0 DE |
810 | |
811 | # End of language makefile fragments. | |
544eb21e | 812 | #\f |
024b5658 JM |
813 | # The only suffixes we want for implicit rules are .c and .o, so clear |
814 | # the list and add them. This speeds up GNU Make, and allows -r to work. | |
815 | .SUFFIXES: | |
816 | .SUFFIXES: .c .o | |
79d8453e | 817 | |
7c0ae5f1 | 818 | Makefile: $(srcdir)/Makefile.in config.status $(srcdir)/version.c \ |
d232dfa4 DE |
819 | $(xmake_file) $(tmake_file) $(LANG_MAKEFILES) |
820 | $(SHELL) $(srcdir)/configure.frag $(srcdir) "$(SUBDIRS)" \ | |
821 | "$(xmake_file)" "$(tmake_file)" | |
173712fb | 822 | cp config.status config.run |
71205e0b | 823 | LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.run |
da0d7cb1 | 824 | rm -f config.run |
79d8453e | 825 | |
723778b0 | 826 | $(srcdir)/configure: $(srcdir)/configure.in |
3c18ea24 RK |
827 | cd $(srcdir); autoconf |
828 | ||
501a4819 ML |
829 | gccbug: $(srcdir)/gccbug.in |
830 | CONFIG_FILES=gccbug CONFIG_HEADERS= ./config.status | |
831 | ||
3ec83fc2 RH |
832 | mklibgcc: $(srcdir)/mklibgcc.in |
833 | CONFIG_FILES=mklibgcc CONFIG_HEADERS= ./config.status | |
834 | ||
da7ece9a | 835 | # cstamp-h.in controls rebuilding of config.in. |
7c0ae5f1 DE |
836 | # It is named cstamp-h.in and not stamp-h.in so the mostlyclean rule doesn't |
837 | # delete it. A stamp file is needed as autoheader won't update the file if | |
838 | # nothing has changed. | |
da7ece9a DE |
839 | # It remains in the source directory and is part of the distribution. |
840 | # This follows what is done in shellutils, fileutils, etc. | |
5408f8d0 DE |
841 | # "echo timestamp" is used instead of touch to be consistent with other |
842 | # packages that use autoconf (??? perhaps also to avoid problems with patch?). | |
da7ece9a DE |
843 | # ??? Newer versions have a maintainer mode that may be useful here. |
844 | $(srcdir)/config.in: $(srcdir)/cstamp-h.in | |
845 | $(srcdir)/cstamp-h.in: $(srcdir)/configure.in $(srcdir)/acconfig.h | |
60ee2a7a | 846 | cd $(srcdir) && autoheader |
71d085b0 | 847 | @rm -f $(srcdir)/cstamp-h.in |
5408f8d0 | 848 | echo timestamp > $(srcdir)/cstamp-h.in |
b7cb92ad | 849 | auto-host.h: cstamp-h ; @true |
da7ece9a | 850 | cstamp-h: config.in config.status |
71205e0b | 851 | CONFIG_HEADERS=auto-host.h:config.in LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status |
d68b51ef | 852 | |
7c0ae5f1 DE |
853 | # Really, really stupid make features, such as SUN's KEEP_STATE, may force |
854 | # a target to build even if it is up-to-date. So we must verify that | |
855 | # config.status does not exist before failing. | |
c5c76735 | 856 | config.status: $(srcdir)/configure version.c |
7c0ae5f1 DE |
857 | @if [ ! -f config.status ] ; then \ |
858 | echo You must configure gcc. Look at the INSTALL file for details.; \ | |
859 | false; \ | |
860 | else \ | |
71205e0b | 861 | LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status --recheck; \ |
7c0ae5f1 DE |
862 | fi |
863 | ||
43297964 | 864 | all.internal: start.encap rest.encap doc |
79d8453e | 865 | # This is what to compile if making a cross-compiler. |
013a2ee0 | 866 | # Note that we can compile enquire using the cross-compiler just built, |
42396e97 | 867 | # although we can't run it on this machine. |
4871239e | 868 | all.cross: native gcc-cross cpp$(exeext) specs \ |
d81c9768 | 869 | $(LIBGCC) $(LIBGCC1_TEST) $(EXTRA_PARTS) lang.all.cross doc |
057f494b | 870 | # This is what to compile if making gcc with a cross-compiler. |
4871239e | 871 | all.build: native xgcc$(exeext) cpp$(exeext) $(EXTRA_PARTS) lang.all.build |
79d8453e | 872 | # This is what must be made before installing GCC and converting libraries. |
4871239e | 873 | start.encap: native xgcc$(exeext) cpp$(exeext) specs \ |
922cf99e | 874 | xlimits.h lang.start.encap |
eea77e5f | 875 | # These can't be made until after GCC can run. |
f95e46b9 | 876 | rest.encap: $(STMP_FIXPROTO) $(LIBGCC) $(EXTRA_PARTS) lang.rest.encap |
79d8453e RS |
877 | # This is what is made with the host's compiler |
878 | # whether making a cross compiler or not. | |
4871239e | 879 | native: config.status auto-host.h intl.all $(LANGUAGES) \ |
88393a07 | 880 | $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2) |
79d8453e RS |
881 | |
882 | # Define the names for selecting languages in LANGUAGES. | |
4871239e | 883 | C c: cc1$(exeext) tradcpp0$(exeext) |
79d8453e RS |
884 | PROTO: proto |
885 | ||
bff3fc41 | 886 | # Tell GNU make these are phony targets. |
3379e8ef | 887 | .PHONY: C c PROTO proto |
bff3fc41 | 888 | |
3aa072f2 RS |
889 | # On the target machine, finish building a cross compiler. |
890 | # This does the things that can't be done on the host machine. | |
027ea2a7 | 891 | rest.cross: $(LIBGCC) specs |
3aa072f2 | 892 | |
a2d163c4 | 893 | # Verify that it works to compile and link libgcc1-test. |
e97ed334 | 894 | # If it does, then there are sufficient replacements for libgcc1.a. |
a2d163c4 | 895 | libgcc1-test: libgcc1-test.o native $(GCC_PARTS) |
8f28aa33 | 896 | @echo "Testing libgcc1. Ignore linker warning messages." |
a2d163c4 | 897 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) libgcc1-test.o -o libgcc1-test \ |
fda92428 | 898 | -nostartfiles -nostdlib `$(GCC_FOR_TARGET) --print-libgcc-file-name` |
e09e14e9 | 899 | libgcc1-test.o: libgcc1-test.c native xgcc$(exeext) |
a2d163c4 | 900 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -c $(srcdir)/libgcc1-test.c |
e97ed334 | 901 | |
3aa072f2 RS |
902 | # Recompile all the language-independent object files. |
903 | # This is used only if the user explicitly asks for it. | |
a36556a8 | 904 | compilations: $(BACKEND) |
79d8453e | 905 | |
a36556a8 ZW |
906 | # Like libcpp.a, this archive is strictly for the host. |
907 | libbackend.a: $(OBJS) | |
908 | -rm -rf libbackend.a | |
909 | $(AR) $(AR_FLAGS) libbackend.a $(OBJS) | |
910 | if $(RANLIB_TEST) ; then $(RANLIB) libbackend.a ; else true ; fi | |
6c1cc7fa | 911 | |
acbbf3d9 RS |
912 | # We call this executable `xgcc' rather than `gcc' |
913 | # to avoid confusion if the current directory is in the path | |
914 | # and CC is `gcc'. It is renamed to `gcc' when it is installed. | |
08dc830e | 915 | xgcc$(exeext): gcc.o gccspec.o version.o intl.o prefix.o \ |
917acb0e | 916 | version.o $(LIBDEPS) $(EXTRA_GCC_OBJS) |
08dc830e ZW |
917 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o gccspec.o intl.o \ |
918 | prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS) | |
3aa072f2 | 919 | |
4871239e | 920 | # cpp is to cpp0 as gcc is to cc1. |
922cf99e ZW |
921 | # The only difference from xgcc is that it's linked with cppspec.o |
922 | # instead of gccspec.o. | |
4871239e | 923 | cpp$(exeext): gcc.o cppspec.o version.o intl.o prefix.o \ |
922cf99e ZW |
924 | version.o $(LIBDEPS) $(EXTRA_GCC_OBJS) |
925 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o cppspec.o intl.o \ | |
926 | prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS) | |
927 | ||
3aa072f2 | 928 | # Dump a specs file to make -B./ read these specs over installed ones. |
e09e14e9 | 929 | specs: xgcc$(exeext) |
d521a023 RK |
930 | $(GCC_FOR_TARGET) -dumpspecs > tmp-specs |
931 | mv tmp-specs specs | |
79d8453e | 932 | |
acbbf3d9 | 933 | # We do want to create an executable named `xgcc', so we can use it to |
79d8453e RS |
934 | # compile libgcc2.a. |
935 | # Also create gcc-cross, so that install-common will install properly. | |
e09e14e9 | 936 | gcc-cross: xgcc$(exeext) |
aab26e16 | 937 | cp xgcc$(exeext) gcc-cross$(exeext) |
79d8453e | 938 | |
a36556a8 ZW |
939 | cc1$(exeext): $(P) $(C_OBJS) $(BACKEND) $(LIBDEPS) |
940 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1$(exeext) \ | |
941 | $(C_OBJS) $(BACKEND) $(LIBS) | |
79d8453e | 942 | |
1402d22c RS |
943 | # Build the version of limits.h that we will install. |
944 | xlimits.h: glimits.h limitx.h limity.h | |
40dc28fc | 945 | if $(LIMITS_H_TEST) ; then \ |
d521a023 | 946 | cat $(srcdir)/limitx.h $(srcdir)/glimits.h $(srcdir)/limity.h > tmp-xlimits.h; \ |
1402d22c | 947 | else \ |
d521a023 | 948 | cat $(srcdir)/glimits.h > tmp-xlimits.h; \ |
1402d22c | 949 | fi |
d521a023 | 950 | mv tmp-xlimits.h xlimits.h |
544eb21e | 951 | #\f |
79d8453e | 952 | # Build libgcc.a. |
a2ab7f2b | 953 | |
ce152ef8 | 954 | LIB2ADD = $(LIB2ADDEH) $(LIB2FUNCS_EXTRA) $(LANG_LIB2FUNCS) |
3ec83fc2 | 955 | |
34840988 | 956 | libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) xgcc$(exeext) |
3ec83fc2 RH |
957 | objext='$(objext)' \ |
958 | OLDCC='$(OLDCC)' \ | |
959 | LIBGCC1='$(LIBGCC1)' \ | |
960 | LIB1FUNCS='$(LIB1FUNCS)' \ | |
961 | LIB1ASMFUNCS='$(LIB1ASMFUNCS)' \ | |
962 | LIB1FUNCS_EXTRA='$(LIB1FUNCS_EXTRA)' \ | |
963 | LIB2FUNCS='$(LIB2FUNCS)' \ | |
964 | LIB2FUNCS_EH='$(LIB2FUNCS_EH)' \ | |
965 | LIB2ADD='$(LIB2ADD)' \ | |
966 | FPBIT='$(FPBIT)' \ | |
967 | FPBIT_FUNCS='$(FPBIT_FUNCS)' \ | |
968 | DPBIT='$(DPBIT)' \ | |
969 | DPBIT_FUNCS='$(DPBIT_FUNCS)' \ | |
970 | MULTILIBS=`$(GCC_FOR_TARGET) --print-multi-lib` \ | |
971 | EXTRA_MULTILIB_PARTS='$(EXTRA_MULTILIB_PARTS)' \ | |
50503ac8 RH |
972 | SHLIB_LINK='$(SHLIB_LINK)' \ |
973 | SHLIB_LIBS='$(SHLIB_LIBS)' \ | |
974 | SHLIB_MULTILIB='$(SHLIB_MULTILIB)' \ | |
3ec83fc2 | 975 | $(SHELL) mklibgcc > tmp-libgcc.mk |
2aceb30d JM |
976 | mv tmp-libgcc.mk libgcc.mk |
977 | ||
978 | # All the things that might cause us to want to recompile bits of libgcc. | |
979 | LIBGCC_DEPS = $(GCC_PASSES) $(LANGUAGES) stmp-int-hdrs $(STMP_FIXPROTO) \ | |
980 | libgcc.mk $(srcdir)/libgcc1.c $(srcdir)/libgcc2.c $(CONFIG_H) \ | |
981 | $(MACHMODE_H) longlong.h frame.h gbl-ctors.h config.status \ | |
50503ac8 | 982 | stmp-int-hdrs tsystem.h $(FPBIT) $(DPBIT) $(LIB2ADD) $(EXTRA_PARTS) |
3ec83fc2 | 983 | |
2aceb30d | 984 | libgcc.a: $(LIBGCC_DEPS) |
3ec83fc2 RH |
985 | $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \ |
986 | HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \ | |
987 | AR_FOR_TARGET="$(AR_FOR_TARGET)" \ | |
988 | AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \ | |
989 | AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \ | |
5b67ad6f DA |
990 | OLDCC="$(OLDCC)" CCLIBFLAGS="$(CCLIBFLAGS)" \ |
991 | CFLAGS="$(CFLAGS) $(WARN_CFLAGS)" \ | |
3ec83fc2 RH |
992 | RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)" \ |
993 | RANLIB_TEST_FOR_TARGET="$(RANLIB_TEST_FOR_TARGET)" \ | |
994 | LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" \ | |
995 | INCLUDES="$(INCLUDES)" MAYBE_USE_COLLECT2="$(MAYBE_USE_COLLECT2)" \ | |
996 | CONFIG_H="$(CONFIG_H)" MACHMODE_H="$(MACHMODE_H)" \ | |
d34cba2b | 997 | LIB1ASMSRC='$(LIB1ASMSRC)' \ |
3ec83fc2 | 998 | -f libgcc.mk all |
79d8453e | 999 | |
f6cdc7ea DE |
1000 | # Use the genmultilib shell script to generate the information the gcc |
1001 | # driver program needs to select the library directory based on the | |
1002 | # switches. | |
e5e809f4 JL |
1003 | multilib.h: s-mlib; @true |
1004 | s-mlib: $(srcdir)/genmultilib Makefile | |
961b7009 MM |
1005 | $(SHELL) $(srcdir)/genmultilib \ |
1006 | "$(MULTILIB_OPTIONS)" \ | |
1007 | "$(MULTILIB_DIRNAMES)" \ | |
1008 | "$(MULTILIB_MATCHES)" \ | |
1009 | "$(MULTILIB_EXCEPTIONS)" \ | |
0a8d6618 BC |
1010 | "$(MULTILIB_EXTRA_OPTS)" \ |
1011 | "$(MULTILIB_EXCLUSIONS)" > tmp-mlib.h | |
84c81320 | 1012 | $(SHELL) $(srcdir)/move-if-change tmp-mlib.h multilib.h |
e5e809f4 | 1013 | touch s-mlib |
f6cdc7ea DE |
1014 | |
1015 | # Build multiple copies of libgcc.a, one for each target switch. | |
2aceb30d | 1016 | stmp-multilib: $(LIBGCC_DEPS) |
ad3a9224 | 1017 | $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \ |
3ec83fc2 | 1018 | HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \ |
8f25d5cd | 1019 | AR_FOR_TARGET="$(AR_FOR_TARGET)" \ |
7bde2862 | 1020 | AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \ |
8f25d5cd | 1021 | AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \ |
5b67ad6f DA |
1022 | OLDCC="$(OLDCC)" CCLIBFLAGS="$(CCLIBFLAGS)" \ |
1023 | CFLAGS="$(CFLAGS) $(WARN_CFLAGS)" \ | |
3ec83fc2 RH |
1024 | RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)" \ |
1025 | RANLIB_TEST_FOR_TARGET="$(RANLIB_TEST_FOR_TARGET)" \ | |
1026 | LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" \ | |
1027 | INCLUDES="$(INCLUDES)" MAYBE_USE_COLLECT2="$(MAYBE_USE_COLLECT2)" \ | |
1028 | CONFIG_H="$(CONFIG_H)" MACHMODE_H="$(MACHMODE_H)" \ | |
00447f7d | 1029 | LIB1ASMSRC='$(LIB1ASMSRC)' \ |
3ec83fc2 RH |
1030 | -f libgcc.mk all |
1031 | touch stmp-multilib | |
ad3a9224 | 1032 | |
79d8453e | 1033 | # Compile two additional files that are linked with every program |
32988c4a RM |
1034 | # linked using GCC on systems using COFF or ELF, for the sake of C++ |
1035 | # constructors. | |
956d6950 | 1036 | $(T)crtbegin.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \ |
2e39bdbe | 1037 | defaults.h frame.h gbl-ctors.h stmp-int-hdrs tsystem.h |
a94dbf2c | 1038 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \ |
ac1c999f JL |
1039 | -finhibit-size-directive -fno-inline-functions \ |
1040 | -fno-exceptions $(CRTSTUFF_T_CFLAGS) @inhibit_libc@ \ | |
a94dbf2c | 1041 | -c $(srcdir)/crtstuff.c -DCRT_BEGIN -o $(T)crtbegin$(objext) |
47a22692 | 1042 | |
956d6950 | 1043 | $(T)crtend.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \ |
2e39bdbe | 1044 | defaults.h frame.h gbl-ctors.h stmp-int-hdrs tsystem.h |
a94dbf2c | 1045 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \ |
ac1c999f JL |
1046 | -finhibit-size-directive -fno-inline-functions \ |
1047 | -fno-exceptions $(CRTSTUFF_T_CFLAGS) @inhibit_libc@ \ | |
a94dbf2c | 1048 | -c $(srcdir)/crtstuff.c -DCRT_END -o $(T)crtend$(objext) |
32988c4a | 1049 | |
a9e6777f JJ |
1050 | # These are versions of crtbegin and crtend for shared libraries. |
1051 | $(T)crtbeginS.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \ | |
1052 | defaults.h frame.h gbl-ctors.h stmp-int-hdrs tsystem.h | |
1053 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \ | |
1054 | -finhibit-size-directive -fno-inline-functions \ | |
1055 | -fno-exceptions $(CRTSTUFF_T_CFLAGS_S) @inhibit_libc@ \ | |
1056 | -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFS_O \ | |
1057 | -o $(T)crtbeginS$(objext) | |
32988c4a | 1058 | |
a9e6777f | 1059 | $(T)crtendS.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \ |
2e39bdbe | 1060 | defaults.h frame.h gbl-ctors.h stmp-int-hdrs tsystem.h |
a9e6777f JJ |
1061 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \ |
1062 | -finhibit-size-directive -fno-inline-functions \ | |
1063 | -fno-exceptions $(CRTSTUFF_T_CFLAGS_S) @inhibit_libc@ \ | |
1064 | -c $(srcdir)/crtstuff.c -DCRT_END -DCRTSTUFFS_O \ | |
1065 | -o $(T)crtendS$(objext) | |
522170ca | 1066 | |
3ec83fc2 RH |
1067 | # Compile the start modules crt0.o and mcrt0.o that are linked with |
1068 | # every program | |
e5e809f4 JL |
1069 | crt0.o: s-crt0 ; @true |
1070 | mcrt0.o: s-crt0; @true | |
522170ca | 1071 | |
e5e809f4 | 1072 | s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H) |
522170ca RK |
1073 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \ |
1074 | -o crt0.o -c $(CRT0_S) | |
1075 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \ | |
1076 | -o mcrt0.o -c $(MCRT0_S) | |
e5e809f4 | 1077 | touch s-crt0 |
544eb21e | 1078 | #\f |
79d8453e RS |
1079 | # Compiling object files from source files. |
1080 | ||
1081 | # Note that dependencies on obstack.h are not written | |
1082 | # because that file is not part of GCC. | |
79d8453e RS |
1083 | |
1084 | # C language specific files. | |
1085 | ||
8f17b5c5 | 1086 | c-errors.o: c-errors.c $(CONFIG_H) system.h $(TREE_H) $(C_TREE_H) flags.h \ |
8364301f | 1087 | diagnostic.h |
0e5921e8 | 1088 | c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h $(GGC_H) intl.h \ |
8f17b5c5 | 1089 | $(C_TREE_H) input.h flags.h system.h toplev.h output.h cpplib.h |
79d8453e | 1090 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c |
0e5921e8 | 1091 | |
c09cda19 | 1092 | $(srcdir)/c-parse.c: $(srcdir)/c-parse.y |
0e5921e8 | 1093 | cd $(srcdir); $(BISON) $(BISONFLAGS) -o c-parse.c c-parse.y |
c09cda19 | 1094 | $(srcdir)/c-parse.y: c-parse.in |
49381011 | 1095 | echo '/*WARNING: This file is automatically generated!*/' >tmp-c-parse.y |
1c48d17e RS |
1096 | sed -e "/^ifobjc$$/,/^end ifobjc$$/d" \ |
1097 | -e "/^ifc$$/d" -e "/^end ifc$$/d" \ | |
49381011 | 1098 | $(srcdir)/c-parse.in >>tmp-c-parse.y |
84c81320 | 1099 | $(SHELL) $(srcdir)/move-if-change tmp-c-parse.y $(srcdir)/c-parse.y |
1c48d17e | 1100 | |
8f17b5c5 MM |
1101 | c-decl.o : c-decl.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) $(C_TREE_H) \ |
1102 | $(GGC_H) c-lex.h flags.h function.h output.h $(EXPR_H) \ | |
993c790e | 1103 | toplev.h defaults.h intl.h |
8f17b5c5 | 1104 | c-typeck.o : c-typeck.c $(CONFIG_H) system.h $(TREE_H) $(C_TREE_H) \ |
7f4edbcb | 1105 | flags.h intl.h output.h $(EXPR_H) $(RTL_H) toplev.h |
8f17b5c5 MM |
1106 | c-lang.o : c-lang.c $(CONFIG_H) system.h $(TREE_H) $(C_TREE_H) \ |
1107 | $(GGC_H) c-lex.h toplev.h diagnostic.h output.h function.h \ | |
1108 | $(RTL_H) $(EXPR_H) | |
1109 | c-lex.o : c-lex.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) c-lex.h $(C_TREE_H) \ | |
1110 | c-pragma.h input.h intl.h flags.h toplev.h output.h \ | |
1111 | mbchar.h $(GGC_H) cpplib.h $(EXPR_H) | |
1112 | c-aux-info.o : c-aux-info.c $(CONFIG_H) system.h $(TREE_H) $(C_TREE_H) \ | |
1113 | flags.h toplev.h | |
a0c8e1b2 | 1114 | c-convert.o : c-convert.c $(CONFIG_H) system.h $(TREE_H) flags.h toplev.h |
b384405b | 1115 | c-pragma.o: c-pragma.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) function.h \ |
bedda2da | 1116 | defaults.h c-pragma.h toplev.h $(GGC_H) |
0056a9b5 | 1117 | mbchar.o: mbchar.c $(CONFIG_H) system.h mbchar.h |
0c3a267b | 1118 | graph.o: graph.c $(CONFIG_H) system.h toplev.h flags.h output.h $(RTL_H) \ |
6a2cc2ac | 1119 | function.h hard-reg-set.h $(BASIC_BLOCK_H) graph.h |
efc9bd41 RK |
1120 | sbitmap.o: sbitmap.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h \ |
1121 | $(BASIC_BLOCK_H) | |
79d8453e | 1122 | |
4c457b6b | 1123 | COLLECT2_OBJS = collect2.o tlink.o hash.o intl.o underscore.o version.o |
a2d25763 | 1124 | collect2$(exeext): $(COLLECT2_OBJS) $(LIBDEPS) |
057f494b | 1125 | # Don't try modifying collect2 (aka ld) in place--it might be linking this. |
aab26e16 | 1126 | -rm -f collect2$(exeext) |
ab87f8c8 | 1127 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(COLLECT2_OBJS) $(LIBS) |
79d8453e | 1128 | |
ab87f8c8 | 1129 | collect2.o : collect2.c $(CONFIG_H) system.h gstab.h intl.h \ |
4e872036 | 1130 | $(OBSTACK_H) $(DEMANGLE_H) collect2.h version.h |
b7b08dcd | 1131 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ |
8b06b20a | 1132 | -DTARGET_MACHINE=\"$(target_alias)\" $(MAYBE_USE_COLLECT2) \ |
b7b08dcd | 1133 | -c `echo $(srcdir)/collect2.c | sed 's,^\./,,'` |
79d8453e | 1134 | |
993c790e | 1135 | tlink.o: tlink.c $(DEMANGLE_H) hash.h $(CONFIG_H) system.h collect2.h intl.h |
a0c8e1b2 | 1136 | hash.o: hash.c hash.h system.h toplev.h |
eaa41c8d | 1137 | |
0056a9b5 | 1138 | vfprintf.o: $(srcdir)/../libiberty/vfprintf.c $(CONFIG_H) system.h |
39802f41 JL |
1139 | rm -f vfprintf.c |
1140 | $(LN_S) $(srcdir)/../libiberty/vfprintf.c vfprintf.c | |
1141 | $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) vfprintf.c | |
1142 | ||
3932261a | 1143 | splay-tree.o: $(srcdir)/../libiberty/splay-tree.c \ |
0056a9b5 | 1144 | $(srcdir)/../include/splay-tree.h $(srcdir)/../include/libiberty.h |
3932261a MM |
1145 | rm -f splay-tree.c |
1146 | $(LN_S) $(srcdir)/../libiberty/splay-tree.c splay-tree.c | |
1147 | $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) splay-tree.c | |
1148 | ||
e5e809f4 | 1149 | underscore.c: s-under ; @true |
7af4e697 | 1150 | |
e5e809f4 | 1151 | s-under: $(GCC_PASSES) |
7ac16ba0 RK |
1152 | echo "int xxy_us_dummy;" >tmp-dum.c |
1153 | $(GCC_FOR_TARGET) -S tmp-dum.c | |
1154 | echo '/*WARNING: This file is automatically generated!*/' >tmp-under.c | |
1155 | if grep _xxy_us_dummy tmp-dum.s > /dev/null ; then \ | |
1156 | echo "int prepends_underscore = 1;" >>tmp-under.c; \ | |
a3184468 | 1157 | else \ |
7ac16ba0 | 1158 | echo "int prepends_underscore = 0;" >>tmp-under.c; \ |
a3184468 | 1159 | fi |
84c81320 | 1160 | $(SHELL) $(srcdir)/move-if-change tmp-under.c underscore.c |
7ac16ba0 | 1161 | -rm -f tmp-dum.c tmp-dum.s |
e5e809f4 | 1162 | touch s-under |
a3184468 | 1163 | |
79d8453e RS |
1164 | # A file used by all variants of C. |
1165 | ||
f09f1de5 | 1166 | c-common.o : c-common.c $(CONFIG_H) system.h $(TREE_H) \ |
8f17b5c5 | 1167 | $(C_COMMON_H) flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \ |
3f80e6ac | 1168 | $(EXPR_H) diagnostic.h |
79d8453e | 1169 | |
8f17b5c5 MM |
1170 | c-semantics.o : c-semantics.c $(CONFIG_H) system.h $(TREE_H) $(C_TREE_H) \ |
1171 | c-lex.h flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \ | |
f2c5f623 BC |
1172 | $(EXPR_H) |
1173 | ||
79d8453e RS |
1174 | # Language-independent files. |
1175 | ||
610c62ac | 1176 | DRIVER_DEFINES = \ |
0deb20df | 1177 | -DSTANDARD_STARTFILE_PREFIX=\"$(unlibsubdir)/\" \ |
2e494f70 | 1178 | -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \ |
964ceda1 | 1179 | -DDEFAULT_TARGET_VERSION=\"$(version)\" \ |
8b06b20a | 1180 | -DDEFAULT_TARGET_MACHINE=\"$(target_alias)\" \ |
0deb20df TT |
1181 | -DSTANDARD_BINDIR_PREFIX=\"$(bindir)/\" \ |
1182 | -DTOOLDIR_BASE_PREFIX=\"$(unlibsubdir)/../\" | |
ab87f8c8 | 1183 | gcc.o: gcc.c $(CONFIG_H) system.h intl.h multilib.h \ |
4746ee26 | 1184 | Makefile $(lang_specs_files) prefix.h $(GCC_H) |
610c62ac BK |
1185 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ |
1186 | $(DRIVER_DEFINES) \ | |
79d8453e RS |
1187 | -c `echo $(srcdir)/gcc.c | sed 's,^\./,,'` |
1188 | ||
4746ee26 KG |
1189 | gccspec.o: gccspec.c $(CONFIG_H) system.h $(GCC_H) |
1190 | cppspec.o: cppspec.c $(CONFIG_H) system.h $(GCC_H) | |
08dc830e | 1191 | |
12b195d9 | 1192 | tree-check.h: s-check ; @true |
b00c2351 | 1193 | s-check : gencheck $(srcdir)/move-if-change |
12b195d9 | 1194 | ./gencheck > tmp-check.h |
84c81320 | 1195 | $(SHELL) $(srcdir)/move-if-change tmp-check.h tree-check.h |
12b195d9 ML |
1196 | touch s-check |
1197 | ||
87d35858 | 1198 | gencheck : gencheck.o $(HOST_LIBDEPS) |
12b195d9 ML |
1199 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ |
1200 | gencheck.o $(HOST_LIBS) | |
1201 | ||
87d35858 MM |
1202 | gencheck.o : gencheck.c gencheck.h tree.def $(CONFIG_H) hconfig.h system.h \ |
1203 | $(lang_tree_files) | |
ab87f8c8 JL |
1204 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \ |
1205 | $(srcdir)/gencheck.c | |
1a4bf22f | 1206 | |
79d8453e RS |
1207 | dumpvers: dumpvers.c |
1208 | ||
4746ee26 | 1209 | version.o: version.c version.h |
0a25f1f5 | 1210 | |
d336e504 | 1211 | ggc-common.o: ggc-common.c $(CONFIG_H) $(RTL_H) $(TREE_H) \ |
bedda2da | 1212 | flags.h $(GGC_H) varray.h hash.h |
b49a6a90 | 1213 | |
d336e504 | 1214 | ggc-simple.o: ggc-simple.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \ |
614f6bc1 | 1215 | $(GGC_H) varray.h $(TIMEVAR_H) |
0a25f1f5 | 1216 | |
b9bfacf0 | 1217 | ggc-page.o: ggc-page.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h toplev.h \ |
614f6bc1 | 1218 | $(GGC_H) varray.h $(TIMEVAR_H) |
21341cfd | 1219 | |
bedda2da | 1220 | ggc-none.o: ggc-none.c $(CONFIG_H) $(RTL_H) $(GGC_H) |
0a25f1f5 | 1221 | |
bedda2da | 1222 | ggc-callbacks.o: ggc-callbacks.c $(CONFIG_H) $(RTL_H) $(TREE_H) $(GGC_H) |
03705c95 | 1223 | |
2bdfeefa JL |
1224 | obstack.o: $(srcdir)/../libiberty/obstack.c $(CONFIG_H) |
1225 | rm -f obstack.c | |
1226 | $(LN_S) $(srcdir)/../libiberty/obstack.c obstack.c | |
1227 | $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) obstack.c | |
1228 | ||
460ee112 | 1229 | prefix.o: prefix.c $(CONFIG_H) system.h Makefile prefix.h |
e9a25f70 JL |
1230 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ |
1231 | -DPREFIX=\"$(prefix)\" \ | |
1232 | -c `echo $(srcdir)/prefix.c | sed 's,^\./,,'` | |
79d8453e | 1233 | |
c5c76735 | 1234 | convert.o: convert.c $(CONFIG_H) system.h $(TREE_H) flags.h convert.h toplev.h |
c5d3565c | 1235 | |
87ff9c8e | 1236 | tree.o : tree.c $(CONFIG_H) system.h $(TREE_H) flags.h function.h toplev.h \ |
d8ea8f28 | 1237 | $(GGC_H) $(HASHTAB_H) output.h defaults.h |
bedda2da | 1238 | print-tree.o : print-tree.c $(CONFIG_H) system.h $(TREE_H) $(GGC_H) |
234042f4 | 1239 | stor-layout.o : stor-layout.c $(CONFIG_H) system.h $(TREE_H) flags.h \ |
bedda2da | 1240 | function.h $(EXPR_H) $(RTL_H) toplev.h $(GGC_H) |
efe3eb65 | 1241 | fold-const.o : fold-const.c $(CONFIG_H) system.h $(TREE_H) flags.h toplev.h \ |
345ed1fe GDR |
1242 | $(RTL_H) ggc.h |
1243 | diagnostic.o : diagnostic.c diagnostic.h \ | |
1244 | $(CONFIG_H) system.h $(TREE_H) $(RTL_H) tm_p.h flags.h \ | |
9d98a694 | 1245 | $(GGC_H) input.h $(INSN_ATTR_H) insn-codes.h insn-config.h toplev.h intl.h |
49ad7cfa | 1246 | toplev.o : toplev.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) function.h \ |
9d98a694 | 1247 | flags.h input.h $(INSN_ATTR_H) xcoffout.h defaults.h output.h diagnostic.h \ |
ab87f8c8 | 1248 | insn-codes.h insn-config.h intl.h $(RECOG_H) Makefile toplev.h dwarfout.h \ |
efc9bd41 | 1249 | dwarf2out.h sdbout.h dbxout.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \ |
b53978a3 | 1250 | graph.h loop.h except.h regs.h $(TIMEVAR_H) $(lang_options_files) ssa.h |
9c6e68c2 | 1251 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(MAYBE_USE_COLLECT2) \ |
8b06b20a | 1252 | -DTARGET_NAME=\"$(target_alias)\" \ |
b7ac21e3 | 1253 | -c `echo $(srcdir)/toplev.c | sed 's,^\./,,'` |
79d8453e | 1254 | |
bedda2da | 1255 | rtl.o : rtl.c $(CONFIG_H) system.h $(RTL_H) bitmap.h $(GGC_H) toplev.h |
79d8453e | 1256 | |
efc9bd41 RK |
1257 | print-rtl.o : print-rtl.c $(CONFIG_H) system.h $(RTL_H) hard-reg-set.h \ |
1258 | $(BASIC_BLOCK_H) | |
e35b9579 | 1259 | rtlanal.o : rtlanal.c $(CONFIG_H) system.h toplev.h $(RTL_H) |
f8b6598e | 1260 | errors.o : errors.c $(CONFIG_H) system.h errors.h |
79d8453e | 1261 | |
670ee920 | 1262 | varasm.o : varasm.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h \ |
6feacd09 | 1263 | function.h defaults.h $(EXPR_H) hard-reg-set.h $(REGS_H) \ |
bedda2da | 1264 | xcoffout.h output.h c-pragma.h toplev.h dbxout.h sdbout.h $(GGC_H) |
670ee920 | 1265 | function.o : function.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \ |
6feacd09 | 1266 | function.h insn-flags.h insn-codes.h $(EXPR_H) $(REGS_H) hard-reg-set.h \ |
bedda2da | 1267 | insn-config.h $(RECOG_H) output.h toplev.h except.h hash.h $(GGC_H) |
670ee920 | 1268 | stmt.o : stmt.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h function.h \ |
50793ea3 | 1269 | insn-flags.h insn-config.h insn-codes.h hard-reg-set.h $(EXPR_H) except.h \ |
bedda2da | 1270 | $(LOOP_H) $(RECOG_H) toplev.h output.h varray.h $(GGC_H) |
670ee920 | 1271 | except.o : except.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \ |
6feacd09 | 1272 | function.h insn-flags.h $(EXPR_H) $(REGS_H) hard-reg-set.h \ |
bedda2da | 1273 | insn-config.h $(RECOG_H) output.h except.h toplev.h intl.h $(GGC_H) |
670ee920 | 1274 | expr.o : expr.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h function.h \ |
01198c2f | 1275 | $(REGS_H) insn-flags.h insn-codes.h $(EXPR_H) insn-config.h $(RECOG_H) \ |
d7db6646 | 1276 | output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h except.h \ |
3ef1eef4 | 1277 | reload.h $(GGC_H) intl.h |
28f4ec01 BS |
1278 | builtins.o : builtins.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \ |
1279 | function.h $(REGS_H) insn-flags.h insn-codes.h $(EXPR_H) insn-config.h \ | |
1280 | $(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \ | |
1281 | except.h | |
50793ea3 | 1282 | calls.o : calls.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h $(EXPR_H) \ |
0d565768 | 1283 | insn-flags.h $(REGS_H) toplev.h output.h function.h $(TIMEVAR_H) |
670ee920 | 1284 | expmed.o : expmed.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \ |
01198c2f | 1285 | insn-flags.h insn-config.h insn-codes.h $(EXPR_H) $(RECOG_H) real.h toplev.h |
670ee920 | 1286 | explow.o : explow.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \ |
01198c2f | 1287 | hard-reg-set.h insn-config.h $(EXPR_H) $(RECOG_H) insn-flags.h \ |
11a6092b | 1288 | insn-codes.h toplev.h function.h |
670ee920 | 1289 | optabs.o : optabs.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \ |
01198c2f | 1290 | insn-flags.h insn-config.h insn-codes.h $(EXPR_H) $(RECOG_H) reload.h \ |
d8ea8f28 | 1291 | toplev.h $(GGC_H) real.h defaults.h |
6feacd09 | 1292 | dbxout.o : dbxout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h $(REGS_H) \ |
487a6e06 | 1293 | insn-config.h reload.h gstab.h xcoffout.h defaults.h output.h dbxout.h \ |
4746ee26 | 1294 | toplev.h |
670ee920 | 1295 | sdbout.o : sdbout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h except.h \ |
6feacd09 | 1296 | function.h $(EXPR_H) output.h hard-reg-set.h $(REGS_H) defaults.h real.h \ |
4e872036 | 1297 | insn-config.h $(OBSTACK_H) xcoffout.h c-pragma.h \ |
2bdfeefa | 1298 | sdbout.h toplev.h |
670ee920 | 1299 | dwarfout.o : dwarfout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) dwarf.h \ |
c478efd1 | 1300 | flags.h insn-config.h reload.h output.h defaults.h toplev.h dwarfout.h |
670ee920 | 1301 | dwarf2out.o : dwarf2out.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) dwarf2.h \ |
50793ea3 | 1302 | flags.h insn-config.h reload.h output.h defaults.h \ |
1865dbb5 | 1303 | hard-reg-set.h $(REGS_H) $(EXPR_H) toplev.h dwarf2out.h varray.h \ |
bedda2da | 1304 | $(GGC_H) except.h |
670ee920 | 1305 | xcoffout.o : xcoffout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) xcoffout.h \ |
bedda2da | 1306 | flags.h toplev.h output.h dbxout.h $(GGC_H) |
670ee920 | 1307 | emit-rtl.o : emit-rtl.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \ |
bedda2da | 1308 | function.h $(REGS_H) insn-config.h $(RECOG_H) real.h $(GGC_H) \ |
c13e8210 | 1309 | $(EXPR_H) $(srcdir)/../include/obstack.h hard-reg-set.h bitmap.h toplev.h \ |
d8ea8f28 | 1310 | $(HASHTAB_H) defaults.h |
a0c8e1b2 | 1311 | real.o : real.c $(CONFIG_H) system.h $(TREE_H) toplev.h |
670ee920 | 1312 | integrate.o : integrate.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \ |
a6873608 | 1313 | $(INTEGRATE_H) insn-flags.h insn-config.h $(EXPR_H) real.h $(REGS_H) \ |
4dc9341c | 1314 | intl.h function.h output.h $(RECOG_H) except.h toplev.h $(LOOP_H) |
6feacd09 | 1315 | jump.o : jump.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h $(REGS_H) \ |
49ad7cfa | 1316 | insn-config.h insn-flags.h $(RECOG_H) $(EXPR_H) real.h except.h function.h \ |
9d98a694 | 1317 | toplev.h $(INSN_ATTR_H) |
79d8453e | 1318 | |
0cedb36c JL |
1319 | simplify-rtx.o : simplify-rtx.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) \ |
1320 | hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \ | |
4e872036 | 1321 | output.h function.h cselib.h ggc.h $(OBSTACK_H) |
6feacd09 | 1322 | cse.o : cse.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h flags.h \ |
630c79be BS |
1323 | real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h output.h function.h \ |
1324 | $(BASIC_BLOCK_H) $(GGC_H) | |
01198c2f ZW |
1325 | gcse.o : gcse.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h \ |
1326 | flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) \ | |
49ad7cfa | 1327 | function.h output.h toplev.h |
0a1c58a2 JL |
1328 | sibcall.o : sibcall.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) function.h \ |
1329 | hard-reg-set.h flags.h insn-config.h $(RECOG_H) $(BASIC_BLOCK_H) | |
1841f23b | 1330 | resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h system.h \ |
7bdb32b9 | 1331 | $(BASIC_BLOCK_H) $(REGS_H) flags.h output.h resource.h function.h toplev.h \ |
9d98a694 | 1332 | $(INSN_ATTR_H) except.h |
d2ecda27 | 1333 | lcm.o : lcm.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h flags.h \ |
9d98a694 | 1334 | real.h insn-config.h $(INSN_ATTR_H) $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) |
b53978a3 JO |
1335 | ssa.o : ssa.c $(CONFIG_H) system.h $(REGS_H) varray.h \ |
1336 | hard-reg-set.h flags.h function.h real.h insn-config.h $(RECOG_H) \ | |
1337 | $(BASIC_BLOCK_H) output.h ssa.h | |
1338 | dce.o : dce.c $(CONFIG_H) system.h $(RTL_H) hard-reg-set.h $(BASIC_BLOCK_H) \ | |
1339 | ssa.h insn-config.h $(RECOG_H) output.h | |
03492bae | 1340 | conflict.o : conflict.c $(CONFIG_H) system.h $(OBSTACK_H) $(HASHTAB_H) \ |
efc9bd41 RK |
1341 | $(RTL_H) hard-reg-set.h $(BASIC_BLOCK_H) |
1342 | profile.o : profile.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \ | |
1343 | insn-flags.h insn-config.h output.h $(REGS_H) $(EXPR_H) function.h \ | |
d8ea8f28 | 1344 | gcov-io.h toplev.h $(GGC_H) hard-reg-set.h $(BASIC_BLOCK_H) defaults.h |
4dc9341c | 1345 | loop.o : loop.c $(CONFIG_H) system.h $(RTL_H) flags.h $(LOOP_H) insn-config.h \ |
6feacd09 | 1346 | insn-flags.h $(REGS_H) hard-reg-set.h $(RECOG_H) $(EXPR_H) real.h \ |
eab5c70a | 1347 | $(BASIC_BLOCK_H) function.h toplev.h varray.h except.h cselib.h |
5527bf14 RH |
1348 | doloop.o : doloop.c $(CONFIG_H) system.h $(RTL_H) flags.h $(LOOP_H) \ |
1349 | insn-flags.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) | |
49ad7cfa | 1350 | unroll.o : unroll.c $(CONFIG_H) system.h $(RTL_H) insn-config.h function.h \ |
a6873608 | 1351 | $(INTEGRATE_H) $(REGS_H) $(RECOG_H) flags.h $(EXPR_H) $(LOOP_H) toplev.h \ |
efc9bd41 | 1352 | hard-reg-set.h varray.h $(BASIC_BLOCK_H) |
d3a923ee | 1353 | flow.o : flow.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h insn-config.h \ |
43849fa9 | 1354 | $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \ |
b53978a3 | 1355 | insn-flags.h function.h except.h $(EXPR_H) ssa.h |
49ad7cfa | 1356 | combine.o : combine.c $(CONFIG_H) system.h $(RTL_H) flags.h function.h \ |
9d98a694 | 1357 | insn-config.h insn-flags.h insn-codes.h $(INSN_ATTR_H) $(REGS_H) $(EXPR_H) \ |
2e107e9e | 1358 | $(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h toplev.h |
670ee920 | 1359 | regclass.o : regclass.c $(CONFIG_H) system.h $(RTL_H) hard-reg-set.h flags.h \ |
49ad7cfa | 1360 | $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(RECOG_H) reload.h real.h \ |
bedda2da | 1361 | toplev.h function.h output.h $(GGC_H) |
670ee920 | 1362 | local-alloc.o : local-alloc.c $(CONFIG_H) system.h $(RTL_H) flags.h \ |
49ad7cfa | 1363 | $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \ |
9d98a694 | 1364 | output.h function.h $(INSN_ATTR_H) toplev.h |
670ee920 | 1365 | bitmap.o : bitmap.c $(CONFIG_H) system.h $(RTL_H) flags.h $(BASIC_BLOCK_H) \ |
6feacd09 | 1366 | $(REGS_H) |
49ad7cfa | 1367 | global.o : global.c $(CONFIG_H) system.h $(RTL_H) flags.h reload.h function.h \ |
6feacd09 MM |
1368 | $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h output.h toplev.h |
1369 | varray.o : varray.c $(CONFIG_H) system.h varray.h $(RTL_H) $(TREE_H) bitmap.h | |
50793ea3 | 1370 | reload.o : reload.c $(CONFIG_H) system.h $(RTL_H) flags.h output.h $(EXPR_H) \ |
6feacd09 | 1371 | reload.h $(RECOG_H) hard-reg-set.h insn-config.h insn-codes.h $(REGS_H) \ |
49ad7cfa | 1372 | function.h real.h toplev.h |
50793ea3 | 1373 | reload1.o : reload1.c $(CONFIG_H) system.h $(RTL_H) real.h flags.h $(EXPR_H) \ |
6feacd09 | 1374 | reload.h $(REGS_H) hard-reg-set.h insn-config.h insn-flags.h insn-codes.h \ |
eab5c70a | 1375 | $(BASIC_BLOCK_H) $(RECOG_H) output.h function.h toplev.h cselib.h |
670ee920 | 1376 | caller-save.o : caller-save.c $(CONFIG_H) system.h $(RTL_H) flags.h \ |
49ad7cfa | 1377 | $(REGS_H) hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) function.h \ |
50793ea3 | 1378 | $(RECOG_H) reload.h $(EXPR_H) toplev.h |
670ee920 | 1379 | reorg.o : reorg.c $(CONFIG_H) system.h $(RTL_H) conditions.h hard-reg-set.h \ |
9d98a694 | 1380 | $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(INSN_ATTR_H) insn-flags.h \ |
49ad7cfa | 1381 | $(RECOG_H) function.h flags.h output.h $(EXPR_H) toplev.h |
52fe52e2 | 1382 | alias.o : alias.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h \ |
bedda2da | 1383 | $(REGS_H) toplev.h output.h $(EXPR_H) insn-flags.h $(GGC_H) function.h \ |
037a1740 | 1384 | cselib.h $(TREE_H) |
670ee920 | 1385 | regmove.o : regmove.c $(CONFIG_H) system.h $(RTL_H) insn-config.h \ |
4b983fdc | 1386 | $(RECOG_H) output.h $(REGS_H) hard-reg-set.h flags.h function.h \ |
50793ea3 | 1387 | $(EXPR_H) insn-flags.h $(BASIC_BLOCK_H) toplev.h |
7b5efe21 | 1388 | haifa-sched.o : haifa-sched.c $(CONFIG_H) system.h $(RTL_H) \ |
49ad7cfa | 1389 | $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \ |
9d98a694 | 1390 | $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h |
ab87f8c8 | 1391 | final.o : final.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h intl.h \ |
9d98a694 | 1392 | $(REGS_H) $(RECOG_H) conditions.h insn-config.h $(INSN_ATTR_H) function.h \ |
49ad7cfa BS |
1393 | real.h output.h hard-reg-set.h insn-flags.h insn-codes.h gstab.h except.h \ |
1394 | xcoffout.h defaults.h toplev.h reload.h dwarfout.h dwarf2out.h sdbout.h \ | |
be1bb652 | 1395 | dbxout.h $(BASIC_BLOCK_H) |
294ffb37 | 1396 | recog.o : recog.c $(CONFIG_H) system.h $(RTL_H) function.h $(BASIC_BLOCK_H) \ |
9d98a694 | 1397 | $(REGS_H) $(RECOG_H) hard-reg-set.h flags.h insn-config.h $(INSN_ATTR_H) \ |
23280139 | 1398 | insn-flags.h insn-codes.h real.h toplev.h output.h |
43849fa9 | 1399 | reg-stack.o : reg-stack.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) $(RECOG_H) \ |
49ad7cfa | 1400 | $(REGS_H) hard-reg-set.h flags.h insn-config.h insn-flags.h toplev.h \ |
ede7cd44 | 1401 | varray.h function.h |
f1ebdfc5 JE |
1402 | predict.o: predict.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \ |
1403 | insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \ | |
d3de1cf7 | 1404 | $(RECOG_H) insn-flags.h function.h except.h $(EXPR_H) |
bedda2da | 1405 | lists.o: lists.c $(CONFIG_H) system.h toplev.h $(RTL_H) $(GGC_H) |
295ae817 JE |
1406 | bb-reorder.o : bb-reorder.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \ |
1407 | insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \ | |
1408 | $(RECOG_H) insn-flags.h function.h except.h $(EXPR_H) | |
993c790e | 1409 | timevar.o : timevar.c $(CONFIG_H) system.h $(TIMEVAR_H) flags.h intl.h |
7b82b5da SC |
1410 | regrename.o : regrename.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \ |
1411 | insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h \ | |
1412 | $(RECOG_H) function.h resource.h | |
9ec6d7ab RH |
1413 | ifcvt.o : ifcvt.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) \ |
1414 | flags.h insn-config.h function.h $(RECOG_H) $(BASIC_BLOCK_H) $(EXPR_H) \ | |
1415 | output.h | |
8f17b5c5 MM |
1416 | dependence.o : dependence.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) \ |
1417 | $(C_COMMON_H) flags.h varray.h $(EXPR_H) | |
d061bc1e | 1418 | |
bedda2da | 1419 | $(out_object_file): $(out_file) $(CONFIG_H) $(TREE_H) $(GGC_H) \ |
6feacd09 | 1420 | $(RTL_H) $(REGS_H) hard-reg-set.h real.h insn-config.h conditions.h \ |
9d98a694 | 1421 | insn-flags.h output.h $(INSN_ATTR_H) insn-codes.h system.h toplev.h function.h |
9c6e68c2 | 1422 | $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(out_file) |
79d8453e | 1423 | |
4e0db2ce RK |
1424 | # Build auxiliary files that support ecoff format. |
1425 | mips-tfile: mips-tfile.o version.o $(LIBDEPS) | |
aab26e16 | 1426 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tfile.o version.o $(LIBS) |
4e0db2ce | 1427 | |
9f8f4efe | 1428 | mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H) system.h version.h |
4e0db2ce RK |
1429 | |
1430 | mips-tdump: mips-tdump.o version.o $(LIBDEPS) | |
aab26e16 | 1431 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tdump.o version.o $(LIBS) |
4e0db2ce | 1432 | |
90fbb8c9 | 1433 | mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) system.h |
4e0db2ce | 1434 | |
579d0ecf | 1435 | # Build file to support OSF/rose half-pic format. |
b04cd507 | 1436 | halfpic.o: halfpic.c $(CONFIG_H) $(RTL_H) $(TREE_H) system.h |
579d0ecf | 1437 | |
79d8453e RS |
1438 | # Normally this target is not used; but it is used if you |
1439 | # define ALLOCA=alloca.o. In that case, you must get a suitable alloca.c | |
1440 | # from the GNU Emacs distribution. | |
39802f41 JL |
1441 | alloca.o: $(srcdir)/../libiberty/alloca.c |
1442 | rm -f alloca.c | |
1443 | $(LN_S) $(srcdir)/../libiberty/alloca.c alloca.c | |
79d8453e | 1444 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(ALLOCA_FLAGS) \ |
39802f41 | 1445 | -c `echo alloca.c | sed 's,^\./,,'` |
79d8453e | 1446 | $(ALLOCA_FINISH) |
544eb21e | 1447 | #\f |
4c457b6b | 1448 | # Generate header and source files from the machine description, |
79d8453e RS |
1449 | # and compile them. |
1450 | ||
1451 | .PRECIOUS: insn-config.h insn-flags.h insn-codes.h \ | |
1452 | insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c \ | |
1453 | insn-attr.h insn-attrtab.c | |
1454 | ||
1455 | # The following pair of rules has this effect: | |
1456 | # genconfig is run only if the md has changed since genconfig was last run; | |
1457 | # but the file insn-config.h is touched only when its contents actually change. | |
1458 | ||
1459 | # Each of the other insn-* files is handled by a similar pair of rules. | |
1460 | ||
1402d22c | 1461 | # This causes an anomaly in the results of make -n |
e5e809f4 | 1462 | # because insn-* is older than s-* |
1402d22c RS |
1463 | # and thus make -n thinks that insn-* will be updated |
1464 | # and force recompilation of things that depend on it. | |
424aa086 | 1465 | # We use move-if-change precisely to avoid such recompilation. |
1402d22c RS |
1466 | # But there is no way to teach make -n that it will be avoided. |
1467 | ||
79d8453e RS |
1468 | # Each of the insn-*.[ch] rules has a semicolon at the end, |
1469 | # for otherwise the system Make on SunOS 4.1 never tries | |
7bd95cc1 BK |
1470 | # to recompile insn-*.o. To avoid problems and extra noise from |
1471 | # versions of make which don't like empty commands (nothing after the | |
1472 | # trailing `;'), we call true for each. | |
79d8453e | 1473 | |
e5e809f4 JL |
1474 | insn-config.h: s-config ; @true |
1475 | s-config : $(md_file) genconfig $(srcdir)/move-if-change | |
7ac16ba0 | 1476 | ./genconfig $(md_file) > tmp-config.h |
84c81320 | 1477 | $(SHELL) $(srcdir)/move-if-change tmp-config.h insn-config.h |
e5e809f4 | 1478 | touch s-config |
79d8453e | 1479 | |
e5e809f4 JL |
1480 | insn-flags.h: s-flags ; @true |
1481 | s-flags : $(md_file) genflags $(srcdir)/move-if-change | |
7ac16ba0 | 1482 | ./genflags $(md_file) > tmp-flags.h |
84c81320 | 1483 | $(SHELL) $(srcdir)/move-if-change tmp-flags.h insn-flags.h |
e5e809f4 | 1484 | touch s-flags |
79d8453e | 1485 | |
e5e809f4 JL |
1486 | insn-codes.h: s-codes ; @true |
1487 | s-codes : $(md_file) gencodes $(srcdir)/move-if-change | |
7ac16ba0 | 1488 | ./gencodes $(md_file) > tmp-codes.h |
84c81320 | 1489 | $(SHELL) $(srcdir)/move-if-change tmp-codes.h insn-codes.h |
e5e809f4 | 1490 | touch s-codes |
79d8453e | 1491 | |
50793ea3 | 1492 | insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) $(EXPR_H) real.h output.h \ |
43849fa9 HPN |
1493 | insn-config.h insn-flags.h insn-codes.h system.h reload.h $(RECOG_H) \ |
1494 | function.h flags.h hard-reg-set.h resource.h | |
79d8453e RS |
1495 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c |
1496 | ||
e5e809f4 JL |
1497 | insn-emit.c: s-emit ; @true |
1498 | s-emit : $(md_file) genemit $(srcdir)/move-if-change | |
7ac16ba0 | 1499 | ./genemit $(md_file) > tmp-emit.c |
84c81320 | 1500 | $(SHELL) $(srcdir)/move-if-change tmp-emit.c insn-emit.c |
e5e809f4 | 1501 | touch s-emit |
79d8453e | 1502 | |
956d6950 | 1503 | insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h $(RECOG_H) \ |
b1afd7f4 | 1504 | real.h output.h flags.h system.h function.h hard-reg-set.h resource.h |
79d8453e RS |
1505 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-recog.c |
1506 | ||
e5e809f4 JL |
1507 | insn-recog.c: s-recog ; @true |
1508 | s-recog : $(md_file) genrecog $(srcdir)/move-if-change | |
7ac16ba0 | 1509 | ./genrecog $(md_file) > tmp-recog.c |
84c81320 | 1510 | $(SHELL) $(srcdir)/move-if-change tmp-recog.c insn-recog.c |
e5e809f4 | 1511 | touch s-recog |
79d8453e | 1512 | |
118bdbf8 | 1513 | insn-opinit.o : insn-opinit.c $(CONFIG_H) $(RTL_H) insn-codes.h insn-flags.h \ |
50793ea3 | 1514 | insn-config.h flags.h $(RECOG_H) $(EXPR_H) reload.h system.h |
118bdbf8 RK |
1515 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-opinit.c |
1516 | ||
e5e809f4 JL |
1517 | insn-opinit.c: s-opinit ; @true |
1518 | s-opinit : $(md_file) genopinit $(srcdir)/move-if-change | |
7ac16ba0 | 1519 | ./genopinit $(md_file) > tmp-opinit.c |
84c81320 | 1520 | $(SHELL) $(srcdir)/move-if-change tmp-opinit.c insn-opinit.c |
e5e809f4 | 1521 | touch s-opinit |
118bdbf8 | 1522 | |
0a578fee | 1523 | insn-extract.o : insn-extract.c $(CONFIG_H) $(RTL_H) system.h toplev.h \ |
43849fa9 | 1524 | insn-config.h $(RECOG_H) |
79d8453e RS |
1525 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-extract.c |
1526 | ||
e5e809f4 JL |
1527 | insn-extract.c: s-extract ; @true |
1528 | s-extract : $(md_file) genextract $(srcdir)/move-if-change | |
7ac16ba0 | 1529 | ./genextract $(md_file) > tmp-extract.c |
84c81320 | 1530 | $(SHELL) $(srcdir)/move-if-change tmp-extract.c insn-extract.c |
e5e809f4 | 1531 | touch s-extract |
79d8453e | 1532 | |
7f7f8214 | 1533 | insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) $(REGS_H) output.h real.h \ |
43849fa9 | 1534 | system.h insn-config.h $(RECOG_H) except.h function.h |
79d8453e RS |
1535 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-peep.c |
1536 | ||
e5e809f4 JL |
1537 | insn-peep.c: s-peep ; @true |
1538 | s-peep : $(md_file) genpeep $(srcdir)/move-if-change | |
7ac16ba0 | 1539 | ./genpeep $(md_file) > tmp-peep.c |
84c81320 | 1540 | $(SHELL) $(srcdir)/move-if-change tmp-peep.c insn-peep.c |
e5e809f4 | 1541 | touch s-peep |
79d8453e | 1542 | |
114791ea | 1543 | insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(RTL_H) $(REGS_H) real.h \ |
9d98a694 | 1544 | output.h $(INSN_ATTR_H) insn-config.h system.h toplev.h $(RECOG_H) |
79d8453e RS |
1545 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-attrtab.c |
1546 | ||
e5e809f4 JL |
1547 | insn-attr.h: s-attr ; @true |
1548 | s-attr : $(md_file) genattr $(srcdir)/move-if-change | |
7ac16ba0 | 1549 | ./genattr $(md_file) > tmp-attr.h |
84c81320 | 1550 | $(SHELL) $(srcdir)/move-if-change tmp-attr.h insn-attr.h |
e5e809f4 | 1551 | touch s-attr |
79d8453e | 1552 | |
e5e809f4 JL |
1553 | insn-attrtab.c: s-attrtab ; @true |
1554 | s-attrtab : $(md_file) genattrtab $(srcdir)/move-if-change | |
5b4146bd | 1555 | ./genattrtab $(md_file) > tmp-attrtab.c |
84c81320 | 1556 | $(SHELL) $(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c |
e5e809f4 | 1557 | touch s-attrtab |
79d8453e | 1558 | |
bedda2da | 1559 | insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) $(GGC_H) $(REGS_H) real.h \ |
9d98a694 | 1560 | conditions.h hard-reg-set.h insn-config.h insn-flags.h $(INSN_ATTR_H) \ |
3bc9f12b | 1561 | output.h $(RECOG_H) function.h insn-codes.h system.h toplev.h flags.h |
79d8453e RS |
1562 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c |
1563 | ||
e5e809f4 JL |
1564 | insn-output.c: s-output ; @true |
1565 | s-output : $(md_file) genoutput $(srcdir)/move-if-change | |
7ac16ba0 | 1566 | ./genoutput $(md_file) > tmp-output.c |
84c81320 | 1567 | $(SHELL) $(srcdir)/move-if-change tmp-output.c insn-output.c |
e5e809f4 | 1568 | touch s-output |
3b80f6ca | 1569 | |
bedda2da | 1570 | genrtl.o : genrtl.c $(CONFIG_H) $(RTL_H) system.h $(GGC_H) |
e5e809f4 | 1571 | genrtl.c genrtl.h : s-genrtl |
a3f80023 AS |
1572 | @true # force gnu make to recheck modification times. |
1573 | ||
e5e809f4 | 1574 | s-genrtl: gengenrtl $(srcdir)/move-if-change $(RTL_BASE_H) |
c5c76735 | 1575 | ./gengenrtl -h >tmp-genrtl.h |
84c81320 | 1576 | $(SHELL) $(srcdir)/move-if-change tmp-genrtl.h genrtl.h |
c5c76735 | 1577 | ./gengenrtl >tmp-genrtl.c |
84c81320 | 1578 | $(SHELL) $(srcdir)/move-if-change tmp-genrtl.c genrtl.c |
e5e809f4 | 1579 | touch s-genrtl |
544eb21e | 1580 | #\f |
79d8453e RS |
1581 | # Compile the programs that generate insn-* from the machine description. |
1582 | # They are compiled with $(HOST_CC), and associated libraries, | |
1583 | # since they need to run on this machine | |
1584 | # even if GCC is being compiled to run on some other machine. | |
1585 | ||
1586 | # $(CONFIG_H) is omitted from the deps of the gen*.o | |
4c457b6b | 1587 | # because these programs don't really depend on anything |
79d8453e RS |
1588 | # about the target machine. They do depend on config.h itself, |
1589 | # since that describes the host machine. | |
1590 | ||
c3efc7c4 | 1591 | # Pass the md file through cpp if the target requests it. |
aa90345a RK |
1592 | $(MD_FILE): $(MD_DEPS) |
1593 | rm -f $@ | |
7ac16ba0 | 1594 | $(MD_CPP) $(MD_CPPFLAGS) $(md_file) | sed 's/^# /; /g' > tmp-$@ |
d521a023 | 1595 | mv tmp-$@ $@ |
c3efc7c4 | 1596 | |
3916d6d8 | 1597 | gensupport.o: gensupport.c $(RTL_H) $(OBSTACK_H) system.h errors.h gensupport.h |
592f1241 | 1598 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gensupport.c |
3916d6d8 | 1599 | |
f8b6598e | 1600 | genconfig : genconfig.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS) |
aab26e16 | 1601 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ |
f8b6598e | 1602 | genconfig.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS) |
79d8453e | 1603 | |
3916d6d8 RH |
1604 | genconfig.o : genconfig.c $(RTL_H) $(build_xm_file) \ |
1605 | system.h errors.h gensupport.h | |
79d8453e RS |
1606 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c |
1607 | ||
f8b6598e | 1608 | genflags : genflags.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS) |
aab26e16 | 1609 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ |
f8b6598e | 1610 | genflags.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS) |
79d8453e | 1611 | |
3916d6d8 RH |
1612 | genflags.o : genflags.c $(RTL_H) $(OBSTACK_H) $(build_xm_file) \ |
1613 | system.h errors.h gensupport.h | |
79d8453e RS |
1614 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c |
1615 | ||
f8b6598e | 1616 | gencodes : gencodes.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS) |
aab26e16 | 1617 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ |
f8b6598e | 1618 | gencodes.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS) |
79d8453e | 1619 | |
3916d6d8 RH |
1620 | gencodes.o : gencodes.c $(RTL_H) $(build_xm_file) \ |
1621 | system.h errors.h gensupport.h | |
79d8453e RS |
1622 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c |
1623 | ||
f8b6598e | 1624 | genemit : genemit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS) |
aab26e16 | 1625 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ |
f8b6598e | 1626 | genemit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS) |
79d8453e | 1627 | |
3916d6d8 | 1628 | genemit.o : genemit.c $(RTL_H) $(build_xm_file) system.h errors.h gensupport.h |
79d8453e RS |
1629 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c |
1630 | ||
f8b6598e | 1631 | genopinit : genopinit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS) |
aab26e16 | 1632 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ |
f8b6598e | 1633 | genopinit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS) |
118bdbf8 | 1634 | |
3916d6d8 RH |
1635 | genopinit.o : genopinit.c $(RTL_H) $(build_xm_file) \ |
1636 | system.h errors.h gensupport.h | |
118bdbf8 RK |
1637 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genopinit.c |
1638 | ||
f8b6598e | 1639 | genrecog : genrecog.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS) |
aab26e16 | 1640 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ |
f8b6598e | 1641 | genrecog.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS) |
79d8453e | 1642 | |
3916d6d8 RH |
1643 | genrecog.o : genrecog.c $(RTL_H) $(build_xm_file) \ |
1644 | system.h errors.h gensupport.h | |
1645 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c | |
f8b6598e | 1646 | genextract : genextract.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS) |
aab26e16 | 1647 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ |
f8b6598e | 1648 | genextract.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS) |
79d8453e | 1649 | |
3916d6d8 RH |
1650 | genextract.o : genextract.c $(RTL_H) $(build_xm_file) \ |
1651 | system.h insn-config.h errors.h gensupport.h | |
79d8453e RS |
1652 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c |
1653 | ||
f8b6598e | 1654 | genpeep : genpeep.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS) |
aab26e16 | 1655 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ |
f8b6598e | 1656 | genpeep.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS) |
79d8453e | 1657 | |
3916d6d8 | 1658 | genpeep.o : genpeep.c $(RTL_H) $(build_xm_file) system.h errors.h gensupport.h |
79d8453e RS |
1659 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c |
1660 | ||
f8b6598e | 1661 | genattr : genattr.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS) |
aab26e16 | 1662 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ |
f8b6598e | 1663 | genattr.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS) |
79d8453e | 1664 | |
3916d6d8 | 1665 | genattr.o : genattr.c $(RTL_H) $(build_xm_file) system.h errors.h gensupport.h |
79d8453e RS |
1666 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c |
1667 | ||
b5ee7789 | 1668 | genattrtab : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS) |
aab26e16 | 1669 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ |
b5ee7789 | 1670 | genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS) |
79d8453e | 1671 | |
3916d6d8 RH |
1672 | genattrtab.o : genattrtab.c $(RTL_H) $(OBSTACK_H) $(build_xm_file) \ |
1673 | system.h errors.h $(GGC_H) gensupport.h | |
79d8453e RS |
1674 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c |
1675 | ||
f8b6598e | 1676 | genoutput : genoutput.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS) |
aab26e16 | 1677 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ |
f8b6598e | 1678 | genoutput.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS) |
79d8453e | 1679 | |
3916d6d8 RH |
1680 | genoutput.o : genoutput.c $(RTL_H) $(build_xm_file) \ |
1681 | system.h errors.h gensupport.h | |
79d8453e | 1682 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c |
3b80f6ca RH |
1683 | |
1684 | gengenrtl : gengenrtl.o $(HOST_LIBDEPS) | |
1685 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ | |
1686 | gengenrtl.o $(HOST_LIBS) | |
1687 | ||
43849fa9 | 1688 | gengenrtl.o : gengenrtl.c $(RTL_BASE_H) system.h real.h |
3b80f6ca | 1689 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gengenrtl.c |
544eb21e | 1690 | #\f |
79d8453e RS |
1691 | # Compile the libraries to be used by gen*. |
1692 | # If we are not cross-building, gen* use the same .o's that cc1 will use, | |
1693 | # and HOST_PREFIX_1 is `foobar', just to ensure these rules don't conflict | |
1694 | # with the rules for rtl.o, alloca.o, etc. | |
ca76ec07 | 1695 | $(HOST_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(CONFIG_H) system.h $(RTL_H) \ |
bedda2da | 1696 | bitmap.h $(GGC_H) toplev.h |
79d8453e | 1697 | rm -f $(HOST_PREFIX)rtl.c |
057f494b | 1698 | sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtl.c > $(HOST_PREFIX)rtl.c |
79d8453e RS |
1699 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtl.c |
1700 | ||
294ffb37 AO |
1701 | $(HOST_PREFIX_1)print-rtl.o: $(srcdir)/print-rtl.c $(CONFIG_H) \ |
1702 | $(RTL_H) $(BASIC_BLOCK_H) system.h | |
d3614a37 | 1703 | rm -f $(HOST_PREFIX)print-rtl.c |
057f494b | 1704 | sed -e 's/config[.]h/hconfig.h/' $(srcdir)/print-rtl.c > $(HOST_PREFIX)print-rtl.c |
d3614a37 RS |
1705 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)print-rtl.c |
1706 | ||
0dfa1860 | 1707 | $(HOST_PREFIX_1)bitmap.o: $(srcdir)/bitmap.c $(CONFIG_H) system.h $(RTL_H) \ |
efc9bd41 | 1708 | flags.h bitmap.h |
0dfa1860 MM |
1709 | rm -f $(HOST_PREFIX)bitmap.c |
1710 | sed -e 's/config[.]h/hconfig.h/' $(srcdir)/bitmap.c > $(HOST_PREFIX)bitmap.c | |
1711 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)bitmap.c | |
1712 | ||
ca76ec07 | 1713 | $(HOST_PREFIX_1)rtlanal.o: $(srcdir)/rtlanal.c $(CONFIG_H) system.h $(RTL_H) |
79d8453e | 1714 | rm -f $(HOST_PREFIX)rtlanal.c |
057f494b | 1715 | sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtlanal.c > $(HOST_PREFIX)rtlanal.c |
79d8453e RS |
1716 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtlanal.c |
1717 | ||
39802f41 | 1718 | $(HOST_PREFIX_1)alloca.o: $(srcdir)/../libiberty/alloca.c |
79d8453e | 1719 | rm -f $(HOST_PREFIX)alloca.c |
39802f41 | 1720 | $(LN_S) $(srcdir)/../libiberty/alloca.c $(HOST_PREFIX)alloca.c |
79d8453e RS |
1721 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)alloca.c |
1722 | ||
ca76ec07 | 1723 | $(HOST_PREFIX_1)obstack.o: $(srcdir)/../libiberty/obstack.c $(CONFIG_H) |
79d8453e | 1724 | rm -f $(HOST_PREFIX)obstack.c |
2bdfeefa | 1725 | sed -e 's/config[.]h/hconfig.h/' $(srcdir)/../libiberty/obstack.c > $(HOST_PREFIX)obstack.c |
79d8453e RS |
1726 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)obstack.c |
1727 | ||
2a63377c | 1728 | $(HOST_PREFIX_1)vfprintf.o: $(srcdir)/../libiberty/vfprintf.c |
76b4b31e | 1729 | rm -f $(HOST_PREFIX)vfprintf.c |
39802f41 | 1730 | sed -e 's/config[.]h/hconfig.h/' $(srcdir)/../libiberty/vfprintf.c > $(HOST_PREFIX)vfprintf.c |
76b4b31e KG |
1731 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)vfprintf.c |
1732 | ||
1733 | $(HOST_PREFIX_1)doprint.o: doprint.c | |
1734 | rm -f $(HOST_PREFIX)doprint.c | |
1735 | sed -e 's/config[.]h/hconfig.h/' $(srcdir)/doprint.c > $(HOST_PREFIX)doprint.c | |
1736 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)doprint.c | |
1737 | ||
79d8453e RS |
1738 | $(HOST_PREFIX_1)malloc.o: malloc.c |
1739 | rm -f $(HOST_PREFIX)malloc.c | |
057f494b | 1740 | sed -e 's/config[.]h/hconfig.h/' $(srcdir)/malloc.c > $(HOST_PREFIX)malloc.c |
79d8453e RS |
1741 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)malloc.c |
1742 | ||
f8b6598e ZW |
1743 | $(HOST_PREFIX_1)errors.o: errors.c |
1744 | rm -f $(HOST_PREFIX)errors.c | |
1745 | sed -e 's/config[.]h/hconfig.h/' $(srcdir)/errors.c > $(HOST_PREFIX)errors.c | |
1746 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)errors.c | |
1747 | ||
1748 | ||
79d8453e RS |
1749 | # This satisfies the dependency that we get if you cross-compile a compiler |
1750 | # that does not need to compile alloca, malloc or whatever. | |
4c457b6b | 1751 | $(HOST_PREFIX_1): |
79d8453e | 1752 | touch $(HOST_PREFIX_1) |
ca695ac9 | 1753 | |
d7160de9 | 1754 | $(HOST_PREFIX_1)ggc-none.o: ggc-none.c |
13aa2d05 JL |
1755 | rm -f $(HOST_PREFIX)ggc-none.c |
1756 | sed -e 's/config[.]h/hconfig.h/' $(srcdir)/ggc-none.c > $(HOST_PREFIX)ggc-none.c | |
1757 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)ggc-none.c | |
d7160de9 | 1758 | |
ab87f8c8 JL |
1759 | #\f |
1760 | # Remake internationalization support. | |
1761 | ||
1762 | intl.o: intl.c intl.h gansidecl.h Makefile | |
1763 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ | |
1764 | -DLOCALEDIR=\"$(localedir)\" \ | |
1765 | -c `echo $(srcdir)/intl.c | sed 's,^\./,,'` | |
1766 | ||
c4c37359 | 1767 | $(top_builddir)/intl/libintl.a: intl.all |
ab87f8c8 JL |
1768 | |
1769 | # Make sure all the headers are there for xgettext to scan. | |
0e5921e8 | 1770 | $(INTL_TARGETS): $(srcdir)/c-parse.c |
ab87f8c8 JL |
1771 | |
1772 | intl.all intl.install intl.uninstall intl.distdir \ | |
1773 | intl.mostlyclean intl.clean intl.distclean intl.maintainer-clean: | |
1774 | @for d in $(INTL_SUBDIRS); do \ | |
1775 | target=`expr $@ : 'intl.\(.*\)'` && \ | |
1776 | echo "(cd $$d && $(MAKE) $$target)" && \ | |
1777 | (cd $$d && AWK='$(AWK)' $(MAKE) $(SUBDIR_FLAGS_TO_PASS) $$target); \ | |
031926e2 | 1778 | if [ $$? -eq 0 ] ; then true ; else exit 1 ; fi ; \ |
ab87f8c8 JL |
1779 | done |
1780 | ||
1781 | # intl.distdir doesn't copy the intl makefiles (since they aren't distributed), | |
1782 | # but we need them for the `make extraclean' in distdir-finish. | |
1783 | intl.distdir-fixup: | |
1784 | for d in $(INTL_SUBDIRS); do \ | |
1785 | ln $$d/Makefile tmp/$$d || cp $$d/Makefile tmp/$$d || exit; \ | |
1786 | done | |
544eb21e | 1787 | #\f |
79d8453e RS |
1788 | # Remake cpp and protoize. |
1789 | ||
d059a239 FF |
1790 | PREPROCESSOR_DEFINES = \ |
1791 | -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \ | |
1792 | -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \ | |
1793 | -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \ | |
1794 | -DCROSS_INCLUDE_DIR=\"$(gcc_tooldir)/sys-include\" \ | |
1795 | -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" | |
79d8453e | 1796 | |
711b8824 | 1797 | LIBCPP_OBJS = cpplib.o cpplex.o cppmacro.o cppexp.o cppfiles.o \ |
7de4d004 | 1798 | cpphash.o cpperror.o cppinit.o cppdefault.o cppoutput.o \ |
711b8824 | 1799 | mkdeps.o prefix.o version.o mbchar.o @extra_cpp_objs@ |
19283265 | 1800 | |
86702e31 | 1801 | LIBCPP_DEPS = cpplib.h cpphash.h intl.h system.h |
8ebb00d5 | 1802 | |
a36556a8 ZW |
1803 | # Most of the other archives built/used by this makefile are for |
1804 | # targets. This one is strictly for the host. | |
19283265 | 1805 | libcpp.a: $(LIBCPP_OBJS) |
b8d12d79 | 1806 | -rm -rf libcpp.a |
8f25d5cd JW |
1807 | $(AR) $(AR_FLAGS) libcpp.a $(LIBCPP_OBJS) |
1808 | if $(RANLIB_TEST) ; then $(RANLIB) libcpp.a ; else true ; fi | |
19283265 | 1809 | |
4871239e ZW |
1810 | cpp0$(exeext): cppmain.o intl.o libcpp.a $(LIBDEPS) |
1811 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cpp0$(exeext) cppmain.o \ | |
69b2ac84 | 1812 | intl.o libcpp.a $(LIBS) |
59949f60 | 1813 | |
d35364d1 | 1814 | cppmain.o: cppmain.c $(CONFIG_H) cpplib.h intl.h system.h |
66334b64 | 1815 | |
8ebb00d5 | 1816 | cpperror.o: cpperror.c $(CONFIG_H) $(LIBCPP_DEPS) |
d8ea8f28 | 1817 | cppexp.o: cppexp.c $(CONFIG_H) $(LIBCPP_DEPS) defaults.h |
45b966db | 1818 | cpplex.o: cpplex.c $(CONFIG_H) $(LIBCPP_DEPS) |
711b8824 | 1819 | cppmacro.o: cppmacro.c $(CONFIG_H) $(LIBCPP_DEPS) |
7de4d004 | 1820 | cppoutput.o: cppoutput.c $(CONFIG_H) $(LIBCPP_DEPS) |
c71f835b | 1821 | cpplib.o: cpplib.c $(CONFIG_H) $(LIBCPP_DEPS) $(OBSTACK_H) |
711b8824 | 1822 | cpphash.o: cpphash.c $(CONFIG_H) $(LIBCPP_DEPS) $(OBSTACK_H) |
5193cc6d | 1823 | cppfiles.o: cppfiles.c $(CONFIG_H) $(LIBCPP_DEPS) $(SPLAY_TREE_H) mkdeps.h |
60893f43 ZW |
1824 | cppinit.o: cppinit.c $(CONFIG_H) $(LIBCPP_DEPS) cppdefault.h \ |
1825 | mkdeps.h prefix.h output.h version.h | |
e915b770 | 1826 | |
60893f43 | 1827 | cppdefault.o: cppdefault.c $(CONFIG_H) system.h cppdefault.h Makefile |
59949f60 | 1828 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ |
d059a239 | 1829 | $(PREPROCESSOR_DEFINES) \ |
60893f43 | 1830 | -c `echo $(srcdir)/cppdefault.c | sed 's,^\./,,'` |
5538ada6 | 1831 | |
49e6c08e ZW |
1832 | mkdeps.o: mkdeps.c $(CONFIG_H) system.h mkdeps.h |
1833 | ||
24c3c71a ZW |
1834 | # The traditional mode preprocessor, a separate program for ease of |
1835 | # maintenance. Some code is shared with the ISO-C cpp. | |
4871239e ZW |
1836 | tradcpp0$(exeext): tradcpp.o tradcif.o cppdefault.o version.o intl.o $(LIBDEPS) |
1837 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o tradcpp0$(exeext) \ | |
24c3c71a ZW |
1838 | tradcpp.o tradcif.o cppdefault.o version.o intl.o $(LIBS) |
1839 | ||
1840 | tradcpp.o: tradcpp.c $(CONFIG_H) system.h version.h cppdefault.h | |
d8ea8f28 | 1841 | tradcif.o: $(srcdir)/tradcif.c $(CONFIG_H) system.h defaults.h |
24c3c71a ZW |
1842 | |
1843 | $(srcdir)/tradcif.c: $(srcdir)/tradcif.y | |
1844 | cd $(srcdir); $(BISON) $(BISONFLAGS) -o tradcif.c tradcif.y | |
1845 | ||
7bd95cc1 BK |
1846 | # Note for the stamp targets, we run the program `true' instead of |
1847 | # having an empty command (nothing following the semicolon). | |
1848 | ||
e09e14e9 | 1849 | proto: config.status protoize$(exeext) unprotoize$(exeext) SYSCALLS.c.X |
79d8453e | 1850 | |
4c457b6b | 1851 | PROTO_OBJS = intl.o version.o |
ab87f8c8 JL |
1852 | |
1853 | protoize$(exeext): protoize.o $(PROTO_OBJS) $(LIBDEPS) | |
1854 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ protoize.o $(PROTO_OBJS) $(LIBS) | |
2e0b13db | 1855 | |
ab87f8c8 JL |
1856 | unprotoize$(exeext): unprotoize.o $(PROTO_OBJS) $(LIBDEPS) |
1857 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ unprotoize.o $(PROTO_OBJS) $(LIBS) | |
2e0b13db | 1858 | |
196fb9ff | 1859 | protoize.o: protoize.c $(srcdir)/../include/getopt.h $(CONFIG_H) system.h \ |
9f8f4efe | 1860 | Makefile version.h |
79d8453e | 1861 | $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ |
d059a239 | 1862 | $(DRIVER_DEFINES) $(PREPROCESSOR_DEFINES) \ |
6c32c807 BH |
1863 | $(srcdir)/protoize.c |
1864 | ||
196fb9ff | 1865 | unprotoize.o: unprotoize.c protoize.c $(srcdir)/../include/getopt.h \ |
9f8f4efe | 1866 | $(CONFIG_H) system.h Makefile version.h |
79d8453e | 1867 | $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ |
d059a239 | 1868 | $(DRIVER_DEFINES) $(PREPROCESSOR_DEFINES) \ |
6c32c807 | 1869 | $(srcdir)/unprotoize.c |
79d8453e | 1870 | |
79d8453e | 1871 | # This info describes the target machine, so compile with GCC just built. |
aab26e16 RK |
1872 | SYSCALLS.c.X: $(srcdir)/sys-types.h $(srcdir)/sys-protos.h $(GCC_PASSES) \ |
1873 | stmp-int-hdrs | |
c21cf0a7 | 1874 | -rm -f SYSCALLS.c tmp-SYSCALLS.s |
e256b8b6 DA |
1875 | sed -e s/TARGET_GETGROUPS_T/$(TARGET_GETGROUPS_T)/ \ |
1876 | $(srcdir)/sys-types.h $(srcdir)/sys-protos.h > SYSCALLS.c | |
79d8453e | 1877 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ |
c21cf0a7 RS |
1878 | -aux-info $@ -S -o tmp-SYSCALLS.s SYSCALLS.c |
1879 | -rm -f SYSCALLS.c tmp-SYSCALLS.s | |
9c0022f6 | 1880 | |
ac1284f9 | 1881 | |
9c0022f6 | 1882 | test-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES) |
4803a34a | 1883 | -rm -f tmp-proto.[cso] |
d3614a37 RS |
1884 | cp $(srcdir)/protoize.c tmp-proto.c |
1885 | chmod u+w tmp-proto.c | |
4803a34a | 1886 | ./protoize -N -B ./ -x getopt.h -c "-B./ -Wall -Wwrite-strings \ |
d059a239 | 1887 | $(GCC_CFLAGS) $(INCLUDES) \ |
9c0022f6 RS |
1888 | -DGCC_INCLUDE_DIR=0 \ |
1889 | -DGPLUSPLUS_INCLUDE_DIR=0 \ | |
1890 | -DCROSS_INCLUDE_DIR=0 \ | |
14b18068 | 1891 | -DTOOL_INCLUDE_DIR=0 \ |
d059a239 FF |
1892 | -DSTANDARD_EXEC_PREFIX=0 \ |
1893 | -DDEFAULT_TARGET_MACHINE=0 \ | |
1894 | -DDEFAULT_TARGET_VERSION=0" tmp-proto.c | |
e3e873d2 | 1895 | @echo '**********' Expect 400 lines of differences. |
4803a34a RK |
1896 | -diff $(srcdir)/protoize.c tmp-proto.c > tmp-proto.diff |
1897 | -wc -l tmp-proto.diff | |
1898 | ./unprotoize -N -x getopt.h -c "-B./ -Wall -Wwrite-strings \ | |
d059a239 | 1899 | $(GCC_CFLAGS) $(INCLUDES) \ |
9c0022f6 RS |
1900 | -DGCC_INCLUDE_DIR=0 \ |
1901 | -DGPLUSPLUS_INCLUDE_DIR=0 \ | |
1902 | -DCROSS_INCLUDE_DIR=0 \ | |
14b18068 | 1903 | -DTOOL_INCLUDE_DIR=0 \ |
d059a239 FF |
1904 | -DSTANDARD_EXEC_PREFIX=0 \ |
1905 | -DDEFAULT_TARGET_MACHINE=0 \ | |
1906 | -DDEFAULT_TARGET_VERSION=0" tmp-proto.c | |
9c0022f6 | 1907 | @echo Expect zero differences. |
d3614a37 | 1908 | diff $(srcdir)/protoize.c tmp-proto.c | cat |
aab26e16 | 1909 | -rm -f tmp-proto.[cs] tmp-proto$(objext) |
59a64126 | 1910 | |
ab87f8c8 | 1911 | gcov.o: gcov.c gcov-io.h intl.h system.h |
59a64126 | 1912 | |
2ea9a965 NC |
1913 | # Only one of 'gcov' or 'gcov.exe' is actually built, depending |
1914 | # upon whether $(exeext) is empty or not. | |
ab87f8c8 JL |
1915 | GCOV_OBJS = gcov.o intl.o |
1916 | gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS) | |
1917 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@ | |
544eb21e | 1918 | #\f |
ba1811f1 | 1919 | # Build the include directory. The stamp files are stmp-* rather than |
e5e809f4 | 1920 | # s-* so that mostlyclean does not force the include directory to |
ba1811f1 ILT |
1921 | # be rebuilt. |
1922 | ||
e7f62ad3 | 1923 | # Build the include directory including float.h (which no longer depends upon |
56f9206d | 1924 | # enquire). |
f95e46b9 | 1925 | stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) xlimits.h |
ba1811f1 ILT |
1926 | # Copy in the headers provided with gcc. |
1927 | # The sed command gets just the last file name component; | |
1928 | # this is necessary because VPATH could add a dirname. | |
1929 | # Using basename would be simpler, but some systems don't have it. | |
c85f7c16 | 1930 | # The touch command is here to workaround an AIX/Linux NFS bug. |
7bfe3c97 | 1931 | -if [ -d include ] ; then true; else mkdir include; chmod a+rx include; fi |
d7371761 RK |
1932 | for file in .. $(USER_H); do \ |
1933 | if [ X$$file != X.. ]; then \ | |
1934 | realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \ | |
c85f7c16 | 1935 | touch include/$$realfile; \ |
ae678a13 JW |
1936 | rm -f include/$$realfile; \ |
1937 | cp $$file include; \ | |
1938 | chmod a+r include/$$realfile; \ | |
d7371761 | 1939 | fi; \ |
ba1811f1 | 1940 | done |
1f050b9b | 1941 | rm -f include/limits.h |
ba1811f1 ILT |
1942 | cp xlimits.h include/limits.h |
1943 | chmod a+r include/limits.h | |
56f9206d | 1944 | rm -f include/float.h |
027ea2a7 JW |
1945 | if [ x$(FLOAT_H) != xMakefile.in ]; then \ |
1946 | cp $(srcdir)/config/$(FLOAT_H) include/float.h && \ | |
e9a25f70 JL |
1947 | chmod a+r include/float.h; \ |
1948 | else :; fi | |
e7f62ad3 MH |
1949 | # Install the README |
1950 | rm -f include/README | |
1951 | cp $(srcdir)/README-fixinc include/README | |
1952 | chmod a+r include/README | |
1953 | touch $@ | |
1954 | ||
f2321837 KG |
1955 | # fixinc.sh depends on this, not on specs directly. |
1956 | # The idea is to make sure specs gets built, but not rerun fixinc.sh | |
1957 | # after each stage just because specs' mtime has changed. | |
1958 | specs.ready: specs | |
1959 | -if [ -f specs.ready ] ; then \ | |
1960 | true; \ | |
1961 | else \ | |
1962 | touch specs.ready; \ | |
1963 | fi | |
1964 | ||
5d55e5cd RL |
1965 | FIXINCSRCDIR=$(srcdir)/fixinc |
1966 | fixinc.sh: $(FIXINCSRCDIR)/mkfixinc.sh $(FIXINCSRCDIR)/fixincl.c \ | |
f7d920fd RL |
1967 | $(FIXINCSRCDIR)/procopen.c $(FIXINCSRCDIR)/gnu-regex.c \ |
1968 | $(FIXINCSRCDIR)/server.c $(FIXINCSRCDIR)/gnu-regex.h \ | |
f2321837 | 1969 | $(FIXINCSRCDIR)/server.h $(FIXINCSRCDIR)/inclhack.def specs.ready |
9f3d1bc2 | 1970 | MAKE="$(MAKE)"; srcdir=`cd $(srcdir)/fixinc; pwd` ; \ |
b145ee27 GM |
1971 | CC="$(CC)"; CFLAGS="$(CFLAGS)"; LDFLAGS="$(LDFLAGS)"; \ |
1972 | export MAKE srcdir CC CFLAGS LDFLAGS; \ | |
9f3d1bc2 BK |
1973 | cd ./fixinc; $(SHELL) $${srcdir}/mkfixinc.sh $(target) |
1974 | ||
ba1811f1 | 1975 | # Build fixed copies of system files. |
9f3d1bc2 BK |
1976 | stmp-fixinc: fixinc.sh gsyslimits.h |
1977 | rm -rf include; mkdir include | |
c5c76735 | 1978 | -chmod a+rx include |
9f3d1bc2 | 1979 | TARGET_MACHINE=$(target); srcdir=`cd $(srcdir); pwd`; \ |
f853036b BK |
1980 | INSTALL_ASSERT_H=$(INSTALL_ASSERT_H); SHELL=$(SHELL) ;\ |
1981 | export TARGET_MACHINE srcdir INSTALL_ASSERT_H SHELL ; \ | |
9f3d1bc2 | 1982 | $(SHELL) ./fixinc.sh `pwd`/include $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS) |
3dc4a939 RK |
1983 | rm -f include/syslimits.h |
1984 | if [ -f include/limits.h ]; then \ | |
1985 | mv include/limits.h include/syslimits.h; \ | |
1986 | else \ | |
1987 | cp $(srcdir)/gsyslimits.h include/syslimits.h; \ | |
1988 | fi | |
1989 | chmod a+r include/syslimits.h | |
2d490c9e | 1990 | # If $(SYSTEM_HEADER_DIR) is $(tooldir)/sys-include, and |
1f72bfca | 1991 | # that directory exists, then make sure that $(libsubdir) exists. |
2d490c9e | 1992 | # This is because cpp is compiled to find $(tooldir)/include via |
1f72bfca JL |
1993 | # $(libsubdir)/$(unlibsubdir), which will only work if $(libsubdir) |
1994 | # exists. | |
2d490c9e JW |
1995 | # We deliberately use tooldir instead of gcc_tooldir here. gcc_tooldir |
1996 | # won't work because libsubdir doesn't exist yet. | |
1997 | if [ "$(SYSTEM_HEADER_DIR)" = "$(tooldir)/sys-include" ] \ | |
1998 | && [ -d $(tooldir)/sys-include ]; then \ | |
1f72bfca JL |
1999 | if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; fi; \ |
2000 | if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib; fi; \ | |
2001 | if [ -d $(libdir)/gcc-lib/$(target_alias) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias) ; fi; \ | |
2002 | if [ -d $(libdir)/gcc-lib/$(target_alias)/$(version) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias)/$(version) ; fi; \ | |
2003 | else true; fi | |
49b6e255 | 2004 | touch stmp-fixinc |
469778e2 | 2005 | |
ac1284f9 | 2006 | # Files related to the fixproto script. |
f95e46b9 ZW |
2007 | # gen-protos and fix-header are compiled with HOST_CC, but they are only |
2008 | # used in native and host-x-target builds, so it's safe to link them with | |
2009 | # libiberty.a. | |
ac1284f9 | 2010 | |
74bb4fdf | 2011 | deduced.h: $(GCC_PASSES) $(srcdir)/scan-types.sh stmp-int-hdrs |
40859b41 JL |
2012 | if [ -d $(SYSTEM_HEADER_DIR) ]; \ |
2013 | then \ | |
3c9a2b55 | 2014 | CC="$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -I. -I$(srcdir) -isystem include -isystem ${SYSTEM_HEADER_DIR}"; \ |
ac1284f9 | 2015 | export CC; \ |
40859b41 JL |
2016 | $(SHELL) $(srcdir)/scan-types.sh "$(srcdir)" >tmp-deduced.h; \ |
2017 | mv tmp-deduced.h deduced.h; \ | |
2018 | else \ | |
2019 | touch deduced.h; \ | |
2020 | fi | |
ac1284f9 | 2021 | |
5fa7f88c | 2022 | GEN_PROTOS_OBJS = gen-protos.o scan.o |
7e1878ef | 2023 | gen-protos: $(GEN_PROTOS_OBJS) |
850350d1 | 2024 | ${HOST_CC} $(HOST_CFLAGS) $(HOST_LDFLAGS) -o gen-protos \ |
f95e46b9 | 2025 | $(GEN_PROTOS_OBJS) ../libiberty/libiberty.a |
ac1284f9 | 2026 | |
5fa7f88c | 2027 | gen-protos.o: gen-protos.c scan.h $(build_xm_file) system.h |
c192da27 RK |
2028 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gen-protos.c |
2029 | ||
b04cd507 | 2030 | scan.o: scan.c scan.h $(build_xm_file) system.h |
c192da27 | 2031 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/scan.c |
7b41f815 | 2032 | |
74bb4fdf | 2033 | xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h gen-protos Makefile |
e256b8b6 DA |
2034 | sed -e s/TARGET_GETGROUPS_T/$(TARGET_GETGROUPS_T)/ \ |
2035 | deduced.h $(srcdir)/sys-protos.h > tmp-fixtmp.c | |
d521a023 | 2036 | mv tmp-fixtmp.c fixtmp.c |
c061c5d7 | 2037 | $(GCC_FOR_TARGET) fixtmp.c -w -U__SIZE_TYPE__ -U__PTRDIFF_TYPE__ -U__WCHAR_TYPE__ -E \ |
c1b9947f | 2038 | | sed -e 's/ / /g' -e 's/ *(/ (/g' -e 's/ [ ]*/ /g' -e 's/( )/()/' \ |
d521a023 RK |
2039 | | ./gen-protos >xsys-protos.hT |
2040 | mv xsys-protos.hT xsys-protos.h | |
d7a58f93 | 2041 | rm -rf fixtmp.c |
ac1284f9 | 2042 | |
6650a443 ZW |
2043 | # This is nominally a 'build' program, but it's run only when host==build, |
2044 | # so we can (indeed, must) use $(LIBDEPS) and $(LIBS). | |
2045 | fix-header: fix-header.o scan-decls.o scan.o xsys-protos.h $(LIBDEPS) \ | |
19283265 | 2046 | libcpp.a |
aab26e16 | 2047 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ fix-header.o \ |
6650a443 | 2048 | scan-decls.o scan.o libcpp.a $(LIBS) |
ac1284f9 | 2049 | |
4e872036 | 2050 | fix-header.o: fix-header.c $(OBSTACK_H) scan.h \ |
5fa7f88c | 2051 | xsys-protos.h $(build_xm_file) system.h cpplib.h |
c192da27 RK |
2052 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/fix-header.c |
2053 | ||
e915b770 | 2054 | scan-decls.o: scan-decls.c scan.h cpplib.h $(build_xm_file) system.h |
c192da27 | 2055 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/scan-decls.c |
ac1284f9 | 2056 | |
74bb4fdf RS |
2057 | # stmp-fixproto depends on this, not on fix-header directly. |
2058 | # The idea is to make sure fix-header gets built, | |
2059 | # but not rerun fixproto after each stage | |
2060 | # just because fix-header's mtime has changed. | |
2061 | fixhdr.ready: fix-header | |
2062 | -if [ -f fixhdr.ready ] ; then \ | |
2063 | true; \ | |
2064 | else \ | |
2065 | touch fixhdr.ready; \ | |
2066 | fi | |
2067 | ||
f95e46b9 | 2068 | # stmp-int-headers is to make sure fixincludes has already finished. |
700ba19c RS |
2069 | # The if statement is so that we don't run fixproto a second time |
2070 | # if it has already been run on the files in `include'. | |
f95e46b9 | 2071 | stmp-fixproto: fixhdr.ready fixproto stmp-int-hdrs |
01b2995f | 2072 | if [ -f include/fixed ] ; then true; \ |
700ba19c | 2073 | else \ |
b1f99e2f | 2074 | : This line works around a 'make' bug in BSDI 1.1.; \ |
b3ca463c | 2075 | FIXPROTO_DEFINES="$(FIXPROTO_DEFINES)"; export FIXPROTO_DEFINES; \ |
bcf1ba1d AO |
2076 | mkinstalldirs="$(SHELL) $(srcdir)/mkinstalldirs"; \ |
2077 | export mkinstalldirs; \ | |
aef1617c JL |
2078 | if [ -d $(SYSTEM_HEADER_DIR) ] ; then \ |
2079 | $(SHELL) ${srcdir}/fixproto include include $(SYSTEM_HEADER_DIR); \ | |
01b2995f | 2080 | if [ $$? -eq 0 ] ; then true ; else exit 1 ; fi ; \ |
aef1617c | 2081 | else true; fi; \ |
700ba19c RS |
2082 | touch include/fixed; \ |
2083 | fi | |
ac1284f9 | 2084 | touch stmp-fixproto |
544eb21e | 2085 | #\f |
79d8453e RS |
2086 | # Remake the info files. |
2087 | ||
09fa0705 | 2088 | doc: $(BUILD_INFO) gccbug |
c06aa51e | 2089 | info: cpp.info gcc.info lang.info c-tree.info |
79d8453e | 2090 | |
8be52aaa | 2091 | cpp.info: $(srcdir)/cpp.texi |
c1879238 | 2092 | $(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o cpp.info $(srcdir)/cpp.texi |
79d8453e | 2093 | |
8be52aaa JL |
2094 | gcc.info: $(srcdir)/gcc.texi $(srcdir)/extend.texi $(srcdir)/install.texi \ |
2095 | $(srcdir)/invoke.texi $(srcdir)/md.texi $(srcdir)/rtl.texi \ | |
2096 | $(srcdir)/tm.texi $(srcdir)/gcov.texi | |
c1879238 | 2097 | $(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o gcc.info $(srcdir)/gcc.texi |
f780d21b | 2098 | |
c06aa51e MM |
2099 | c-tree.info: $(srcdir)/c-tree.texi |
2100 | $(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o c-tree.info \ | |
2101 | $(srcdir)/c-tree.texi | |
2102 | ||
8be52aaa | 2103 | dvi: gcc.dvi cpp.dvi lang.dvi |
8dbda01e | 2104 | |
dd08cdda | 2105 | # This works with GNU Make's default rule. |
8be52aaa JL |
2106 | gcc.dvi: $(srcdir)/gcc.texi $(srcdir)/extend.texi $(srcdir)/install.texi \ |
2107 | $(srcdir)/invoke.texi $(srcdir)/md.texi $(srcdir)/rtl.texi \ | |
2108 | $(srcdir)/tm.texi $(srcdir)/gcov.texi | |
2109 | TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex gcc.texi | |
2110 | texindex gcc.?? | |
2111 | TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex gcc.texi | |
2112 | ||
2113 | cpp.dvi: $(srcdir)/cpp.texi | |
2114 | TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex cpp.texi | |
2115 | texindex cpp.?? | |
2116 | TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex cpp.texi | |
2117 | ||
2118 | ||
2119 | INSTALL: $(srcdir)/install1.texi $(srcdir)/install.texi | |
b4ea9a9d | 2120 | cd $(srcdir); $(MAKEINFO) -D INSTALLONLY \ |
86702e31 | 2121 | --no-split --no-headers -o INSTALL install1.texi |
544eb21e | 2122 | #\f |
79d8453e RS |
2123 | # Deletion of files made during compilation. |
2124 | # There are four levels of this: | |
f1908d70 | 2125 | # `mostlyclean', `clean', `distclean' and `maintainer-clean'. |
79d8453e | 2126 | # `mostlyclean' is useful while working on a particular type of machine. |
2e494f70 | 2127 | # It deletes most, but not all, of the files made by compilation. |
79d8453e | 2128 | # It does not delete libgcc.a or its parts, so it won't have to be recompiled. |
2e494f70 | 2129 | # `clean' deletes everything made by running `make all'. |
47547081 | 2130 | # `distclean' also deletes the files made by config. |
f1908d70 | 2131 | # `maintainer-clean' also deletes everything that could be regenerated |
63d9b81c RK |
2132 | # automatically, except for `configure'. |
2133 | # We remove as much from the language subdirectories as we can | |
013a2ee0 | 2134 | # (less duplicated code). |
79d8453e | 2135 | |
2051eea1 NS |
2136 | INTL_MOSTLYCLEAN = intl.mostlyclean |
2137 | mostlyclean: $(INTL_MOSTLYCLEAN) lang.mostlyclean | |
79d8453e | 2138 | -rm -f $(STAGESTUFF) |
4993ddc1 | 2139 | -rm -rf libgcc |
79d8453e RS |
2140 | # Delete the temporary source copies for cross compilation. |
2141 | -rm -f $(HOST_PREFIX_1)rtl.c $(HOST_PREFIX_1)rtlanal.c | |
2142 | -rm -f $(HOST_PREFIX_1)alloca.c $(HOST_PREFIX_1)malloc.c | |
4c457b6b | 2143 | -rm -f $(HOST_PREFIX_1)obstack.c |
79d8453e | 2144 | # Delete the temp files made in the course of building libgcc.a. |
3ec83fc2 | 2145 | -rm -f xlimits.h libgcc1-test |
79d8453e | 2146 | for name in $(LIB1FUNCS); do rm -f $${name}.c; done |
e5e809f4 | 2147 | # Delete other built files. |
3ec83fc2 | 2148 | -rm -f t-float.h-cross xsys-protos.hT |
e5e809f4 JL |
2149 | # Delete the stamp and temporary files. |
2150 | -rm -f s-* tmp-* stamp-* stmp-* | |
013a2ee0 | 2151 | -rm -f */stamp-* */tmp-* |
2e494f70 | 2152 | # Delete debugging dump files. |
61098249 | 2153 | -rm -f *.[0-9][0-9].* */*.[0-9][0-9].* |
2e494f70 | 2154 | # Delete some files made during installation. |
027ea2a7 | 2155 | -rm -f specs float.h-* enquire SYSCALLS.c.X SYSCALLS.c |
813fc11c | 2156 | -rm -f collect collect2 mips-tfile mips-tdump alloca.s |
ac1284f9 | 2157 | # Delete files generated for fixproto |
1162b3a6 | 2158 | -rm -rf fix-header xsys-protos.h deduced.h tmp-deduced.h \ |
02521409 | 2159 | gen-protos fixproto.list fixtmp.* fixhdr.ready |
fa9c7493 ZW |
2160 | # Delete files generated for fixincl |
2161 | -rm -rf fixincl fixinc.sh specs.ready | |
f0267a67 | 2162 | (cd fixinc && $(MAKE) clean) |
2e494f70 RS |
2163 | # Delete unwanted output files from TeX. |
2164 | -rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg | |
013a2ee0 | 2165 | -rm -f */*.toc */*.log */*.vr */*.fn */*.cp */*.tp */*.ky */*.pg |
47547081 RS |
2166 | # Delete sorted indices we don't actually use. |
2167 | -rm -f gcc.vrs gcc.kys gcc.tps gcc.pgs gcc.fns | |
2e494f70 | 2168 | # Delete core dumps. |
013a2ee0 | 2169 | -rm -f core */core |
79d8453e | 2170 | |
47547081 RS |
2171 | # Delete all files made by compilation |
2172 | # that don't exist in the distribution. | |
2051eea1 NS |
2173 | INTL_CLEAN = intl.clean |
2174 | clean: mostlyclean $(INTL_CLEAN) lang.clean | |
2aceb30d | 2175 | -rm -f libgcc.a |
97d81d66 | 2176 | -rm -rf libgcc |
be0d23ff | 2177 | -rm -f *.dvi |
013a2ee0 | 2178 | -rm -f */*.dvi |
c3efc7c4 DE |
2179 | -if [ -f md.pre-cpp ]; then \ |
2180 | rm -f md ; \ | |
2181 | fi | |
ba1811f1 | 2182 | # Delete the include directory. |
e5e809f4 | 2183 | -rm -rf include |
75ed5d8b | 2184 | # Delete files used by the "multilib" facility (including libgcc subdirs). |
f6cdc7ea | 2185 | -rm -f multilib.h tmpmultilib* |
75ed5d8b DE |
2186 | -if [ "x$(MULTILIB_DIRNAMES)" != x ] ; then \ |
2187 | rm -rf $(MULTILIB_DIRNAMES); \ | |
2188 | else if [ "x$(MULTILIB_OPTIONS)" != x ] ; then \ | |
2189 | rm -rf `echo $(MULTILIB_OPTIONS) | sed -e 's/\// /g'`; \ | |
2190 | fi ; fi | |
5768f211 | 2191 | -rm -fr stage1 stage2 stage3 stage4 |
204093e6 DT |
2192 | # Delete stamps of bootstrap stages |
2193 | -rm -f stage_* | |
2194 | -rm -f clean_* | |
79d8453e | 2195 | |
47547081 RS |
2196 | # Delete all files that users would normally create |
2197 | # while building and installing GCC. | |
ab87f8c8 JL |
2198 | INTL_DISTCLEAN = intl.distclean |
2199 | distclean: clean $(INTL_DISTCLEAN) lang.distclean | |
6baf1cc8 | 2200 | -rm -f tm.h tm_p.h config.h auto-host.h auto-build.h tconfig.h hconfig.h |
b7cb92ad | 2201 | -rm -f md cstamp-h |
63d9b81c | 2202 | -rm -f config.status config.run config.cache config.bak |
d232dfa4 | 2203 | -rm -f Make-lang Make-hooks Make-host Make-target |
3103b7db | 2204 | -rm -f Makefile specs.h options.h gencheck.h *.oaux |
f24af81b | 2205 | -rm -f gthr-default.h |
26f887e5 | 2206 | -rm -f */stage1 */stage2 */stage3 */stage4 */include |
3dab45b7 | 2207 | -rm -f c-parse.output |
338023d4 | 2208 | -rm -f *.asm |
67446ffe | 2209 | -rm -f float.h |
a051ad3a JL |
2210 | -rm -f site.exp site.bak testsuite/site.exp testsuite/site.bak |
2211 | -rm -f testsuite/{gcc,g++}.{log,sum} | |
ab87f8c8 | 2212 | -rm -f intl/libintl.h libintl.h |
2e494f70 RS |
2213 | |
2214 | # Delete anything likely to be found in the source directory | |
2215 | # that shouldn't be in the distribution. | |
013a2ee0 | 2216 | extraclean: distclean lang.extraclean |
fb92d909 | 2217 | -rm -rf =* ./"#"* *~* config/=* config/"#"* config/*~* |
be0d23ff | 2218 | -rm -f patch* *.orig *.rej config/patch* config/*.orig config/*.rej |
3dab45b7 RS |
2219 | -rm -f config/*/=* config/*/"#"* config/*/*~* |
2220 | -rm -f config/*/*.orig config/*/*.rej | |
d72a7857 | 2221 | -rm -f *.dvi *.ps *.oaux *.d *.[zZ] *.gz |
184be4bf | 2222 | -rm -f *.tar *.xtar *diff *.diff.* *.tar.* *.xtar.* *diffs |
3dab45b7 | 2223 | -rm -f *lose config/*lose config/*/*lose |
e5e809f4 | 2224 | -rm -f *.s *.s[0-9] *.i config/ChangeLog |
ab87f8c8 | 2225 | -rm -f y.tab.c yacc.* |
013a2ee0 DE |
2226 | -rm -f */=* */"#"* */*~* |
2227 | -rm -f */patch* */*.orig */*.rej | |
2228 | -rm -f */*.dvi */*.oaux */*.d */*.[zZ] */*.gz | |
2229 | -rm -f */*.tar */*.xtar */*diff */*.diff.* */*.tar.* */*.xtar.* */*diffs | |
2230 | -rm -f */*lose */*.s */*.s[0-9] */*.i | |
79d8453e | 2231 | |
63d9b81c | 2232 | # Get rid of every file that's generated from some other file, except for `configure'. |
79d8453e | 2233 | # Most of these files ARE PRESENT in the GCC distribution. |
2051eea1 NS |
2234 | # We define INTL_DISTCLEAN, INTL_CLEAN & INTL_MOSTLYCLEAN to be empty in the |
2235 | # submake, so that we don't descend into intl after its makefile has been | |
2236 | # removed. | |
63d9b81c RK |
2237 | maintainer-clean: |
2238 | @echo 'This command is intended for maintainers to use; it' | |
2239 | @echo 'deletes files that may need special tools to rebuild.' | |
2051eea1 NS |
2240 | $(MAKE) INTL_DISTCLEAN= INTL_CLEAN= INTL_MOSTLYCLEAN= \ |
2241 | intl.maintainer-clean lang.maintainer-clean distclean | |
0e5921e8 | 2242 | -rm -f c-parse.y c-parse.c c-parse.output TAGS |
2e494f70 RS |
2243 | -rm -f cpp.info* cpp.??s cpp.*aux |
2244 | -rm -f gcc.info* gcc.??s gcc.*aux | |
544eb21e | 2245 | #\f |
79d8453e | 2246 | # Entry points `install' and `uninstall'. |
2e494f70 | 2247 | # Also use `install-collect2' to install collect2 when the config files don't. |
79d8453e | 2248 | |
1402d22c | 2249 | # The semicolon is to prevent the install.sh -> install default rule |
7bd95cc1 BK |
2250 | # from doing anything. Having it run true helps avoid problems and |
2251 | # noise from versions of make which don't like to have null commands. | |
d960abef | 2252 | install: $(INSTALL_TARGET) ; @true |
79d8453e | 2253 | |
ba1811f1 | 2254 | # Copy the compiler files into directories where they will be run. |
aab26e16 RK |
2255 | # Install the driver last so that the window when things are |
2256 | # broken is small. | |
b583eed8 | 2257 | install-normal: install-common $(INSTALL_HEADERS) $(INSTALL_LIBGCC) \ |
09fa0705 ZW |
2258 | $(INSTALL_CPP) install-man $(INSTALL_INFO) intl.install \ |
2259 | lang.install-normal install-driver | |
79d8453e | 2260 | |
057f494b RS |
2261 | # Do nothing while making gcc with a cross-compiler. The person who |
2262 | # makes gcc for the target machine has to know how to put a complete | |
2263 | # gcc together by hand. | |
2264 | install-build: force | |
2265 | @echo You have to install gcc on your target machine by hand. | |
2266 | ||
79d8453e RS |
2267 | # Run this on the target machine |
2268 | # to finish installation of cross compiler. | |
027ea2a7 | 2269 | # This is not used anymore now that float.h does not depend on enquire. |
79d8453e RS |
2270 | install-cross-rest: install-float-h-cross |
2271 | ||
587a4ba6 | 2272 | # Handle cpp installation. |
4871239e | 2273 | install-cpp: cpp$(exeext) |
9799e470 AS |
2274 | -if [ -f gcc-cross$(exeext) ] ; then \ |
2275 | rm -f $(bindir)/$(CPP_CROSS_NAME)$(exeext); \ | |
4871239e | 2276 | $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(bindir)/$(CPP_CROSS_NAME)$(exeext); \ |
9799e470 AS |
2277 | if [ x$(cpp_install_dir) != x ]; then \ |
2278 | rm -f $(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \ | |
4871239e | 2279 | $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \ |
9799e470 AS |
2280 | else true; fi; \ |
2281 | else \ | |
2282 | rm -f $(bindir)/$(CPP_INSTALL_NAME)$(exeext); \ | |
4871239e | 2283 | $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(bindir)/$(CPP_INSTALL_NAME)$(exeext); \ |
9799e470 AS |
2284 | if [ x$(cpp_install_dir) != x ]; then \ |
2285 | rm -f $(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \ | |
4871239e | 2286 | $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \ |
9799e470 AS |
2287 | else true; fi; \ |
2288 | fi | |
587a4ba6 L |
2289 | |
2290 | uninstall-cpp: | |
9799e470 AS |
2291 | -rm -f $(bindir)/$(CPP_INSTALL_NAME)$(exeext) |
2292 | -rm -f $(bindir)/$(CPP_CROSS_NAME)$(exeext) | |
587a4ba6 | 2293 | -if [ x$(cpp_install_dir) != x ]; then \ |
9799e470 AS |
2294 | rm -f $(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \ |
2295 | rm -f $(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \ | |
587a4ba6 L |
2296 | else true; fi |
2297 | ||
79d8453e RS |
2298 | # Install float.h for cross compiler. |
2299 | # Run this on the target machine! | |
027ea2a7 | 2300 | # This is not used anymore now that float.h does not depend on enquire. |
69cbb85a | 2301 | install-float-h-cross: installdirs |
3f7531db RS |
2302 | # if [ -f enquire ] ; then true; else false; fi |
2303 | # Note: don't use -. We should fail right away if enquire was not made. | |
2304 | ./enquire -f > $(tmpdir)/float.h | |
79d8453e | 2305 | -rm -f $(libsubdir)/include/float.h |
62c13b81 RS |
2306 | $(INSTALL_DATA) $(tmpdir)/float.h $(libsubdir)/include/float.h |
2307 | -rm -f $(tmpdir)/float.h | |
79d8453e RS |
2308 | chmod a-x $(libsubdir)/include/float.h |
2309 | ||
69cbb85a RK |
2310 | # Create the installation directories. |
2311 | installdirs: | |
2312 | -if [ -d $(prefix) ] ; then true ; else mkdir $(prefix) ; chmod a+rx $(prefix) ; fi | |
2313 | -if [ -d $(exec_prefix) ] ; then true ; else mkdir $(exec_prefix) ; chmod a+rx $(exec_prefix) ; fi | |
394fa7c8 JW |
2314 | -if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; chmod a+rx $(libdir) ; fi |
2315 | -if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib ; chmod a+rx $(libdir)/gcc-lib ; fi | |
9eb91772 | 2316 | # This dir isn't currently searched by cpp. |
394fa7c8 | 2317 | # -if [ -d $(libdir)/gcc-lib/include ] ; then true ; else mkdir $(libdir)/gcc-lib/include ; chmod a+rx $(libdir)/gcc-lib/include ; fi |
05fd993d MH |
2318 | -fdir= ; for dir in `echo $(libsubdir) | tr '/' ' '`; do \ |
2319 | fdir=$${fdir}/$${dir}; \ | |
2320 | if [ -d $${fdir} ] ; then true ; else mkdir $${fdir}; chmod a+rx $${fdir}; fi ; \ | |
2321 | done | |
394fa7c8 JW |
2322 | -if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; chmod a+rx $(bindir) ; fi |
2323 | -if [ -d $(includedir) ] ; then true ; else mkdir $(includedir) ; chmod a+rx $(includedir) ; fi | |
91c7bd9b | 2324 | -if [ -d $(gcc_tooldir) ] ; then true ; else mkdir $(gcc_tooldir) ; chmod a+rx $(gcc_tooldir) ; fi |
394fa7c8 JW |
2325 | -if [ -d $(assertdir) ] ; then true ; else mkdir $(assertdir) ; chmod a+rx $(assertdir) ; fi |
2326 | -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; chmod a+rx $(infodir) ; fi | |
a76b6b40 | 2327 | # We don't use mkdir -p to create the parents of man1dir, |
79d8453e | 2328 | # because some systems don't support it. |
a76b6b40 MH |
2329 | # Instead, we use this technique to create the immediate parent of man1dir. |
2330 | -parent=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \ | |
394fa7c8 | 2331 | if [ -d $$parent ] ; then true ; else mkdir $$parent ; chmod a+rx $$parent ; fi |
a76b6b40 | 2332 | -if [ -d $(man1dir) ] ; then true ; else mkdir $(man1dir) ; chmod a+rx $(man1dir) ; fi |
79d8453e RS |
2333 | |
2334 | # Install the compiler executables built during cross compilation. | |
69cbb85a | 2335 | install-common: native installdirs $(EXTRA_PARTS) lang.install-common |
79d8453e RS |
2336 | for file in $(COMPILERS); do \ |
2337 | if [ -f $$file ] ; then \ | |
2338 | rm -f $(libsubdir)/$$file; \ | |
2339 | $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \ | |
2340 | else true; \ | |
2341 | fi; \ | |
2342 | done | |
2fe8d2d6 | 2343 | for file in $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2) ..; do \ |
79d8453e RS |
2344 | if [ x"$$file" != x.. ]; then \ |
2345 | rm -f $(libsubdir)/$$file; \ | |
2346 | $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \ | |
2347 | else true; fi; \ | |
2348 | done | |
2fe8d2d6 RK |
2349 | for file in $(EXTRA_PARTS) ..; do \ |
2350 | if [ x"$$file" != x.. ]; then \ | |
2351 | rm -f $(libsubdir)/$$file; \ | |
2352 | $(INSTALL_DATA) $$file $(libsubdir)/$$file; \ | |
e9a25f70 | 2353 | chmod a-x $(libsubdir)/$$file; \ |
2fe8d2d6 RK |
2354 | else true; fi; \ |
2355 | done | |
f0ec1f64 | 2356 | # Don't mess with specs if it doesn't exist yet. |
2a7bccbb TG |
2357 | -if [ -f specs ] ; then \ |
2358 | rm -f $(libsubdir)/specs; \ | |
f0ec1f64 | 2359 | $(INSTALL_DATA) specs $(libsubdir)/specs; \ |
e9a25f70 | 2360 | chmod a-x $(libsubdir)/specs; \ |
f0ec1f64 | 2361 | fi |
aab26e16 RK |
2362 | # Install protoize if it was compiled. |
2363 | -if [ -f protoize$(exeext) ]; \ | |
2364 | then \ | |
225695a4 JW |
2365 | if [ -f gcc-cross$(exeext) ] ; then \ |
2366 | rm -f $(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext); \ | |
2367 | $(INSTALL_PROGRAM) protoize$(exeext) $(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext); \ | |
2368 | rm -f $(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext); \ | |
2369 | $(INSTALL_PROGRAM) unprotoize$(exeext) $(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext); \ | |
2370 | else \ | |
2371 | rm -f $(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \ | |
2372 | $(INSTALL_PROGRAM) protoize$(exeext) $(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \ | |
2373 | rm -f $(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext); \ | |
2374 | $(INSTALL_PROGRAM) unprotoize$(exeext) $(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext); \ | |
2375 | fi ; \ | |
aab26e16 RK |
2376 | rm -f $(libsubdir)/SYSCALLS.c.X; \ |
2377 | $(INSTALL_DATA) SYSCALLS.c.X $(libsubdir)/SYSCALLS.c.X; \ | |
2378 | chmod a-x $(libsubdir)/SYSCALLS.c.X; \ | |
2379 | fi | |
4871239e ZW |
2380 | -rm -f $(libsubdir)/cpp0$(exeext) |
2381 | $(INSTALL_PROGRAM) cpp0$(exeext) $(libsubdir)/cpp0$(exeext) | |
2382 | -rm -f $(libsubdir)/tradcpp0$(exeext) | |
2383 | $(INSTALL_PROGRAM) tradcpp0$(exeext) $(libsubdir)/tradcpp0$(exeext) | |
ca363bb6 | 2384 | # Install gcov if it was compiled. |
59a64126 DE |
2385 | -if [ -f gcov$(exeext) ]; \ |
2386 | then \ | |
2387 | rm -f $(bindir)/gcov$(exeext); \ | |
23473647 | 2388 | $(INSTALL_PROGRAM) gcov$(exeext) $(bindir)/$(GCOV_INSTALL_NAME)$(exeext); \ |
59a64126 | 2389 | fi |
e4476d1c | 2390 | $(INSTALL_PROGRAM) gccbug $(bindir)/$(GCCBUG_INSTALL_NAME) |
aab26e16 | 2391 | |
8b06b20a | 2392 | # Install the driver program as $(target_alias)-gcc |
91c7bd9b | 2393 | # and also as either gcc (if native) or $(gcc_tooldir)/bin/gcc. |
e09e14e9 | 2394 | install-driver: xgcc$(exeext) |
173712fb RK |
2395 | -if [ -f gcc-cross$(exeext) ] ; then \ |
2396 | rm -f $(bindir)/$(GCC_CROSS_NAME)$(exeext); \ | |
94a8b9fe | 2397 | $(INSTALL_PROGRAM) gcc-cross$(exeext) $(bindir)/$(GCC_CROSS_NAME)$(exeext); \ |
91c7bd9b JL |
2398 | if [ -d $(gcc_tooldir)/bin/. ] ; then \ |
2399 | rm -f $(gcc_tooldir)/bin/gcc$(exeext); \ | |
2400 | $(INSTALL_PROGRAM) gcc-cross$(exeext) $(gcc_tooldir)/bin/gcc$(exeext); \ | |
79d8453e RS |
2401 | else true; fi; \ |
2402 | else \ | |
173712fb RK |
2403 | rm -f $(bindir)/$(GCC_INSTALL_NAME)$(exeext); \ |
2404 | $(INSTALL_PROGRAM) xgcc$(exeext) $(bindir)/$(GCC_INSTALL_NAME)$(exeext); \ | |
8b06b20a | 2405 | rm -f $(bindir)/$(target_alias)-gcc-1$(exeext); \ |
ac64120e | 2406 | $(LN) $(bindir)/$(GCC_INSTALL_NAME)$(exeext) $(bindir)/$(target_alias)-gcc-1$(exeext); \ |
8b06b20a | 2407 | mv $(bindir)/$(target_alias)-gcc-1$(exeext) $(bindir)/$(target_alias)-gcc$(exeext); \ |
79d8453e | 2408 | fi |
79d8453e | 2409 | |
0b2fbcb2 | 2410 | # Install the info files. |
feb9ea1a | 2411 | # $(INSTALL_DATA) might be a relative pathname, so we can't cd into srcdir |
ee5b121e | 2412 | # to do the install. |
69cbb85a | 2413 | install-info: doc installdirs lang.install-info |
0b2fbcb2 | 2414 | -rm -f $(infodir)/cpp.info* $(infodir)/gcc.info* |
8be52aaa | 2415 | for f in cpp.info* gcc.info*; do \ |
ee5b121e | 2416 | $(INSTALL_DATA) $$f $(infodir)/$$f; \ |
feb9ea1a | 2417 | done |
ee5b121e | 2418 | -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ |
f8c86b58 | 2419 | if [ -f $(infodir)/dir ] ; then \ |
265ce5bb | 2420 | for f in cpp.info gcc.info; do \ |
ee5b121e | 2421 | install-info --dir-file=$(infodir)/dir $(infodir)/$$f; \ |
265ce5bb | 2422 | done; \ |
f8c86b58 | 2423 | else true; fi; \ |
265ce5bb | 2424 | else true; fi; |
0b2fbcb2 RS |
2425 | -chmod a-x $(infodir)/cpp.info* $(infodir)/gcc.info* |
2426 | ||
79d8453e | 2427 | # Install the man pages. |
86702e31 | 2428 | install-man: installdirs $(srcdir)/gcc.1 $(srcdir)/cpp.1 lang.install-man |
e9a25f70 | 2429 | -if [ -f gcc-cross$(exeext) ] ; then \ |
a76b6b40 MH |
2430 | rm -f $(man1dir)/$(GCC_CROSS_NAME)$(manext); \ |
2431 | $(INSTALL_DATA) $(srcdir)/gcc.1 $(man1dir)/$(GCC_CROSS_NAME)$(manext); \ | |
2432 | chmod a-x $(man1dir)/$(GCC_CROSS_NAME)$(manext); \ | |
338023d4 | 2433 | else \ |
a76b6b40 MH |
2434 | rm -f $(man1dir)/$(GCC_INSTALL_NAME)$(manext); \ |
2435 | $(INSTALL_DATA) $(srcdir)/gcc.1 $(man1dir)/$(GCC_INSTALL_NAME)$(manext); \ | |
2436 | chmod a-x $(man1dir)/$(GCC_INSTALL_NAME)$(manext); \ | |
338023d4 | 2437 | fi |
86702e31 ZW |
2438 | -rm -f $(man1dir)/cpp$(manext) |
2439 | -$(INSTALL_DATA) $(srcdir)/cpp.1 $(man1dir)/cpp$(manext) | |
2440 | -chmod a-x $(man1dir)/cpp$(manext) | |
79d8453e RS |
2441 | |
2442 | # Install the library. | |
69cbb85a | 2443 | install-libgcc: libgcc.a installdirs |
79d8453e RS |
2444 | -if [ -f libgcc.a ] ; then \ |
2445 | rm -f $(libsubdir)/libgcc.a; \ | |
2446 | $(INSTALL_DATA) libgcc.a $(libsubdir)/libgcc.a; \ | |
8f25d5cd JW |
2447 | if $(RANLIB_TEST_FOR_TARGET) ; then \ |
2448 | (cd $(libsubdir); $(RANLIB_FOR_TARGET) libgcc.a); else true; fi; \ | |
79d8453e RS |
2449 | chmod a-x $(libsubdir)/libgcc.a; \ |
2450 | else true; fi | |
2451 | ||
f6cdc7ea | 2452 | # Install multiple versions of libgcc.a. |
69cbb85a | 2453 | install-multilib: stmp-multilib installdirs |
f6cdc7ea DE |
2454 | for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \ |
2455 | dir=`echo $$i | sed -e 's/;.*$$//'`; \ | |
c5c76735 | 2456 | if [ -d $(libsubdir)/$${dir} ]; then true; else mkdir $(libsubdir)/$${dir}; chmod a+rx $(libsubdir)/$${dir}; fi; \ |
47a22692 JM |
2457 | for f in libgcc.a $(EXTRA_MULTILIB_PARTS); do \ |
2458 | rm -f $(libsubdir)/$${dir}/$${f}; \ | |
2459 | $(INSTALL_DATA) $${dir}/$${f} $(libsubdir)/$${dir}/$${f}; \ | |
2460 | done; \ | |
8f25d5cd JW |
2461 | if $(RANLIB_TEST_FOR_TARGET); then \ |
2462 | (cd $(libsubdir)/$${dir}; $(RANLIB_FOR_TARGET) libgcc.a); \ | |
2463 | else true; fi; \ | |
f6cdc7ea DE |
2464 | chmod a-x $(libsubdir)/$${dir}/libgcc.a; \ |
2465 | done | |
2466 | ||
ba1811f1 | 2467 | # Install all the header files built in the include subdirectory. |
d7371761 | 2468 | install-headers: install-include-dir $(INSTALL_HEADERS_DIR) $(INSTALL_ASSERT_H) |
ba1811f1 ILT |
2469 | # Fix symlinks to absolute paths in the installed include directory to |
2470 | # point to the installed directory, not the build directory. | |
ac64120e | 2471 | # Don't need to use LN_S here since we really do need ln -s and no substitutes. |
ba1811f1 ILT |
2472 | -files=`cd $(libsubdir)/include; find . -type l -print 2>/dev/null`; \ |
2473 | if [ $$? -eq 0 ]; then \ | |
2474 | dir=`cd include; pwd`; \ | |
2475 | for i in $$files; do \ | |
2476 | dest=`ls -ld $(libsubdir)/include/$$i | sed -n 's/.*-> //p'`; \ | |
2477 | if expr "$$dest" : "$$dir.*" > /dev/null; then \ | |
2478 | rm -f $(libsubdir)/include/$$i; \ | |
44735512 | 2479 | ln -s `echo $$i | sed "s|/[^/]*|/..|g" | sed 's|/..$$||'``echo "$$dest" | sed "s|$$dir||"` $(libsubdir)/include/$$i; \ |
ba1811f1 ILT |
2480 | fi; \ |
2481 | done; \ | |
2482 | fi | |
79d8453e | 2483 | |
ba1811f1 | 2484 | # Create or recreate the gcc private include file directory. |
69cbb85a | 2485 | install-include-dir: installdirs |
ba1811f1 ILT |
2486 | -rm -rf $(libsubdir)/include |
2487 | mkdir $(libsubdir)/include | |
2488 | -chmod a+rx $(libsubdir)/include | |
2489 | ||
2490 | # Install the include directory using tar. | |
f95e46b9 | 2491 | install-headers-tar: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir |
965c3f43 AO |
2492 | # We use `pwd`/include instead of just include to problems with CDPATH |
2493 | # Unless a full pathname is provided, some shells would print the new CWD, | |
2494 | # found in CDPATH, corrupting the output. We could just redirect the | |
2495 | # output of `cd', but some shells lose on redirection within `()'s | |
2496 | (cd `pwd`/include ; \ | |
cf52b2f7 | 2497 | tar -cf - .; exit 0) | (cd $(libsubdir)/include; tar xpf - ) |
e6431ec5 RS |
2498 | # /bin/sh on some systems returns the status of the first tar, |
2499 | # and that can lose with GNU tar which always writes a full block. | |
2500 | # So use `exit 0' to ignore its exit status. | |
ba1811f1 ILT |
2501 | |
2502 | # Install the include directory using cpio. | |
f95e46b9 | 2503 | install-headers-cpio: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir |
965c3f43 AO |
2504 | # See discussion about the use of `pwd` above |
2505 | cd `pwd`/include ; \ | |
2506 | find . -print | cpio -pdum $(libsubdir)/include | |
79d8453e | 2507 | |
49ba557e RS |
2508 | # Put assert.h where it won't override GNU libc's assert.h. |
2509 | # It goes in a dir that is searched after GNU libc's headers; | |
2510 | # thus, the following conditionals are no longer needed. | |
2511 | # But it's not worth deleting them now. | |
2512 | ## Don't replace the assert.h already there if it is not from GCC. | |
2513 | ## This code would be simpler if it tested for -f ... && ! grep ... | |
2514 | ## but supposedly the ! operator is missing in sh on some systems. | |
69cbb85a | 2515 | install-assert-h: assert.h installdirs |
c9d929d7 RS |
2516 | if [ -f $(assertdir)/assert.h ]; \ |
2517 | then \ | |
998812ac | 2518 | if grep "__eprintf" $(assertdir)/assert.h >/dev/null; \ |
396f9edb | 2519 | then \ |
c9d929d7 RS |
2520 | rm -f $(assertdir)/assert.h; \ |
2521 | $(INSTALL_DATA) $(srcdir)/assert.h $(assertdir)/assert.h; \ | |
0cd4060d | 2522 | chmod a-x $(assertdir)/assert.h; \ |
c9d929d7 RS |
2523 | else true; \ |
2524 | fi; \ | |
9fcedbef | 2525 | else \ |
6204c24f RS |
2526 | rm -f $(assertdir)/assert.h; \ |
2527 | $(INSTALL_DATA) $(srcdir)/assert.h $(assertdir)/assert.h; \ | |
0cd4060d | 2528 | chmod a-x $(assertdir)/assert.h; \ |
9fcedbef | 2529 | fi |
79d8453e | 2530 | |
10da1131 | 2531 | # Use this target to install the program `collect2' under the name `collect2'. |
69cbb85a | 2532 | install-collect2: collect2 installdirs |
10da1131 | 2533 | $(INSTALL_PROGRAM) collect2$(exeext) $(libsubdir)/collect2$(exeext) |
2e494f70 | 2534 | # Install the driver program as $(libsubdir)/gcc for collect2. |
173712fb | 2535 | $(INSTALL_PROGRAM) xgcc$(exeext) $(libsubdir)/gcc$(exeext) |
2e494f70 | 2536 | |
79d8453e | 2537 | # Cancel installation by deleting the installed files. |
587a4ba6 | 2538 | uninstall: intl.uninstall lang.uninstall $(UNINSTALL_CPP) |
79d8453e | 2539 | -rm -rf $(libsubdir) |
173712fb RK |
2540 | -rm -rf $(bindir)/$(GCC_INSTALL_NAME)$(exeext) |
2541 | -rm -rf $(bindir)/$(GCC_CROSS_NAME)$(exeext) | |
23473647 NS |
2542 | -rm -rf $(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext) |
2543 | -rm -rf $(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext) | |
2544 | -rm -rf $(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext) | |
2545 | -rm -rf $(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext) | |
2546 | -rm -rf $(bindir)/$(GCOV_INSTALL_NAME)$(exeext) | |
a76b6b40 MH |
2547 | -rm -rf $(man1dir)/$(GCC_INSTALL_NAME)$(manext) |
2548 | -rm -rf $(man1dir)/$(GCC_CROSS_NAME)$(manext) | |
86702e31 | 2549 | -rm -rf $(man1dir)/cpp$(manext) |
a76b6b40 MH |
2550 | -rm -rf $(man1dir)/protoize$(manext) |
2551 | -rm -rf $(man1dir)/unprotoize$(manext) | |
9ec36da5 | 2552 | -rm -f $(infodir)/cpp.info* $(infodir)/gcc.info* |
544eb21e | 2553 | #\f |
4c457b6b | 2554 | # These targets are for the dejagnu testsuites. The file site.exp |
e933cbe0 JL |
2555 | # contains global variables that all the testsuites will use. |
2556 | ||
2557 | # Set to $(target_alias)/ for cross. | |
2558 | target_subdir = @target_subdir@ | |
2559 | ||
2560 | site.exp: ./config.status Makefile | |
2561 | @echo "Making a new config file..." | |
2562 | -@rm -f ./tmp? | |
2563 | @touch site.exp | |
2564 | -@mv site.exp site.bak | |
2565 | @echo "## these variables are automatically generated by make ##" > ./tmp0 | |
2566 | @echo "# Do not edit here. If you wish to override these values" >> ./tmp0 | |
2567 | @echo "# add them to the last section" >> ./tmp0 | |
2568 | @echo "set rootme \"`pwd`\"" >> ./tmp0 | |
2569 | @echo "set srcdir \"`cd ${srcdir}; pwd`\"" >> ./tmp0 | |
2570 | @echo "set host_triplet $(host_canonical)" >> ./tmp0 | |
2571 | @echo "set build_triplet $(build_canonical)" >> ./tmp0 | |
2572 | @echo "set target_triplet $(target)" >> ./tmp0 | |
2573 | @echo "set target_alias $(target_alias)" >> ./tmp0 | |
2574 | # CFLAGS is set even though it's empty to show we reserve the right to set it. | |
2575 | @echo "set CFLAGS \"\"" >> ./tmp0 | |
2576 | @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 | |
2577 | # If newlib has been configured, we need to pass -B to gcc so it can find | |
2578 | # newlib's crt0.o if it exists. This will cause a "path prefix not used" | |
2579 | # message if it doesn't, but the testsuite is supposed to ignore the message - | |
2580 | # it's too difficult to tell when to and when not to pass -B (not all targets | |
2581 | # have crt0's). We could only add the -B if ../newlib/crt0.o exists, but that | |
2582 | # seems like too selective a test. | |
2583 | # ??? Another way to solve this might be to rely on linker scripts. Then | |
2584 | # theoretically the -B won't be needed. | |
2585 | # We also need to pass -L ../ld so that the linker can find ldscripts. | |
2586 | @if [ -d $(objdir)/../$(target_subdir)newlib ] ; then \ | |
2587 | echo "set newlib_cflags \"-I$(objdir)/../$(target_subdir)newlib/targ-include -I\$$srcdir/../newlib/libc/include\"" >> ./tmp0; \ | |
2588 | echo "set newlib_ldflags \"-B$(objdir)/../$(target_subdir)newlib/\"" >> ./tmp0; \ | |
2589 | echo "append CFLAGS \" \$$newlib_cflags\"" >> ./tmp0; \ | |
2590 | echo "append CXXFLAGS \" \$$newlib_cflags\"" >> ./tmp0; \ | |
2591 | echo "append LDFLAGS \" \$$newlib_ldflags\"" >> ./tmp0; \ | |
2592 | else true; \ | |
2593 | fi | |
2594 | @if [ -d $(objdir)/../ld ] ; then \ | |
2595 | echo "append LDFLAGS \" -L$(objdir)/../ld\"" >> ./tmp0; \ | |
2596 | else true; \ | |
2597 | fi | |
ccdb9251 | 2598 | echo "set tmpdir $(objdir)/testsuite" >> ./tmp0 |
e933cbe0 JL |
2599 | @echo "set srcdir \"\$${srcdir}/testsuite\"" >> ./tmp0 |
2600 | @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0 | |
2601 | @cat ./tmp0 > site.exp | |
2602 | @cat site.bak | sed \ | |
2603 | -e '1,/^## All variables above are.*##/ d' >> site.exp | |
2604 | -@rm -f ./tmp? | |
2605 | ||
d8bb17c8 | 2606 | CHECK_TARGETS = check-gcc check-g++ check-g77 check-objc |
e933cbe0 JL |
2607 | |
2608 | check: $(CHECK_TARGETS) | |
2609 | ||
3979dfb8 | 2610 | testsuite/site.exp: site.exp |
e933cbe0 JL |
2611 | if [ -d testsuite ]; then \ |
2612 | true; \ | |
2613 | else \ | |
2614 | mkdir testsuite; \ | |
2615 | fi | |
2616 | rm -rf testsuite/site.exp | |
2617 | cp site.exp testsuite/site.exp | |
3979dfb8 JW |
2618 | |
2619 | check-g++: testsuite/site.exp | |
2620 | -rootme=`pwd`; export rootme; \ | |
e933cbe0 JL |
2621 | srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \ |
2622 | cd testsuite; \ | |
2623 | EXPECT=${EXPECT} ; export EXPECT ; \ | |
2624 | if [ -f $${rootme}/../expect/expect ] ; then \ | |
73a3903d | 2625 | TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; pwd` ; \ |
e933cbe0 JL |
2626 | export TCL_LIBRARY ; fi ; \ |
2627 | $(RUNTEST) --tool g++ $(RUNTESTFLAGS) | |
2628 | ||
3979dfb8 JW |
2629 | check-gcc: testsuite/site.exp |
2630 | -rootme=`pwd`; export rootme; \ | |
e933cbe0 JL |
2631 | srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \ |
2632 | cd testsuite; \ | |
2633 | EXPECT=${EXPECT} ; export EXPECT ; \ | |
2634 | if [ -f $${rootme}/../expect/expect ] ; then \ | |
73a3903d | 2635 | TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; pwd` ; \ |
e933cbe0 JL |
2636 | export TCL_LIBRARY ; fi ; \ |
2637 | $(RUNTEST) --tool gcc $(RUNTESTFLAGS) | |
2638 | ||
dc84d7bc JL |
2639 | check-g77: testsuite/site.exp |
2640 | -rootme=`pwd`; export rootme; \ | |
2641 | srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \ | |
2642 | cd testsuite; \ | |
2643 | EXPECT=${EXPECT} ; export EXPECT ; \ | |
2644 | if [ -f $${rootme}/../expect/expect ] ; then \ | |
73a3903d | 2645 | TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; pwd` ; \ |
dc84d7bc JL |
2646 | export TCL_LIBRARY ; fi ; \ |
2647 | $(RUNTEST) --tool g77 $(RUNTESTFLAGS) | |
2648 | ||
d8bb17c8 OP |
2649 | check-objc: testsuite/site.exp |
2650 | -rootme=`pwd`; export rootme; \ | |
2651 | srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \ | |
2652 | cd testsuite; \ | |
2653 | EXPECT=${EXPECT} ; export EXPECT ; \ | |
2654 | if [ -f $${rootme}/../expect/expect ] ; then \ | |
73a3903d | 2655 | TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; pwd` ; \ |
d8bb17c8 OP |
2656 | export TCL_LIBRARY ; fi ; \ |
2657 | $(RUNTEST) --tool objc $(RUNTESTFLAGS) | |
2658 | ||
79d8453e RS |
2659 | # These exist for maintenance purposes. |
2660 | ||
2661 | # Update the tags table. | |
2662 | TAGS: force | |
2663 | cd $(srcdir); \ | |
e5e809f4 | 2664 | mkdir tmp-tags; \ |
86702e31 | 2665 | mv -f c-parse.[ch] =*.[chy] tmp-tags; \ |
79d8453e | 2666 | etags *.y *.h *.c; \ |
e5e809f4 JL |
2667 | mv tmp-tags/* .; \ |
2668 | rmdir tmp-tags | |
79d8453e | 2669 | |
e5e809f4 JL |
2670 | # Create the distribution tar.gz file. |
2671 | dist: tmp-gcc.xtar | |
2672 | gzip --best < tmp-gcc.xtar > tmp-gcc.xtar.gz | |
2673 | mv tmp-gcc.xtar.gz gcc-$(version).tar.gz | |
79d8453e | 2674 | |
e5e809f4 | 2675 | tmp-gcc.xtar: distdir |
7d27b36c | 2676 | # Make the distribution. |
e5e809f4 JL |
2677 | tar -chf tmp-gcc.xtar gcc-$(version) |
2678 | ||
2679 | distdir-cvs: force | |
298978c9 | 2680 | if [ -d $(srcdir)/CVS ]; then cd $(srcdir) && cvs -r update; fi |
7d27b36c | 2681 | |
013a2ee0 DE |
2682 | # This target exists to do the initial work before the language specific |
2683 | # stuff gets done. | |
0e5921e8 | 2684 | distdir-start: doc $(srcdir)/INSTALL $(srcdir)/c-parse.y \ |
86702e31 | 2685 | $(srcdir)/c-parse.c $(srcdir)/config.in $(srcdir)/version.c TAGS |
ab87f8c8 JL |
2686 | @case '$(USE_NLS)' in \ |
2687 | yes) ;; \ | |
2688 | *) echo "configure with --enable-nls before making a distribution"; \ | |
2689 | exit 1;; \ | |
2690 | esac | |
db4e119f | 2691 | @if grep -s "for version ${mainversion}" gcc.texi > /dev/null; \ |
f780d21b | 2692 | then true; \ |
96b5daff | 2693 | else echo "You must update the version number in \`gcc.texi'"; sleep 10;\ |
f780d21b | 2694 | fi |
be0d23ff | 2695 | # Update the version number in README |
ab87f8c8 | 2696 | $(AWK) '$$1 " " $$2 " " $$3 == "This directory contains" \ |
be0d23ff RS |
2697 | { $$6 = version; print $$0 } \ |
2698 | $$1 " " $$2 " " $$3 != "This directory contains"' \ | |
298978c9 | 2699 | version=$(version) $(srcdir)/README > tmp.README |
be0d23ff | 2700 | mv tmp.README README |
4c457b6b | 2701 | -rm -rf gcc-$(version) tmp |
79d8453e RS |
2702 | # Put all the files in a temporary subdirectory |
2703 | # which has the name that we want to have in the tar file. | |
2e494f70 RS |
2704 | mkdir tmp |
2705 | mkdir tmp/config | |
eb3a6507 | 2706 | mkdir tmp/ginclude |
298978c9 | 2707 | mkdir tmp/objc |
ab87f8c8 JL |
2708 | mkdir tmp/intl |
2709 | mkdir tmp/po | |
298978c9 PB |
2710 | for file in `(cd $(srcdir) && echo *[0-9a-zA-Z+])`; do \ |
2711 | test -f $(srcdir)/$$file && $(LN_S) $(srcdir)/$$file tmp; \ | |
2e494f70 | 2712 | done |
298978c9 | 2713 | if test "$(srcdir)" != "." ; then \ |
86702e31 | 2714 | for file in c-parse.c ; do \ |
298978c9 PB |
2715 | test -f ./$$file && $(LN_S) ../$$file tmp; \ |
2716 | done; \ | |
2717 | fi | |
2718 | for file in `(cd $(srcdir)/config && echo *[0-9a-zA-Z+])`; do \ | |
2719 | if test -d $(srcdir)/config/$$file \ | |
2720 | && test "$$file" != RCS && test "$$file" != CVS; then \ | |
2721 | mkdir tmp/config/$$file; \ | |
2722 | for subfile in `(cd $(srcdir)/config/$$file && echo *[0-9a-zA-Z+])`; do \ | |
2723 | $(LN_S) $(srcdir)/config/$$file/$$subfile tmp/config/$$file; \ | |
e52114f8 | 2724 | done; \ |
e52114f8 | 2725 | else \ |
298978c9 | 2726 | $(LN_S) $(srcdir)/config/$$file tmp/config; \ |
e52114f8 | 2727 | fi; \ |
79d8453e | 2728 | done |
298978c9 PB |
2729 | for file in `(cd $(srcdir)/ginclude && echo *[0-9a-zA-Z+])`; do \ |
2730 | $(LN_S) $(srcdir)/ginclude/$$file tmp/ginclude; \ | |
eb3a6507 | 2731 | done |
298978c9 PB |
2732 | for file in `(cd $(srcdir)/objc && echo *[0-9a-zA-Z+])`; do \ |
2733 | $(LN_S) $(srcdir)/objc/$$file tmp/objc; \ | |
ea727bbf | 2734 | done |
298978c9 | 2735 | $(LN_S) .gdbinit tmp |
013a2ee0 DE |
2736 | |
2737 | # Finish making `distdir', after the languages have done their thing. | |
2738 | distdir-finish: | |
2e494f70 | 2739 | mv tmp gcc-$(version) |
eb3a6507 RK |
2740 | # Get rid of everything we don't want in the distribution. We'd want |
2741 | # this to use Makefile.in, but it doesn't have the `lang.foo' targets | |
2742 | # expanded. | |
ab87f8c8 JL |
2743 | cd gcc-$(version); make extraclean distdir-check VERSION_DEP= |
2744 | ||
2745 | distdir-check: | |
2746 | ($(AWK) '/^[^#]/{print} /^#[A-Za-z]/{print substr($$1, 2)}' | sort) \ | |
2747 | < po/POTFILES.in > tmp.POTFILES | |
2748 | ls [A-Za-z]*.[ch] [a-z]*/[A-Za-z]*.[ch] \ | |
2749 | [a-z]*/[a-z]*/[A-Za-z]*.[ch] | sort > tmp.src | |
2750 | diff tmp.POTFILES tmp.src || { \ | |
2751 | echo "po/POTFILES.in and sources do not match -- please fix"; \ | |
2752 | exit 1; \ | |
2753 | } | |
2754 | rm -f tmp.* | |
79d8453e | 2755 | |
ab87f8c8 JL |
2756 | distdir: distdir-cvs distdir-start intl.distdir intl.distdir-fixup \ |
2757 | lang.distdir distdir-finish | |
013a2ee0 | 2758 | |
4c457b6b | 2759 | # make diff oldversion=M.N |
db4e119f RS |
2760 | # creates a diff file between an older distribution and this one. |
2761 | # The -P option assumes this is GNU diff. | |
2762 | diff: | |
0e5921e8 | 2763 | diff -rc2P -x c-parse.y -x c-parse.c \ |
86702e31 | 2764 | -x TAGS -x INSTALL -x configure -x config.in \ |
013a2ee0 DE |
2765 | -x "gcc.??" -x "gcc.??s" -x gcc.aux -x "gcc.info*" \ |
2766 | -x "cpp.??" -x "cpp.??s" -x cpp.aux -x "cpp.info*" \ | |
2767 | $(LANG_DIFF_EXCLUDES) \ | |
e5e809f4 | 2768 | gcc-$(oldversion) gcc-$(version) > gcc-$(oldversion)-$(version).diff |
db4e119f | 2769 | |
87a8affe | 2770 | # A list of files to be destroyed during "lean" builds. |
a36556a8 | 2771 | VOL_FILES=`echo $(BACKEND) $(OBJS) $(C_OBJS) $(LIBCPP_OBJS) *.c *.h gen*` |
87a8affe | 2772 | |
9c4614c3 TW |
2773 | # Only build the C compiler for stage1, because that is the only one that |
2774 | # we can guarantee will build with the native compiler, and also it is the | |
2775 | # only thing useful for building stage2. | |
204093e6 DT |
2776 | stage_a: |
2777 | +$(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)" LANG_LIB2FUNCS= | |
2778 | touch stage_a | |
2779 | ||
112c7aea | 2780 | stage_b: stage_a |
79d8453e | 2781 | $(MAKE) stage1 |
204093e6 DT |
2782 | touch stage_b |
2783 | ||
2e494f70 RS |
2784 | # This used to define ALLOCA as empty, but that would lead to bad results |
2785 | # for a subsequent `make install' since that would not have ALLOCA empty. | |
2786 | # To prevent `make install' from compiling alloca.o and then relinking cc1 | |
2787 | # because alloca.o is newer, we permit these recursive makes to compile | |
2788 | # alloca.o. Then cc1 is newer, so it won't have to be relinked. | |
112c7aea | 2789 | stage_c: stage_b |
204093e6 DT |
2790 | +$(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CFLAGS="$(BOOT_CFLAGS)" WARN_CFLAGS="$(WARN2_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)" |
2791 | touch stage_c | |
2792 | ||
112c7aea | 2793 | stage_d: stage_c |
204093e6 DT |
2794 | +$(MAKE) stage2 |
2795 | touch stage_d | |
2796 | ||
112c7aea | 2797 | stage_e: stage_d |
204093e6 DT |
2798 | +$(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CFLAGS="$(BOOT_CFLAGS)" WARN_CFLAGS="$(WARN2_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)" |
2799 | touch stage_e | |
2800 | ||
2801 | # For bootstrap4: | |
112c7aea | 2802 | stage_f: stage_e |
204093e6 DT |
2803 | +$(MAKE) CC="stage3/xgcc$(exeext) -B$(build_tooldir)/bin/ -Bstage3/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage3/ LANGUAGES="$(LANGUAGES)" |
2804 | touch stage_f | |
2805 | ||
2806 | # Additional steps for *-lean targets: | |
d5cfb451 | 2807 | clean_s1: stage_b |
204093e6 DT |
2808 | -cd stage1; rm -f $(VOL_FILES) |
2809 | touch clean_s1 | |
2810 | ||
d5cfb451 | 2811 | clean_s2: stage_d |
204093e6 | 2812 | -rm -rf stage1 |
204093e6 DT |
2813 | touch clean_s2 |
2814 | ||
2815 | # This next little bit is the way it is for parallel builds. It's simply | |
2816 | # a chain of stages which DO have to be done sequentially. | |
2817 | ||
2818 | bootstrap_a: stage_a | |
2819 | bootstrap_b: bootstrap_a stage_b | |
2820 | bootstrap_c: bootstrap_b stage_c | |
2821 | bootstrap_d: bootstrap_c stage_d | |
2822 | bootstrap_e: bootstrap_d stage_e | |
2823 | bootstrap: force bootstrap_e | |
2824 | ||
2825 | bootstrap-lean_a: stage_a | |
2826 | bootstrap-lean_b: bootstrap-lean_a stage_b | |
2827 | bootstrap-lean_c: bootstrap-lean_b clean_s1 | |
2828 | bootstrap-lean_d: bootstrap-lean_c stage_c | |
2829 | bootstrap-lean_e: bootstrap-lean_d stage_d | |
2830 | bootstrap-lean_f: bootstrap-lean_e clean_s2 | |
2831 | bootstrap-lean_g: bootstrap-lean_f stage_e | |
1bac0fb4 | 2832 | bootstrap-lean: force bootstrap-lean_g |
204093e6 DT |
2833 | |
2834 | bootstrap2_c: stage_c | |
2835 | bootstrap2_d: bootstrap2_c stage_d | |
2836 | bootstrap2_e: bootstrap2_d stage_e | |
2837 | bootstrap2: force bootstrap2_e | |
2838 | ||
2839 | bootstrap2-lean_c: stage_c | |
2840 | bootstrap2-lean_d: bootstrap2-lean_c stage_d | |
2841 | bootstrap2-lean_e: bootstrap2-lean_d clean_s2 | |
2842 | bootstrap2-lean_f: bootstrap2-lean_e stage_e | |
2843 | bootstrap2-lean: force bootstrap2-lean_f | |
2844 | ||
2845 | bootstrap3 bootstrap3-lean: force stage_e | |
2846 | ||
2847 | bootstrap4 bootstrap4-lean: force stage_f | |
361e618f | 2848 | |
dcfedcd0 RK |
2849 | # Compare the object files in the current directory with those in the |
2850 | # stage2 directory. | |
2851 | ||
9825189b | 2852 | # ./ avoids bug in some versions of tail. |
e85988b5 | 2853 | compare compare3 compare4 compare-lean compare3-lean compare4-lean: force |
3fb2f401 | 2854 | -rm -f .bad_compare |
e85988b5 | 2855 | case "$@" in compare | compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^compare\([0-9][0-9]*\).*,\1,'` ;; esac; \ |
aab26e16 | 2856 | for file in *$(objext); do \ |
9825189b | 2857 | tail +16c ./$$file > tmp-foo1; \ |
e85988b5 | 2858 | tail +16c stage$$stage/$$file > tmp-foo2 \ |
3fb2f401 | 2859 | && (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \ |
dcfedcd0 | 2860 | done |
e85988b5 | 2861 | case "$@" in compare | compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^compare\([0-9][0-9]*\).*,\1,'` ;; esac; \ |
ab87f8c8 | 2862 | for dir in tmp-foo intl $(SUBDIRS); do \ |
aab26e16 RK |
2863 | if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \ |
2864 | for file in $$dir/*$(objext); do \ | |
013a2ee0 | 2865 | tail +16c ./$$file > tmp-foo1; \ |
e85988b5 | 2866 | tail +16c stage$$stage/$$file > tmp-foo2 \ |
3fb2f401 | 2867 | && (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \ |
094ecbb0 | 2868 | done; \ |
7ce1e6c8 | 2869 | else true; fi; \ |
013a2ee0 | 2870 | done |
dcfedcd0 | 2871 | -rm -f tmp-foo* |
4931312c | 2872 | case "$@" in compare | compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^compare\([0-9][0-9]*\).*,\1,'` ;; esac; \ |
3fb2f401 JL |
2873 | if [ -f .bad_compare ]; then \ |
2874 | echo "Bootstrap comparison failure!"; \ | |
2875 | cat .bad_compare; \ | |
2876 | exit 1; \ | |
e85988b5 MH |
2877 | else \ |
2878 | case "$@" in \ | |
2879 | *-lean ) rm -rf stage$$stage ;; \ | |
25b76cc1 | 2880 | *) ;; \ |
e85988b5 | 2881 | esac; true; \ |
3fb2f401 | 2882 | fi |
dcfedcd0 | 2883 | |
e85988b5 MH |
2884 | # Compare the object files in the current directory with those in the |
2885 | # stage2 directory. Use gnu cmp (diffutils v2.4 or later) to avoid | |
2886 | # running tail and the overhead of twice copying each object file. | |
2887 | ||
2888 | gnucompare gnucompare3 gnucompare4 gnucompare-lean gnucompare3-lean gnucompare4-lean: force | |
b1e3ddfd | 2889 | -rm -f .bad_compare |
e85988b5 | 2890 | case "$@" in gnucompare | gnucompare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^gnucompare\([0-9][0-9]*\).*,\1,'` ;; esac; \ |
b1e3ddfd | 2891 | for file in *$(objext); do \ |
e85988b5 | 2892 | (cmp --ignore-initial=16 $$file stage$$stage/$$file > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \ |
b1e3ddfd | 2893 | done |
e85988b5 | 2894 | case "$@" in gnucompare | gnucompare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^gnucompare\([0-9][0-9]*\).*,\1,'` ;; esac; \ |
ab87f8c8 | 2895 | for dir in tmp-foo intl $(SUBDIRS); do \ |
b1e3ddfd AJ |
2896 | if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \ |
2897 | for file in $$dir/*$(objext); do \ | |
e85988b5 | 2898 | (cmp --ignore-initial=16 $$file stage$$stage/$$file > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \ |
b1e3ddfd | 2899 | done; \ |
7ce1e6c8 | 2900 | else true; fi; \ |
b1e3ddfd | 2901 | done |
4931312c | 2902 | case "$@" in gnucompare | gnucompare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^gnucompare\([0-9][0-9]*\).*,\1,'` ;; esac; \ |
b1e3ddfd AJ |
2903 | if [ -f .bad_compare ]; then \ |
2904 | echo "Bootstrap comparison failure!"; \ | |
2905 | cat .bad_compare; \ | |
2906 | exit 1; \ | |
e85988b5 MH |
2907 | else \ |
2908 | case "$@" in \ | |
2909 | *-lean ) rm -rf stage$$stage ;; \ | |
2910 | esac; true; \ | |
b1e3ddfd AJ |
2911 | fi |
2912 | ||
79d8453e | 2913 | # Copy the object files from a particular stage into a subdirectory. |
013a2ee0 | 2914 | stage1-start: |
2e494f70 | 2915 | -if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi |
f472a17c AS |
2916 | $(MAKE) -f libgcc.mk libgcc-stage-start stage=stage1 |
2917 | -for dir in intl $(SUBDIRS) ; \ | |
013a2ee0 | 2918 | do \ |
9a517e7b | 2919 | if [ -d stage1/$$dir ] ; then true ; else mkdir stage1/$$dir ; fi ; \ |
013a2ee0 | 2920 | done |
79d8453e | 2921 | -mv $(STAGESTUFF) stage1 |
ab87f8c8 | 2922 | -mv intl/*$(objext) stage1/intl |
338023d4 DE |
2923 | # Copy as/ld if they exist to stage dir, so that running xgcc from the stage |
2924 | # dir will work properly. | |
ac64120e JW |
2925 | -if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage1 ; else true ; fi |
2926 | -if [ -f ld$(exeext) ] ; then $(LN_S) ../ld$(exeext) stage1 ; else true ; fi | |
2927 | -if [ -f collect-ld$(exeext) ] ; then $(LN_S) ../collect-ld$(exeext) stage1 ; else true ; fi | |
79d8453e RS |
2928 | -rm -f stage1/libgcc.a |
2929 | -cp libgcc.a stage1 | |
8f25d5cd JW |
2930 | -if $(RANLIB_TEST_FOR_TARGET) ; then \ |
2931 | $(RANLIB_FOR_TARGET) stage1/libgcc.a; \ | |
2932 | else true; fi | |
04e95620 JM |
2933 | -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \ |
2934 | cp stage1/$${f} . ; \ | |
db814993 | 2935 | else true; \ |
04e95620 | 2936 | fi; done |
013a2ee0 | 2937 | stage1: force stage1-start lang.stage1 |
79d8453e | 2938 | |
013a2ee0 | 2939 | stage2-start: |
2e494f70 | 2940 | -if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi |
f472a17c AS |
2941 | $(MAKE) -f libgcc.mk libgcc-stage-start stage=stage2 |
2942 | -for dir in intl $(SUBDIRS) ; \ | |
013a2ee0 | 2943 | do \ |
9a517e7b | 2944 | if [ -d stage2/$$dir ] ; then true ; else mkdir stage2/$$dir ; fi ; \ |
013a2ee0 | 2945 | done |
79d8453e | 2946 | -mv $(STAGESTUFF) stage2 |
ab87f8c8 | 2947 | -mv intl/*$(objext) stage2/intl |
338023d4 DE |
2948 | # Copy as/ld if they exist to stage dir, so that running xgcc from the stage |
2949 | # dir will work properly. | |
ac64120e JW |
2950 | -if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage2 ; else true ; fi |
2951 | -if [ -f ld$(exeext) ] ; then $(LN_S) ../ld$(exeext) stage2 ; else true ; fi | |
2952 | -if [ -f collect-ld ] ; then $(LN_S) ../collect-ld$(exeext) stage2 ; else true ; fi | |
79d8453e RS |
2953 | -rm -f stage2/libgcc.a |
2954 | -cp libgcc.a stage2 | |
8f25d5cd JW |
2955 | -if $(RANLIB_TEST_FOR_TARGET) ; then \ |
2956 | $(RANLIB_FOR_TARGET) stage2/libgcc.a; \ | |
2957 | else true; fi | |
04e95620 JM |
2958 | -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \ |
2959 | cp stage2/$${f} . ; \ | |
db814993 | 2960 | else true; \ |
04e95620 | 2961 | fi; done |
013a2ee0 | 2962 | stage2: force stage2-start lang.stage2 |
79d8453e | 2963 | |
013a2ee0 | 2964 | stage3-start: |
935e11b0 | 2965 | -if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi |
f472a17c AS |
2966 | $(MAKE) -f libgcc.mk libgcc-stage-start stage=stage3 |
2967 | -for dir in intl $(SUBDIRS) ; \ | |
013a2ee0 | 2968 | do \ |
9a517e7b | 2969 | if [ -d stage3/$$dir ] ; then true ; else mkdir stage3/$$dir ; fi ; \ |
013a2ee0 | 2970 | done |
79d8453e | 2971 | -mv $(STAGESTUFF) stage3 |
ab87f8c8 | 2972 | -mv intl/*$(objext) stage3/intl |
338023d4 DE |
2973 | # Copy as/ld if they exist to stage dir, so that running xgcc from the stage |
2974 | # dir will work properly. | |
ac64120e JW |
2975 | -if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage3 ; else true ; fi |
2976 | -if [ -f ld$(exeext) ] ; then $(LN_S) ../ld$(exeext) stage3 ; else true ; fi | |
2977 | -if [ -f collect-ld$(exeext) ] ; then $(LN_S) ../collect-ld$(exeext) stage3 ; else true ; fi | |
79d8453e RS |
2978 | -rm -f stage3/libgcc.a |
2979 | -cp libgcc.a stage3 | |
8f25d5cd JW |
2980 | -if $(RANLIB_TEST_FOR_TARGET) ; then \ |
2981 | $(RANLIB_FOR_TARGET) stage3/libgcc.a; \ | |
2982 | else true; fi | |
04e95620 JM |
2983 | -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \ |
2984 | cp stage3/$${f} . ; \ | |
db814993 | 2985 | else true; \ |
04e95620 | 2986 | fi; done |
013a2ee0 | 2987 | stage3: force stage3-start lang.stage3 |
79d8453e | 2988 | |
013a2ee0 | 2989 | stage4-start: |
935e11b0 | 2990 | -if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi |
f472a17c AS |
2991 | $(MAKE) -f libgcc.mk libgcc-stage-start stage=stage4 |
2992 | -for dir in intl $(SUBDIRS) ; \ | |
013a2ee0 | 2993 | do \ |
9a517e7b | 2994 | if [ -d stage4/$$dir ] ; then true ; else mkdir stage4/$$dir ; fi ; \ |
013a2ee0 | 2995 | done |
79d8453e | 2996 | -mv $(STAGESTUFF) stage4 |
ab87f8c8 | 2997 | -mv intl/*$(objext) stage4/intl |
338023d4 DE |
2998 | # Copy as/ld if they exist to stage dir, so that running xgcc from the stage |
2999 | # dir will work properly. | |
ac64120e JW |
3000 | -if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage4 ; else true ; fi |
3001 | -if [ -f ld$(exeext) ] ; then $(LN_S) ../ld$(exeext) stage4 ; else true ; fi | |
3002 | -if [ -f collect-ld$(exeext) ] ; then $(LN_S) ../collect-ld$(exeext) stage4 ; else true ; fi | |
79d8453e RS |
3003 | -rm -f stage4/libgcc.a |
3004 | -cp libgcc.a stage4 | |
8f25d5cd JW |
3005 | -if $(RANLIB_TEST_FOR_TARGET) ; then \ |
3006 | $(RANLIB_FOR_TARGET) stage4/libgcc.a; \ | |
3007 | else true; fi | |
04e95620 JM |
3008 | -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \ |
3009 | cp stage4/$${f} . ; \ | |
db814993 | 3010 | else true; \ |
04e95620 | 3011 | fi; done |
013a2ee0 | 3012 | stage4: force stage4-start lang.stage4 |
79d8453e RS |
3013 | |
3014 | # Copy just the executable files from a particular stage into a subdirectory, | |
3015 | # and delete the object files. Use this if you're just verifying a version | |
3016 | # that is pretty sure to work, and you are short of disk space. | |
aab26e16 | 3017 | risky-stage1: stage1 |
003455d9 | 3018 | -make clean |
79d8453e | 3019 | |
aab26e16 | 3020 | risky-stage2: stage2 |
79d8453e RS |
3021 | -make clean |
3022 | ||
aab26e16 | 3023 | risky-stage3: stage3 |
79d8453e RS |
3024 | -make clean |
3025 | ||
aab26e16 | 3026 | risky-stage4: stage4 |
79d8453e RS |
3027 | -make clean |
3028 | ||
3029 | #In GNU Make, ignore whether `stage*' exists. | |
f1908d70 | 3030 | .PHONY: stage1 stage2 stage3 stage4 clean maintainer-clean TAGS bootstrap |
79d8453e RS |
3031 | .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4 |
3032 | ||
3033 | force: | |
e7f62ad3 MH |
3034 | |
3035 | # --- | |
3036 | # The enquire rules are still useful for building new float-anything.h. | |
3037 | # Special flags for compiling enquire. | |
3038 | # We disable optimization to make floating point more reliable. | |
3039 | ENQUIRE_CFLAGS = -DNO_MEM -DNO_LONG_DOUBLE_IO -O0 | |
3040 | ENQUIRE_LDFLAGS = $(LDFLAGS) | |
3041 | ||
3042 | # Enquire target (This is a variable so that a target can choose not to | |
3043 | # build it.) | |
3044 | ENQUIRE = enquire | |
3045 | ||
3046 | # Test to see whether <float.h> exists in the system header files, | |
3047 | # and is not derived from GCC. | |
3048 | FLOAT_H_TEST = \ | |
3049 | [ -f $(SYSTEM_HEADER_DIR)/float.h ] && \ | |
3050 | if grep 'ifndef _FLOAT_H___' $(SYSTEM_HEADER_DIR)/float.h >/dev/null; \ | |
3051 | then false; \ | |
3052 | else :; fi | |
3053 | # We pretend to not having a usable <float.h>, hence disable the FLOAT_H_TEST | |
3054 | # to ensure, we're emitting a full blown <float.h> ourselves. | |
3055 | FLOAT_H_TEST = false | |
3056 | ||
3057 | # Used to compile enquire with standard cc, but have forgotten why. | |
3058 | # Let's try with GCC. | |
3059 | enquire: enquire.o $(GCC_PARTS) | |
3060 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ENQUIRE_LDFLAGS) enquire.o -o $@ | |
3061 | enquire.o: $(srcdir)/enquire.c $(GCC_PASSES) stmp-int-hdrs | |
3062 | if $(FLOAT_H_TEST); then \ | |
3063 | rm -f include/float.h; \ | |
3064 | SYS_FLOAT_H_WRAP=1; \ | |
3065 | else :; \ | |
3066 | SYS_FLOAT_H_WRAP=0; \ | |
3067 | fi; \ | |
3068 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(ENQUIRE_CFLAGS) \ | |
3069 | -DSYS_FLOAT_H_WRAP=$$SYS_FLOAT_H_WRAP \ | |
3070 | -I. -c $(srcdir)/enquire.c | |
3071 | ||
3072 | # Create float.h source for the native machine. | |
3073 | # Make it empty if we can use the system float.h without changes. | |
3074 | float.h-nat: enquire | |
3075 | -./enquire -f > tmp-float.h | |
3076 | grep '#define [^_]' tmp-float.h >/dev/null || true > tmp-float.h | |
3077 | mv tmp-float.h float.h-nat | |
3078 | ||
3079 | # Create a dummy float.h source for a cross-compiler. | |
3080 | # ??? This isn't used anymore. Should we create config/float-unkn.h | |
3081 | # and make that the default float_format in configure? | |
3082 | float.h-cross: | |
3083 | echo "#ifndef __GCC_FLOAT_NOT_NEEDED" > t-float.h-cross | |
3084 | echo "#error float.h values not known for cross-compiler" >> t-float.h-cross | |
3085 | echo "#endif" >> t-float.h-cross | |
3086 | mv t-float.h-cross float.h-cross |