Debian Codegraph @

gcc/Makefile.in

raw
1 # Makefile for GNU Compiler Collection
2 # Run 'configure' to generate Makefile from Makefile.in
3
4 # Copyright (C) 1987-2025 Free Software Foundation, Inc.
5
6 #This file is part of GCC.
7
8 #GCC is free software; you can redistribute it and/or modify
9 #it under the terms of the GNU General Public License as published by
10 #the Free Software Foundation; either version 3, or (at your option)
11 #any later version.
12
13 #GCC is distributed in the hope that it will be useful,
14 #but WITHOUT ANY WARRANTY; without even the implied warranty of
15 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 #GNU General Public License for more details.
17
18 #You should have received a copy of the GNU General Public License
19 #along with GCC; see the file COPYING3. If not see
20 #<http://www.gnu.org/licenses/>.
21
22 # The targets for external use include:
23 # all, doc, install, install-cross, install-cross-rest, install-strip,
24 # uninstall, TAGS, mostlyclean, clean, distclean, maintainer-clean.
25
26 # This is the default target.
27 # Set by autoconf to "all.internal" for a native build, or
28 # "all.cross" to build a cross compiler.
29 all: @ALL@
30
31 # Depend on this to specify a phony target portably.
32 force:
33
34 # This tells GNU make version 3 not to export the variables
35 # defined in this file into the environment (and thus recursive makes).
36 .NOEXPORT:
37 # And this tells it not to automatically pass command-line variables
38 # to recursive makes.
39 MAKEOVERRIDES =
40
41 # Suppress smart makes who think they know how to automake yacc and flex file
42 .y.c:
43 .l.c:
44
45 # The only suffixes we want for implicit rules are .c and .o, so clear
46 # the list and add them. This speeds up GNU Make, and allows -r to work.
47 # For i18n support, we also need .gmo, .po, .pox.
48 # This must come before the language makefile fragments to allow them to
49 # add suffixes and rules of their own.
50 .SUFFIXES:
51 .SUFFIXES: .c .cc .o .po .pox .gmo
52
53 # -------------------------------
54 # Standard autoconf-set variables
55 # -------------------------------
56
57 build=@build@
58 build_os=@build_os@
59 host=@host@
60 host_noncanonical=@host_noncanonical@
61 host_os=@host_os@
62 target=@target@
63 target_noncanonical:=@target_noncanonical@
64
65 # Normally identical to target_noncanonical, except for compilers built
66 # as accelerator targets.
67 real_target_noncanonical:=@real_target_noncanonical@
68 accel_dir_suffix = @accel_dir_suffix@
69
70 # Sed command to transform gcc to installed name.
71 program_transform_name := @program_transform_name@
72
73 # -----------------------------
74 # Directories used during build
75 # -----------------------------
76
77 # Directory where sources are, from where we are.
78 srcdir = @srcdir@
79 gcc_docdir = @srcdir@/doc
80
81 # Directory where sources are, absolute.
82 abs_srcdir = @abs_srcdir@
83 abs_docdir = @abs_srcdir@/doc
84
85 # Directory where sources are, relative to here.
86 top_srcdir = @top_srcdir@
87
88 # Top build directory for this package, relative to here.
89 top_builddir = .
90
91 # The absolute path to the current directory.
92 objdir := $(shell pwd)
93
94 host_subdir=@host_subdir@
95 build_subdir=@build_subdir@
96 target_subdir=@target_subdir@
97 build_libsubdir=@build_libsubdir@
98
99 # Top build directory for the "Cygnus tree", relative to $(top_builddir).
100 ifeq ($(host_subdir),.)
101 toplevel_builddir := ..
102 else
103 toplevel_builddir := ../..
104 endif
105
106 build_objdir := $(toplevel_builddir)/$(build_subdir)
107 build_libobjdir := $(toplevel_builddir)/$(build_libsubdir)
108 target_objdir := $(toplevel_builddir)/$(target_subdir)
109
110 # --------
111 # Defined vpaths
112 # --------
113
114 # Directory where sources are, from where we are.
115 VPATH = @srcdir@
116
117 # We define a vpath for the sources of the .texi files here because they
118 # are split between multiple directories and we would rather use one implicit
119 # pattern rule for everything.
120 # This vpath could be extended within the Make-lang fragments.
121
122 vpath %.texi $(gcc_docdir)
123 vpath %.texi $(gcc_docdir)/include
124
125 # --------
126 # UNSORTED
127 # --------
128
129 # Extra flags to pass to indicate cross compilation, which
130 # might be used or tested by Make-lang fragments.
131 CROSS=@CROSS@
132
133 # Variables that exist for you to override.
134 # See below for how to change them for certain systems.
135
136 # List of language subdirectories.
137 SUBDIRS =@subdirs@ build
138
139 # Selection of languages to be made.
140 CONFIG_LANGUAGES = @all_selected_languages@
141 LANGUAGES = c $(CONFIG_LANGUAGES)
142 ifeq (@enable_gcov@,yes)
143 LANGUAGES += gcov$(exeext) gcov-dump$(exeext) gcov-tool$(exeext)
144 endif
145
146 # Default values for variables overridden in Makefile fragments.
147 # CFLAGS is for the user to override to, e.g., do a cross build with -O2.
148 # TCFLAGS is used for compilations with the GCC just built.
149 # T_CFLAGS is used for all compilations and is overridden by t-* files.
150 # TFLAGS is also for the user to override, passed down from the top-level
151 # Makefile. It is used for all compilations.
152 T_CFLAGS =
153 TCFLAGS =
154 TFLAGS =
155 CFLAGS = @CFLAGS@
156 CXXFLAGS = @CXXFLAGS@
157 LDFLAGS = @LDFLAGS@
158
159 # Should we build position-independent host code?
160 PICFLAG = @PICFLAG@
161
162 # The linker flag for the above.
163 LD_PICFLAG = @LD_PICFLAG@
164
165 # Flags to determine code coverage. When coverage is disabled, this will
166 # contain the optimization flags, as you normally want code coverage
167 # without optimization.
168 COVERAGE_FLAGS = @coverage_flags@
169 coverageexts = .{gcda,gcno}
170
171 # The warning flags are separate from CFLAGS because people tend to
172 # override optimization flags and we'd like them to still have warnings
173 # turned on. These flags are also used to pass other stage dependent
174 # flags from configure. The user is free to explicitly turn these flags
175 # off if they wish.
176 # LOOSE_WARN are the warning flags to use when compiling something
177 # which is only compiled with gcc, such as libgcc.
178 # C_LOOSE_WARN is similar, but with C-only warnings.
179 # STRICT_WARN are the additional warning flags to
180 # apply to the back end and some front ends, which may be compiled
181 # with other compilers.
182 # C_STRICT_WARN is similar, with C-only warnings.
183 LOOSE_WARN = @loose_warn@
184 C_LOOSE_WARN = @c_loose_warn@
185 STRICT_WARN = @strict_warn@
186 C_STRICT_WARN = @c_strict_warn@
187
188 NOEXCEPTION_FLAGS = @noexception_flags@
189
190 ALIASING_FLAGS = @aliasing_flags@
191
192 # This is set by --disable-maintainer-mode (default) to "#"
193 # FIXME: 'MAINT' will always be set to an empty string, no matter if
194 # --disable-maintainer-mode is used or not. This is because the
195 # following will expand to "MAINT := " in maintainer mode, and to
196 # "MAINT := #" in non-maintainer mode, but because '#' starts a comment,
197 # they mean exactly the same thing for make.
198 MAINT := @MAINT@
199
200 # The following provides the variable ENABLE_MAINTAINER_RULES that can
201 # be used in language Make-lang.in makefile fragments to enable
202 # maintainer rules. So, ENABLE_MAINTAINER_RULES is 'true' in
203 # maintainer mode, and '' otherwise.
204 @MAINT@ ENABLE_MAINTAINER_RULES = true
205
206 # These are set by --enable-checking=valgrind.
207 RUN_GEN = @valgrind_command@
208 VALGRIND_DRIVER_DEFINES = @valgrind_path_defines@
209
210 # This is how we control whether or not the additional warnings are applied.
211 .-warn = $(STRICT_WARN)
212 build-warn = $(STRICT_WARN)
213 rtl-ssa-warn = $(STRICT_WARN)
214 GCC_WARN_CFLAGS = $(LOOSE_WARN) $(C_LOOSE_WARN) $($(@D)-warn) $(if $(filter-out $(STRICT_WARN),$($(@D)-warn)),,$(C_STRICT_WARN)) $($@-warn)
215 GCC_WARN_CXXFLAGS = $(LOOSE_WARN) $($(@D)-warn) $($@-warn)
216
217 # 1 2 3 ... 9999
218 one_to_9999_0:=1 2 3 4 5 6 7 8 9
219 one_to_9999_1:=0 $(one_to_9999_0)
220 one_to_9999_2:=$(foreach i,$(one_to_9999_0),$(addprefix $(i),$(one_to_9999_1)))
221 one_to_9999_3:=$(addprefix 0,$(one_to_9999_1)) $(one_to_9999_2)
222 one_to_9999_4:=$(foreach i,$(one_to_9999_0),$(addprefix $(i),$(one_to_9999_3)))
223 one_to_9999_5:=$(addprefix 0,$(one_to_9999_3)) $(one_to_9999_4)
224 one_to_9999_6:=$(foreach i,$(one_to_9999_0),$(addprefix $(i),$(one_to_9999_5)))
225 one_to_9999:=$(one_to_9999_0) $(one_to_9999_2) $(one_to_9999_4) $(one_to_9999_6)
226
227 # The number of splits to be made for the match.pd files.
228 NUM_MATCH_SPLITS = @DEFAULT_MATCHPD_PARTITIONS@
229 MATCH_SPLITS_SEQ = $(wordlist 1,$(NUM_MATCH_SPLITS),$(one_to_9999))
230 GIMPLE_MATCH_PD_SEQ_SRC = $(patsubst %, gimple-match-%.cc, $(MATCH_SPLITS_SEQ))
231 GIMPLE_MATCH_PD_SEQ_O = $(patsubst %, gimple-match-%.o, $(MATCH_SPLITS_SEQ))
232 GENERIC_MATCH_PD_SEQ_SRC = $(patsubst %, generic-match-%.cc, $(MATCH_SPLITS_SEQ))
233 GENERIC_MATCH_PD_SEQ_O = $(patsubst %, generic-match-%.o, $(MATCH_SPLITS_SEQ))
234
235 # The number of splits to be made for the insn-emit files.
236 NUM_INSNEMIT_SPLITS = @DEFAULT_INSNEMIT_PARTITIONS@
237 INSNEMIT_SPLITS_SEQ = $(wordlist 1,$(NUM_INSNEMIT_SPLITS),$(one_to_9999))
238 INSNEMIT_SEQ_SRC = $(patsubst %, insn-emit-%.cc, $(INSNEMIT_SPLITS_SEQ))
239 INSNEMIT_SEQ_TMP = $(patsubst %, tmp-emit-%.cc, $(INSNEMIT_SPLITS_SEQ))
240 INSNEMIT_SEQ_O = $(patsubst %, insn-emit-%.o, $(INSNEMIT_SPLITS_SEQ))
241
242 # Re-use the split number for insn-recog as well.
243 INSNRECOG_SPLITS_SEQ = $(wordlist 1,$(NUM_INSNEMIT_SPLITS),$(one_to_9999))
244 INSNRECOG_SEQ_SRC = $(patsubst %, insn-recog-%.cc, $(INSNRECOG_SPLITS_SEQ))
245 INSNRECOG_SEQ_TMP = $(patsubst %, tmp-recog-%.cc, $(INSNRECOG_SPLITS_SEQ))
246 INSNRECOG_SEQ_O = $(patsubst %, insn-recog-%.o, $(INSNRECOG_SPLITS_SEQ))
247
248 # These files are to have specific diagnostics suppressed, or are not to
249 # be subject to -Werror:
250 # flex output may yield harmless "no previous prototype" warnings
251 build/gengtype-lex.o-warn = -Wno-error
252 gengtype-lex.o-warn = -Wno-error
253 libgcov-util.o-warn = -Wno-error
254 libgcov-driver-tool.o-warn = -Wno-error
255 libgcov-merge-tool.o-warn = -Wno-error
256 gimple-match-exports.o-warn = -Wno-unused
257 dfp.o-warn = -Wno-strict-aliasing
258
259 # All warnings have to be shut off in stage1 if the compiler used then
260 # isn't gcc; configure determines that. WARN_CFLAGS will be either
261 # $(GCC_WARN_CFLAGS), or nothing. Similarly, WARN_CXXFLAGS will be
262 # either $(GCC_WARN_CXXFLAGS), or nothing.
263 WARN_CFLAGS = @warn_cflags@
264 WARN_CXXFLAGS = @warn_cxxflags@
265
266 CPPFLAGS = @CPPFLAGS@
267
268 AWK = @AWK@
269 CC = @CC@
270 CXX = @CXX@
271 BISON = @BISON@
272 BISONFLAGS =
273 FLEX = @FLEX@
274 FLEXFLAGS =
275 AR = @AR@
276 AR_FLAGS = rc
277 NM = @NM@
278 RANLIB = @RANLIB@
279 RANLIB_FLAGS = @ranlib_flags@
280
281 # Libraries to use on the host.
282 HOST_LIBS = @HOST_LIBS@
283
284 # The name of the compiler to use.
285 COMPILER = $(CXX)
286 COMPILER_FLAGS = $(CXXFLAGS)
287 # If HOST_LIBS is set, then the user is controlling the libraries to
288 # link against. In that case, link with $(CC) so that the -lstdc++
289 # library is not introduced. If HOST_LIBS is not set, link with
290 # $(CXX) to pick up -lstdc++.
291 ifeq ($(HOST_LIBS),)
292 LINKER = $(CXX)
293 LINKER_FLAGS = $(CXXFLAGS)
294 else
295 LINKER = $(CC)
296 LINKER_FLAGS = $(CFLAGS)
297 endif
298
299 enable_host_pie = @enable_host_pie@
300
301 # Enable Intel CET on Intel CET enabled host if needed.
302 CET_HOST_FLAGS = @CET_HOST_FLAGS@
303 COMPILER += $(CET_HOST_FLAGS)
304
305 DO_LINK_MUTEX = @DO_LINK_MUTEX@
306
307 # Maybe compile the compilers with -fPIE or -fPIC.
308 COMPILER += $(PICFLAG)
309
310 # Link with -pie, or -no-pie, depending on the above.
311 LINKER += $(LD_PICFLAG)
312
313 # Like LINKER, but use a mutex for serializing front end links.
314 ifeq (@DO_LINK_MUTEX@,true)
315 LLINKER = $(SHELL) $(srcdir)/lock-and-run.sh linkfe.lck $(LINKER)
316 else
317 LLINKER = $(LINKER)
318 endif
319
320 THIN_ARCHIVE_SUPPORT = @thin_archive_support@
321
322 USE_THIN_ARCHIVES = no
323 ifeq ($(THIN_ARCHIVE_SUPPORT),yes)
324 ifeq ($(AR_FLAGS),rc)
325 ifeq ($(RANLIB_FLAGS),)
326 USE_THIN_ARCHIVES = yes
327 endif
328 endif
329 endif
330
331 # -------------------------------------------
332 # Programs which operate on the build machine
333 # -------------------------------------------
334
335 SHELL = @SHELL@
336 # pwd command to use. Allow user to override default by setting PWDCMD in
337 # the environment to account for automounters. The make variable must not
338 # be called PWDCMD, otherwise the value set here is passed to make
339 # subprocesses and overrides the setting from the user's environment.
340 # Don't use PWD since it is a common shell environment variable and we
341 # don't want to corrupt it.
342 PWD_COMMAND = $${PWDCMD-pwd}
343 # on sysV, define this as cp.
344 INSTALL = @INSTALL@
345 # Some systems may be missing symbolic links, regular links, or both.
346 # Allow configure to check this and use "ln -s", "ln", or "cp" as appropriate.
347 LN=@LN@
348 LN_S=@LN_S@
349 # These permit overriding just for certain files.
350 INSTALL_PROGRAM = @INSTALL_PROGRAM@
351 INSTALL_DATA = @INSTALL_DATA@
352 INSTALL_SCRIPT = @INSTALL@
353 install_sh = $(SHELL) $(srcdir)/../install-sh
354 INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
355 MAKEINFO = @MAKEINFO@
356 MAKEINFOFLAGS = --no-split
357 TEXI2DVI = texi2dvi
358 TEXI2PDF = texi2pdf
359 TEXI2HTML = $(MAKEINFO) --html
360 TEXI2POD = perl $(srcdir)/../contrib/texi2pod.pl
361 POD2MAN = pod2man --center="GNU" --release="gcc-$(version)" --date=$(shell sed 's/\(....\)\(..\)\(..\)/\1-\2-\3/' <$(DATESTAMP))
362 # Some versions of `touch' (such as the version on Solaris 2.8)
363 # do not correctly set the timestamp due to buggy versions of `utime'
364 # in the kernel. So, we use `echo' instead.
365 STAMP = echo timestamp >
366 # If necessary (e.g., when using the MSYS shell on Microsoft Windows)
367 # translate the shell's notion of absolute pathnames to the native
368 # spelling.
369 build_file_translate = @build_file_translate@
370
371 # Make sure the $(MAKE) variable is defined.
372 @SET_MAKE@
373
374 # Locate mkinstalldirs.
375 mkinstalldirs=$(SHELL) $(srcdir)/../mkinstalldirs
376
377 # write_entries_to_file - writes each entry in a list
378 # to the specified file. Entries are written in chunks of
379 # $(write_entries_to_file_split) to accommodate systems with
380 # severe command-line-length limitations.
381 # Parameters:
382 # $(1): variable containing entries to iterate over
383 # $(2): output file
384 write_entries_to_file_split = 50
385 write_entries_to_file = $(shell rm -f $(2) || :) $(shell touch $(2)) \
386 $(foreach range, \
387 $(shell i=1; while test $$i -le $(words $(1)); do \
388 echo $$i; i=`expr $$i + $(write_entries_to_file_split)`; done), \
389 $(shell echo "$(wordlist $(range), \
390 $(shell expr $(range) + $(write_entries_to_file_split) - 1), $(1))" \
391 | tr ' ' '\012' >> $(2)))
392
393 # The jit documentation looks better if built with sphinx, but can be
394 # built with texinfo if sphinx is not available.
395 # configure sets "doc_build_sys" to "sphinx" or "texinfo" accordingly
396 doc_build_sys=@doc_build_sys@
397
398 # --------
399 # UNSORTED
400 # --------
401
402 # Dependency tracking stuff.
403 CXXDEPMODE = @CXXDEPMODE@
404 DEPDIR = @DEPDIR@
405 depcomp = $(SHELL) $(srcdir)/../depcomp
406
407 # In the past we used AC_PROG_CC_C_O and set this properly, but
408 # it was discovered that this hadn't worked in a long time, so now
409 # we just hard-code.
410 OUTPUT_OPTION = -o $@
411
412 # This is where we get zlib from. zlibdir is -L../zlib and zlibinc is
413 # -I../zlib, unless we were configured with --with-system-zlib, in which
414 # case both are empty.
415 ZLIB = @zlibdir@ -lz
416 ZLIBINC = @zlibinc@
417
418 # How to find GMP
419 GMPLIBS = @GMPLIBS@
420 GMPINC = @GMPINC@
421
422 # How to find isl.
423 ISLLIBS = @ISLLIBS@
424 ISLINC = @ISLINC@
425
426 # Set to 'yes' if the LTO front end is enabled.
427 enable_lto = @enable_lto@
428
429 # Compiler and flags needed for plugin support
430 PLUGINCC = @CXX@
431 PLUGINCFLAGS = @CXXFLAGS@
432
433 # Libs and linker options needed for plugin support
434 PLUGINLIBS = @pluginlibs@
435
436 enable_plugin = @enable_plugin@
437
438 # On MinGW plugin installation involves installing import libraries.
439 ifeq ($(enable_plugin),yes)
440 plugin_implib := $(if $(strip $(filter mingw%,$(host_os))),yes,no)
441 endif
442
443 enable_host_shared = @enable_host_shared@
444
445 enable_libgdiagnostics = @enable_libgdiagnostics@
446
447 enable_as_accelerator = @enable_as_accelerator@
448
449 CPPLIB = ../libcpp/libcpp.a
450 CPPINC = -I$(srcdir)/../libcpp/include
451
452 CODYLIB = ../libcody/libcody.a
453 CODYINC = -I$(srcdir)/../libcody
454
455 # Where to find decNumber
456 enable_decimal_float = @enable_decimal_float@
457 DECNUM = $(srcdir)/../libdecnumber
458 DECNUMFMT = $(srcdir)/../libdecnumber/$(enable_decimal_float)
459 DECNUMINC = -I$(DECNUM) -I$(DECNUMFMT) -I../libdecnumber
460 LIBDECNUMBER = ../libdecnumber/libdecnumber.a
461
462 # The backtrace library.
463 BACKTRACE = $(srcdir)/../libbacktrace
464 BACKTRACEINC = -I$(BACKTRACE)
465 LIBBACKTRACE = ../libbacktrace/.libs/libbacktrace.a
466
467 # Target to use when installing include directory. Either
468 # install-headers-tar, install-headers-cpio or install-headers-cp.
469 INSTALL_HEADERS_DIR = @build_install_headers_dir@
470
471 # Header files that are made available under the same name
472 # to programs compiled with GCC.
473 USER_H = $(srcdir)/ginclude/float.h \
474 $(srcdir)/ginclude/iso646.h \
475 $(srcdir)/ginclude/stdarg.h \
476 $(srcdir)/ginclude/stdbool.h \
477 $(srcdir)/ginclude/stddef.h \
478 $(srcdir)/ginclude/varargs.h \
479 $(srcdir)/ginclude/stdfix.h \
480 $(srcdir)/ginclude/stdnoreturn.h \
481 $(srcdir)/ginclude/stdalign.h \
482 $(srcdir)/ginclude/stdatomic.h \
483 $(srcdir)/ginclude/stdckdint.h \
484 $(EXTRA_HEADERS)
485
486 USER_H_INC_NEXT_PRE = @user_headers_inc_next_pre@
487 USER_H_INC_NEXT_POST = @user_headers_inc_next_post@
488
489 # Enable target overriding of this fragment, as in config/t-vxworks.
490 T_GLIMITS_H = $(srcdir)/glimits.h
491 T_STDINT_GCC_H = $(srcdir)/ginclude/stdint-gcc.h
492
493 # The GCC to use for compiling crt*.o.
494 # Usually the one we just built.
495 # Don't use this as a dependency--use $(GCC_PASSES).
496 GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include -L$(objdir)/../ld $(TFLAGS)
497
498 # The GCC to use when running selftests
499 GCC_FOR_SELFTESTS = LC_ALL=C GCC_COLORS= $(GCC_FOR_TARGET)
500
501 # Set if the compiler was configured with --with-build-sysroot.
502 SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
503
504 # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
505 # It specifies -B./.
506 # It also specifies -isystem ./include to find, e.g., stddef.h.
507 GCC_CFLAGS=$(CFLAGS_FOR_TARGET) $(INTERNAL_CFLAGS) $(T_CFLAGS) $(LOOSE_WARN) $(C_LOOSE_WARN) -Wold-style-definition $($@-warn) -isystem ./include $(TCFLAGS)
508
509 # ---------------------------------------------------
510 # Programs which produce files for the target machine
511 # ---------------------------------------------------
512
513 AR_FOR_TARGET := $(shell \
514 if [ -f $(objdir)/../binutils/ar ] ; then \
515 echo $(objdir)/../binutils/ar ; \
516 else \
517 if [ "$(host)" = "$(target)" ] ; then \
518 echo $(AR); \
519 else \
520 t='$(program_transform_name)'; echo ar | sed -e "$$t" ; \
521 fi; \
522 fi)
523 AR_FLAGS_FOR_TARGET =
524 AR_CREATE_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) rc
525 AR_EXTRACT_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) x
526 LIPO_FOR_TARGET = lipo
527 ORIGINAL_AS_FOR_TARGET = @ORIGINAL_AS_FOR_TARGET@
528 RANLIB_FOR_TARGET := $(shell \
529 if [ -f $(objdir)/../binutils/ranlib ] ; then \
530 echo $(objdir)/../binutils/ranlib ; \
531 else \
532 if [ "$(host)" = "$(target)" ] ; then \
533 echo $(RANLIB); \
534 else \
535 t='$(program_transform_name)'; echo ranlib | sed -e "$$t" ; \
536 fi; \
537 fi)
538 ORIGINAL_LD_FOR_TARGET = @ORIGINAL_LD_FOR_TARGET@
539 ORIGINAL_NM_FOR_TARGET = @ORIGINAL_NM_FOR_TARGET@
540 NM_FOR_TARGET = ./nm
541 STRIP_FOR_TARGET := $(shell \
542 if [ -f $(objdir)/../binutils/strip-new ] ; then \
543 echo $(objdir)/../binutils/strip-new ; \
544 else \
545 if [ "$(host)" = "$(target)" ] ; then \
546 echo strip; \
547 else \
548 t='$(program_transform_name)'; echo strip | sed -e "$$t" ; \
549 fi; \
550 fi)
551
552 # --------
553 # UNSORTED
554 # --------
555
556 # Where to find some libiberty headers.
557 HASHTAB_H = $(srcdir)/../include/hashtab.h
558 OBSTACK_H = $(srcdir)/../include/obstack.h
559 SPLAY_TREE_H= $(srcdir)/../include/splay-tree.h
560 MD5_H = $(srcdir)/../include/md5.h
561 XREGEX_H = $(srcdir)/../include/xregex.h
562 FNMATCH_H = $(srcdir)/../include/fnmatch.h
563
564 # Linker plugin API headers
565 LINKER_PLUGIN_API_H = $(srcdir)/../include/plugin-api.h
566
567 # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
568 NATIVE_SYSTEM_HEADER_DIR = @NATIVE_SYSTEM_HEADER_DIR@
569 # Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
570 ifeq (@includedir@,$(prefix)/include)
571 CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
572 else
573 CROSS_SYSTEM_HEADER_DIR = @includedir@
574 endif
575
576 # autoconf sets SYSTEM_HEADER_DIR to one of the above.
577 # Purge it of unnecessary internal relative paths
578 # to directories that might not exist yet.
579 # The sed idiom for this is to repeat the search-and-replace until it doesn't match, using :a ... ta.
580 # Use single quotes here to avoid nested double- and backquotes, this
581 # macro is also used in a double-quoted context.
582 SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta`
583
584 # Path to the system headers on the build machine.
585 BUILD_SYSTEM_HEADER_DIR = `echo @BUILD_SYSTEM_HEADER_DIR@ | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta`
586
587 # Control whether to run fixincludes.
588 STMP_FIXINC = @STMP_FIXINC@
589
590 # Test to see whether <limits.h> exists in the system header files.
591 LIMITS_H_TEST = [ -f $(BUILD_SYSTEM_HEADER_DIR)/limits.h ]
592
593 # Directory for prefix to system directories, for
594 # each of $(system_prefix)/usr/include, $(system_prefix)/usr/lib, etc.
595 TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
596 TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@
597
598 xmake_file=@xmake_file@
599 tmake_file=@tmake_file@
600 TM_ENDIAN_CONFIG=@TM_ENDIAN_CONFIG@
601 TM_MULTILIB_CONFIG=@TM_MULTILIB_CONFIG@
602 TM_MULTILIB_EXCEPTIONS_CONFIG=@TM_MULTILIB_EXCEPTIONS_CONFIG@
603 out_file=$(srcdir)/config/@out_file@
604 out_object_file=@out_object_file@
605 common_out_file=$(srcdir)/common/config/@common_out_file@
606 common_out_object_file=@common_out_object_file@
607 EXTRA_GTYPE_DEPS=
608 md_file=$(srcdir)/common.md $(srcdir)/config/@md_file@
609 tm_file_list=@tm_file_list@
610 tm_include_list=@tm_include_list@
611 tm_defines=@tm_defines@
612 tm_p_file_list=@tm_p_file_list@
613 tm_p_include_list=@tm_p_include_list@
614 tm_d_file_list=@tm_d_file_list@
615 tm_d_include_list=@tm_d_include_list@
616 tm_rust_file_list=@tm_rust_file_list@
617 tm_rust_include_list=@tm_rust_include_list@
618 build_xm_file_list=@build_xm_file_list@
619 build_xm_include_list=@build_xm_include_list@
620 build_xm_defines=@build_xm_defines@
621 host_xm_file_list=@host_xm_file_list@
622 host_xm_include_list=@host_xm_include_list@
623 host_xm_defines=@host_xm_defines@
624 xm_file_list=@xm_file_list@
625 xm_include_list=@xm_include_list@
626 xm_defines=@xm_defines@
627 lang_checks=
628 lang_checks_parallelized=
629 ifeq (@enable_libgdiagnostics@,yes)
630 lang_checks += check-libgdiagnostics check-sarif-replay
631 endif
632 lang_opt_files=@lang_opt_files@ $(srcdir)/c-family/c.opt $(srcdir)/common.opt $(srcdir)/params.opt $(srcdir)/analyzer/analyzer.opt
633 lang_specs_files=@lang_specs_files@
634 lang_tree_files=@lang_tree_files@
635 target_cpu_default=@target_cpu_default@
636 OBJC_BOEHM_GC=@objc_boehm_gc@
637 extra_modes_file=@extra_modes_file@
638 extra_opt_files=@extra_opt_files@
639 host_hook_obj=@out_host_hook_obj@
640
641 # Multiarch support
642 enable_multiarch = @enable_multiarch@
643 with_cpu = @with_cpu@
644 with_float = @with_float@
645 ifeq ($(enable_multiarch),yes)
646 if_multiarch = $(1)
647 else
648 ifeq ($(enable_multiarch),auto)
649 # SYSTEM_HEADER_DIR is makefile syntax, cannot be evaluated in configure.ac
650 if_multiarch = $(if $(wildcard $(shell echo $(BUILD_SYSTEM_HEADER_DIR))/../../usr/lib/*/crti.o),$(1))
651 else
652 if_multiarch =
653 endif
654 endif
655
656 # ------------------------
657 # Installation directories
658 # ------------------------
659
660 # Common prefix for installation directories.
661 # NOTE: This directory must exist when you start installation.
662 prefix = @prefix@
663 # Directory in which to put localized header files. On the systems with
664 # gcc as the native cc, `local_prefix' may not be `prefix' which is
665 # `/usr'.
666 # NOTE: local_prefix *should not* default from prefix.
667 local_prefix = @local_prefix@
668 # Directory in which to put host dependent programs and libraries
669 exec_prefix = @exec_prefix@
670 # Directory in which to put the executable for the command `gcc'
671 bindir = @bindir@
672 # Directory in which to put the directories used by the compiler.
673 libdir = @libdir@
674 # Directory in which GCC puts its executables.
675 libexecdir = @libexecdir@
676
677 # --------
678 # UNSORTED
679 # --------
680
681 # Directory in which the compiler finds libraries etc.
682 libsubdir = $(libdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix)
683 # Directory in which the compiler finds executables
684 libexecsubdir = $(libexecdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix)
685 # Directory in which all plugin resources are installed
686 plugin_resourcesdir = $(libsubdir)/plugin
687 # Directory in which plugin headers are installed
688 plugin_includedir = $(plugin_resourcesdir)/include
689 # Directory in which plugin specific executables are installed
690 plugin_bindir = $(libexecsubdir)/plugin
691 # Used to produce a relative $(gcc_tooldir) in gcc.o
692 ifeq ($(enable_as_accelerator),yes)
693 unlibsubdir = ../../../../..
694 else
695 unlibsubdir = ../../..
696 endif
697 # $(prefix), expressed as a path relative to $(libsubdir).
698 #
699 # An explanation of the sed strings:
700 # -e 's|^$(prefix)||' matches and eliminates 'prefix' from 'exec_prefix'
701 # -e 's|/$$||' match a trailing forward slash and eliminates it
702 # -e 's|^[^/]|/|' forces the string to start with a forward slash (*)
703 # -e 's|/[^/]*|../|g' replaces each occurrence of /<directory> with ../
704 #
705 # (*) Note this pattern overwrites the first character of the string
706 # with a forward slash if one is not already present. This is not a
707 # problem because the exact names of the sub-directories concerned is
708 # unimportant, just the number of them matters.
709 #
710 # The practical upshot of these patterns is like this:
711 #
712 # prefix exec_prefix result
713 # ------ ----------- ------
714 # /foo /foo/bar ../
715 # /foo/ /foo/bar ../
716 # /foo /foo/bar/ ../
717 # /foo/ /foo/bar/ ../
718 # /foo /foo/bar/ugg ../../
719 libsubdir_to_prefix := \
720 $(unlibsubdir)/$(shell echo "$(libdir)" | \
721 sed -e 's|^$(prefix)||' -e 's|/$$||' -e 's|^[^/]|/|' \
722 -e 's|/[^/]*|../|g')
723 # $(exec_prefix), expressed as a path relative to $(prefix).
724 prefix_to_exec_prefix := \
725 $(shell echo "$(exec_prefix)" | \
726 sed -e 's|^$(prefix)||' -e 's|^/||' -e '/./s|$$|/|')
727 # Directory in which to find other cross-compilation tools and headers.
728 dollar = @dollar@
729 # Used in install-cross.
730 gcc_tooldir = @gcc_tooldir@
731 # Since gcc_tooldir does not exist at build-time, use -B$(build_tooldir)/bin/
732 build_tooldir = $(exec_prefix)/$(target_noncanonical)
733 # Directory in which the compiler finds target-independent g++ includes.
734 gcc_gxx_include_dir = @gcc_gxx_include_dir@
735 gcc_gxx_include_dir_add_sysroot = @gcc_gxx_include_dir_add_sysroot@
736 # Directory in which the compiler finds libc++ includes.
737 gcc_gxx_libcxx_include_dir = @gcc_gxx_libcxx_include_dir@
738 gcc_gxx_libcxx_include_dir_add_sysroot = @gcc_gxx_libcxx_include_dir_add_sysroot@
739 # Directory to search for site-specific includes.
740 local_includedir = $(local_prefix)/include
741 includedir = $(prefix)/include
742 # where the info files go
743 infodir = @infodir@
744 # Where cpp should go besides $prefix/bin if necessary
745 cpp_install_dir = @cpp_install_dir@
746 # where the locale files go
747 datadir = @datadir@
748 localedir = $(datadir)/locale
749 # Extension (if any) to put in installed man-page filename.
750 man1ext = .1
751 man3ext = .3
752 man7ext = .7
753 objext = .o
754 exeext = @host_exeext@
755 build_exeext = @build_exeext@
756
757 # Directory in which to put man pages.
758 mandir = @mandir@
759 man1dir = $(mandir)/man1
760 man3dir = $(mandir)/man3
761 man7dir = $(mandir)/man7
762 # Dir for temp files.
763 tmpdir = /tmp
764
765 datarootdir = @datarootdir@
766 docdir = @docdir@
767 # Directory in which to put DVIs
768 dvidir = @dvidir@
769 # Directory in which to build HTML
770 build_htmldir = $(objdir)/HTML/gcc-$(version)
771 # Directory in which to put HTML
772 htmldir = @htmldir@
773
774 # Whether we were configured with NLS.
775 USE_NLS = @USE_NLS@
776
777 # Internationalization library.
778 INCINTL = @INCINTL@
779 LIBINTL = @LIBINTL@
780 LIBINTL_DEP = @LIBINTL_DEP@
781
782 # Character encoding conversion library.
783 LIBICONV = @LIBICONV@
784 LIBICONV_DEP = @LIBICONV_DEP@
785
786 # If a supplementary library is being used for the GC.
787 GGC_LIB=
788
789 # "true" if the target C library headers are unavailable; "false"
790 # otherwise.
791 inhibit_libc = @inhibit_libc@
792 ifeq ($(inhibit_libc),true)
793 INHIBIT_LIBC_CFLAGS = -Dinhibit_libc
794 endif
795
796 # List of extra executables that should be compiled for this target machine
797 # that are used when linking.
798 # The rules for compiling them should be in the t-* file for the machine.
799 EXTRA_PROGRAMS = @extra_programs@
800
801 # List of extra object files that should be compiled and linked with
802 # compiler proper (cc1, cc1obj, cc1plus).
803 EXTRA_OBJS = @extra_objs@
804
805 # List of extra object files that should be compiled and linked with
806 # the gcc driver.
807 EXTRA_GCC_OBJS =@extra_gcc_objs@
808
809 # List of extra libraries that should be linked with the gcc driver.
810 EXTRA_GCC_LIBS = @EXTRA_GCC_LIBS@
811
812 # List of additional header files to install.
813 EXTRA_HEADERS =@extra_headers_list@
814
815 # How to handle <stdint.h>.
816 USE_GCC_STDINT = @use_gcc_stdint@
817
818 # The configure script will set this to collect2$(exeext), except on a
819 # (non-Unix) host which cannot build collect2, for which it will be
820 # set to empty.
821 COLLECT2 = @collect2@
822
823 # Program to convert libraries.
824 LIBCONVERT =
825
826 # Control whether header files are installed.
827 INSTALL_HEADERS=install-headers install-mkheaders
828
829 # Control whether Info documentation is built and installed.
830 BUILD_INFO = @BUILD_INFO@
831
832 # Control flags for @contents placement in HTML output
833 MAKEINFO_TOC_INLINE_FLAG = @MAKEINFO_TOC_INLINE_FLAG@
834
835 # Control whether manpages generated by texi2pod.pl can be rebuilt.
836 GENERATED_MANPAGES = @GENERATED_MANPAGES@
837
838 # Additional directories of header files to run fixincludes on.
839 # These should be directories searched automatically by default
840 # just as /usr/include is.
841 # *Do not* use this for directories that happen to contain
842 # header files, but are not searched automatically by default.
843 # On most systems, this is empty.
844 OTHER_FIXINCLUDES_DIRS=
845
846 # A list of all the language-specific executables.
847 COMPILERS = @all_compilers@
848
849 # List of things which should already be built whenever we try to use xgcc
850 # to compile anything (without linking).
851 GCC_PASSES=xgcc$(exeext) specs
852
853 # Directory to link to, when using the target `maketest'.
854 DIR = ../gcc
855
856 # Native compiler for the build machine and its switches.
857 CC_FOR_BUILD = @CC_FOR_BUILD@
858 CXX_FOR_BUILD = @CXX_FOR_BUILD@
859 BUILD_CFLAGS= @BUILD_CFLAGS@ $(GENERATOR_CFLAGS) -DGENERATOR_FILE
860 BUILD_CXXFLAGS = @BUILD_CXXFLAGS@ $(GENERATOR_CFLAGS) -DGENERATOR_FILE
861
862 # Native compiler that we use. This may be C++ some day.
863 COMPILER_FOR_BUILD = $(CXX_FOR_BUILD)
864 BUILD_COMPILERFLAGS = $(BUILD_CXXFLAGS)
865
866 # Native linker that we use.
867 LINKER_FOR_BUILD = $(CXX_FOR_BUILD)
868 BUILD_LINKERFLAGS = $(BUILD_CXXFLAGS)
869
870 # Native linker and preprocessor flags. For x-fragment overrides.
871 BUILD_LDFLAGS=@BUILD_LDFLAGS@
872 BUILD_CPPFLAGS= -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
873 -I$(srcdir)/../include $(INCINTL) $(CPPINC) $(CPPFLAGS)
874
875 # Actual name to use when installing a native compiler.
876 GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)')
877 GCC_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo gcc|sed '$(program_transform_name)')
878 CPP_INSTALL_NAME := $(shell echo cpp|sed '$(program_transform_name)')
879 GCOV_INSTALL_NAME := $(shell echo gcov|sed '$(program_transform_name)')
880 GCOV_TOOL_INSTALL_NAME := $(shell echo gcov-tool|sed '$(program_transform_name)')
881 GCOV_DUMP_INSTALL_NAME := $(shell echo gcov-dump|sed '$(program_transform_name)')
882
883 # Setup the testing framework, if you have one
884 EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \
885 echo $${rootme}/../expect/expect ; \
886 else echo expect ; fi`
887
888 RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
889 echo $${srcdir}/../dejagnu/runtest ; \
890 else echo runtest; fi`
891 RUNTESTFLAGS =
892
893 # This should name the specs file that we're going to install. Target
894 # Makefiles may override it and name another file to be generated from
895 # the built-in specs and installed as the default spec, as long as
896 # they also introduce a rule to generate a file name specs, to be used
897 # at build time.
898 SPECS = specs
899
900 # Extra include files that are defined by HeaderInclude directives in
901 # the .opt files
902 OPTIONS_H_EXTRA =
903
904 # Extra include files that are defined by SourceInclude directives in
905 # the .opt files
906 OPTIONS_C_EXTRA = $(PRETTY_PRINT_H)
907
908 @option_includes@
909
910 # End of variables for you to override.
911
912 # GTM_H lists the config files that the generator files depend on,
913 # while TM_H lists the ones ordinary gcc files depend on, which
914 # includes several files generated by those generators.
915 BCONFIG_H = bconfig.h $(build_xm_file_list)
916 CONFIG_H = config.h $(host_xm_file_list)
917 TCONFIG_H = tconfig.h $(xm_file_list)
918 # Some $(target)-protos.h depends on tree.h
919 TM_P_H = tm_p.h $(tm_p_file_list) $(TREE_H)
920 TM_D_H = tm_d.h $(tm_d_file_list)
921 TM_RUST_H = tm_rust.h $(tm_rust_file_list)
922 GTM_H = tm.h $(tm_file_list) insn-constants.h
923 TM_H = $(GTM_H) insn-flags.h $(OPTIONS_H)
924
925 # Variables for version information.
926 BASEVER := $(srcdir)/BASE-VER # 4.x.y
927 DEVPHASE := $(srcdir)/DEV-PHASE # experimental, prerelease, ""
928 DATESTAMP := $(srcdir)/DATESTAMP # YYYYMMDD or empty
929 REVISION := $(srcdir)/REVISION # [BRANCH revision XXXXXX]
930
931 BASEVER_c := $(shell cat $(BASEVER))
932 DEVPHASE_c := $(shell cat $(DEVPHASE))
933 DATESTAMP_c := $(shell cat $(DATESTAMP))
934
935 ifeq (,$(wildcard $(REVISION)))
936 REVISION_c :=
937 REVISION :=
938 else
939 REVISION_c := $(shell cat $(REVISION))
940 endif
941
942 version := $(shell @get_gcc_base_ver@ $(BASEVER))
943
944 PATCHLEVEL_c := \
945 $(shell echo $(BASEVER_c) | sed -e 's/^[0-9]*\.[0-9]*\.\([0-9]*\)$$/\1/')
946
947
948 # For use in version.cc - double quoted strings, with appropriate
949 # surrounding punctuation and spaces, and with the datestamp and
950 # development phase collapsed to the empty string in release mode
951 # (i.e. if DEVPHASE_c is empty and PATCHLEVEL_c is 0). The space
952 # immediately after the comma in the $(if ...) constructs is
953 # significant - do not remove it.
954 BASEVER_s := "\"$(BASEVER_c)\""
955 DEVPHASE_s := "\"$(if $(DEVPHASE_c), ($(DEVPHASE_c)))\""
956 DATESTAMP_s := \
957 "\"$(if $(DEVPHASE_c)$(filter-out 0,$(PATCHLEVEL_c)), $(DATESTAMP_c))\""
958 PKGVERSION_s:= "\"@PKGVERSION@\""
959 BUGURL_s := "\"@REPORT_BUGS_TO@\""
960
961 PKGVERSION := @PKGVERSION@
962 BUGURL_TEXI := @REPORT_BUGS_TEXI@
963
964 ifdef REVISION_c
965 REVISION_s := \
966 "\"$(if $(DEVPHASE_c)$(filter-out 0,$(PATCHLEVEL_c)), $(REVISION_c))\""
967 else
968 REVISION_s := "\"\""
969 endif
970
971 # Shorthand variables for dependency lists.
972 DUMPFILE_H = $(srcdir)/../libcpp/include/line-map.h dumpfile.h
973 VEC_H = vec.h statistics.h $(GGC_H)
974 HASH_TABLE_H = $(HASHTAB_H) hash-table.h $(GGC_H)
975 EXCEPT_H = except.h $(HASHTAB_H)
976 TARGET_DEF = target.def target-hooks-macros.h target-insns.def
977 C_TARGET_DEF = c-family/c-target.def target-hooks-macros.h
978 COMMON_TARGET_DEF = common/common-target.def target-hooks-macros.h
979 D_TARGET_DEF = d/d-target.def target-hooks-macros.h
980 RUST_TARGET_DEF = rust/rust-target.def target-hooks-macros.h
981 TARGET_H = $(TM_H) target.h $(TARGET_DEF) insn-modes.h insn-codes.h
982 C_TARGET_H = c-family/c-target.h $(C_TARGET_DEF)
983 COMMON_TARGET_H = common/common-target.h $(INPUT_H) $(COMMON_TARGET_DEF)
984 D_TARGET_H = d/d-target.h $(D_TARGET_DEF)
985 RUST_TARGET_H = rust/rust-target.h $(RUST_TARGET_DEF)
986 MACHMODE_H = machmode.h mode-classes.def
987 HOOKS_H = hooks.h
988 HOSTHOOKS_DEF_H = hosthooks-def.h $(HOOKS_H)
989 LANGHOOKS_DEF_H = langhooks-def.h $(HOOKS_H)
990 TARGET_DEF_H = target-def.h target-hooks-def.h $(HOOKS_H) targhooks.h
991 C_TARGET_DEF_H = c-family/c-target-def.h c-family/c-target-hooks-def.h \
992 $(TREE_H) $(C_COMMON_H) $(HOOKS_H) common/common-targhooks.h
993 CORETYPES_H = coretypes.h insn-modes.h signop.h wide-int.h wide-int-print.h \
994 insn-modes-inline.h $(MACHMODE_H) double-int.h align.h poly-int.h \
995 poly-int-types.h
996 RTL_BASE_H = $(CORETYPES_H) rtl.h rtl.def reg-notes.def \
997 insn-notes.def $(INPUT_H) $(REAL_H) statistics.h $(VEC_H) \
998 $(FIXED_VALUE_H) alias.h $(HASHTAB_H)
999 FIXED_VALUE_H = fixed-value.h
1000 RTL_H = $(RTL_BASE_H) $(FLAGS_H) genrtl.h
1001 READ_MD_H = $(OBSTACK_H) $(HASHTAB_H) read-md.h
1002 BUILTINS_DEF = builtins.def sync-builtins.def omp-builtins.def \
1003 gtm-builtins.def sanitizer.def
1004 INTERNAL_FN_DEF = internal-fn.def
1005 INTERNAL_FN_H = internal-fn.h $(INTERNAL_FN_DEF) insn-opinit.h
1006 TREE_CORE_H = tree-core.h $(CORETYPES_H) all-tree.def tree.def \
1007 c-family/c-common.def $(lang_tree_files) \
1008 $(BUILTINS_DEF) $(INPUT_H) statistics.h \
1009 $(VEC_H) treestruct.def $(HASHTAB_H) \
1010 alias.h $(SYMTAB_H) $(FLAGS_H) \
1011 $(REAL_H) $(FIXED_VALUE_H)
1012 TREE_H = tree.h $(TREE_CORE_H) tree-check.h
1013 REGSET_H = regset.h $(BITMAP_H) hard-reg-set.h
1014 BASIC_BLOCK_H = basic-block.h $(PREDICT_H) $(VEC_H) $(FUNCTION_H) \
1015 cfg-flags.def cfghooks.h profile-count.h
1016 GIMPLE_H = gimple.h gimple.def gsstruct.def $(VEC_H) \
1017 $(GGC_H) $(BASIC_BLOCK_H) $(TREE_H) tree-ssa-operands.h \
1018 tree-ssa-alias.h $(INTERNAL_FN_H) $(HASH_TABLE_H) is-a.h
1019 GCOV_IO_H = gcov-io.h version.h auto-host.h gcov-counter.def
1020 RECOG_H = recog.h $(TREE_H)
1021 EMIT_RTL_H = emit-rtl.h
1022 FLAGS_H = flags.h flag-types.h $(OPTIONS_H)
1023 OPTIONS_H = options.h flag-types.h $(OPTIONS_H_EXTRA)
1024 FUNCTION_H = function.h $(HASHTAB_H) $(TM_H) hard-reg-set.h \
1025 $(VEC_H) $(INPUT_H)
1026 EXPR_H = expr.h insn-config.h $(FUNCTION_H) $(RTL_H) $(FLAGS_H) $(TREE_H) \
1027 $(EMIT_RTL_H)
1028 OPTABS_H = optabs.h insn-codes.h insn-opinit.h
1029 REGS_H = regs.h hard-reg-set.h
1030 CFGLOOP_H = cfgloop.h $(BASIC_BLOCK_H) $(BITMAP_H) sbitmap.h
1031 IPA_UTILS_H = ipa-utils.h $(TREE_H) $(CGRAPH_H)
1032 IPA_REFERENCE_H = ipa-reference.h $(BITMAP_H) $(TREE_H)
1033 CGRAPH_H = cgraph.h $(VEC_H) $(TREE_H) $(BASIC_BLOCK_H) $(FUNCTION_H) \
1034 cif-code.def ipa-ref.h $(LINKER_PLUGIN_API_H) is-a.h
1035 DF_H = df.h $(BITMAP_H) $(REGSET_H) sbitmap.h $(BASIC_BLOCK_H) \
1036 alloc-pool.h $(TIMEVAR_H)
1037 RESOURCE_H = resource.h hard-reg-set.h $(DF_H)
1038 GCC_H = gcc.h version.h $(DIAGNOSTIC_CORE_H)
1039 GGC_H = ggc.h gtype-desc.h statistics.h
1040 TIMEVAR_H = timevar.h timevar.def
1041 INSN_ATTR_H = insn-attr.h insn-attr-common.h $(INSN_ADDR_H)
1042 INSN_ADDR_H = $(srcdir)/insn-addr.h
1043 C_COMMON_H = c-family/c-common.h c-family/c-common.def $(TREE_H) \
1044 $(SPLAY_TREE_H) $(CPPLIB_H) $(GGC_H) $(DIAGNOSTIC_CORE_H)
1045 C_PRAGMA_H = c-family/c-pragma.h $(CPPLIB_H)
1046 C_TREE_H = c/c-tree.h $(C_COMMON_H) $(DIAGNOSTIC_H)
1047 SYSTEM_H = system.h hwint.h $(srcdir)/../include/libiberty.h \
1048 $(srcdir)/../include/safe-ctype.h $(srcdir)/../include/filenames.h \
1049 $(HASHTAB_H)
1050 PREDICT_H = predict.h predict.def
1051 CPPLIB_H = $(srcdir)/../libcpp/include/line-map.h \
1052 $(srcdir)/../libcpp/include/rich-location.h \
1053 $(srcdir)/../libcpp/include/label-text.h \
1054 $(srcdir)/../libcpp/include/cpplib.h
1055 CODYLIB_H = $(srcdir)/../libcody/cody.hh
1056 INPUT_H = $(srcdir)/../libcpp/include/line-map.h input.h
1057 OPTS_H = $(INPUT_H) $(VEC_H) opts.h $(OBSTACK_H)
1058 SYMTAB_H = $(srcdir)/../libcpp/include/symtab.h $(OBSTACK_H)
1059 CPP_INTERNAL_H = $(srcdir)/../libcpp/internal.h
1060 TREE_DUMP_H = tree-dump.h $(SPLAY_TREE_H) $(DUMPFILE_H)
1061 TREE_PASS_H = tree-pass.h $(TIMEVAR_H) $(DUMPFILE_H)
1062 TREE_SSA_H = tree-ssa.h tree-ssa-operands.h \
1063 $(BITMAP_H) sbitmap.h $(BASIC_BLOCK_H) $(GIMPLE_H) \
1064 $(HASHTAB_H) $(CGRAPH_H) $(IPA_REFERENCE_H) \
1065 tree-ssa-alias.h
1066 PRETTY_PRINT_H = pretty-print.h $(INPUT_H) $(OBSTACK_H) wide-int-print.h
1067 TREE_PRETTY_PRINT_H = tree-pretty-print.h $(PRETTY_PRINT_H)
1068 GIMPLE_PRETTY_PRINT_H = gimple-pretty-print.h $(TREE_PRETTY_PRINT_H)
1069 DIAGNOSTIC_CORE_H = diagnostic-core.h $(INPUT_H) bversion.h diagnostic.def
1070 DIAGNOSTIC_H = diagnostic.h $(DIAGNOSTIC_CORE_H) $(PRETTY_PRINT_H)
1071 C_PRETTY_PRINT_H = c-family/c-pretty-print.h $(PRETTY_PRINT_H) \
1072 $(C_COMMON_H) $(TREE_H)
1073 TREE_INLINE_H = tree-inline.h
1074 REAL_H = real.h
1075 LTO_STREAMER_H = lto-streamer.h $(LINKER_PLUGIN_API_H) $(TARGET_H) \
1076 $(CGRAPH_H) $(VEC_H) $(HASH_TABLE_H) $(TREE_H) $(GIMPLE_H) \
1077 $(GCOV_IO_H) $(DIAGNOSTIC_H) alloc-pool.h
1078 IPA_PROP_H = ipa-prop.h $(TREE_H) $(VEC_H) $(CGRAPH_H) $(GIMPLE_H) alloc-pool.h
1079 BITMAP_H = bitmap.h $(HASHTAB_H) statistics.h
1080 GCC_PLUGIN_H = gcc-plugin.h highlev-plugin-common.h plugin.def \
1081 $(CONFIG_H) $(SYSTEM_H) $(HASHTAB_H)
1082 PLUGIN_H = plugin.h $(GCC_PLUGIN_H)
1083 PLUGIN_VERSION_H = plugin-version.h configargs.h
1084 CONTEXT_H = context.h
1085 GENSUPPORT_H = gensupport.h read-md.h optabs.def
1086 RTL_SSA_H = $(PRETTY_PRINT_H) insn-config.h splay-tree-utils.h \
1087 $(RECOG_H) $(REGS_H) function-abi.h obstack-utils.h \
1088 mux-utils.h rtlanal.h memmodel.h $(EMIT_RTL_H) \
1089 rtl-ssa/accesses.h rtl-ssa/insns.h rtl-ssa/blocks.h \
1090 rtl-ssa/changes.h rtl-ssa/functions.h rtl-ssa/is-a.inl \
1091 rtl-ssa/access-utils.h rtl-ssa/insn-utils.h rtl-ssa/movement.h \
1092 rtl-ssa/change-utils.h rtl-ssa/member-fns.inl
1093
1094 #
1095 # Now figure out from those variables how to compile and link.
1096
1097 # IN_GCC distinguishes between code compiled into GCC itself and other
1098 # programs built during a bootstrap.
1099 # autoconf inserts -DCROSS_DIRECTORY_STRUCTURE if we are building a
1100 # cross compiler which does not use the native headers and libraries.
1101 INTERNAL_CFLAGS = -DIN_GCC @CROSS@
1102
1103 # This is the variable actually used when we compile. If you change this,
1104 # you probably want to update BUILD_CFLAGS in configure.ac
1105 ALL_CFLAGS = $(T_CFLAGS) $(CFLAGS-$@) \
1106 $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) @DEFS@
1107
1108 # The C++ version.
1109 ALL_CXXFLAGS = $(T_CFLAGS) $(CFLAGS-$@) $(CXXFLAGS) $(INTERNAL_CFLAGS) \
1110 $(COVERAGE_FLAGS) $(ALIASING_FLAGS) $(NOEXCEPTION_FLAGS) \
1111 $(WARN_CXXFLAGS) @DEFS@
1112
1113 # Likewise. Put INCLUDES at the beginning: this way, if some autoconf macro
1114 # puts -I options in CPPFLAGS, our include files in the srcdir will always
1115 # win against random include files in /usr/include.
1116 ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS)
1117
1118 # This is the variable to use when using $(COMPILER).
1119 ALL_COMPILERFLAGS = $(ALL_CXXFLAGS) $(PICFLAG)
1120
1121 # This is the variable to use when using $(LINKER).
1122 ALL_LINKERFLAGS = $(ALL_CXXFLAGS) $(LD_PICFLAG)
1123
1124 # Build and host support libraries.
1125
1126 # Use the "pic" build of libiberty if --enable-host-shared or --enable-host-pie,
1127 # unless we are building for mingw.
1128 LIBIBERTY_PICDIR=$(if $(findstring mingw,$(target)),,pic)
1129 ifneq ($(enable_host_shared)$(enable_host_pie),)
1130 LIBIBERTY = ../libiberty/$(LIBIBERTY_PICDIR)/libiberty.a
1131 else
1132 LIBIBERTY = ../libiberty/libiberty.a
1133 endif
1134 ifeq ($(enable_host_shared),yes)
1135 BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/$(LIBIBERTY_PICDIR)/libiberty.a
1136 else
1137 BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a
1138 endif
1139
1140 # Dependencies on the intl and portability libraries. The INTL dep might be
1141 # constructed with a ./ prefix, which GNU Make removes while processing
1142 # prerequisites, so we need to strip it off.
1143 LIBDEPS= libcommon.a $(CPPLIB) $(LIBIBERTY) $(LIBICONV_DEP) $(LIBDECNUMBER) \
1144 $(LIBBACKTRACE) $(LIBINTL_DEP:./%=%)
1145
1146 # Likewise, for use in the tools that must run on this machine
1147 # even if we are cross-building GCC.
1148 BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
1149
1150 # How to link with both our special library facilities
1151 # and the system's installed libraries.
1152 LIBS = @LIBS@ libcommon.a $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBBACKTRACE) \
1153 $(LIBIBERTY) $(LIBDECNUMBER) $(HOST_LIBS)
1154 BACKENDLIBS = $(ISLLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \
1155 $(ZLIB) $(ZSTD_LIB)
1156 # Any system libraries needed just for GNAT.
1157 SYSLIBS = @GNAT_LIBEXC@
1158
1159 # Used from ada/gcc-interface/Make-lang.in
1160 GNATBIND = @GNATBIND@
1161 GNATMAKE = @GNATMAKE@
1162
1163 # Used from d/Make-lang.in
1164 GDC = @GDC@
1165 GDCFLAGS = @GDCFLAGS@
1166
1167 # Libs needed (at present) just for jcf-dump.
1168 LDEXP_LIB = @LDEXP_LIB@
1169
1170 ZSTD_INC = @ZSTD_CPPFLAGS@
1171 ZSTD_LIB = @ZSTD_LDFLAGS@ @ZSTD_LIB@
1172
1173 # Likewise, for use in the tools that must run on this machine
1174 # even if we are cross-building GCC.
1175 BUILD_LIBS = $(BUILD_LIBIBERTY)
1176
1177 BUILD_RTL = build/rtl.o build/read-rtl.o build/ggc-none.o \
1178 build/vec.o build/min-insn-modes.o build/gensupport.o \
1179 build/print-rtl.o build/hash-table.o build/sort.o
1180 BUILD_MD = build/read-md.o
1181 BUILD_ERRORS = build/errors.o
1182
1183 # Specify the directories to be searched for header files.
1184 # Both . and srcdir are used, in that order,
1185 # so that *config.h will be found in the compilation
1186 # subdirectory rather than in the source directory.
1187 # -I$(@D) and -I$(srcdir)/$(@D) cause the subdirectory of the file
1188 # currently being compiled, in both source trees, to be examined as well.
1189 # libintl.h will be found in ../intl if we are using the included libintl.
1190 INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
1191 -I$(srcdir)/../include $(INCINTL) \
1192 $(CPPINC) $(CODYINC) $(GMPINC) $(DECNUMINC) $(BACKTRACEINC) \
1193 $(ISLINC)
1194
1195 COMPILE.base = $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) -o $@
1196 ifeq ($(CXXDEPMODE),depmode=gcc3)
1197 # Note a subtlety here: we use $(@D) for the directory part, to make
1198 # things like the go/%.o rule work properly; but we use $(*F) for the
1199 # file part, as we just want the file part of the stem, not the entire
1200 # file name.
1201 COMPILE = $(COMPILE.base) -MT $@ -MMD -MP -MF $(@D)/$(DEPDIR)/$(*F).TPo
1202 POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(*F).TPo $(@D)/$(DEPDIR)/$(*F).Po
1203 else
1204 COMPILE = source='$<' object='$@' libtool=no \
1205 DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) $(COMPILE.base)
1206 POSTCOMPILE =
1207 endif
1208
1209 .cc.o .c.o:
1210 $(COMPILE) $<
1211 $(POSTCOMPILE)
1212
1213 #
1214 # Support for additional languages (other than C).
1215 # C can be supported this way too (leave for later).
1216
1217 LANG_CONFIGUREFRAGS = @all_lang_configurefrags@
1218 LANG_MAKEFRAGS = @all_lang_makefrags@
1219
1220 # Used by gcc/jit/Make-lang.in
1221 LIBGCCJIT_VERSION_NUM = @libgccjit_version@
1222 LD_VERSION_SCRIPT_OPTION = @ld_version_script_option@
1223 LD_SONAME_OPTION = @ld_soname_option@
1224 @ENABLE_DARWIN_AT_RPATH_TRUE@DARWIN_RPATH = @rpath
1225 @ENABLE_DARWIN_AT_RPATH_FALSE@DARWIN_RPATH = ${libdir}
1226
1227 # Flags to pass to recursive makes.
1228 # CC is set by configure.
1229 # ??? The choices here will need some experimenting with.
1230
1231 export AR_FOR_TARGET
1232 export AR_CREATE_FOR_TARGET
1233 export AR_FLAGS_FOR_TARGET
1234 export AR_EXTRACT_FOR_TARGET
1235 export AWK
1236 export DESTDIR
1237 export GCC_FOR_TARGET
1238 export INCLUDES
1239 export INSTALL_DATA
1240 export LIPO_FOR_TARGET
1241 export MACHMODE_H
1242 export NM_FOR_TARGET
1243 export STRIP_FOR_TARGET
1244 export RANLIB_FOR_TARGET
1245 export libsubdir
1246
1247 FLAGS_TO_PASS = \
1248 "ADA_CFLAGS=$(ADA_CFLAGS)" \
1249 "BISON=$(BISON)" \
1250 "BISONFLAGS=$(BISONFLAGS)" \
1251 "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
1252 "LDFLAGS=$(LDFLAGS)" \
1253 "FLEX=$(FLEX)" \
1254 "FLEXFLAGS=$(FLEXFLAGS)" \
1255 "INSTALL=$(INSTALL)" \
1256 "INSTALL_DATA=$(INSTALL_DATA)" \
1257 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
1258 "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
1259 "LN=$(LN)" \
1260 "LN_S=$(LN_S)" \
1261 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
1262 "MAKEINFO=$(MAKEINFO)" \
1263 "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
1264 "MAKEOVERRIDES=" \
1265 "SHELL=$(SHELL)" \
1266 "TFLAGS=$(TFLAGS)" \
1267 "exeext=$(exeext)" \
1268 "build_exeext=$(build_exeext)" \
1269 "objext=$(objext)" \
1270 "exec_prefix=$(exec_prefix)" \
1271 "prefix=$(prefix)" \
1272 "local_prefix=$(local_prefix)" \
1273 "gxx_include_dir=$(gcc_gxx_include_dir)" \
1274 "gxx_libcxx_include_dir=$(gcc_gxx_libcxx_include_dir)" \
1275 "build_tooldir=$(build_tooldir)" \
1276 "gcc_tooldir=$(gcc_tooldir)" \
1277 "bindir=$(bindir)" \
1278 "libexecsubdir=$(libexecsubdir)" \
1279 "datarootdir=$(datarootdir)" \
1280 "datadir=$(datadir)" \
1281 "libsubdir=$(libsubdir)" \
1282 "localedir=$(localedir)"
1283 #
1284 # Lists of files for various purposes.
1285
1286 # All option source files
1287 ALL_OPT_FILES=$(lang_opt_files) $(extra_opt_files)
1288
1289 ALL_OPT_URL_FILES=$(patsubst %, %.urls, $(ALL_OPT_FILES))
1290
1291 # Target specific, C specific object file
1292 C_TARGET_OBJS=@c_target_objs@
1293
1294 # Target specific, C++ specific object file
1295 CXX_TARGET_OBJS=@cxx_target_objs@
1296
1297 # Target specific, D specific object file
1298 D_TARGET_OBJS=@d_target_objs@
1299
1300 # Target specific, Fortran specific object file
1301 FORTRAN_TARGET_OBJS=@fortran_target_objs@
1302
1303 # Target specific, Rust specific object file
1304 RUST_TARGET_OBJS=@rust_target_objs@
1305
1306 # Object files for gcc many-languages driver.
1307 GCC_OBJS = gcc.o gcc-main.o ggc-none.o gcc-urlifier.o options-urls.o
1308
1309 SARIF_REPLAY_OBJS = sarif-replay.o libsarifreplay.o
1310
1311 c-family-warn = $(STRICT_WARN)
1312
1313 # Language-specific object files shared by all C-family front ends.
1314 C_COMMON_OBJS = c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o \
1315 c-family/c-format.o c-family/c-gimplify.o c-family/c-indentation.o \
1316 c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o \
1317 c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o \
1318 c-family/c-semantics.o c-family/c-ada-spec.o \
1319 c-family/c-ubsan.o c-family/known-headers.o \
1320 c-family/c-attribs.o c-family/c-warn.o c-family/c-spellcheck.o \
1321 c-family/c-type-mismatch.o
1322
1323 # Analyzer object files
1324 ANALYZER_OBJS = \
1325 analyzer/access-diagram.o \
1326 analyzer/analysis-plan.o \
1327 analyzer/analyzer.o \
1328 analyzer/analyzer-language.o \
1329 analyzer/analyzer-logging.o \
1330 analyzer/analyzer-pass.o \
1331 analyzer/analyzer-selftests.o \
1332 analyzer/bar-chart.o \
1333 analyzer/bounds-checking.o \
1334 analyzer/call-details.o \
1335 analyzer/call-info.o \
1336 analyzer/call-string.o \
1337 analyzer/call-summary.o \
1338 analyzer/checker-event.o \
1339 analyzer/checker-path.o \
1340 analyzer/complexity.o \
1341 analyzer/constraint-manager.o \
1342 analyzer/diagnostic-manager.o \
1343 analyzer/engine.o \
1344 analyzer/feasible-graph.o \
1345 analyzer/function-set.o \
1346 analyzer/infinite-loop.o \
1347 analyzer/infinite-recursion.o \
1348 analyzer/kf.o \
1349 analyzer/kf-analyzer.o \
1350 analyzer/kf-lang-cp.o \
1351 analyzer/known-function-manager.o \
1352 analyzer/pending-diagnostic.o \
1353 analyzer/program-point.o \
1354 analyzer/program-state.o \
1355 analyzer/ranges.o \
1356 analyzer/record-layout.o \
1357 analyzer/region.o \
1358 analyzer/region-model.o \
1359 analyzer/region-model-asm.o \
1360 analyzer/region-model-manager.o \
1361 analyzer/region-model-reachability.o \
1362 analyzer/sm.o \
1363 analyzer/sm-file.o \
1364 analyzer/sm-fd.o \
1365 analyzer/sm-malloc.o \
1366 analyzer/sm-pattern-test.o \
1367 analyzer/sm-sensitive.o \
1368 analyzer/sm-signal.o \
1369 analyzer/sm-taint.o \
1370 analyzer/state-purge.o \
1371 analyzer/store.o \
1372 analyzer/supergraph.o \
1373 analyzer/svalue.o \
1374 analyzer/symbol.o \
1375 analyzer/trimmed-graph.o \
1376 analyzer/varargs.o
1377
1378 # Language-independent object files.
1379 # We put the *-match.o and insn-*.o files first so that a parallel make
1380 # will build them sooner, because they are large and otherwise tend to be
1381 # the last objects to finish building.
1382 OBJS = \
1383 $(GIMPLE_MATCH_PD_SEQ_O) \
1384 gimple-match-exports.o \
1385 $(GENERIC_MATCH_PD_SEQ_O) \
1386 insn-attrtab.o \
1387 insn-automata.o \
1388 insn-dfatab.o \
1389 $(INSNEMIT_SEQ_O) \
1390 insn-extract.o \
1391 insn-latencytab.o \
1392 insn-modes.o \
1393 insn-opinit.o \
1394 insn-output.o \
1395 insn-peep.o \
1396 insn-preds.o \
1397 $(INSNRECOG_SEQ_O) \
1398 insn-enums.o \
1399 ggc-page.o \
1400 adjust-alignment.o \
1401 alias.o \
1402 alloc-pool.o \
1403 auto-inc-dec.o \
1404 auto-profile.o \
1405 bb-reorder.o \
1406 bitmap.o \
1407 builtins.o \
1408 caller-save.o \
1409 calls.o \
1410 ccmp.o \
1411 cfg.o \
1412 cfganal.o \
1413 cfgbuild.o \
1414 cfgcleanup.o \
1415 cfgexpand.o \
1416 cfghooks.o \
1417 cfgloop.o \
1418 cfgloopanal.o \
1419 cfgloopmanip.o \
1420 cfgrtl.o \
1421 ctfc.o \
1422 ctfout.o \
1423 btfout.o \
1424 symtab.o \
1425 symtab-thunks.o \
1426 symtab-clones.o \
1427 cgraph.o \
1428 cgraphbuild.o \
1429 cgraphunit.o \
1430 cgraphclones.o \
1431 combine.o \
1432 combine-stack-adj.o \
1433 compare-elim.o \
1434 context.o \
1435 convert.o \
1436 coroutine-passes.o \
1437 coverage.o \
1438 cppbuiltin.o \
1439 cppdefault.o \
1440 cprop.o \
1441 cse.o \
1442 cselib.o \
1443 data-streamer.o \
1444 data-streamer-in.o \
1445 data-streamer-out.o \
1446 dbgcnt.o \
1447 dce.o \
1448 ddg.o \
1449 debug.o \
1450 df-core.o \
1451 df-problems.o \
1452 df-scan.o \
1453 dfp.o \
1454 digraph.o \
1455 dojump.o \
1456 dominance.o \
1457 domwalk.o \
1458 double-int.o \
1459 dse.o \
1460 dumpfile.o \
1461 dwarf2asm.o \
1462 dwarf2cfi.o \
1463 dwarf2codeview.o \
1464 dwarf2ctf.o \
1465 dwarf2out.o \
1466 early-remat.o \
1467 emit-rtl.o \
1468 et-forest.o \
1469 except.o \
1470 explow.o \
1471 expmed.o \
1472 expr.o \
1473 ext-dce.o \
1474 fibonacci_heap.o \
1475 file-prefix-map.o \
1476 final.o \
1477 fixed-value.o \
1478 fold-const.o \
1479 fold-const-call.o \
1480 fold-mem-offsets.o \
1481 function.o \
1482 function-abi.o \
1483 function-tests.o \
1484 fwprop.o \
1485 gcc-attribute-urlifier.o \
1486 gcc-rich-location.o \
1487 gcc-urlifier.o \
1488 gcse.o \
1489 gcse-common.o \
1490 ggc-common.o \
1491 ggc-tests.o \
1492 gimple.o \
1493 gimple-array-bounds.o \
1494 gimple-builder.o \
1495 gimple-expr.o \
1496 gimple-if-to-switch.o \
1497 gimple-iterator.o \
1498 gimple-fold.o \
1499 gimple-harden-conditionals.o \
1500 gimple-harden-control-flow.o \
1501 gimple-laddress.o \
1502 gimple-loop-interchange.o \
1503 gimple-loop-jam.o \
1504 gimple-loop-versioning.o \
1505 gimple-low.o \
1506 gimple-lower-bitint.o \
1507 gimple-predicate-analysis.o \
1508 gimple-pretty-print.o \
1509 gimple-range.o \
1510 gimple-range-cache.o \
1511 gimple-range-edge.o \
1512 gimple-range-fold.o \
1513 gimple-range-gori.o \
1514 gimple-range-infer.o \
1515 gimple-range-op.o \
1516 gimple-range-phi.o \
1517 gimple-range-trace.o \
1518 gimple-ssa-backprop.o \
1519 gimple-ssa-isolate-paths.o \
1520 gimple-ssa-nonnull-compare.o \
1521 gimple-ssa-sccopy.o \
1522 gimple-ssa-split-paths.o \
1523 gimple-ssa-store-merging.o \
1524 gimple-ssa-strength-reduction.o \
1525 gimple-ssa-sprintf.o \
1526 gimple-ssa-warn-access.o \
1527 gimple-ssa-warn-alloca.o \
1528 gimple-ssa-warn-restrict.o \
1529 gimple-streamer-in.o \
1530 gimple-streamer-out.o \
1531 gimple-walk.o \
1532 gimple-warn-recursion.o \
1533 gimplify.o \
1534 gimplify-me.o \
1535 godump.o \
1536 graph.o \
1537 graphds.o \
1538 graphviz.o \
1539 graphite.o \
1540 graphite-isl-ast-to-gimple.o \
1541 graphite-dependences.o \
1542 graphite-optimize-isl.o \
1543 graphite-poly.o \
1544 graphite-scop-detection.o \
1545 graphite-sese-to-poly.o \
1546 gtype-desc.o \
1547 haifa-sched.o \
1548 hash-map-tests.o \
1549 hash-set-tests.o \
1550 hw-doloop.o \
1551 hwint.o \
1552 ifcvt.o \
1553 ree.o \
1554 inchash.o \
1555 incpath.o \
1556 init-regs.o \
1557 internal-fn.o \
1558 ipa-locality-cloning.o \
1559 ipa-cp.o \
1560 ipa-sra.o \
1561 ipa-devirt.o \
1562 ipa-fnsummary.o \
1563 ipa-polymorphic-call.o \
1564 ipa-split.o \
1565 ipa-inline.o \
1566 ipa-comdats.o \
1567 ipa-free-lang-data.o \
1568 ipa-visibility.o \
1569 ipa-inline-analysis.o \
1570 ipa-inline-transform.o \
1571 ipa-modref.o \
1572 ipa-modref-tree.o \
1573 ipa-predicate.o \
1574 ipa-profile.o \
1575 ipa-prop.o \
1576 ipa-param-manipulation.o \
1577 ipa-pure-const.o \
1578 ipa-icf.o \
1579 ipa-icf-gimple.o \
1580 ipa-reference.o \
1581 ipa-ref.o \
1582 ipa-utils.o \
1583 ipa-strub.o \
1584 ipa.o \
1585 ira.o \
1586 pair-fusion.o \
1587 ira-build.o \
1588 ira-costs.o \
1589 ira-conflicts.o \
1590 ira-color.o \
1591 ira-emit.o \
1592 ira-lives.o \
1593 jump.o \
1594 langhooks.o \
1595 late-combine.o \
1596 lazy-diagnostic-path.o \
1597 lcm.o \
1598 lists.o \
1599 loop-doloop.o \
1600 loop-init.o \
1601 loop-invariant.o \
1602 loop-iv.o \
1603 loop-unroll.o \
1604 lower-subreg.o \
1605 lra.o \
1606 lra-assigns.o \
1607 lra-coalesce.o \
1608 lra-constraints.o \
1609 lra-eliminations.o \
1610 lra-lives.o \
1611 lra-remat.o \
1612 lra-spills.o \
1613 lto-cgraph.o \
1614 lto-streamer.o \
1615 lto-streamer-in.o \
1616 lto-streamer-out.o \
1617 lto-section-in.o \
1618 lto-section-out.o \
1619 lto-opts.o \
1620 lto-compress.o \
1621 mcf.o \
1622 mode-switching.o \
1623 modulo-sched.o \
1624 multiple_target.o \
1625 omp-offload.o \
1626 omp-expand.o \
1627 omp-general.o \
1628 omp-low.o \
1629 omp-oacc-kernels-decompose.o \
1630 omp-oacc-neuter-broadcast.o \
1631 omp-simd-clone.o \
1632 opt-problem.o \
1633 optabs.o \
1634 optabs-libfuncs.o \
1635 optabs-query.o \
1636 optabs-tree.o \
1637 optinfo.o \
1638 optinfo-emit-json.o \
1639 options-save.o \
1640 options-urls.o \
1641 opts-global.o \
1642 ordered-hash-map-tests.o \
1643 passes.o \
1644 prime-paths.o \
1645 path-coverage.o \
1646 plugin.o \
1647 pointer-query.o \
1648 postreload-gcse.o \
1649 postreload.o \
1650 predict.o \
1651 print-rtl.o \
1652 print-rtl-function.o \
1653 print-tree.o \
1654 profile.o \
1655 profile-count.o \
1656 range.o \
1657 range-op.o \
1658 range-op-float.o \
1659 range-op-ptr.o \
1660 read-md.o \
1661 read-rtl.o \
1662 read-rtl-function.o \
1663 real.o \
1664 realmpfr.o \
1665 recog.o \
1666 reg-stack.o \
1667 regcprop.o \
1668 reginfo.o \
1669 regrename.o \
1670 regstat.o \
1671 reload.o \
1672 reload1.o \
1673 reorg.o \
1674 resource.o \
1675 rtl-error.o \
1676 rtl-ssa/accesses.o \
1677 rtl-ssa/blocks.o \
1678 rtl-ssa/changes.o \
1679 rtl-ssa/functions.o \
1680 rtl-ssa/insns.o \
1681 rtl-ssa/movement.o \
1682 rtl-tests.o \
1683 rtl.o \
1684 rtlhash.o \
1685 rtlanal.o \
1686 rtlhooks.o \
1687 rtx-vector-builder.o \
1688 run-rtl-passes.o \
1689 sched-deps.o \
1690 sched-ebb.o \
1691 sched-rgn.o \
1692 sel-sched-ir.o \
1693 sel-sched-dump.o \
1694 sel-sched.o \
1695 selftest-rtl.o \
1696 selftest-run-tests.o \
1697 sese.o \
1698 shrink-wrap.o \
1699 simplify-rtx.o \
1700 sparseset.o \
1701 spellcheck.o \
1702 spellcheck-tree.o \
1703 splay-tree-utils.o \
1704 sreal.o \
1705 stack-ptr-mod.o \
1706 statistics.o \
1707 stmt.o \
1708 stor-layout.o \
1709 avoid-store-forwarding.o \
1710 store-motion.o \
1711 streamer-hooks.o \
1712 stringpool.o \
1713 substring-locations.o \
1714 target-globals.o \
1715 targhooks.o \
1716 timevar.o \
1717 toplev.o \
1718 tracer.o \
1719 trans-mem.o \
1720 tree-affine.o \
1721 asan.o \
1722 tsan.o \
1723 ubsan.o \
1724 sanopt.o \
1725 sancov.o \
1726 simple-diagnostic-path.o \
1727 tree-assume.o \
1728 tree-call-cdce.o \
1729 tree-cfg.o \
1730 tree-cfgcleanup.o \
1731 tree-chrec.o \
1732 tree-complex.o \
1733 tree-data-ref.o \
1734 tree-dfa.o \
1735 tree-diagnostic.o \
1736 tree-diagnostic-client-data-hooks.o \
1737 tree-dump.o \
1738 tree-eh.o \
1739 tree-emutls.o \
1740 tree-if-conv.o \
1741 tree-inline.o \
1742 tree-into-ssa.o \
1743 tree-iterator.o \
1744 tree-logical-location.o \
1745 tree-loop-distribution.o \
1746 crc-verification.o \
1747 gimple-crc-optimization.o \
1748 sym-exec/sym-exec-expression.o \
1749 sym-exec/sym-exec-state.o \
1750 sym-exec/sym-exec-condition.o \
1751 tree-nested.o \
1752 tree-nrv.o \
1753 tree-object-size.o \
1754 tree-outof-ssa.o \
1755 tree-parloops.o \
1756 tree-phinodes.o \
1757 tree-predcom.o \
1758 tree-pretty-print.o \
1759 tree-profile.o \
1760 tree-scalar-evolution.o \
1761 tree-sra.o \
1762 tree-switch-conversion.o \
1763 tree-ssa-address.o \
1764 tree-ssa-alias.o \
1765 tree-ssa-ccp.o \
1766 tree-ssa-coalesce.o \
1767 tree-ssa-copy.o \
1768 tree-ssa-dce.o \
1769 tree-ssa-dom.o \
1770 tree-ssa-dse.o \
1771 tree-ssa-forwprop.o \
1772 tree-ssa-ifcombine.o \
1773 tree-ssa-live.o \
1774 tree-ssa-loop-ch.o \
1775 tree-ssa-loop-im.o \
1776 tree-ssa-loop-ivcanon.o \
1777 tree-ssa-loop-ivopts.o \
1778 tree-ssa-loop-manip.o \
1779 tree-ssa-loop-niter.o \
1780 tree-ssa-loop-prefetch.o \
1781 tree-ssa-loop-split.o \
1782 tree-ssa-loop-unswitch.o \
1783 tree-ssa-loop.o \
1784 tree-ssa-math-opts.o \
1785 tree-ssa-operands.o \
1786 gimple-range-path.o \
1787 tree-ssa-phiopt.o \
1788 tree-ssa-phiprop.o \
1789 tree-ssa-pre.o \
1790 tree-ssa-propagate.o \
1791 tree-ssa-reassoc.o \
1792 tree-ssa-sccvn.o \
1793 tree-ssa-scopedtables.o \
1794 tree-ssa-sink.o \
1795 tree-ssa-strlen.o \
1796 tree-ssa-structalias.o \
1797 tree-ssa-tail-merge.o \
1798 tree-ssa-ter.o \
1799 tree-ssa-threadbackward.o \
1800 tree-ssa-threadedge.o \
1801 tree-ssa-threadupdate.o \
1802 tree-ssa-uncprop.o \
1803 tree-ssa-uninit.o \
1804 tree-ssa.o \
1805 tree-ssanames.o \
1806 tree-stdarg.o \
1807 tree-streamer.o \
1808 tree-streamer-in.o \
1809 tree-streamer-out.o \
1810 tree-tailcall.o \
1811 tree-vect-generic.o \
1812 gimple-isel.o \
1813 tree-vect-patterns.o \
1814 tree-vect-data-refs.o \
1815 tree-vect-stmts.o \
1816 tree-vect-loop.o \
1817 tree-vect-loop-manip.o \
1818 tree-vect-slp.o \
1819 tree-vect-slp-patterns.o \
1820 tree-vectorizer.o \
1821 tree-vector-builder.o \
1822 tree-vrp.o \
1823 tree.o \
1824 tristate.o \
1825 typed-splay-tree.o \
1826 valtrack.o \
1827 value-pointer-equiv.o \
1828 value-query.o \
1829 value-range.o \
1830 value-range-pretty-print.o \
1831 value-range-storage.o \
1832 value-relation.o \
1833 value-prof.o \
1834 var-tracking.o \
1835 varasm.o \
1836 varpool.o \
1837 vec-perm-indices.o \
1838 vmsdbgout.o \
1839 vr-values.o \
1840 vtable-verify.o \
1841 warning-control.o \
1842 web.o \
1843 wide-int.o \
1844 wide-int-print.o \
1845 $(out_object_file) \
1846 $(ANALYZER_OBJS) \
1847 $(EXTRA_OBJS) \
1848 $(host_hook_obj)
1849
1850 # Objects in libcommon.a, potentially used by all host binaries and with
1851 # no target dependencies.
1852 OBJS-libcommon = diagnostic-spec.o diagnostic.o diagnostic-color.o \
1853 diagnostic-format-json.o \
1854 diagnostic-format-sarif.o \
1855 diagnostic-format-text.o \
1856 diagnostic-global-context.o \
1857 diagnostic-macro-unwinding.o \
1858 diagnostic-path.o \
1859 diagnostic-show-locus.o \
1860 edit-context.o \
1861 pretty-print.o intl.o \
1862 json.o json-parsing.o \
1863 sbitmap.o \
1864 vec.o input.o hash-table.o ggc-none.o memory-block.o \
1865 selftest.o selftest-diagnostic.o sort.o \
1866 selftest-diagnostic-path.o \
1867 selftest-json.o \
1868 selftest-logical-location.o \
1869 text-art/box-drawing.o \
1870 text-art/canvas.o \
1871 text-art/ruler.o \
1872 text-art/selftests.o \
1873 text-art/style.o \
1874 text-art/styled-string.o \
1875 text-art/table.o \
1876 text-art/theme.o \
1877 text-art/tree-widget.o \
1878 text-art/widget.o
1879
1880 # Objects in libcommon-target.a, used by drivers and by the core
1881 # compiler and containing target-dependent code.
1882 OBJS-libcommon-target = $(common_out_object_file) prefix.o \
1883 opts.o opts-common.o opts-diagnostic.o options.o \
1884 vec.o hooks.o common/common-targhooks.o \
1885 hash-table.o file-find.o spellcheck.o selftest.o opt-suggestions.o \
1886 options-urls.o
1887
1888 # This lists all host objects for the front ends.
1889 ALL_HOST_FRONTEND_OBJS = $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS))
1890
1891 ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OBJS) $(OBJS-libcommon) \
1892 $(OBJS-libcommon-target) main.o c-family/cppspec.o \
1893 $(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) $(GCOV_OBJS) $(GCOV_DUMP_OBJS) \
1894 $(GCOV_TOOL_OBJS) $(GENGTYPE_OBJS) gcc-ar.o gcc-nm.o gcc-ranlib.o \
1895 lto-wrapper.o collect-utils.o lockfile.o lto-ltrans-cache.o
1896
1897 # for anything that is shared use the cc1plus profile data, as that
1898 # is likely the most exercised during the build
1899 ifeq ($(if $(wildcard ../stage_current),$(shell cat \
1900 ../stage_current)),stageautofeedback)
1901 $(ALL_HOST_BACKEND_OBJS): ALL_COMPILERFLAGS += -fauto-profile=cc1plus.fda
1902 $(ALL_HOST_BACKEND_OBJS): cc1plus.fda
1903 endif
1904
1905 # This lists all host object files, whether they are included in this
1906 # compilation or not.
1907 ALL_HOST_OBJS = $(ALL_HOST_FRONTEND_OBJS) $(ALL_HOST_BACKEND_OBJS)
1908
1909 ifeq (@enable_libgdiagnostics@,yes)
1910 ALL_HOST_OBJS += $(libgdiagnostics_OBJS) $(SARIF_REPLAY_OBJS)
1911 endif
1912
1913 # libbackend.a objs that might not be in some cases linked into the compiler,
1914 # yet they are supposed to be part of the plugin ABI. See PR116143.
1915 EXTRA_BACKEND_OBJS = simple-diagnostic-path.o lazy-diagnostic-path.o
1916
1917 BACKEND = $(EXTRA_BACKEND_OBJS) libbackend.a main.o libcommon-target.a \
1918 libcommon.a $(CPPLIB) $(LIBDECNUMBER)
1919
1920 # This is defined to "yes" if Tree checking is enabled, which roughly means
1921 # front-end checking.
1922 TREECHECKING = @TREECHECKING@
1923
1924 # The full name of the driver on installation
1925 FULL_DRIVER_NAME=$(target_noncanonical)-gcc-$(version)$(exeext)
1926
1927 MOSTLYCLEANFILES = insn-flags.h insn-config.h insn-codes.h \
1928 insn-output.cc $(INSNRECOG_SEQ_SRC) insn-recog.h \
1929 $(INSNEMIT_SEQ_SRC) insn-extract.cc insn-peep.cc \
1930 insn-attr.h insn-attr-common.h insn-attrtab.cc insn-dfatab.cc \
1931 insn-latencytab.cc insn-opinit.cc insn-opinit.h insn-preds.cc insn-constants.h \
1932 tm-preds.h tm-constrs.h checksum-options $(GIMPLE_MATCH_PD_SEQ_SRC) \
1933 $(GENERIC_MATCH_PD_SEQ_SRC) gimple-match-auto.h generic-match-auto.h \
1934 tree-check.h min-insn-modes.cc insn-modes.cc insn-modes.h insn-modes-inline.h \
1935 genrtl.h gt-*.h gtype-*.h gtype-desc.cc gtyp-input.list \
1936 case-cfn-macros.h cfn-operators.pd \
1937 xgcc$(exeext) cpp$(exeext) $(FULL_DRIVER_NAME) \
1938 $(EXTRA_PROGRAMS) gcc-cross$(exeext) \
1939 $(SPECS) collect2$(exeext) gcc-ar$(exeext) gcc-nm$(exeext) \
1940 gcc-ranlib$(exeext) \
1941 genversion$(build_exeext) gcov$(exeext) gcov-dump$(exeext) \
1942 gcov-tool$(exeect) \
1943 gengtype$(exeext) *.[0-9][0-9].* *.[si] *-checksum.cc libbackend.a \
1944 libcommon-target.a libcommon.a libgcc.mk perf.data
1945
1946 # This symlink makes the full installation name of the driver be available
1947 # from within the *build* directory, for use when running the JIT library
1948 # from there (e.g. when running its testsuite).
1949 $(FULL_DRIVER_NAME): ./xgcc$(exeext)
1950 rm -f $@
1951 $(LN_S) $< $@
1952
1953 #
1954 # SELFTEST_DEPS need to be set before including language makefile fragments.
1955 # Otherwise $(SELFTEST_DEPS) is empty when used from <LANG>/Make-lang.in.
1956 SELFTEST_DEPS = $(GCC_PASSES) stmp-int-hdrs $(srcdir)/testsuite/selftests
1957
1958 DO_LINK_SERIALIZATION = @DO_LINK_SERIALIZATION@
1959
1960 # Language makefile fragments.
1961
1962 # The following targets define the interface between us and the languages.
1963 #
1964 # all.cross, start.encap, rest.encap,
1965 # install-common, install-info, install-man,
1966 # uninstall,
1967 # mostlyclean, clean, distclean, maintainer-clean,
1968 #
1969 # Each language is linked in with a series of hooks. The name of each
1970 # hooked is "lang.${target_name}" (eg: lang.info). Configure computes
1971 # and adds these here. We use double-colon rules for some of the hooks;
1972 # double-colon rules should be preferred for any new hooks.
1973
1974 # language hooks, generated by configure
1975 @language_hooks@
1976
1977 ifeq ($(DO_LINK_SERIALIZATION),)
1978 LINK_PROGRESS = :
1979 else
1980 LINK_PROGRESS = msg="Linking $@ |"; cnt=0; if test "$(2)" = start; then \
1981 idx=0; cnt2=$(DO_LINK_SERIALIZATION); \
1982 while test $$cnt2 -le $(1); do msg="$${msg}=="; cnt2=`expr $$cnt2 + 1`; idx=`expr $$idx + 1`; done; \
1983 cnt=$$idx; \
1984 while test $$cnt -lt $(1); do msg="$${msg}>>"; cnt=`expr $$cnt + 1`; done; \
1985 msg="$${msg}--"; cnt=`expr $$cnt + 1`; \
1986 else \
1987 idx=`expr $(1) + 1`; \
1988 while test $$cnt -le $(1); do msg="$${msg}=="; cnt=`expr $$cnt + 1`; done; \
1989 fi; \
1990 while test $$cnt -lt $(SERIAL_COUNT); do msg="$${msg} "; cnt=`expr $$cnt + 1`; done; \
1991 msg="$${msg}| `expr 100 \* $$idx / $(SERIAL_COUNT)`%"; echo "$$msg"
1992 endif
1993
1994 # Wire in install-gnatlib invocation with `make install' for a configuration
1995 # with top-level libada disabled.
1996 gnat_install_lib = @gnat_install_lib@
1997
1998 # per-language makefile fragments
1999 -include $(LANG_MAKEFRAGS)
2000
2001 # target and host overrides must follow the per-language makefile fragments
2002 # so they can override or augment language-specific variables
2003
2004 # target overrides
2005 -include $(tmake_file)
2006
2007 # host overrides
2008 -include $(xmake_file)
2009
2010 # all-tree.def includes all the tree.def files.
2011 all-tree.def: s-alltree; @true
2012 s-alltree: Makefile
2013 rm -f tmp-all-tree.def
2014 echo '#include "tree.def"' > tmp-all-tree.def
2015 echo 'END_OF_BASE_TREE_CODES' >> tmp-all-tree.def
2016 echo '#include "c-family/c-common.def"' >> tmp-all-tree.def
2017 ltf="$(lang_tree_files)"; for f in $$ltf; do \
2018 echo "#include \"$$f\""; \
2019 done | sed 's|$(srcdir)/||' >> tmp-all-tree.def
2020 $(SHELL) $(srcdir)/../move-if-change tmp-all-tree.def all-tree.def
2021 $(STAMP) s-alltree
2022
2023 # Now that LANG_MAKEFRAGS are included, we can add special flags to the
2024 # objects that belong to the front ends. We add an extra define that
2025 # causes back-end specific include files to be poisoned, in the hope that
2026 # we can avoid introducing dependencies of the front ends on things that
2027 # no front end should ever look at (e.g. everything RTL related).
2028 $(foreach file,$(ALL_HOST_FRONTEND_OBJS),$(eval CFLAGS-$(file) += -DIN_GCC_FRONTEND))
2029
2030 #
2031
2032 # -----------------------------
2033 # Rebuilding this configuration
2034 # -----------------------------
2035
2036 # On the use of stamps:
2037 # Consider the example of tree-check.h. It is constructed with build/gencheck.
2038 # A simple rule to build tree-check.h would be
2039 # tree-check.h: build/gencheck$(build_exeext)
2040 # $(RUN_GEN) build/gencheck$(build_exeext) > tree-check.h
2041 #
2042 # but tree-check.h doesn't change every time gencheck changes. It would the
2043 # nice if targets that depend on tree-check.h wouldn't be rebuild
2044 # unnecessarily when tree-check.h is unchanged. To make this, tree-check.h
2045 # must not be overwritten with a identical copy. One solution is to use a
2046 # temporary file
2047 # tree-check.h: build/gencheck$(build_exeext)
2048 # $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h
2049 # $(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h
2050 #
2051 # This solution has a different problem. Since the time stamp of tree-check.h
2052 # is unchanged, make will try to update tree-check.h every time it runs.
2053 # To prevent this, one can add a stamp
2054 # tree-check.h: s-check
2055 # s-check : build/gencheck$(build_exeext)
2056 # $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h
2057 # $(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h
2058 # $(STAMP) s-check
2059 #
2060 # The problem with this solution is that make thinks that tree-check.h is
2061 # always unchanged. Make must be deceived into thinking that tree-check.h is
2062 # rebuild by the "tree-check.h: s-check" rule. To do this, add a dummy command:
2063 # tree-check.h: s-check; @true
2064 # s-check : build/gencheck$(build_exeext)
2065 # $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h
2066 # $(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h
2067 # $(STAMP) s-check
2068 #
2069 # This is what is done in this makefile. Note that mkconfig.sh has a
2070 # move-if-change built-in
2071
2072 Makefile: config.status $(srcdir)/Makefile.in $(LANG_MAKEFRAGS)
2073 LANGUAGES="$(CONFIG_LANGUAGES)" \
2074 CONFIG_HEADERS= \
2075 CONFIG_SHELL="$(SHELL)" \
2076 CONFIG_FILES=$@ $(SHELL) config.status
2077
2078 config.h: cs-config.h ; @true
2079 bconfig.h: cs-bconfig.h ; @true
2080 tconfig.h: cs-tconfig.h ; @true
2081 tm.h: cs-tm.h ; @true
2082 tm_p.h: cs-tm_p.h ; @true
2083 tm_d.h: cs-tm_d.h ; @true
2084 tm_rust.h: cs-tm_rust.h ; @true
2085
2086 cs-config.h: Makefile
2087 TARGET_CPU_DEFAULT="" \
2088 HEADERS="$(host_xm_include_list)" DEFINES="$(host_xm_defines)" \
2089 $(SHELL) $(srcdir)/mkconfig.sh config.h
2090
2091 cs-bconfig.h: Makefile
2092 TARGET_CPU_DEFAULT="" \
2093 HEADERS="$(build_xm_include_list)" DEFINES="$(build_xm_defines)" \
2094 $(SHELL) $(srcdir)/mkconfig.sh bconfig.h
2095
2096 cs-tconfig.h: Makefile
2097 TARGET_CPU_DEFAULT="" \
2098 HEADERS="$(xm_include_list)" DEFINES="USED_FOR_TARGET $(xm_defines)" \
2099 $(SHELL) $(srcdir)/mkconfig.sh tconfig.h
2100
2101 cs-tm.h: Makefile
2102 @ENABLE_DARWIN_AT_RPATH_FALSE@ TARGET_CPU_DEFAULT="$(target_cpu_default)" \
2103 @ENABLE_DARWIN_AT_RPATH_FALSE@ HEADERS="$(tm_include_list)" DEFINES="$(tm_defines)" \
2104 @ENABLE_DARWIN_AT_RPATH_FALSE@ $(SHELL) $(srcdir)/mkconfig.sh tm.h
2105 @ENABLE_DARWIN_AT_RPATH_TRUE@ TARGET_CPU_DEFAULT="$(target_cpu_default)" \
2106 @ENABLE_DARWIN_AT_RPATH_TRUE@ HEADERS="$(tm_include_list)" DEFINES="$(tm_defines) DARWIN_AT_RPATH=1" \
2107 @ENABLE_DARWIN_AT_RPATH_TRUE@ $(SHELL) $(srcdir)/mkconfig.sh tm.h
2108
2109 cs-tm_p.h: Makefile
2110 TARGET_CPU_DEFAULT="" \
2111 HEADERS="$(tm_p_include_list)" DEFINES="" \
2112 $(SHELL) $(srcdir)/mkconfig.sh tm_p.h
2113
2114 cs-tm_d.h: Makefile
2115 TARGET_CPU_DEFAULT="" \
2116 HEADERS="$(tm_d_include_list)" DEFINES="" \
2117 $(SHELL) $(srcdir)/mkconfig.sh tm_d.h
2118
2119 cs-tm_rust.h: Makefile
2120 TARGET_CPU_DEFAULT="" \
2121 HEADERS="$(tm_rust_include_list)" DEFINES="" \
2122 $(SHELL) $(srcdir)/mkconfig.sh tm_rust.h
2123
2124 # Don't automatically run autoconf, since configure.ac might be accidentally
2125 # newer than configure. Also, this writes into the source directory which
2126 # might be on a read-only file system. If configured for maintainer mode
2127 # then do allow autoconf to be run.
2128
2129 AUTOCONF = autoconf
2130 ACLOCAL = aclocal
2131 ACLOCAL_AMFLAGS = -I ../config -I ..
2132 aclocal_deps = \
2133 $(srcdir)/../libtool.m4 \
2134 $(srcdir)/../ltoptions.m4 \
2135 $(srcdir)/../ltsugar.m4 \
2136 $(srcdir)/../ltversion.m4 \
2137 $(srcdir)/../lt~obsolete.m4 \
2138 $(srcdir)/../config/acx.m4 \
2139 $(srcdir)/../config/codeset.m4 \
2140 $(srcdir)/../config/depstand.m4 \
2141 $(srcdir)/../config/dfp.m4 \
2142 $(srcdir)/../config/gcc-plugin.m4 \
2143 $(srcdir)/../config/gettext-sister.m4 \
2144 $(srcdir)/../config/iconv.m4 \
2145 $(srcdir)/../config/lcmessage.m4 \
2146 $(srcdir)/../config/lead-dot.m4 \
2147 $(srcdir)/../config/lib-ld.m4 \
2148 $(srcdir)/../config/lib-link.m4 \
2149 $(srcdir)/../config/lib-prefix.m4 \
2150 $(srcdir)/../config/mmap.m4 \
2151 $(srcdir)/../config/override.m4 \
2152 $(srcdir)/../config/picflag.m4 \
2153 $(srcdir)/../config/progtest.m4 \
2154 $(srcdir)/../config/stdint.m4 \
2155 $(srcdir)/../config/warnings.m4 \
2156 $(srcdir)/../config/zlib.m4 \
2157 $(srcdir)/acinclude.m4
2158
2159 $(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/aclocal.m4
2160 (cd $(srcdir) && $(AUTOCONF))
2161
2162 $(srcdir)/aclocal.m4 : @MAINT@ $(aclocal_deps)
2163 (cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS))
2164
2165 # cstamp-h.in controls rebuilding of config.in.
2166 # It is named cstamp-h.in and not stamp-h.in so the mostlyclean rule doesn't
2167 # delete it. A stamp file is needed as autoheader won't update the file if
2168 # nothing has changed.
2169 # It remains in the source directory and is part of the distribution.
2170 # This follows what is done in shellutils, fileutils, etc.
2171 # "echo timestamp" is used instead of touch to be consistent with other
2172 # packages that use autoconf (??? perhaps also to avoid problems with patch?).
2173 # ??? Newer versions have a maintainer mode that may be useful here.
2174
2175 # Don't run autoheader automatically either.
2176 # Only run it if maintainer mode is enabled.
2177 @MAINT@ AUTOHEADER = autoheader
2178 @MAINT@ $(srcdir)/config.in: $(srcdir)/cstamp-h.in
2179 @MAINT@ $(srcdir)/cstamp-h.in: $(srcdir)/configure.ac
2180 @MAINT@ (cd $(srcdir) && $(AUTOHEADER))
2181 @MAINT@ @rm -f $(srcdir)/cstamp-h.in
2182 @MAINT@ echo timestamp > $(srcdir)/cstamp-h.in
2183 auto-host.h: cstamp-h ; @true
2184 cstamp-h: config.in config.status
2185 CONFIG_HEADERS=auto-host.h:config.in \
2186 CONFIG_FILES= \
2187 LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status
2188
2189 # On configurations that require auto-build.h, it is created while
2190 # running configure, so make config.status depend on it, so that
2191 # config.status --recheck runs and updates or creates it.
2192 @[email protected]: $(srcdir)/configure $(srcdir)/config.gcc
2193 @HAVE_AUTO_BUILD@ @if test -f $@; then echo rerunning config.status to update $@; \
2194 @HAVE_AUTO_BUILD@ else echo rerunning config.status to update $@; fi
2195 @[email protected]: auto-build.h
2196
2197 # Really, really stupid make features, such as SUN's KEEP_STATE, may force
2198 # a target to build even if it is up-to-date. So we must verify that
2199 # config.status does not exist before failing.
2200 config.status: $(srcdir)/configure $(srcdir)/config.gcc $(LANG_CONFIGUREFRAGS)
2201 @if [ ! -f config.status ] ; then \
2202 echo You must configure gcc. Look at http://gcc.gnu.org/install/ for details.; \
2203 false; \
2204 else \
2205 LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status --recheck; \
2206 fi
2207
2208 # --------
2209 # UNSORTED
2210 # --------
2211
2212 # Provide quickstrap as a target that people can type into the gcc directory,
2213 # and that fails if you're not into it.
2214 quickstrap: all
2215 cd $(toplevel_builddir) && $(MAKE) all-target-libgcc
2216
2217 all.internal: start.encap rest.encap doc selftest
2218 # This is what to compile if making a cross-compiler.
2219 all.cross: native gcc-cross$(exeext) cpp$(exeext) specs \
2220 libgcc-support lang.all.cross doc selftest @GENINSRC@ srcextra
2221 # This is what must be made before installing GCC and converting libraries.
2222 start.encap: native xgcc$(exeext) cpp$(exeext) specs \
2223 libgcc-support lang.start.encap @LIBGDIAGNOSTICS@ @GENINSRC@ srcextra
2224 # These can't be made until after GCC can run.
2225 rest.encap: lang.rest.encap
2226 # This is what is made with the host's compiler
2227 # whether making a cross compiler or not.
2228 native: config.status auto-host.h build-@POSUB@ $(LANGUAGES) \
2229 $(EXTRA_PROGRAMS) $(COLLECT2) lto-wrapper$(exeext) \
2230 gcc-ar$(exeext) gcc-nm$(exeext) gcc-ranlib$(exeext)
2231
2232 ifeq ($(enable_plugin),yes)
2233 native: gengtype$(exeext)
2234 endif
2235
2236 # On the target machine, finish building a cross compiler.
2237 # This does the things that can't be done on the host machine.
2238 rest.cross: specs
2239
2240 # GCC's selftests.
2241 # Specify a dummy input file to placate the driver.
2242 # Specify -nostdinc to work around missing WIND_BASE environment variable
2243 # required for *-wrs-vxworks-* targets.
2244 # Specify -o /dev/null so the output of -S is discarded. More importantly
2245 # It does not try to create a file with the name "null.s" on POSIX and
2246 # "nul.s" on Windows. Because on Windows "nul" is a reserved file name.
2247 # Beware that /dev/null is not available to mingw tools, so directly use
2248 # "nul" instead of "/dev/null" if we're building on a mingw machine.
2249 # Specify the path to gcc/testsuite/selftests within the srcdir
2250 # as an argument to -fself-test.
2251 DEVNULL=$(if $(findstring mingw,$(build)),nul,/dev/null)
2252 SELFTEST_FLAGS = -nostdinc $(DEVNULL) -S -o $(DEVNULL) \
2253 -fself-test=$(srcdir)/testsuite/selftests
2254
2255 # Run the selftests during the build once we have a driver and the frontend,
2256 # so that self-test failures are caught as early as possible.
2257 # Use "s-selftest-FE" to ensure that we only run the selftests if the
2258 # driver, frontend, or selftest data change.
2259 .PHONY: selftest
2260
2261 # Potentially run all selftest-<LANG>. The various <LANG>/Make-lang.in can
2262 # require the selftests to be run by defining their selftest-<LANG> as
2263 # s-selftest-<LANG>. Otherwise, they should define it as empty.
2264
2265 SELFTEST_TARGETS = @selftest_languages@
2266 selftest: $(SELFTEST_TARGETS)
2267
2268 # Recompile all the language-independent object files.
2269 # This is used only if the user explicitly asks for it.
2270 compilations: $(BACKEND)
2271
2272 # This archive is strictly for the host.
2273 libbackend.a: $(OBJS)
2274 -rm -rf libbackend.a
2275 @# Build libbackend.a as a thin archive if possible, as doing so
2276 @# significantly reduces build times.
2277 ifeq ($(USE_THIN_ARCHIVES),yes)
2278 $(AR) $(AR_FLAGS)T libbackend.a $(OBJS)
2279 else
2280 $(AR) $(AR_FLAGS) libbackend.a $(OBJS)
2281 -$(RANLIB) $(RANLIB_FLAGS) libbackend.a
2282 endif
2283
2284 libcommon-target.a: $(OBJS-libcommon-target)
2285 -rm -rf libcommon-target.a
2286 $(AR) $(AR_FLAGS) libcommon-target.a $(OBJS-libcommon-target)
2287 -$(RANLIB) $(RANLIB_FLAGS) libcommon-target.a
2288
2289 libcommon.a: $(OBJS-libcommon)
2290 -rm -rf libcommon.a
2291 $(AR) $(AR_FLAGS) libcommon.a $(OBJS-libcommon)
2292 -$(RANLIB) $(RANLIB_FLAGS) libcommon.a
2293
2294 # We call this executable `xgcc' rather than `gcc'
2295 # to avoid confusion if the current directory is in the path
2296 # and CC is `gcc'. It is renamed to `gcc' when it is installed.
2297 xgcc$(exeext): $(GCC_OBJS) c/gccspec.o libcommon-target.a $(LIBDEPS) \
2298 $(EXTRA_GCC_OBJS)
2299 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) \
2300 c/gccspec.o $(EXTRA_GCC_OBJS) libcommon-target.a \
2301 $(EXTRA_GCC_LIBS) $(LIBS)
2302
2303 # cpp is to cpp0 as e.g. g++ is to cc1plus: Just another driver.
2304 # It is part of c-family because the handled extensions are hard-coded
2305 # and only contain c-family extensions (see known_suffixes).
2306 cpp$(exeext): $(GCC_OBJS) c-family/cppspec.o libcommon-target.a $(LIBDEPS) \
2307 $(EXTRA_GCC_OBJS)
2308 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) \
2309 c-family/cppspec.o $(EXTRA_GCC_OBJS) libcommon-target.a \
2310 $(EXTRA_GCC_LIBS) $(LIBS)
2311
2312
2313 libgdiagnostics_OBJS = libgdiagnostics.o \
2314 libcommon.a
2315
2316 # libgdiagnostics
2317
2318 LIBGDIAGNOSTICS_VERSION_NUM = 0
2319 LIBGDIAGNOSTICS_MINOR_NUM = 0
2320 LIBGDIAGNOSTICS_RELEASE_NUM = 1
2321
2322 ifneq (,$(findstring mingw,$(target)))
2323 LIBGDIAGNOSTICS_FILENAME = libgdiagnostics-$(LIBGDIAGNOSTICS_VERSION_NUM).dll
2324 LIBGDIAGNOSTICS_IMPORT_LIB = libgdiagnostics.dll.a
2325
2326 libgdiagnostics: $(LIBGDIAGNOSTICS_FILENAME)
2327
2328 else
2329
2330 ifneq (,$(findstring darwin,$(host)))
2331
2332 LIBGDIAGNOSTICS_AGE = 1
2333 LIBGDIAGNOSTICS_BASENAME = libgdiagnostics
2334
2335 LIBGDIAGNOSTICS_SONAME = \
2336 ${libdir}/$(LIBGDIAGNOSTICS_BASENAME).$(LIBGDIAGNOSTICS_VERSION_NUM).dylib
2337 LIBGDIAGNOSTICS_FILENAME = $(LIBGDIAGNOSTICS_BASENAME).$(LIBGDIAGNOSTICS_VERSION_NUM).dylib
2338 LIBGDIAGNOSTICS_LINKER_NAME = $(LIBGDIAGNOSTICS_BASENAME).dylib
2339
2340 # Conditionalize the use of the LD_VERSION_SCRIPT_OPTION and
2341 # LD_SONAME_OPTION depending if configure found them, using $(if)
2342 # We have to define a LIBGDIAGNOSTICS_COMMA here, otherwise the commas in the "true"
2343 # result are treated as separators by the $(if).
2344 LIBGDIAGNOSTICS_COMMA := ,
2345 LIBGDIAGNOSTICS_VERSION_SCRIPT_OPTION = \
2346 $(if $(LD_VERSION_SCRIPT_OPTION),\
2347 -Wl$(LIBGDIAGNOSTICS_COMMA)$(LD_VERSION_SCRIPT_OPTION)$(LIBGDIAGNOSTICS_COMMA)$(srcdir)/libgdiagnostics.map)
2348
2349 LIBGDIAGNOSTICS_SONAME_OPTION = \
2350 $(if $(LD_SONAME_OPTION), \
2351 -Wl$(LIBGDIAGNOSTICS_COMMA)$(LD_SONAME_OPTION)$(LIBGDIAGNOSTICS_COMMA)$(LIBGDIAGNOSTICS_SONAME))
2352
2353 LIBGDIAGNOSTICS_SONAME_SYMLINK = $(LIBGDIAGNOSTICS_FILENAME)
2354 LIBGDIAGNOSTICS_LINKER_NAME_SYMLINK = $(LIBGDIAGNOSTICS_LINKER_NAME)
2355
2356 libgdiagnostics: $(LIBGDIAGNOSTICS_FILENAME) \
2357 $(LIBGDIAGNOSTICS_SYMLINK) \
2358 $(LIBGDIAGNOSTICS_LINKER_NAME_SYMLINK)
2359
2360 else
2361
2362 LIBGDIAGNOSTICS_LINKER_NAME = libgdiagnostics.so
2363 LIBGDIAGNOSTICS_SONAME = $(LIBGDIAGNOSTICS_LINKER_NAME).$(LIBGDIAGNOSTICS_VERSION_NUM)
2364 LIBGDIAGNOSTICS_FILENAME = \
2365 $(LIBGDIAGNOSTICS_SONAME).$(LIBGDIAGNOSTICS_MINOR_NUM).$(LIBGDIAGNOSTICS_RELEASE_NUM)
2366
2367 LIBGDIAGNOSTICS_LINKER_NAME_SYMLINK = $(LIBGDIAGNOSTICS_LINKER_NAME)
2368 LIBGDIAGNOSTICS_SONAME_SYMLINK = $(LIBGDIAGNOSTICS_SONAME)
2369
2370 # Conditionalize the use of the LD_VERSION_SCRIPT_OPTION and
2371 # LD_SONAME_OPTION depending if configure found them, using $(if)
2372 # We have to define a LIBGDIAGNOSTICS_COMMA here, otherwise the commas in the "true"
2373 # result are treated as separators by the $(if).
2374 LIBGDIAGNOSTICS_COMMA := ,
2375 LIBGDIAGNOSTICS_VERSION_SCRIPT_OPTION = \
2376 $(if $(LD_VERSION_SCRIPT_OPTION),\
2377 -Wl$(LIBGDIAGNOSTICS_COMMA)$(LD_VERSION_SCRIPT_OPTION)$(LIBGDIAGNOSTICS_COMMA)$(srcdir)/libgdiagnostics.map)
2378
2379 LIBGDIAGNOSTICS_SONAME_OPTION = \
2380 $(if $(LD_SONAME_OPTION), \
2381 -Wl$(LIBGDIAGNOSTICS_COMMA)$(LD_SONAME_OPTION)$(LIBGDIAGNOSTICS_COMMA)$(LIBGDIAGNOSTICS_SONAME))
2382
2383 libgdiagnostics: $(LIBGDIAGNOSTICS_FILENAME) \
2384 $(LIBGDIAGNOSTICS_SYMLINK) \
2385 $(LIBGDIAGNOSTICS_LINKER_NAME_SYMLINK)
2386
2387 endif
2388 endif
2389
2390 libgdiagnostics.serial = $(LIBGDIAGNOSTICS_FILENAME)
2391
2392 # Tell GNU make to ignore these if they exist.
2393 .PHONY: libgdiagnostics
2394
2395 ifneq (,$(findstring mingw,$(target)))
2396 # Create import library
2397 LIBGDIAGNOSTICS_EXTRA_OPTS = -Wl,--out-implib,$(LIBGDIAGNOSTICS_IMPORT_LIB)
2398 else
2399
2400 ifneq (,$(findstring darwin,$(host)))
2401 # TODO : Construct a Darwin-style symbol export file.
2402 LIBGDIAGNOSTICS_EXTRA_OPTS = -Wl,-compatibility_version,$(LIBGDIAGNOSTICS_VERSION_NUM) \
2403 -Wl,-current_version,$(LIBGDIAGNOSTICS_VERSION_NUM).$(LIBGDIAGNOSTICS_MINOR_NUM).$(LIBGDIAGNOSTICS_AGE) \
2404 $(LIBGDIAGNOSTICS_VERSION_SCRIPT_OPTION) \
2405 $(LIBGDIAGNOSTICS_SONAME_OPTION)
2406 else
2407
2408 LIBGDIAGNOSTICS_EXTRA_OPTS = $(LIBGDIAGNOSTICS_VERSION_SCRIPT_OPTION) \
2409 $(LIBGDIAGNOSTICS_SONAME_OPTION)
2410 endif
2411 endif
2412
2413 $(LIBGDIAGNOSTICS_FILENAME): $(libgdiagnostics_OBJS) $(CPPLIB) $(EXTRA_GCC_LIBS) $(LIBS) \
2414 $(LIBDEPS) $(srcdir)/libgdiagnostics.map
2415 @$(call LINK_PROGRESS,$(INDEX.libgdiagnostics),start)
2416 +$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ -shared \
2417 $(libgdiagnostics_OBJS) \
2418 $(CPPLIB) $(EXTRA_GCC_LIBS) $(LIBS) \
2419 $(LIBGDIAGNOSTICS_EXTRA_OPTS)
2420 @$(call LINK_PROGRESS,$(INDEX.libgdiagnostics),end)
2421
2422 # Create symlinks when not building for Windows
2423 ifeq (,$(findstring mingw,$(target)))
2424
2425 ifeq (,$(findstring darwin,$(host)))
2426 # but only one level for Darwin, version info is embedded.
2427 $(LIBGDIAGNOSTICS_SONAME_SYMLINK): $(LIBGDIAGNOSTICS_FILENAME)
2428 ln -sf $(LIBGDIAGNOSTICS_FILENAME) $(LIBGDIAGNOSTICS_SONAME_SYMLINK)
2429 endif
2430
2431 $(LIBGDIAGNOSTICS_LINKER_NAME_SYMLINK): $(LIBGDIAGNOSTICS_SONAME_SYMLINK)
2432 ln -sf $(LIBGDIAGNOSTICS_SONAME_SYMLINK) $(LIBGDIAGNOSTICS_LINKER_NAME_SYMLINK)
2433 endif
2434
2435 # sarif-replay: a command-line tool that uses libgdiagnostics to
2436 # replay SARIF files
2437 sarif-replay: $(SARIF_REPLAY_OBJS) $(LIBGDIAGNOSTICS_FILENAME)
2438 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
2439 $(SARIF_REPLAY_OBJS) $(LIBGDIAGNOSTICS_FILENAME) $(LIBS)
2440
2441 # Dump a specs file to make -B./ read these specs over installed ones.
2442 $(SPECS): xgcc$(exeext)
2443 $(GCC_FOR_TARGET) -dumpspecs > tmp-specs
2444 mv tmp-specs $(SPECS)
2445
2446 # We do want to create an executable named `xgcc', so we can use it to
2447 # compile libgcc2.a.
2448 # Also create gcc-cross, so that install-common will install properly.
2449 gcc-cross$(exeext): xgcc$(exeext)
2450 cp xgcc$(exeext) gcc-cross$(exeext)
2451
2452 checksum-options:
2453 echo "$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS)" > checksum-options.tmp \
2454 && $(srcdir)/../move-if-change checksum-options.tmp checksum-options
2455
2456 #
2457 # Build libgcc.a.
2458
2459 libgcc-support: libgcc.mvars stmp-int-hdrs $(TCONFIG_H) \
2460 $(MACHMODE_H) version.h
2461
2462 libgcc.mvars: config.status Makefile specs xgcc$(exeext)
2463 : > tmp-libgcc.mvars
2464 echo GCC_CFLAGS = '$(GCC_CFLAGS)' >> tmp-libgcc.mvars
2465 echo INHIBIT_LIBC_CFLAGS = '$(INHIBIT_LIBC_CFLAGS)' >> tmp-libgcc.mvars
2466 echo TARGET_SYSTEM_ROOT = '$(TARGET_SYSTEM_ROOT)' >> tmp-libgcc.mvars
2467 if test @enable_default_pie@ = yes; then \
2468 NO_PIE_CFLAGS="-fno-PIE"; \
2469 else \
2470 NO_PIE_CFLAGS=; \
2471 fi; \
2472 echo NO_PIE_CFLAGS = "$$NO_PIE_CFLAGS" >> tmp-libgcc.mvars
2473
2474 mv tmp-libgcc.mvars libgcc.mvars
2475
2476 ifneq (@enable_multilib_space@,no)
2477
2478 # When multilib has been disabled, override all settings
2479 ifneq (@enable_multilib@,yes)
2480 MULTILIB_OPTIONS =
2481 MULTILIB_DIRNAMES =
2482 MULTILIB_MATCHES =
2483 MULTILIB_OSDIRNAMES =
2484 MULTILIB_REQUIRED =
2485 MULTILIB_EXCEPTIONS =
2486 MULTILIB_REUSE =
2487 endif
2488
2489 MULTILIB_OPTIONS += Os
2490 MULTILIB_DIRNAMES += space
2491 MULTILIB_MATCHES += Os=Oz
2492
2493 MULTILIB_OSDIRNAMES_SPACE = $(MULTILIB_OSDIRNAMES)\
2494 $(if $(findstring =,$(MULTILIB_OSDIRNAMES)),\
2495 $(foreach OSD,$(MULTILIB_OSDIRNAMES),$(subst =,/Os=,$(OSD))/space),\
2496 $(if $(MULTILIB_OSDIRNAMES),space,))
2497 MULTILIB_REQUIRED_SPACE = $(if $(MULTILIB_REQUIRED),Os $(foreach REQ, $(MULTILIB_REQUIRED), $(REQ) $(REQ)/Os),)
2498 MULTILIB_EXCEPTIONS_SPACE = $(foreach EXC, $(MULTILIB_EXCEPTIONS), $(EXC) $(EXC)/Os)
2499 MULTILIB_REUSE_SPACE = $(foreach REU, $(MULTILIB_REUSE), $(REU) $(subst =,/Os=,$(REU))/Os)
2500 MULTILIB_ENABLE = yes
2501 else
2502 MULTILIB_OSDIRNAMES_SPACE = $(MULTILIB_OSDIRNAMES)
2503 MULTILIB_REQUIRED_SPACE = $(MULTILIB_REQUIRED)
2504 MULTILIB_EXCEPTIONS_SPACE = $(MULTILIB_EXCEPTIONS)
2505 MULTILIB_REUSE_SPACE = $(MULTILIB_REUSE)
2506 MULTILIB_ENABLE = @enable_multilib@
2507 endif
2508
2509 # Use the genmultilib shell script to generate the information the gcc
2510 # driver program needs to select the library directory based on the
2511 # switches.
2512 multilib.h: s-mlib; @true
2513 s-mlib: $(srcdir)/genmultilib Makefile
2514 if test @enable_multilib@ = yes \
2515 || test @enable_multilib_space@ != no \
2516 || test -n "$(MULTILIB_OSDIRNAMES)"; then \
2517 $(SHELL) $(srcdir)/genmultilib \
2518 "$(MULTILIB_OPTIONS)" \
2519 "$(MULTILIB_DIRNAMES)" \
2520 "$(MULTILIB_MATCHES)" \
2521 "$(MULTILIB_EXCEPTIONS_SPACE)" \
2522 "$(MULTILIB_EXTRA_OPTS)" \
2523 "$(MULTILIB_EXCLUSIONS)" \
2524 "$(MULTILIB_OSDIRNAMES_SPACE)" \
2525 "$(MULTILIB_REQUIRED_SPACE)" \
2526 "$(if $(MULTILIB_OSDIRNAMES),,$(MULTIARCH_DIRNAME))" \
2527 "$(MULTILIB_REUSE_SPACE)" \
2528 "$(MULTILIB_ENABLE)" \
2529 > tmp-mlib.h; \
2530 else \
2531 $(SHELL) $(srcdir)/genmultilib '' '' '' '' '' '' '' '' \
2532 "$(MULTIARCH_DIRNAME)" '' no \
2533 > tmp-mlib.h; \
2534 fi
2535 $(SHELL) $(srcdir)/../move-if-change tmp-mlib.h multilib.h
2536 $(STAMP) s-mlib
2537 #
2538 # Compiling object files from source files.
2539
2540 # Note that dependencies on obstack.h are not written
2541 # because that file is not part of GCC.
2542
2543 srcextra: gcc.srcextra lang.srcextra
2544
2545 gcc.srcextra: gengtype-lex.cc
2546 -sed -e '/^#line/s,".*/gcc/gengtype-lex\.l","gengtype-lex.l",' $^ > $(srcdir)/$^
2547
2548 AR_OBJS = file-find.o
2549 AR_LIBS = @COLLECT2_LIBS@
2550
2551 gcc-ar$(exeext): gcc-ar.o $(AR_OBJS) $(LIBDEPS)
2552 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) gcc-ar.o -o $@ \
2553 $(AR_OBJS) $(LIBS) $(AR_LIBS)
2554
2555 gcc-nm$(exeext): gcc-nm.o $(AR_OBJS) $(LIBDEPS)
2556 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) gcc-nm.o -o $@ \
2557 $(AR_OBJS) $(LIBS) $(AR_LIBS)
2558
2559 gcc-ranlib$(exeext): gcc-ranlib.o $(AR_OBJS) $(LIBDEPS)
2560 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) gcc-ranlib.o -o $@ \
2561 $(AR_OBJS) $(LIBS) $(AR_LIBS)
2562
2563 CFLAGS-gcc-ar.o += $(DRIVER_DEFINES) \
2564 -DTARGET_MACHINE=\"$(target_noncanonical)\" \
2565 @TARGET_SYSTEM_ROOT_DEFINE@ -DPERSONALITY=\"ar\"
2566
2567 CFLAGS-gcc-ranlib.o += $(DRIVER_DEFINES) \
2568 -DTARGET_MACHINE=\"$(target_noncanonical)\" \
2569 @TARGET_SYSTEM_ROOT_DEFINE@ -DPERSONALITY=\"ranlib\"
2570
2571 CFLAGS-gcc-nm.o += $(DRIVER_DEFINES) \
2572 -DTARGET_MACHINE=\"$(target_noncanonical)\" \
2573 @TARGET_SYSTEM_ROOT_DEFINE@ -DPERSONALITY=\"nm\"
2574
2575 # ??? the implicit rules dont trigger if the source file has a different name
2576 # so copy instead
2577 gcc-ranlib.cc: gcc-ar.cc
2578 cp $^ $@
2579
2580 gcc-nm.cc: gcc-ar.cc
2581 cp $^ $@
2582
2583 COLLECT2_OBJS = collect2.o collect2-aix.o vec.o ggc-none.o \
2584 collect-utils.o file-find.o hash-table.o selftest.o
2585 COLLECT2_LIBS = @COLLECT2_LIBS@
2586 collect2$(exeext): $(COLLECT2_OBJS) $(LIBDEPS)
2587 # Don't try modifying collect2 (aka ld) in place--it might be linking this.
2588 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o T$@ \
2589 $(COLLECT2_OBJS) $(LIBS) $(COLLECT2_LIBS)
2590 mv -f T$@ $@
2591
2592 CFLAGS-collect2.o += -DTARGET_MACHINE=\"$(target_noncanonical)\" \
2593 @TARGET_SYSTEM_ROOT_DEFINE@
2594
2595 LTO_WRAPPER_OBJS = lto-wrapper.o collect-utils.o ggc-none.o lockfile.o \
2596 lto-ltrans-cache.o
2597
2598 lto-wrapper$(exeext): $(LTO_WRAPPER_OBJS) libcommon-target.a $(LIBDEPS)
2599 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o T$@ \
2600 $(LTO_WRAPPER_OBJS) libcommon-target.a $(LIBS)
2601 mv -f T$@ $@
2602
2603 # Files used by all variants of C or by the stand-alone pre-processor.
2604
2605 CFLAGS-c-family/c-opts.o += @TARGET_SYSTEM_ROOT_DEFINE@
2606
2607 CFLAGS-c-family/c-pch.o += -DHOST_MACHINE=\"$(host)\" \
2608 -DTARGET_MACHINE=\"$(target)\"
2609
2610 default-c.o: config/default-c.cc
2611 $(COMPILE) $<
2612 $(POSTCOMPILE)
2613
2614 # Files used by all variants of C and some other languages.
2615
2616 CFLAGS-prefix.o += -DPREFIX=\"$(prefix)\" -DBASEVER=$(BASEVER_s)
2617 prefix.o: $(BASEVER)
2618
2619 # Files used by the D language front end.
2620
2621 default-d.o: config/default-d.cc
2622 $(COMPILE) $<
2623 $(POSTCOMPILE)
2624
2625 # Files used by the Rust language front end.
2626
2627 default-rust.o: config/default-rust.cc
2628 $(COMPILE) $<
2629 $(POSTCOMPILE)
2630
2631 # Language-independent files.
2632
2633 DRIVER_DEFINES = \
2634 -DSTANDARD_STARTFILE_PREFIX=\"$(unlibsubdir)/\" \
2635 -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \
2636 -DSTANDARD_LIBEXEC_PREFIX=\"$(libexecdir)/gcc/\" \
2637 -DDEFAULT_TARGET_VERSION=\"$(version)\" \
2638 -DDEFAULT_REAL_TARGET_MACHINE=\"$(real_target_noncanonical)\" \
2639 -DDEFAULT_TARGET_MACHINE=\"$(target_noncanonical)\" \
2640 -DSTANDARD_BINDIR_PREFIX=\"$(bindir)/\" \
2641 -DTOOLDIR_BASE_PREFIX=\"$(libsubdir_to_prefix)$(prefix_to_exec_prefix)\" \
2642 -DACCEL_DIR_SUFFIX=\"$(accel_dir_suffix)\" \
2643 @TARGET_SYSTEM_ROOT_DEFINE@ \
2644 $(VALGRIND_DRIVER_DEFINES) \
2645 $(if $(SHLIB),$(if $(filter yes,@enable_shared@),-DENABLE_SHARED_LIBGCC)) \
2646 -DCONFIGURE_SPECS="\"@CONFIGURE_SPECS@\"" \
2647 -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
2648 -DNATIVE_SYSTEM_HEADER_DIR=\"$(NATIVE_SYSTEM_HEADER_DIR)\"
2649
2650 CFLAGS-gcc.o += $(DRIVER_DEFINES) -DBASEVER=$(BASEVER_s)
2651 gcc.o: $(BASEVER)
2652
2653 specs.h : s-specs ; @true
2654 s-specs : Makefile
2655 lsf="$(lang_specs_files)"; for f in $$lsf; do \
2656 echo "#include \"$$f\""; \
2657 done | sed 's|$(srcdir)/||' > tmp-specs.h
2658 $(SHELL) $(srcdir)/../move-if-change tmp-specs.h specs.h
2659 $(STAMP) s-specs
2660
2661 optionlist: s-options ; @true
2662 s-options: $(ALL_OPT_FILES) $(ALL_OPT_URL_FILES) Makefile $(srcdir)/opt-gather.awk
2663 LC_ALL=C ; export LC_ALL ; \
2664 $(AWK) -f $(srcdir)/opt-gather.awk $(ALL_OPT_FILES) $(ALL_OPT_URL_FILES) > tmp-optionlist
2665 $(SHELL) $(srcdir)/../move-if-change tmp-optionlist optionlist
2666 $(STAMP) s-options
2667
2668 options.cc: optionlist $(srcdir)/opt-functions.awk $(srcdir)/opt-read.awk \
2669 $(srcdir)/optc-gen.awk
2670 $(AWK) -f $(srcdir)/opt-functions.awk -f $(srcdir)/opt-read.awk \
2671 -f $(srcdir)/optc-gen.awk \
2672 -v header_name="config.h system.h coretypes.h options.h tm.h" < $< > $@
2673
2674 options-save.cc: optionlist $(srcdir)/opt-functions.awk $(srcdir)/opt-read.awk \
2675 $(srcdir)/optc-save-gen.awk
2676 $(AWK) -f $(srcdir)/opt-functions.awk -f $(srcdir)/opt-read.awk \
2677 -f $(srcdir)/optc-save-gen.awk \
2678 -v header_name="config.h system.h coretypes.h tm.h" < $< > $@
2679
2680 options-urls.cc: optionlist $(srcdir)/opt-functions.awk $(srcdir)/opt-read.awk \
2681 $(srcdir)/options-urls-cc-gen.awk
2682 $(AWK) -f $(srcdir)/opt-functions.awk -f $(srcdir)/opt-read.awk \
2683 -f $(srcdir)/options-urls-cc-gen.awk \
2684 -v header_name="config.h system.h coretypes.h tm.h" < $< > $@
2685
2686 options.h: s-options-h ; @true
2687 s-options-h: optionlist $(srcdir)/opt-functions.awk $(srcdir)/opt-read.awk \
2688 $(srcdir)/opth-gen.awk
2689 $(AWK) -f $(srcdir)/opt-functions.awk -f $(srcdir)/opt-read.awk \
2690 -f $(srcdir)/opth-gen.awk \
2691 < $< > tmp-options.h
2692 $(SHELL) $(srcdir)/../move-if-change tmp-options.h options.h
2693 $(STAMP) $@
2694
2695 dumpvers: dumpvers.cc
2696
2697 # lto-compress.o needs $(ZLIBINC) added to the include flags.
2698 CFLAGS-lto-compress.o += $(ZLIBINC) $(ZSTD_INC)
2699
2700 CFLAGS-lto-streamer-in.o += -DTARGET_MACHINE=\"$(target_noncanonical)\"
2701
2702 bversion.h: s-bversion; @true
2703 s-bversion: BASE-VER
2704 echo "#define BUILDING_GCC_MAJOR `echo $(BASEVER_c) | sed -e 's/^\([0-9]*\).*$$/\1/'`" > bversion.h
2705 echo "#define BUILDING_GCC_MINOR `echo $(BASEVER_c) | sed -e 's/^[0-9]*\.\([0-9]*\).*$$/\1/'`" >> bversion.h
2706 echo "#define BUILDING_GCC_PATCHLEVEL `echo $(BASEVER_c) | sed -e 's/^[0-9]*\.[0-9]*\.\([0-9]*\)$$/\1/'`" >> bversion.h
2707 echo "#define BUILDING_GCC_VERSION (BUILDING_GCC_MAJOR * 1000 + BUILDING_GCC_MINOR)" >> bversion.h
2708 $(STAMP) s-bversion
2709
2710 CFLAGS-toplev.o += -DTARGET_NAME=\"$(target_noncanonical)\"
2711 CFLAGS-tree-diagnostic-client-data-hooks.o += -DTARGET_NAME=\"$(target_noncanonical)\"
2712 CFLAGS-optinfo-emit-json.o += -DTARGET_NAME=\"$(target_noncanonical)\" $(ZLIBINC)
2713 CFLAGS-analyzer/engine.o += $(ZLIBINC)
2714
2715 pass-instances.def: $(srcdir)/passes.def $(PASSES_EXTRA) \
2716 $(srcdir)/gen-pass-instances.awk
2717 $(AWK) -f $(srcdir)/gen-pass-instances.awk \
2718 $(srcdir)/passes.def $(PASSES_EXTRA) > pass-instances.def
2719
2720 $(out_object_file): $(out_file)
2721 $(COMPILE) $<
2722 $(POSTCOMPILE)
2723
2724 $(common_out_object_file): $(common_out_file)
2725 $(COMPILE) $<
2726 $(POSTCOMPILE)
2727 #
2728 # Generate header and source files from the machine description,
2729 # and compile them.
2730
2731 .PRECIOUS: insn-config.h insn-flags.h insn-codes.h insn-constants.h \
2732 $(INSNEMIT_SEQ_SRC) insn-recog.h $(INSNRECOG_SEQ_SRC) \
2733 insn-extract.cc insn-output.cc \
2734 insn-peep.cc insn-attr.h insn-attr-common.h insn-attrtab.cc \
2735 insn-dfatab.cc insn-latencytab.cc insn-preds.cc \
2736 $(GIMPLE_MATCH_PD_SEQ_SRC) $(GENERIC_MATCH_PD_SEQ_SRC) \
2737 gimple-match-auto.h generic-match-auto.h insn-target-def.h
2738
2739 # Dependencies for the md file. The first time through, we just assume
2740 # the md file itself and the generated dependency file (in order to get
2741 # it built). The second time through we have the dependency file.
2742 -include mddeps.mk
2743 MD_DEPS = s-mddeps $(md_file) $(MD_INCLUDES)
2744
2745 s-mddeps: $(md_file) $(MD_INCLUDES) build/genmddeps$(build_exeext)
2746 $(RUN_GEN) build/genmddeps$(build_exeext) $(md_file) > tmp-mddeps
2747 $(SHELL) $(srcdir)/../move-if-change tmp-mddeps mddeps.mk
2748 $(STAMP) s-mddeps
2749
2750 # For each of the files generated by running a generator program over
2751 # the machine description, the following static pattern rules run the
2752 # generator program only if the machine description has changed,
2753 # but touch the target file only when its contents actually change.
2754 # The "; @true" construct forces Make to recheck the timestamp on
2755 # the target file.
2756
2757 simple_rtl_generated_h = insn-attr.h insn-attr-common.h insn-codes.h \
2758 insn-config.h insn-flags.h insn-target-def.h
2759
2760 simple_rtl_generated_c = insn-automata.cc \
2761 insn-extract.cc insn-output.cc \
2762 insn-peep.cc
2763
2764 simple_generated_h = $(simple_rtl_generated_h) insn-constants.h
2765
2766 simple_generated_c = $(simple_rtl_generated_c) insn-enums.cc
2767
2768 $(simple_generated_h:insn-%.h=s-%) \
2769 $(simple_generated_c:insn-%.cc=s-%): s-%: $(MD_DEPS)
2770
2771 $(simple_rtl_generated_h:insn-%.h=s-%) \
2772 $(simple_rtl_generated_c:insn-%.cc=s-%): s-%: insn-conditions.md
2773
2774 $(simple_generated_h): insn-%.h: s-%; @true
2775
2776 $(simple_generated_h:insn-%.h=s-%): s-%: build/gen%$(build_exeext)
2777 $(RUN_GEN) build/gen$*$(build_exeext) $(md_file) \
2778 $(filter insn-conditions.md,$^) > tmp-$*.h
2779 $(SHELL) $(srcdir)/../move-if-change tmp-$*.h insn-$*.h
2780 $(STAMP) s-$*
2781
2782 $(simple_generated_c): insn-%.cc: s-%; @true
2783 $(simple_generated_c:insn-%.cc=s-%): s-%: build/gen%$(build_exeext)
2784 $(RUN_GEN) build/gen$*$(build_exeext) $(md_file) \
2785 $(filter insn-conditions.md,$^) > tmp-$*.cc
2786 $(SHELL) $(srcdir)/../move-if-change tmp-$*.cc insn-$*.cc
2787 $(STAMP) s-$*
2788
2789 # genemit splits its output into different files and doesn't write to
2790 # stdout. (but rather to tmp-emit-01.cc..tmp-emit-10.cc)
2791 $(INSNEMIT_SEQ_SRC): s-tmp-emit; @true
2792 s-tmp-emit: build/genemit$(build_exeext) $(MD_DEPS) insn-conditions.md
2793 $(RUN_GEN) build/genemit$(build_exeext) $(md_file) insn-conditions.md \
2794 $(addprefix -O,${INSNEMIT_SEQ_TMP})
2795 $(foreach id, $(INSNEMIT_SPLITS_SEQ), \
2796 $(SHELL) $(srcdir)/../move-if-change tmp-emit-$(id).cc \
2797 insn-emit-$(id).cc;)
2798 $(STAMP) s-tmp-emit
2799
2800 # Same for genrecog.
2801 $(INSNRECOG_SEQ_SRC): s-tmp-recog; @true
2802 insn-recog.h: s-tmp-recog; @true
2803 s-tmp-recog: build/genrecog$(build_exeext) $(MD_DEPS) insn-conditions.md
2804 $(RUN_GEN) build/genrecog$(build_exeext) $(md_file) insn-conditions.md \
2805 -Hinsn-recog.h \
2806 $(addprefix -O,${INSNRECOG_SEQ_TMP})
2807 $(foreach id, $(INSNRECOG_SPLITS_SEQ), \
2808 $(SHELL) $(srcdir)/../move-if-change tmp-recog-$(id).cc \
2809 insn-recog-$(id).cc;)
2810 $(STAMP) s-tmp-recog
2811
2812 # gencheck doesn't read the machine description, and the file produced
2813 # doesn't use the insn-* convention.
2814
2815 tree-check.h: s-check ; @true
2816 s-check : build/gencheck$(build_exeext)
2817 $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h
2818 $(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h
2819 $(STAMP) s-check
2820
2821 # genattrtab produces three files: tmp-{attrtab.cc,dfatab.cc,latencytab.cc}
2822 insn-attrtab.cc insn-dfatab.cc insn-latencytab.cc: s-attrtab ; @true
2823 s-attrtab : $(MD_DEPS) build/genattrtab$(build_exeext) \
2824 insn-conditions.md
2825 $(RUN_GEN) build/genattrtab$(build_exeext) $(md_file) insn-conditions.md \
2826 -Atmp-attrtab.cc -Dtmp-dfatab.cc -Ltmp-latencytab.cc
2827 $(SHELL) $(srcdir)/../move-if-change tmp-attrtab.cc insn-attrtab.cc
2828 $(SHELL) $(srcdir)/../move-if-change tmp-dfatab.cc insn-dfatab.cc
2829 $(SHELL) $(srcdir)/../move-if-change tmp-latencytab.cc insn-latencytab.cc
2830 $(STAMP) s-attrtab
2831
2832 # genopinit produces two files.
2833 insn-opinit.cc insn-opinit.h: s-opinit ; @true
2834 s-opinit: $(MD_DEPS) build/genopinit$(build_exeext) insn-conditions.md
2835 $(RUN_GEN) build/genopinit$(build_exeext) $(md_file) \
2836 insn-conditions.md -htmp-opinit.h -ctmp-opinit.cc
2837 $(SHELL) $(srcdir)/../move-if-change tmp-opinit.h insn-opinit.h
2838 $(SHELL) $(srcdir)/../move-if-change tmp-opinit.cc insn-opinit.cc
2839 $(STAMP) s-opinit
2840
2841 # gencondmd doesn't use the standard naming convention.
2842 build/gencondmd.cc: s-conditions; @true
2843 s-conditions: $(MD_DEPS) build/genconditions$(build_exeext)
2844 $(RUN_GEN) build/genconditions$(build_exeext) $(md_file) > tmp-condmd.cc
2845 $(SHELL) $(srcdir)/../move-if-change tmp-condmd.cc build/gencondmd.cc
2846 $(STAMP) s-conditions
2847
2848 insn-conditions.md: s-condmd; @true
2849 s-condmd: build/gencondmd$(build_exeext)
2850 $(RUN_GEN) build/gencondmd$(build_exeext) > tmp-cond.md
2851 $(SHELL) $(srcdir)/../move-if-change tmp-cond.md insn-conditions.md
2852 $(STAMP) s-condmd
2853
2854
2855 # These files are generated by running the same generator more than
2856 # once with different options, so they have custom rules. The
2857 # stampfile idiom is the same.
2858 genrtl.h: s-genrtl-h; @true
2859
2860 s-genrtl-h: build/gengenrtl$(build_exeext)
2861 $(RUN_GEN) build/gengenrtl$(build_exeext) > tmp-genrtl.h
2862 $(SHELL) $(srcdir)/../move-if-change tmp-genrtl.h genrtl.h
2863 $(STAMP) s-genrtl-h
2864
2865 insn-modes.cc: s-modes; @true
2866 insn-modes.h: s-modes-h; @true
2867 insn-modes-inline.h: s-modes-inline-h; @true
2868 min-insn-modes.cc: s-modes-m; @true
2869
2870 s-modes: build/genmodes$(build_exeext)
2871 $(RUN_GEN) build/genmodes$(build_exeext) > tmp-modes.cc
2872 $(SHELL) $(srcdir)/../move-if-change tmp-modes.cc insn-modes.cc
2873 $(STAMP) s-modes
2874
2875 s-modes-h: build/genmodes$(build_exeext)
2876 $(RUN_GEN) build/genmodes$(build_exeext) -h > tmp-modes.h
2877 $(SHELL) $(srcdir)/../move-if-change tmp-modes.h insn-modes.h
2878 $(STAMP) s-modes-h
2879
2880 s-modes-inline-h: build/genmodes$(build_exeext)
2881 $(RUN_GEN) build/genmodes$(build_exeext) -i > tmp-modes-inline.h
2882 $(SHELL) $(srcdir)/../move-if-change tmp-modes-inline.h \
2883 insn-modes-inline.h
2884 $(STAMP) s-modes-inline-h
2885
2886 s-modes-m: build/genmodes$(build_exeext)
2887 $(RUN_GEN) build/genmodes$(build_exeext) -m > tmp-min-modes.cc
2888 $(SHELL) $(srcdir)/../move-if-change tmp-min-modes.cc min-insn-modes.cc
2889 $(STAMP) s-modes-m
2890
2891 insn-preds.cc: s-preds; @true
2892 tm-preds.h: s-preds-h; @true
2893 tm-constrs.h: s-constrs-h; @true
2894
2895 .PHONY: mddump
2896 mddump: $(BUILD_RTL) $(MD_DEPS) build/genmddump$(build_exeext)
2897 $(RUN_GEN) build/genmddump$(build_exeext) $(md_file) > tmp-mddump.md
2898
2899 s-preds: $(MD_DEPS) build/genpreds$(build_exeext)
2900 $(RUN_GEN) build/genpreds$(build_exeext) $(md_file) > tmp-preds.cc
2901 $(SHELL) $(srcdir)/../move-if-change tmp-preds.cc insn-preds.cc
2902 $(STAMP) s-preds
2903
2904 s-preds-h: $(MD_DEPS) build/genpreds$(build_exeext)
2905 $(RUN_GEN) build/genpreds$(build_exeext) -h $(md_file) > tmp-preds.h
2906 $(SHELL) $(srcdir)/../move-if-change tmp-preds.h tm-preds.h
2907 $(STAMP) s-preds-h
2908
2909 s-constrs-h: $(MD_DEPS) build/genpreds$(build_exeext)
2910 $(RUN_GEN) build/genpreds$(build_exeext) -c $(md_file) > tmp-constrs.h
2911 $(SHELL) $(srcdir)/../move-if-change tmp-constrs.h tm-constrs.h
2912 $(STAMP) s-constrs-h
2913
2914 s-case-cfn-macros: build/gencfn-macros$(build_exeext)
2915 $(RUN_GEN) build/gencfn-macros$(build_exeext) -c \
2916 > tmp-case-cfn-macros.h
2917 $(SHELL) $(srcdir)/../move-if-change tmp-case-cfn-macros.h \
2918 case-cfn-macros.h
2919 $(STAMP) s-case-cfn-macros
2920 case-cfn-macros.h: s-case-cfn-macros; @true
2921
2922 s-cfn-operators: build/gencfn-macros$(build_exeext)
2923 $(RUN_GEN) build/gencfn-macros$(build_exeext) -o \
2924 > tmp-cfn-operators.pd
2925 $(SHELL) $(srcdir)/../move-if-change tmp-cfn-operators.pd \
2926 cfn-operators.pd
2927 $(STAMP) s-cfn-operators
2928 cfn-operators.pd: s-cfn-operators; @true
2929
2930 target-hooks-def.h: s-target-hooks-def-h; @true
2931 # make sure that when we build info files, the used tm.texi is up to date.
2932 $(srcdir)/doc/tm.texi: s-tm-texi; @true
2933
2934 s-target-hooks-def-h: build/genhooks$(build_exeext)
2935 $(RUN_GEN) build/genhooks$(build_exeext) "Target Hook" \
2936 > tmp-target-hooks-def.h
2937 $(SHELL) $(srcdir)/../move-if-change tmp-target-hooks-def.h \
2938 target-hooks-def.h
2939 $(STAMP) s-target-hooks-def-h
2940
2941 c-family/c-target-hooks-def.h: s-c-target-hooks-def-h; @true
2942
2943 s-c-target-hooks-def-h: build/genhooks$(build_exeext)
2944 $(RUN_GEN) build/genhooks$(build_exeext) "C Target Hook" \
2945 > tmp-c-target-hooks-def.h
2946 $(SHELL) $(srcdir)/../move-if-change tmp-c-target-hooks-def.h \
2947 c-family/c-target-hooks-def.h
2948 $(STAMP) s-c-target-hooks-def-h
2949
2950 common/common-target-hooks-def.h: s-common-target-hooks-def-h; @true
2951
2952 s-common-target-hooks-def-h: build/genhooks$(build_exeext)
2953 $(RUN_GEN) build/genhooks$(build_exeext) "Common Target Hook" \
2954 > tmp-common-target-hooks-def.h
2955 $(SHELL) $(srcdir)/../move-if-change tmp-common-target-hooks-def.h \
2956 common/common-target-hooks-def.h
2957 $(STAMP) s-common-target-hooks-def-h
2958
2959 d/d-target-hooks-def.h: s-d-target-hooks-def-h; @true
2960
2961 s-d-target-hooks-def-h: build/genhooks$(build_exeext)
2962 $(RUN_GEN) build/genhooks$(build_exeext) "D Target Hook" \
2963 > tmp-d-target-hooks-def.h
2964 $(SHELL) $(srcdir)/../move-if-change tmp-d-target-hooks-def.h \
2965 d/d-target-hooks-def.h
2966 $(STAMP) s-d-target-hooks-def-h
2967
2968 rust/rust-target-hooks-def.h: s-rust-target-hooks-def-h; @true
2969
2970 s-rust-target-hooks-def-h: build/genhooks$(build_exeext)
2971 $(RUN_GEN) build/genhooks$(build_exeext) "Rust Target Hook" \
2972 > tmp-rust-target-hooks-def.h
2973 $(SHELL) $(srcdir)/../move-if-change tmp-rust-target-hooks-def.h \
2974 rust/rust-target-hooks-def.h
2975 $(STAMP) s-rust-target-hooks-def-h
2976
2977 # check if someone mistakenly only changed tm.texi.
2978 # We use a different pathname here to avoid a circular dependency.
2979 s-tm-texi: $(srcdir)/doc/../doc/tm.texi
2980
2981 # The tm.texi we want to compare against / check into svn should have
2982 # unix-style line endings. To make this work on MinGW, remove \r.
2983 # \r is not portable to Solaris tr, therefore we have a special
2984 # case for ASCII. We use \r for other encodings like EBCDIC.
2985 s-tm-texi: build/genhooks$(build_exeext) $(srcdir)/doc/tm.texi.in
2986 cat $(srcdir)/doc/tm.texi.in > tmp-tm.texi
2987 $(STAMP) $@
2988
2989 $(GIMPLE_MATCH_PD_SEQ_SRC): s-gimple-match gimple-match-head.cc; @true
2990 gimple-match-auto.h: s-gimple-match; @true
2991 $(GENERIC_MATCH_PD_SEQ_SRC): s-generic-match generic-match-head.cc; @true
2992 generic-match-auto.h: s-generic-match; @true
2993
2994 s-gimple-match: build/genmatch$(build_exeext) \
2995 $(srcdir)/match.pd cfn-operators.pd
2996 $(RUN_GEN) build/genmatch$(build_exeext) --gimple \
2997 --header=tmp-gimple-match-auto.h --include=gimple-match-auto.h \
2998 $(srcdir)/match.pd $(patsubst %, tmp-%, $(GIMPLE_MATCH_PD_SEQ_SRC))
2999 $(foreach id, $(MATCH_SPLITS_SEQ), \
3000 $(SHELL) $(srcdir)/../move-if-change tmp-gimple-match-$(id).cc \
3001 gimple-match-$(id).cc;)
3002 $(SHELL) $(srcdir)/../move-if-change tmp-gimple-match-auto.h \
3003 gimple-match-auto.h
3004 $(STAMP) s-gimple-match
3005
3006 s-generic-match: build/genmatch$(build_exeext) \
3007 $(srcdir)/match.pd cfn-operators.pd
3008 $(RUN_GEN) build/genmatch$(build_exeext) --generic \
3009 --header=tmp-generic-match-auto.h --include=generic-match-auto.h \
3010 $(srcdir)/match.pd $(patsubst %, tmp-%, $(GENERIC_MATCH_PD_SEQ_SRC))
3011 $(foreach id, $(MATCH_SPLITS_SEQ), \
3012 $(SHELL) $(srcdir)/../move-if-change tmp-generic-match-$(id).cc \
3013 generic-match-$(id).cc;)
3014 $(SHELL) $(srcdir)/../move-if-change tmp-generic-match-auto.h \
3015 generic-match-auto.h
3016 $(STAMP) s-generic-match
3017
3018 GTFILES = $(CPPLIB_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
3019 $(host_xm_file_list) \
3020 $(OPTIONS_H_EXTRA) \
3021 $(tm_file_list) $(HASHTAB_H) $(SPLAY_TREE_H) $(srcdir)/bitmap.h \
3022 $(srcdir)/wide-int.h $(srcdir)/alias.h \
3023 $(srcdir)/coverage.cc $(srcdir)/rtl.h \
3024 $(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/tree-core.h \
3025 $(srcdir)/libfuncs.h $(SYMTAB_H) \
3026 $(srcdir)/real.h $(srcdir)/function.h $(srcdir)/insn-addr.h $(srcdir)/hwint.h \
3027 $(srcdir)/fixed-value.h \
3028 $(srcdir)/function-abi.h \
3029 $(srcdir)/output.h $(srcdir)/cfgloop.h $(srcdir)/cfg.h $(srcdir)/profile-count.h \
3030 $(srcdir)/cselib.h $(srcdir)/basic-block.h $(srcdir)/ipa-ref.h $(srcdir)/cgraph.h \
3031 $(srcdir)/symtab-thunks.h $(srcdir)/symtab-thunks.cc \
3032 $(srcdir)/symtab-clones.h \
3033 $(srcdir)/reload.h $(srcdir)/caller-save.cc $(srcdir)/symtab.cc \
3034 $(srcdir)/alias.cc $(srcdir)/attribs.cc \
3035 $(srcdir)/bitmap.cc $(srcdir)/cselib.cc $(srcdir)/cgraph.cc \
3036 $(srcdir)/ipa-prop.cc $(srcdir)/ipa-cp.cc $(srcdir)/ipa-utils.h \
3037 $(srcdir)/ipa-param-manipulation.h $(srcdir)/ipa-sra.cc \
3038 $(srcdir)/ipa-modref.h $(srcdir)/ipa-modref.cc \
3039 $(srcdir)/ipa-modref-tree.h \
3040 $(srcdir)/ipa-locality-cloning.cc \
3041 $(srcdir)/signop.h \
3042 $(srcdir)/diagnostic-spec.h $(srcdir)/diagnostic-spec.cc \
3043 $(srcdir)/dwarf2out.h \
3044 $(srcdir)/dwarf2asm.cc \
3045 $(srcdir)/dwarf2cfi.cc \
3046 $(srcdir)/dwarf2codeview.cc \
3047 $(srcdir)/dwarf2ctf.cc \
3048 $(srcdir)/dwarf2out.cc \
3049 $(srcdir)/ctfc.h \
3050 $(srcdir)/ctfout.cc \
3051 $(srcdir)/btfout.cc \
3052 $(srcdir)/tree-vect-generic.cc \
3053 $(srcdir)/gimple-isel.cc \
3054 $(srcdir)/dojump.cc $(srcdir)/emit-rtl.h \
3055 $(srcdir)/emit-rtl.cc $(srcdir)/except.h $(srcdir)/explow.cc $(srcdir)/expr.cc \
3056 $(srcdir)/expr.h \
3057 $(srcdir)/function.cc $(srcdir)/except.cc \
3058 $(srcdir)/ggc-tests.cc \
3059 $(srcdir)/gcse.cc $(srcdir)/godump.cc \
3060 $(srcdir)/lists.cc $(srcdir)/optabs-libfuncs.cc \
3061 $(srcdir)/profile.cc $(srcdir)/mcf.cc \
3062 $(srcdir)/reg-stack.cc $(srcdir)/cfgrtl.cc \
3063 $(srcdir)/stor-layout.cc \
3064 $(srcdir)/stringpool.cc $(srcdir)/tree.cc $(srcdir)/varasm.cc \
3065 $(srcdir)/gimple.h \
3066 $(srcdir)/gimple-ssa.h \
3067 $(srcdir)/tree-ssanames.cc $(srcdir)/tree-eh.cc $(srcdir)/tree-ssa-address.cc \
3068 $(srcdir)/tree-cfg.cc $(srcdir)/tree-ssa-loop-ivopts.cc \
3069 $(srcdir)/tree-dfa.cc \
3070 $(srcdir)/tree-iterator.cc $(srcdir)/gimple-expr.cc \
3071 $(srcdir)/tree-chrec.h \
3072 $(srcdir)/tree-scalar-evolution.cc \
3073 $(srcdir)/tree-ssa-operands.h \
3074 $(srcdir)/tree-profile.cc $(srcdir)/tree-nested.cc \
3075 $(srcdir)/path-coverage.cc \
3076 $(srcdir)/prime-paths.cc \
3077 $(srcdir)/omp-offload.h \
3078 $(srcdir)/omp-general.h \
3079 $(srcdir)/omp-general.cc \
3080 $(srcdir)/omp-low.cc \
3081 $(srcdir)/targhooks.cc $(out_file) $(srcdir)/passes.cc \
3082 $(srcdir)/cgraphclones.cc \
3083 $(srcdir)/tree-phinodes.cc \
3084 $(srcdir)/tree-ssa-alias.h \
3085 $(srcdir)/tree-ssanames.h \
3086 $(srcdir)/tree-vrp.h \
3087 $(srcdir)/value-range.h \
3088 $(srcdir)/value-range-storage.h \
3089 $(srcdir)/ipa-prop.h \
3090 $(srcdir)/trans-mem.cc \
3091 $(srcdir)/lto-streamer.h \
3092 $(srcdir)/target-globals.h \
3093 $(srcdir)/ipa-predicate.h \
3094 $(srcdir)/ipa-fnsummary.h \
3095 $(srcdir)/vtable-verify.cc \
3096 $(srcdir)/asan.cc \
3097 $(srcdir)/ubsan.cc \
3098 $(srcdir)/tsan.cc \
3099 $(srcdir)/sanopt.cc \
3100 $(srcdir)/sancov.cc \
3101 $(srcdir)/ipa-devirt.cc \
3102 $(srcdir)/ipa-strub.cc \
3103 $(srcdir)/internal-fn.h \
3104 $(srcdir)/calls.cc \
3105 $(srcdir)/analyzer/analyzer-language.cc \
3106 @all_gtfiles@
3107
3108 # Compute the list of GT header files from the corresponding C sources,
3109 # possibly nested within config or language subdirectories. Match gengtype's
3110 # behavior in this respect: gt-LANG-file.h for "file" anywhere within a LANG
3111 # language subdir, gt-file.h otherwise (no subdir indication for config/
3112 # related sources).
3113
3114 GTFILES_H = $(subst /,-, \
3115 $(shell echo $(patsubst $(srcdir)/%,gt-%, \
3116 $(patsubst %.cc,%.h, \
3117 $(filter %.cc, $(GTFILES)))) \
3118 | sed -e "s|/[^ ]*/|/|g" -e "s|gt-config/|gt-|g"))
3119
3120 GTFILES_LANG_H = $(patsubst [%], gtype-%.h, $(filter [%], $(GTFILES)))
3121 ALL_GTFILES_H := $(sort $(GTFILES_H) $(GTFILES_LANG_H))
3122
3123 # $(GTFILES) may be too long to put on a command line, so we have to
3124 # write it out to a file (taking care not to do that in a way that
3125 # overflows a command line!) and then have gengtype read the file in.
3126
3127 $(ALL_GTFILES_H) gtype-desc.cc gtype-desc.h gtype.state: s-gtype ; @true
3128
3129 ### Common flags to gengtype [e.g. -v or -B backupdir]
3130 GENGTYPE_FLAGS=
3131
3132 gtyp-input.list: s-gtyp-input ; @true
3133 s-gtyp-input: Makefile
3134 @: $(call write_entries_to_file,$(GTFILES),tmp-gi.list)
3135 $(SHELL) $(srcdir)/../move-if-change tmp-gi.list gtyp-input.list
3136 $(STAMP) s-gtyp-input
3137
3138 s-gtype: $(EXTRA_GTYPE_DEPS) build/gengtype$(build_exeext) \
3139 $(filter-out [%], $(GTFILES)) gtyp-input.list
3140 # First, parse all files and save a state file.
3141 $(RUN_GEN) build/gengtype$(build_exeext) $(GENGTYPE_FLAGS) \
3142 -S $(srcdir) -I gtyp-input.list -w tmp-gtype.state
3143 # Second, read the state file and generate all files. This ensure that
3144 # gtype.state is correctly read:
3145 $(SHELL) $(srcdir)/../move-if-change tmp-gtype.state gtype.state
3146 $(RUN_GEN) build/gengtype$(build_exeext) $(GENGTYPE_FLAGS) \
3147 -r gtype.state
3148 $(STAMP) s-gtype
3149
3150 generated_files = config.h tm.h $(TM_P_H) $(TM_D_H) $(TM_H) multilib.h \
3151 $(simple_generated_h) specs.h \
3152 tree-check.h genrtl.h insn-modes.h insn-modes-inline.h \
3153 tm-preds.h tm-constrs.h \
3154 $(ALL_GTFILES_H) gtype-desc.cc gtype-desc.h version.h \
3155 options.h target-hooks-def.h insn-opinit.h \
3156 common/common-target-hooks-def.h pass-instances.def \
3157 $(GIMPLE_MATCH_PD_SEQ_SRC) $(GENERIC_MATCH_PD_SEQ_SRC) \
3158 gimple-match-auto.h generic-match-auto.h \
3159 c-family/c-target-hooks-def.h d/d-target-hooks-def.h \
3160 $(TM_RUST_H) rust/rust-target-hooks-def.h \
3161 case-cfn-macros.h \
3162 cfn-operators.pd omp-device-properties.h
3163
3164 #
3165 # How to compile object files to run on the build machine.
3166
3167 build/%.o : # dependencies provided by explicit rule later
3168 $(COMPILER_FOR_BUILD) -c $(BUILD_COMPILERFLAGS) $(BUILD_CPPFLAGS) \
3169 -o $@ $<
3170
3171 # Header dependencies for the programs that generate source code.
3172 # These are library modules...
3173 build/errors.o : errors.cc $(BCONFIG_H) $(SYSTEM_H) errors.h
3174 build/gensupport.o: gensupport.cc $(BCONFIG_H) $(SYSTEM_H) \
3175 $(CORETYPES_H) $(GTM_H) $(RTL_BASE_H) $(OBSTACK_H) errors.h \
3176 $(HASHTAB_H) $(READ_MD_H) $(GENSUPPORT_H) $(HASH_TABLE_H)
3177 build/ggc-none.o : ggc-none.cc $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) \
3178 $(GGC_H)
3179 build/min-insn-modes.o : min-insn-modes.cc $(BCONFIG_H) $(SYSTEM_H) \
3180 $(CORETYPES_H)
3181 build/print-rtl.o: print-rtl.cc $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) \
3182 $(GTM_H) $(RTL_BASE_H)
3183 build/read-md.o: read-md.cc $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) \
3184 $(HASHTAB_H) errors.h $(READ_MD_H)
3185 build/read-rtl.o: read-rtl.cc $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) \
3186 $(GTM_H) $(RTL_BASE_H) $(OBSTACK_H) $(HASHTAB_H) $(READ_MD_H) \
3187 $(GENSUPPORT_H)
3188 build/rtl.o: rtl.cc $(BCONFIG_H) $(CORETYPES_H) $(GTM_H) $(SYSTEM_H) \
3189 $(RTL_H) $(GGC_H) errors.h
3190 build/vec.o : vec.cc $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) $(VEC_H) \
3191 $(GGC_H) toplev.h $(DIAGNOSTIC_CORE_H) $(HASH_TABLE_H)
3192 build/hash-table.o : hash-table.cc $(BCONFIG_H) $(SYSTEM_H) \
3193 $(CORETYPES_H) $(HASH_TABLE_H) $(GGC_H) toplev.h $(DIAGNOSTIC_CORE_H)
3194 build/sort.o : sort.cc $(BCONFIG_H) $(SYSTEM_H)
3195 build/inchash.o : inchash.cc $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) \
3196 $(HASHTAB_H) inchash.h
3197 build/gencondmd.o : build/gencondmd.cc $(BCONFIG_H) $(SYSTEM_H) \
3198 $(CORETYPES_H) $(GTM_H) insn-constants.h \
3199 $(filter-out insn-flags.h, $(RTL_H) $(TM_P_H) $(FUNCTION_H) $(REGS_H) \
3200 $(RECOG_H) output.h $(FLAGS_H) $(RESOURCE_H) toplev.h $(DIAGNOSTIC_CORE_H) reload.h \
3201 $(EXCEPT_H) tm-constrs.h)
3202 # This pulls in tm-pred.h which contains inline functions wrapping up
3203 # predicates from the back-end so those functions must be discarded.
3204 # No big deal since gencondmd.cc is a dummy file for non-GCC compilers.
3205 build/gencondmd.o : \
3206 BUILD_CFLAGS := $(filter-out -fkeep-inline-functions, $(BUILD_CFLAGS))
3207
3208 # ...these are the programs themselves.
3209 build/genattr.o : genattr.cc $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
3210 $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H)
3211 build/genattr-common.o : genattr-common.cc $(RTL_BASE_H) $(BCONFIG_H) \
3212 $(SYSTEM_H) $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H)
3213 build/genattrtab.o : genattrtab.cc $(RTL_BASE_H) $(OBSTACK_H) \
3214 $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) $(GTM_H) errors.h $(GGC_H) \
3215 $(READ_MD_H) $(GENSUPPORT_H) $(FNMATCH_H)
3216 build/genautomata.o : genautomata.cc $(RTL_BASE_H) $(OBSTACK_H) \
3217 $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) $(GTM_H) errors.h $(VEC_H) \
3218 $(HASHTAB_H) $(GENSUPPORT_H) $(FNMATCH_H)
3219 build/gencheck.o : gencheck.cc all-tree.def $(BCONFIG_H) $(GTM_H) \
3220 $(SYSTEM_H) $(CORETYPES_H) tree.def c-family/c-common.def \
3221 $(lang_tree_files) gimple.def
3222 build/genchecksum.o : genchecksum.cc $(BCONFIG_H) $(SYSTEM_H) $(MD5_H)
3223 build/gencodes.o : gencodes.cc $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
3224 $(CORETYPES_H) $(GTM_H) errors.h $(GENSUPPORT_H)
3225 build/genconditions.o : genconditions.cc $(RTL_BASE_H) $(BCONFIG_H) \
3226 $(SYSTEM_H) $(CORETYPES_H) $(GTM_H) errors.h $(HASHTAB_H) \
3227 $(READ_MD_H) $(GENSUPPORT_H)
3228 build/genconfig.o : genconfig.cc $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
3229 $(CORETYPES_H) $(GTM_H) errors.h $(GENSUPPORT_H)
3230 build/genconstants.o : genconstants.cc $(BCONFIG_H) $(SYSTEM_H) \
3231 $(CORETYPES_H) errors.h $(READ_MD_H)
3232 build/genemit.o : genemit.cc $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
3233 $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) internal-fn.def
3234 build/genenums.o : genenums.cc $(BCONFIG_H) $(SYSTEM_H) \
3235 $(CORETYPES_H) errors.h $(READ_MD_H)
3236 build/genextract.o : genextract.cc $(RTL_BASE_H) $(BCONFIG_H) \
3237 $(SYSTEM_H) $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H)
3238 build/genflags.o : genflags.cc $(RTL_BASE_H) $(OBSTACK_H) $(BCONFIG_H) \
3239 $(SYSTEM_H) $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H)
3240 build/gentarget-def.o : gentarget-def.cc $(BCONFIG_H) $(SYSTEM_H) \
3241 $(CORETYPES_H) $(GTM_H) $(RTL_BASE_H) errors.h $(READ_MD_H) \
3242 $(GENSUPPORT_H) $(HASH_TABLE_H) target-insns.def
3243 build/gengenrtl.o : gengenrtl.cc $(BCONFIG_H) $(SYSTEM_H) rtl.def
3244
3245 # The gengtype generator program is special: Two versions are built.
3246 # One is for the build machine, and one is for the host to allow
3247 # plugins to define their types and generate the supporting GGC
3248 # datastructures and routines with GTY markers.
3249 # The host object files depend on CONFIG_H, and the build objects
3250 # on BCONFIG_H. For the build objects, add -DGENERATOR_FILE manually,
3251 # the build-%: rule doesn't apply to them.
3252
3253 GENGTYPE_OBJS = gengtype.o gengtype-parse.o gengtype-state.o \
3254 gengtype-lex.o errors.o
3255
3256 gengtype-lex.o build/gengtype-lex.o : gengtype-lex.cc gengtype.h $(SYSTEM_H)
3257 CFLAGS-gengtype-lex.o += -DHOST_GENERATOR_FILE
3258 build/gengtype-lex.o: $(BCONFIG_H)
3259
3260 gengtype-parse.o build/gengtype-parse.o : gengtype-parse.cc gengtype.h \
3261 $(SYSTEM_H)
3262 CFLAGS-gengtype-parse.o += -DHOST_GENERATOR_FILE
3263 build/gengtype-parse.o: $(BCONFIG_H)
3264
3265 gengtype-state.o build/gengtype-state.o: gengtype-state.cc $(SYSTEM_H) \
3266 gengtype.h errors.h version.h $(HASHTAB_H) $(OBSTACK_H) \
3267 $(XREGEX_H)
3268 CFLAGS-gengtype-state.o += -DHOST_GENERATOR_FILE
3269 build/gengtype-state.o: $(BCONFIG_H)
3270 gengtype.o build/gengtype.o : gengtype.cc $(SYSTEM_H) gengtype.h \
3271 rtl.def insn-notes.def errors.h version.h \
3272 $(HASHTAB_H) $(OBSTACK_H) $(XREGEX_H)
3273 CFLAGS-gengtype.o += -DHOST_GENERATOR_FILE
3274 build/gengtype.o: $(BCONFIG_H)
3275
3276 CFLAGS-errors.o += -DHOST_GENERATOR_FILE
3277
3278 build/genmddeps.o: genmddeps.cc $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) \
3279 errors.h $(READ_MD_H)
3280 build/genmodes.o : genmodes.cc $(BCONFIG_H) $(SYSTEM_H) errors.h \
3281 $(HASHTAB_H) machmode.def $(extra_modes_file)
3282 build/genopinit.o : genopinit.cc $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
3283 $(CORETYPES_H) $(GTM_H) errors.h $(GENSUPPORT_H) optabs.def
3284 build/genoutput.o : genoutput.cc $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
3285 $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H)
3286 build/genpeep.o : genpeep.cc $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
3287 $(CORETYPES_H) $(GTM_H) errors.h $(GENSUPPORT_H) toplev.h \
3288 $(DIAGNOSTIC_CORE_H)
3289 build/genpreds.o : genpreds.cc $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
3290 $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) $(OBSTACK_H)
3291 build/genrecog.o : genrecog.cc $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
3292 $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) \
3293 $(HASH_TABLE_H) inchash.h
3294 build/genhooks.o : genhooks.cc $(TARGET_DEF) $(C_TARGET_DEF) \
3295 $(COMMON_TARGET_DEF) $(D_TARGET_DEF) $(RUST_TARGET_DEF) $(BCONFIG_H) \
3296 $(SYSTEM_H) errors.h
3297 build/genmddump.o : genmddump.cc $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
3298 $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H)
3299 build/genmatch.o : genmatch.cc $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) \
3300 errors.h $(HASH_TABLE_H) hash-map.h $(GGC_H) is-a.h ordered-hash-map.h \
3301 tree.def builtins.def internal-fn.def case-cfn-macros.h $(CPPLIB_H)
3302 build/gencfn-macros.o : gencfn-macros.cc $(BCONFIG_H) $(SYSTEM_H) \
3303 $(CORETYPES_H) errors.h $(HASH_TABLE_H) hash-set.h builtins.def \
3304 internal-fn.def
3305
3306 # Compile the programs that generate insn-* from the machine description.
3307 # They are compiled with $(COMPILER_FOR_BUILD), and associated libraries,
3308 # since they need to run on this machine
3309 # even if GCC is being compiled to run on some other machine.
3310
3311 # All these programs use the RTL reader ($(BUILD_RTL)).
3312 genprogrtl = attr attr-common attrtab automata codes conditions config emit \
3313 extract flags mddump opinit output peep preds recog target-def
3314 $(genprogrtl:%=build/gen%$(build_exeext)): $(BUILD_RTL)
3315
3316 # All these programs use the MD reader ($(BUILD_MD)).
3317 genprogmd = $(genprogrtl) mddeps constants enums
3318 $(genprogmd:%=build/gen%$(build_exeext)): $(BUILD_MD)
3319
3320 # All these programs need to report errors.
3321 genprogerr = $(genprogmd) genrtl modes gtype hooks cfn-macros condmd
3322 $(genprogerr:%=build/gen%$(build_exeext)): $(BUILD_ERRORS)
3323
3324 # Remaining build programs.
3325 genprog = $(genprogerr) check checksum match
3326
3327 # These programs need libs over and above what they get from the above list.
3328 build/genautomata$(build_exeext) : BUILD_LIBS += -lm
3329
3330 build/genrecog$(build_exeext) : build/hash-table.o build/inchash.o
3331 build/gencfn-macros$(build_exeext) : build/hash-table.o build/vec.o \
3332 build/ggc-none.o build/sort.o
3333
3334 # For stage1 and when cross-compiling use the build libcpp which is
3335 # built with NLS disabled. For stage2+ use the host library and
3336 # its dependencies.
3337 ifeq ($(build_objdir),$(build_libobjdir))
3338 BUILD_CPPLIB = $(build_libobjdir)/libcpp/libcpp.a
3339 else
3340 BUILD_CPPLIB = $(CPPLIB) $(LIBIBERTY)
3341 build/genmatch$(build_exeext): BUILD_LIBDEPS += $(LIBINTL_DEP) $(LIBICONV_DEP)
3342 build/genmatch$(build_exeext): BUILD_LIBS += $(LIBINTL) $(LIBICONV)
3343 build/genmatch.o: BUILD_CPPFLAGS += -DGENMATCH_SELFTESTS
3344 endif
3345
3346 build/genmatch$(build_exeext) : $(BUILD_CPPLIB) \
3347 $(BUILD_ERRORS) build/vec.o build/hash-table.o build/sort.o
3348
3349 # These programs are not linked with the MD reader.
3350 build/gengtype$(build_exeext) : build/gengtype-lex.o build/gengtype-parse.o \
3351 build/gengtype-state.o build/errors.o
3352
3353 gengtype$(exeext) : gengtype.o gengtype-lex.o gengtype-parse.o \
3354 gengtype-state.o errors.o $(LIBDEPS)
3355 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
3356 $(filter-out $(LIBDEPS), $^) $(LIBS)
3357
3358 # Rule for the generator programs:
3359 $(genprog:%=build/gen%$(build_exeext)): build/gen%$(build_exeext): build/gen%.o $(BUILD_LIBDEPS)
3360 +$(LINKER_FOR_BUILD) $(BUILD_LINKERFLAGS) $(BUILD_LDFLAGS) -o $@ \
3361 $(filter-out $(BUILD_LIBDEPS), $^) $(BUILD_LIBS)
3362
3363 omp-general.o: omp-device-properties.h
3364
3365 omp_device_properties = @omp_device_properties@
3366 omp-device-properties.h: s-omp-device-properties-h ; @true
3367 s-omp-device-properties-h: @omp_device_property_deps@
3368 -rm -f tmp-omp-device-properties.h; \
3369 for kind in kind arch isa; do \
3370 echo 'const char omp_offload_device_'$${kind}'[] = ' \
3371 >> tmp-omp-device-properties.h; \
3372 for prop in none $(omp_device_properties); do \
3373 [ "$$prop" = "none" ] && continue; \
3374 tgt=`echo "$$prop" | sed 's/=.*$$//'`; \
3375 props=`echo "$$prop" | sed 's/.*=//'`; \
3376 echo "\"$$tgt\\0\"" >> tmp-omp-device-properties.h; \
3377 sed -n 's/^'$${kind}': //p' $${props} \
3378 | sed 's/[[:blank:]]/ /g;s/ */ /g;s/^ //;s/ $$//;s/ /\\0/g;s/^/"/;s/$$/\\0\\0"/' \
3379 >> tmp-omp-device-properties.h; \
3380 done; \
3381 echo '"";' >> tmp-omp-device-properties.h; \
3382 done; \
3383 $(SHELL) $(srcdir)/../move-if-change tmp-omp-device-properties.h \
3384 omp-device-properties.h
3385 $(STAMP) s-omp-device-properties-h
3386
3387 # Generated source files for gengtype. Prepend inclusion of
3388 # config.h/bconfig.h because AIX requires _LARGE_FILES to be defined before
3389 # any system header is included.
3390 gengtype-lex.cc : gengtype-lex.l
3391 -$(FLEX) $(FLEXFLAGS) -o$@ $< && { \
3392 echo '#ifdef HOST_GENERATOR_FILE' > [email protected]; \
3393 echo '#include "config.h"' >> [email protected]; \
3394 echo '#else' >> [email protected]; \
3395 echo '#include "bconfig.h"' >> [email protected]; \
3396 echo '#endif' >> [email protected]; \
3397 cat $@ >> [email protected]; \
3398 mv [email protected] $@; \
3399 }
3400
3401 #
3402 # Remake internationalization support.
3403 CFLAGS-intl.o += -DLOCALEDIR=\"$(localedir)\"
3404
3405 #
3406 # Remake cpp.
3407
3408 PREPROCESSOR_DEFINES = \
3409 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
3410 -DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \
3411 -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
3412 -DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \
3413 -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
3414 -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
3415 -DGPLUSPLUS_LIBCXX_INCLUDE_DIR=\"$(gcc_gxx_libcxx_include_dir)\" \
3416 -DGPLUSPLUS_LIBCXX_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_libcxx_include_dir_add_sysroot) \
3417 -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
3418 -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
3419 -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
3420 -DNATIVE_SYSTEM_HEADER_DIR=\"$(NATIVE_SYSTEM_HEADER_DIR)\" \
3421 -DPREFIX=\"$(prefix)/\" \
3422 -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \
3423 @TARGET_SYSTEM_ROOT_DEFINE@
3424
3425 CFLAGS-cppbuiltin.o += $(PREPROCESSOR_DEFINES) -DBASEVER=$(BASEVER_s)
3426 cppbuiltin.o: $(BASEVER)
3427
3428 CFLAGS-cppdefault.o += $(PREPROCESSOR_DEFINES)
3429
3430 # Note for the stamp targets, we run the program `true' instead of
3431 # having an empty command (nothing following the semicolon).
3432
3433 # genversion.cc is run on the build machine to generate version.h
3434 CFLAGS-build/genversion.o += -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \
3435 -DREVISION=$(REVISION_s) \
3436 -DDEVPHASE=$(DEVPHASE_s) -DPKGVERSION=$(PKGVERSION_s) \
3437 -DBUGURL=$(BUGURL_s)
3438
3439 build/genversion.o: genversion.cc $(BCONFIG_H) $(SYSTEM_H) $(srcdir)/DATESTAMP
3440
3441 build/genversion$(build_exeext): build/genversion.o
3442 +$(LINKER_FOR_BUILD) $(BUILD_LINKERFLAGS) $(BUILD_LDFLAGS) \
3443 build/genversion.o -o $@
3444
3445 version.h: s-version; @true
3446 s-version: build/genversion$(build_exeext)
3447 build/genversion$(build_exeext) > tmp-version.h
3448 $(SHELL) $(srcdir)/../move-if-change tmp-version.h version.h
3449 $(STAMP) s-version
3450
3451 # gcov.o needs $(ZLIBINC) added to the include flags.
3452 CFLAGS-gcov.o += $(ZLIBINC)
3453
3454 GCOV_OBJS = gcov.o json.o graphds.o prime-paths.o bitmap.o
3455 gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
3456 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) \
3457 hash-table.o ggc-none.o $(LIBS) $(ZLIB) -o $@
3458 GCOV_DUMP_OBJS = gcov-dump.o
3459 gcov-dump$(exeext): $(GCOV_DUMP_OBJS) $(LIBDEPS)
3460 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_DUMP_OBJS) \
3461 hash-table.o ggc-none.o\
3462 $(LIBS) -o $@
3463
3464 GCOV_TOOL_DEP_FILES = $(srcdir)/../libgcc/libgcov-util.c gcov-io.cc $(GCOV_IO_H) \
3465 $(srcdir)/../libgcc/libgcov-driver.c $(srcdir)/../libgcc/libgcov-driver-system.c \
3466 $(srcdir)/../libgcc/libgcov-merge.c $(srcdir)/../libgcc/libgcov.h \
3467 $(SYSTEM_H) coretypes.h $(TM_H) $(CONFIG_H) version.h intl.h $(DIAGNOSTIC_H)
3468 libgcov-util.o: $(srcdir)/../libgcc/libgcov-util.c $(GCOV_TOOL_DEP_FILES)
3469 +$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -o $@ $<
3470 libgcov-driver-tool.o: $(srcdir)/../libgcc/libgcov-driver.c $(GCOV_TOOL_DEP_FILES)
3471 +$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
3472 -DIN_GCOV_TOOL=1 -o $@ $<
3473 libgcov-merge-tool.o: $(srcdir)/../libgcc/libgcov-merge.c $(GCOV_TOOL_DEP_FILES)
3474 +$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
3475 -DIN_GCOV_TOOL=1 -o $@ $<
3476 GCOV_TOOL_OBJS = gcov-tool.o libgcov-util.o libgcov-driver-tool.o libgcov-merge-tool.o
3477 gcov-tool$(exeext): $(GCOV_TOOL_OBJS) $(LIBDEPS)
3478 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_TOOL_OBJS) $(LIBS) -o $@
3479 #
3480 # Build the include directories. The stamp files are stmp-* rather than
3481 # s-* so that mostlyclean does not force the include directory to
3482 # be rebuilt.
3483
3484 # Build the include directories.
3485 stmp-int-hdrs: $(STMP_FIXINC) $(T_GLIMITS_H) $(T_STDINT_GCC_H) $(USER_H) fixinc_list
3486 # Copy in the headers provided with gcc.
3487 #
3488 # The sed command gets just the last file name component;
3489 # this is necessary because VPATH could add a dirname.
3490 # Using basename would be simpler, but some systems don't have it.
3491 #
3492 # The touch command is here to workaround an AIX/Linux NFS bug.
3493 #
3494 # The move-if-change + cp -p twists for limits.h are intended to preserve
3495 # the time stamp when we regenerate, to prevent pointless rebuilds during
3496 # e.g. install-no-fixedincludes.
3497 -if [ -d include ] ; then true; else mkdir include; chmod a+rx include; fi
3498 -if [ -d include-fixed ] ; then true; else mkdir include-fixed; chmod a+rx include-fixed; fi
3499 for file in .. $(USER_H); do \
3500 if [ X$$file != X.. ]; then \
3501 realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
3502 $(STAMP) include/$$realfile; \
3503 rm -f include/$$realfile; \
3504 cp $$file include; \
3505 chmod a+r include/$$realfile; \
3506 fi; \
3507 done
3508 for file in .. $(USER_H_INC_NEXT_PRE); do \
3509 if [ X$$file != X.. ]; then \
3510 mv include/$$file include/x_$$file; \
3511 echo "#include_next <$$file>" >include/$$file; \
3512 cat include/x_$$file >>include/$$file; \
3513 rm -f include/x_$$file; \
3514 chmod a+r include/$$file; \
3515 fi; \
3516 done
3517 for file in .. $(USER_H_INC_NEXT_POST); do \
3518 if [ X$$file != X.. ]; then \
3519 echo "#include_next <$$file>" >>include/$$file; \
3520 chmod a+r include/$$file; \
3521 fi; \
3522 done
3523 rm -f include/stdint.h
3524 if [ $(USE_GCC_STDINT) = wrap ]; then \
3525 rm -f include/stdint-gcc.h; \
3526 cp $(srcdir)/ginclude/stdint-gcc.h include/stdint-gcc.h; \
3527 chmod a+r include/stdint-gcc.h; \
3528 cp $(srcdir)/ginclude/stdint-wrap.h include/stdint.h; \
3529 chmod a+r include/stdint.h; \
3530 elif [ $(USE_GCC_STDINT) = provide ]; then \
3531 cp $(T_STDINT_GCC_H) include/stdint.h; \
3532 chmod a+r include/stdint.h; \
3533 fi
3534 set -e; for ml in `cat fixinc_list`; do \
3535 sysroot_headers_suffix=`echo $${ml} | sed -e 's/;.*$$//'`; \
3536 multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
3537 include_dir=include$${multi_dir}; \
3538 if $(LIMITS_H_TEST) ; then \
3539 cat $(srcdir)/limitx.h $(T_GLIMITS_H) $(srcdir)/limity.h > tmp-xlimits.h; \
3540 else \
3541 cat $(T_GLIMITS_H) > tmp-xlimits.h; \
3542 fi; \
3543 $(mkinstalldirs) $${include_dir}; \
3544 chmod a+rx $${include_dir} || true; \
3545 $(SHELL) $(srcdir)/../move-if-change \
3546 tmp-xlimits.h tmp-limits.h; \
3547 rm -f $${include_dir}/limits.h; \
3548 cp -p tmp-limits.h $${include_dir}/limits.h; \
3549 chmod a+r $${include_dir}/limits.h; \
3550 cp $(srcdir)/gsyslimits.h $${include_dir}/syslimits.h; \
3551 done
3552 # Install the README
3553 if [ x$(STMP_FIXINC) != x ]; then \
3554 rm -f include-fixed/README; \
3555 cp $(srcdir)/../fixincludes/README-fixinc include-fixed/README; \
3556 chmod a+r include-fixed/README; \
3557 fi;
3558 $(STAMP) $@
3559
3560 .PHONY: install-gcc-tooldir
3561 install-gcc-tooldir:
3562 $(mkinstalldirs) $(DESTDIR)$(gcc_tooldir)
3563
3564 macro_list: s-macro_list; @true
3565 s-macro_list : $(GCC_PASSES) cc1$(exeext)
3566 echo | $(GCC_FOR_TARGET) -nostdinc -E -dM - | \
3567 sed -n -e 's/^#define \([^_][a-zA-Z0-9_]*\).*/\1/p' \
3568 -e 's/^#define \(_[^_A-Z][a-zA-Z0-9_]*\).*/\1/p' | \
3569 sort -u > tmp-macro_list
3570 $(SHELL) $(srcdir)/../move-if-change tmp-macro_list macro_list
3571 $(STAMP) s-macro_list
3572
3573 fixinc_list: s-fixinc_list; @true
3574 s-fixinc_list : $(GCC_PASSES)
3575 # Build up a list of multilib directories and corresponding sysroot
3576 # suffixes, in form sysroot;multilib.
3577 if $(GCC_FOR_TARGET) -print-sysroot-headers-suffix > /dev/null 2>&1; then \
3578 set -e; for ml in `$(GCC_FOR_TARGET) -print-multi-lib`; do \
3579 multi_dir=`echo $${ml} | sed -e 's/;.*$$//'`; \
3580 flags=`echo $${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
3581 sfx=`$(GCC_FOR_TARGET) $${flags} -print-sysroot-headers-suffix`; \
3582 if [ "$${multi_dir}" = "." ]; \
3583 then multi_dir=""; \
3584 else \
3585 multi_dir=/$${multi_dir}; \
3586 fi; \
3587 echo "$${sfx};$${multi_dir}"; \
3588 done; \
3589 else \
3590 echo ";"; \
3591 fi > tmp-fixinc_list
3592 $(SHELL) $(srcdir)/../move-if-change tmp-fixinc_list fixinc_list
3593 $(STAMP) s-fixinc_list
3594
3595 # The line below is supposed to avoid accidentally matching the
3596 # built-in suffix rule `.o:' to build fixincl out of fixincl.o. You'd
3597 # expect fixincl to be newer than fixincl.o, such that this situation
3598 # would never come up. As it turns out, if you use ccache with
3599 # CCACHE_HARDLINK enabled, the compiler doesn't embed the current
3600 # working directory in object files (-g absent, or -fno-working-dir
3601 # present), and build and host are the same, fixincl for the host will
3602 # build after fixincl for the build machine, getting a cache hit,
3603 # thereby updating the timestamp of fixincl.o in the host tree.
3604 # Because of CCACHE_HARDLINK, this will also update the timestamp in
3605 # the build tree, and so fixincl in the build tree will appear to be
3606 # out of date. Yuck.
3607 ../$(build_subdir)/fixincludes/fixincl: ; @ :
3608
3609 # Build fixed copies of system files.
3610 # Abort if no system headers available, unless building a crosscompiler.
3611 # FIXME: abort unless building --without-headers would be more accurate and less ugly
3612 stmp-fixinc: gsyslimits.h macro_list fixinc_list \
3613 $(build_objdir)/fixincludes/fixincl \
3614 $(build_objdir)/fixincludes/fixinc.sh
3615 rm -rf include-fixed; mkdir include-fixed
3616 -chmod a+rx include-fixed
3617 if [ -d ../prev-gcc ]; then \
3618 cd ../prev-gcc && \
3619 $(MAKE) real-$(INSTALL_HEADERS_DIR) DESTDIR=`pwd`/../gcc/ \
3620 libsubdir=. ; \
3621 else \
3622 set -e; for ml in `cat fixinc_list`; do \
3623 sysroot_headers_suffix=`echo $${ml} | sed -e 's/;.*$$//'`; \
3624 multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
3625 fix_dir=include-fixed$${multi_dir}; \
3626 if ! $(inhibit_libc) && test ! -d ${BUILD_SYSTEM_HEADER_DIR}; then \
3627 echo "The directory (BUILD_SYSTEM_HEADER_DIR) that should contain system headers does not exist:" >&2 ; \
3628 echo " ${BUILD_SYSTEM_HEADER_DIR}" >&2 ; \
3629 case ${build_os} in \
3630 darwin*) \
3631 echo "(on Darwin this usually means you need to pass the --with-sysroot= flag to point to a valid MacOS SDK)" >&2; \
3632 ;; \
3633 esac; \
3634 tooldir_sysinc=`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`; \
3635 if test "x${BUILD_SYSTEM_HEADER_DIR}" = "x$${tooldir_sysinc}"; \
3636 then sleep 1; else exit 1; fi; \
3637 fi; \
3638 $(mkinstalldirs) $${fix_dir}; \
3639 chmod a+rx $${fix_dir} || true; \
3640 (TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD_COMMAND}`; \
3641 SHELL='$(SHELL)'; MACRO_LIST=`${PWD_COMMAND}`/macro_list ; \
3642 gcc_dir=`${PWD_COMMAND}` ; \
3643 export TARGET_MACHINE srcdir SHELL MACRO_LIST && \
3644 cd $(build_objdir)/fixincludes && \
3645 $(SHELL) ./fixinc.sh "$${gcc_dir}/$${fix_dir}" \
3646 $(BUILD_SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS) ); \
3647 done; \
3648 fi
3649 $(STAMP) stmp-fixinc
3650 #
3651
3652 # Install with the gcc headers files, not the fixed include files, which we
3653 # are typically not allowed to distribute. The general idea is to:
3654 # - Get to "install" with a bare set of internal headers, not the
3655 # fixed system ones,
3656 # - Prevent rebuilds of what normally depends on the headers, which is
3657 # useless for installation purposes and would rely on improper headers.
3658 # - Restore as much of the original state as possible.
3659
3660 .PHONY: install-no-fixedincludes
3661
3662 install-no-fixedincludes:
3663 # Stash the current set of headers away, save stamps we're going to
3664 # alter explicitly, and arrange for fixincludes not to run next time
3665 # we trigger a headers rebuild.
3666 -rm -rf tmp-include
3667 -mv include tmp-include 2>/dev/null
3668 -mv include-fixed tmp-include-fixed 2>/dev/null
3669 -mv stmp-int-hdrs tmp-stmp-int-hdrs 2>/dev/null
3670 -mv stmp-fixinc tmp-stmp-fixinc 2>/dev/null
3671 -mkdir include
3672 -cp -p $(srcdir)/gsyslimits.h include/syslimits.h
3673 -touch stmp-fixinc
3674
3675 # Rebuild our internal headers, restore the original stamps so that
3676 # "install" doesn't trigger pointless rebuilds because of that update,
3677 # then do install
3678 $(MAKE) $(FLAGS_TO_PASS) stmp-int-hdrs
3679 -mv tmp-stmp-int-hdrs stmp-int-hdrs 2>/dev/null
3680 -mv tmp-stmp-fixinc stmp-fixinc 2>/dev/null
3681 $(MAKE) $(FLAGS_TO_PASS) install
3682
3683 # Restore the original set of maybe-fixed headers
3684 -rm -rf include; mv tmp-include include 2>/dev/null
3685 -rm -rf include-fixed; mv tmp-include-fixed include-fixed 2>/dev/null
3686
3687 # Remake the info files.
3688
3689 doc: $(BUILD_INFO) $(GENERATED_MANPAGES)
3690
3691 # If BUILD_INFO is set to no-info by configure, we still want to check
3692 # 'info' dependencies even the build rules are no-ops because
3693 # BUILD_INFO != info (see %.info rule)
3694 ifeq ($(BUILD_INFO),no-info)
3695 no-info: info
3696 endif
3697
3698 INFOFILES = doc/cpp.info doc/gcc.info doc/gccint.info \
3699 doc/gccinstall.info doc/cppinternals.info
3700
3701 info: $(INFOFILES) lang.info @GENINSRC@ srcinfo lang.srcinfo
3702
3703 srcinfo: $(INFOFILES)
3704 -cp -p $^ $(srcdir)/doc
3705
3706 TEXI_CPP_FILES = cpp.texi fdl.texi cppenv.texi cppopts.texi \
3707 gcc-common.texi gcc-vers.texi
3708
3709 TEXI_GCC_FILES = gcc.texi gcc-common.texi gcc-vers.texi frontends.texi \
3710 standards.texi invoke.texi extend.texi md.texi objc.texi \
3711 gcov.texi trouble.texi bugreport.texi service.texi \
3712 contribute.texi compat.texi funding.texi gnu.texi gpl_v3.texi \
3713 fdl.texi contrib.texi cppenv.texi cppopts.texi avr-mmcu.texi \
3714 implement-c.texi implement-cxx.texi gcov-tool.texi gcov-dump.texi \
3715 lto-dump.texi
3716
3717 # we explicitly use $(srcdir)/doc/tm.texi here to avoid confusion with
3718 # the generated tm.texi; the latter might have a more recent timestamp,
3719 # but we don't want to rebuild the info files unless the contents of
3720 # the *.texi files have changed.
3721 TEXI_GCCINT_FILES = gccint.texi gcc-common.texi gcc-vers.texi \
3722 contribute.texi makefile.texi configterms.texi options.texi \
3723 portability.texi passes.texi rtl.texi md.texi \
3724 $(srcdir)/doc/tm.texi hostconfig.texi fragments.texi \
3725 configfiles.texi collect2.texi headerdirs.texi funding.texi \
3726 gnu.texi gpl_v3.texi fdl.texi contrib.texi languages.texi \
3727 sourcebuild.texi gty.texi libgcc.texi cfg.texi tree-ssa.texi \
3728 loop.texi generic.texi gimple.texi plugins.texi optinfo.texi \
3729 match-and-simplify.texi analyzer.texi ux.texi poly-int.texi
3730
3731 TEXI_GCCINSTALL_FILES = install.texi fdl.texi \
3732 gcc-common.texi gcc-vers.texi
3733
3734 TEXI_CPPINT_FILES = cppinternals.texi gcc-common.texi gcc-vers.texi
3735
3736 # gcc-vers.texi is generated from the version files.
3737 gcc-vers.texi: $(BASEVER) $(DEVPHASE)
3738 (echo "@set version-GCC $(BASEVER_c)"; \
3739 if [ "$(DEVPHASE_c)" = "experimental" ]; \
3740 then echo "@set DEVELOPMENT"; \
3741 else echo "@clear DEVELOPMENT"; \
3742 fi) > $@T
3743 $(build_file_translate) echo @set srcdir `echo $(abs_srcdir) | sed -e 's|\\([@{}]\\)|@\\1|g'` >> $@T
3744 if [ -n "$(PKGVERSION)" ]; then \
3745 echo "@set VERSION_PACKAGE $(PKGVERSION)" >> $@T; \
3746 fi
3747 echo "@set BUGURL $(BUGURL_TEXI)" >> $@T; \
3748 mv -f $@T $@
3749
3750
3751 # The *.1, *.7, *.info, *.dvi, and *.pdf files are being generated from implicit
3752 # patterns. To use them, put each of the specific targets with its
3753 # specific dependencies but no build commands.
3754
3755 doc/cpp.info: $(TEXI_CPP_FILES)
3756 doc/gcc.info: $(TEXI_GCC_FILES)
3757 doc/gccint.info: $(TEXI_GCCINT_FILES)
3758 doc/cppinternals.info: $(TEXI_CPPINT_FILES)
3759
3760 doc/%.info: %.texi
3761 if [ x$(BUILD_INFO) = xinfo ]; then \
3762 $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \
3763 -I $(gcc_docdir)/include -o $@ $<; \
3764 fi
3765
3766 # Duplicate entry to handle renaming of gccinstall.info
3767 doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES)
3768 if [ x$(BUILD_INFO) = xinfo ]; then \
3769 $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \
3770 -I $(gcc_docdir)/include -o $@ $<; \
3771 fi
3772
3773 doc/cpp.dvi: $(TEXI_CPP_FILES)
3774 doc/gcc.dvi: $(TEXI_GCC_FILES)
3775 doc/gccint.dvi: $(TEXI_GCCINT_FILES)
3776 doc/cppinternals.dvi: $(TEXI_CPPINT_FILES)
3777
3778 doc/cpp.pdf: $(TEXI_CPP_FILES)
3779 doc/gcc.pdf: $(TEXI_GCC_FILES)
3780 doc/gccint.pdf: $(TEXI_GCCINT_FILES)
3781 doc/cppinternals.pdf: $(TEXI_CPPINT_FILES)
3782
3783 $(build_htmldir)/cpp/index.html: $(TEXI_CPP_FILES)
3784 $(build_htmldir)/gcc/index.html: $(TEXI_GCC_FILES)
3785 $(build_htmldir)/gccint/index.html: $(TEXI_GCCINT_FILES)
3786 $(build_htmldir)/cppinternals/index.html: $(TEXI_CPPINT_FILES)
3787
3788 DVIFILES = doc/gcc.dvi doc/gccint.dvi doc/gccinstall.dvi doc/cpp.dvi \
3789 doc/cppinternals.dvi
3790
3791 dvi:: $(DVIFILES) lang.dvi
3792
3793 doc/%.dvi: %.texi
3794 $(TEXI2DVI) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
3795
3796 # Duplicate entry to handle renaming of gccinstall.dvi
3797 doc/gccinstall.dvi: $(TEXI_GCCINSTALL_FILES)
3798 $(TEXI2DVI) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
3799
3800 PDFFILES = doc/gcc.pdf doc/gccint.pdf doc/gccinstall.pdf doc/cpp.pdf \
3801 doc/cppinternals.pdf
3802
3803 pdf:: $(PDFFILES) lang.pdf
3804
3805 doc/%.pdf: %.texi
3806 $(TEXI2PDF) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
3807
3808 # Duplicate entry to handle renaming of gccinstall.pdf
3809 doc/gccinstall.pdf: $(TEXI_GCCINSTALL_FILES)
3810 $(TEXI2PDF) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
3811
3812 # List the directories or single hmtl files which are installed by
3813 # install-html. The lang.html file triggers language fragments to build
3814 # html documentation.
3815 HTMLS_INSTALL=$(build_htmldir)/cpp $(build_htmldir)/gcc \
3816 $(build_htmldir)/gccinstall $(build_htmldir)/gccint \
3817 $(build_htmldir)/cppinternals
3818
3819 # List the html file targets.
3820 HTMLS_BUILD=$(build_htmldir)/cpp/index.html $(build_htmldir)/gcc/index.html \
3821 $(build_htmldir)/gccinstall/index.html $(build_htmldir)/gccint/index.html \
3822 $(build_htmldir)/cppinternals/index.html lang.html
3823
3824 html:: $(HTMLS_BUILD)
3825
3826 $(build_htmldir)/%/index.html: %.texi
3827 $(mkinstalldirs) $(@D)
3828 rm -f $(@D)/*
3829 $(TEXI2HTML) $(MAKEINFO_TOC_INLINE_FLAG) \
3830 -I $(abs_docdir) -I $(abs_docdir)/include -o $(@D) $<
3831
3832 # Duplicate entry to handle renaming of gccinstall
3833 $(build_htmldir)/gccinstall/index.html: $(TEXI_GCCINSTALL_FILES)
3834 $(mkinstalldirs) $(@D)
3835 echo rm -f $(@D)/*
3836 SOURCEDIR=$(abs_docdir) \
3837 DESTDIR=$(@D) \
3838 $(SHELL) $(srcdir)/doc/install.texi2html
3839
3840 # Regenerate the .opt.urls files from the generated html, and from the .opt
3841 # files.
3842 .PHONY: regenerate-opt-urls
3843 OPT_URLS_HTML_DEPS = $(build_htmldir)/gcc/Option-Index.html \
3844 $(build_htmldir)/gdc/Option-Index.html \
3845 $(build_htmldir)/gfortran/Option-Index.html
3846 $(OPT_URLS_HTML_DEPS): %/Option-Index.html: %/index.html
3847
3848 regenerate-opt-urls: $(srcdir)/regenerate-opt-urls.py $(OPT_URLS_HTML_DEPS)
3849 $(srcdir)/regenerate-opt-urls.py $(build_htmldir) $(shell dirname $(srcdir))
3850
3851 # Run the unit tests for regenerate-opt-urls.py
3852 .PHONY: regenerate-opt-urls-unit-test
3853 regenerate-opt-urls-unit-test: $(OPT_URLS_HTML_DEPS)
3854 $(srcdir)/regenerate-opt-urls.py $(build_htmldir) $(shell dirname $(srcdir)) --unit-test
3855
3856 # Regenerate attr-urls.def from the generated html.
3857 .PHONY: regenerate-attr-urls
3858 ATTR_URLS_HTML_DEPS = $(build_htmldir)/gcc/Concept-and-Symbol-Index.html
3859
3860 regenerate-attr-urls: $(srcdir)/regenerate-attr-urls.py $(ATTR_URLS_HTML_DEPS)
3861 $(srcdir)/regenerate-attr-urls.py $(build_htmldir) $(shell dirname $(srcdir))
3862
3863 # Run the unit tests for regenerate-attr-urls.py
3864 .PHONY: regenerate-attr-urls-unit-test
3865 regenerate-attr-urls-unit-test: $(ATTR_URLS_HTML_DEPS)
3866 $(srcdir)/regenerate-attr-urls.py $(build_htmldir) $(shell dirname $(srcdir)) --unit-test
3867
3868 MANFILES = doc/gcov.1 doc/cpp.1 doc/gcc.1 doc/gfdl.7 doc/gpl.7 \
3869 doc/fsf-funding.7 doc/gcov-tool.1 doc/gcov-dump.1 \
3870 $(if $(filter yes,@enable_lto@),doc/lto-dump.1)
3871
3872 generated-manpages: man
3873
3874 man: $(MANFILES) lang.man @GENINSRC@ srcman lang.srcman
3875
3876 srcman: $(MANFILES)
3877 -cp -p $^ $(srcdir)/doc
3878
3879 doc/%.1: %.pod
3880 $(STAMP) $@
3881 -($(POD2MAN) --section=1 $< > $(@).T$$$$ && \
3882 mv -f $(@).T$$$$ $@) || \
3883 (rm -f $(@).T$$$$ && exit 1)
3884
3885 doc/%.7: %.pod
3886 $(STAMP) $@
3887 -($(POD2MAN) --section=7 $< > $(@).T$$$$ && \
3888 mv -f $(@).T$$$$ $@) || \
3889 (rm -f $(@).T$$$$ && exit 1)
3890
3891 %.pod: %.texi
3892 $(STAMP) $@
3893 -$(TEXI2POD) -DBUGURL="$(BUGURL_TEXI)" $< > $@
3894
3895 .INTERMEDIATE: cpp.pod gcc.pod gfdl.pod fsf-funding.pod gpl.pod
3896 cpp.pod: cpp.texi cppenv.texi cppopts.texi
3897
3898 # These next rules exist because the output name is not the same as
3899 # the input name, so our implicit %.pod rule will not work.
3900
3901 gcc.pod: invoke.texi cppenv.texi cppopts.texi gcc-vers.texi
3902 $(STAMP) $@
3903 -$(TEXI2POD) $< > $@
3904 gfdl.pod: fdl.texi
3905 $(STAMP) $@
3906 -$(TEXI2POD) $< > $@
3907 fsf-funding.pod: funding.texi
3908 $(STAMP) $@
3909 -$(TEXI2POD) $< > $@
3910 gpl.pod: gpl_v3.texi
3911 $(STAMP) $@
3912 -$(TEXI2POD) $< > $@
3913
3914 #
3915 # Deletion of files made during compilation.
3916 # There are four levels of this:
3917 # `mostlyclean', `clean', `distclean' and `maintainer-clean'.
3918 # `mostlyclean' is useful while working on a particular type of machine.
3919 # It deletes most, but not all, of the files made by compilation.
3920 # It does not delete libgcc.a or its parts, so it won't have to be recompiled.
3921 # `clean' deletes everything made by running `make all'.
3922 # `distclean' also deletes the files made by config.
3923 # `maintainer-clean' also deletes everything that could be regenerated
3924 # automatically, except for `configure'.
3925 # We remove as much from the language subdirectories as we can
3926 # (less duplicated code).
3927
3928 mostlyclean: lang.mostlyclean
3929 -rm -f $(MOSTLYCLEANFILES)
3930 -rm -f *$(objext) c-family/*$(objext)
3931 -rm -f *$(coverageexts)
3932 # Delete build programs
3933 -rm -f build/*
3934 -rm -f mddeps.mk
3935 # Delete other built files.
3936 -rm -f specs.h options.cc options.h options-save.cc
3937 # Delete the stamp and temporary files.
3938 -rm -f s-* tmp-* stamp-* stmp-*
3939 -rm -f */stamp-* */tmp-*
3940 # Delete debugging dump files.
3941 -rm -f *.[0-9][0-9].* */*.[0-9][0-9].*
3942 # Delete some files made during installation.
3943 -rm -f specs $(SPECS)
3944 -rm -f collect collect2 mips-tfile mips-tdump
3945 # Delete unwanted output files from TeX.
3946 -rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg
3947 -rm -f */*.toc */*.log */*.vr */*.fn */*.cp */*.tp */*.ky */*.pg
3948 # Delete sorted indices we don't actually use.
3949 -rm -f gcc.vrs gcc.kys gcc.tps gcc.pgs gcc.fns
3950 # Delete core dumps.
3951 -rm -f core */core
3952 # Delete file generated for gengtype
3953 -rm -f gtyp-input.list
3954 # Delete files generated by gengtype
3955 -rm -f gtype-*
3956 -rm -f gt-*
3957 -rm -f gtype.state
3958 # Delete genchecksum outputs
3959 -rm -f *-checksum.cc
3960 # Delete lock-and-run bits
3961 -rm -rf linkfe.lck lock-stamp.*
3962
3963 # Delete all files made by compilation
3964 # that don't exist in the distribution.
3965 clean: mostlyclean lang.clean
3966 -rm -f libgcc.a libgcc_eh.a libgcov.a
3967 -rm -f libgcc_s*
3968 -rm -f libunwind*
3969 -rm -f config.h tconfig.h bconfig.h tm_p.h tm.h
3970 -rm -f options.cc options.h optionlist
3971 -rm -f cs-*
3972 -rm -f doc/*.dvi
3973 -rm -f doc/*.pdf
3974 # Delete the include directories.
3975 -rm -rf include include-fixed
3976
3977 # Delete all files that users would normally create
3978 # while building and installing GCC.
3979 distclean: clean lang.distclean
3980 -rm -f auto-host.h auto-build.h
3981 -rm -f cstamp-h
3982 -rm -f config.status config.run config.cache config.bak
3983 -rm -f Make-lang Make-hooks Make-host Make-target
3984 -rm -f Makefile *.oaux
3985 -rm -f gthr-default.h
3986 -rm -f TAGS */TAGS
3987 -rm -f *.asm
3988 -rm -f site.exp site.bak testsuite/site.exp testsuite/site.bak
3989 -rm -f testsuite/*.log testsuite/*.sum
3990 -cd testsuite && rm -f x *.x *.x? *.exe *.rpo *.o *.s *.S *.cc
3991 -cd testsuite && rm -f *.out *.gcov *$(coverageexts)
3992 -rm -f .gdbinit configargs.h
3993 -rm -f gcov.pod
3994 # Delete po/*.gmo only if we are not building in the source directory.
3995 -if [ ! -f po/exgettext ]; then rm -f po/*.gmo; fi
3996 -rmdir ada cp f java objc intl po testsuite plugin 2>/dev/null
3997
3998 # Get rid of every file that's generated from some other file, except for `configure'.
3999 # Most of these files ARE PRESENT in the GCC distribution.
4000 maintainer-clean:
4001 @echo 'This command is intended for maintainers to use; it'
4002 @echo 'deletes files that may need special tools to rebuild.'
4003 $(MAKE) lang.maintainer-clean distclean
4004 -rm -f cpp.??s cpp.*aux
4005 -rm -f gcc.??s gcc.*aux
4006 -rm -f $(gcc_docdir)/*.info $(gcc_docdir)/*.1 $(gcc_docdir)/*.7 $(gcc_docdir)/*.dvi $(gcc_docdir)/*.pdf
4007 #
4008 # Entry points `install', `install-strip', and `uninstall'.
4009 # Also use `install-collect2' to install collect2 when the config files don't.
4010
4011 # Copy the compiler files into directories where they will be run.
4012 # Install the driver last so that the window when things are
4013 # broken is small.
4014 install: install-common $(INSTALL_HEADERS) \
4015 install-cpp install-man install-info install-@POSUB@ \
4016 install-driver install-lto-wrapper install-gcc-ar
4017
4018 ifeq ($(enable_plugin),yes)
4019 install: install-plugin
4020 endif
4021
4022 ifeq ($(enable_libgdiagnostics),yes)
4023 install: install-libgdiagnostics
4024 endif
4025
4026 install-strip: override INSTALL_PROGRAM = $(INSTALL_STRIP_PROGRAM)
4027 ifneq ($(STRIP),)
4028 install-strip: STRIPPROG = $(STRIP)
4029 export STRIPPROG
4030 endif
4031 install-strip: install
4032
4033 # Handle cpp installation.
4034 install-cpp: installdirs cpp$(exeext)
4035 -if test "$(enable_as_accelerator)" != "yes" ; then \
4036 rm -f $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext); \
4037 $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext); \
4038 if [ x$(cpp_install_dir) != x ]; then \
4039 rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
4040 $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
4041 else true; fi; \
4042 fi
4043
4044 # Create the installation directories.
4045 # $(libdir)/gcc/include isn't currently searched by cpp.
4046 installdirs:
4047 $(mkinstalldirs) $(DESTDIR)$(libsubdir)
4048 $(mkinstalldirs) $(DESTDIR)$(libexecsubdir)
4049 $(mkinstalldirs) $(DESTDIR)$(bindir)
4050 $(mkinstalldirs) $(DESTDIR)$(includedir)
4051 $(mkinstalldirs) $(DESTDIR)$(infodir)
4052 $(mkinstalldirs) $(DESTDIR)$(man1dir)
4053 $(mkinstalldirs) $(DESTDIR)$(man3dir)
4054 $(mkinstalldirs) $(DESTDIR)$(man7dir)
4055
4056 PLUGIN_HEADERS = $(TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
4057 toplev.h $(DIAGNOSTIC_CORE_H) $(BASIC_BLOCK_H) $(HASH_TABLE_H) \
4058 tree-ssa-alias.h $(INTERNAL_FN_H) gimple-fold.h tree-eh.h gimple-expr.h \
4059 gimple.h is-a.h memmodel.h $(TREE_PASS_H) $(GCC_PLUGIN_H) \
4060 $(GGC_H) $(TREE_DUMP_H) $(PRETTY_PRINT_H) $(OPTS_H) $(PARAMS_H) \
4061 $(tm_file_list) $(tm_include_list) $(tm_p_file_list) $(tm_p_include_list) \
4062 $(host_xm_file_list) $(host_xm_include_list) $(xm_include_list) \
4063 intl.h $(PLUGIN_VERSION_H) $(DIAGNOSTIC_H) ${C_TREE_H} \
4064 $(C_COMMON_H) c-family/c-objc.h $(C_PRETTY_PRINT_H) \
4065 tree-iterator.h $(PLUGIN_H) $(TREE_SSA_H) langhooks.h incpath.h debug.h \
4066 $(EXCEPT_H) tree-ssa-sccvn.h real.h output.h $(IPA_UTILS_H) \
4067 ipa-param-manipulation.h $(C_PRAGMA_H) $(CPPLIB_H) $(FUNCTION_H) \
4068 cppdefault.h flags.h $(MD5_H) params.def params.h params-enum.h \
4069 prefix.h tree-inline.h $(GIMPLE_PRETTY_PRINT_H) realmpfr.h \
4070 $(IPA_PROP_H) $(TARGET_H) $(RTL_H) $(TM_P_H) $(CFGLOOP_H) $(EMIT_RTL_H) \
4071 version.h stringpool.h gimplify.h gimple-iterator.h gimple-ssa.h \
4072 fold-const.h fold-const-call.h tree-cfg.h tree-into-ssa.h tree-ssanames.h \
4073 print-tree.h varasm.h context.h tree-phinodes.h stor-layout.h \
4074 ssa-iterators.h $(RESOURCE_H) tree-cfgcleanup.h attribs.h calls.h \
4075 cfgexpand.h diagnostic-color.h gcc-symtab.h gimple-builder.h gimple-low.h \
4076 gimple-walk.h gimplify-me.h pass_manager.h print-rtl.h stmt.h \
4077 tree-dfa.h tree-hasher.h tree-nested.h tree-object-size.h tree-outof-ssa.h \
4078 tree-parloops.h tree-ssa-address.h tree-ssa-coalesce.h tree-ssa-dom.h \
4079 tree-ssa-loop.h tree-ssa-loop-ivopts.h tree-ssa-loop-manip.h \
4080 tree-ssa-loop-niter.h tree-ssa-ter.h tree-ssa-threadedge.h \
4081 tree-ssa-threadupdate.h inchash.h wide-int.h signop.h hash-map.h \
4082 hash-set.h dominance.h cfg.h cfgrtl.h cfganal.h cfgbuild.h cfgcleanup.h \
4083 lcm.h cfgloopmanip.h file-prefix-map.h builtins.def $(INSN_ATTR_H) \
4084 pass-instances.def params.list $(srcdir)/../include/gomp-constants.h \
4085 $(EXPR_H) $(srcdir)/analyzer/*.h
4086
4087 # generate the 'build fragment' b-header-vars
4088 s-header-vars: Makefile
4089 rm -f tmp-header-vars
4090 # The first sed gets the list "header variables" as the list variables
4091 # assigned in Makefile and having _H at the end of the name. "sed -n" proved
4092 # more portable than a trailing "-e d" to filter out the uninteresting lines,
4093 # in particular on ia64-hpux where "s/.../p" only prints if -n was requested
4094 # as well.
4095 $(foreach header_var,$(shell sed < Makefile -n -e 's/^\([A-Z0-9_]*_H\)[ ]*=.*/\1/p'),echo $(header_var)=$(shell echo $($(header_var):$(srcdir)/%=.../%) | sed -e 's~\.\.\./config/~config/~' -e 's~\.\.\./common/config/~common/config/~' -e 's~\.\.\.[^ ]*/~~g') >> tmp-header-vars;)
4096 $(SHELL) $(srcdir)/../move-if-change tmp-header-vars b-header-vars
4097 $(STAMP) s-header-vars
4098
4099 # Install gengtype
4100 install-gengtype: installdirs gengtype$(exeext) gtype.state
4101 $(mkinstalldirs) $(DESTDIR)$(plugin_resourcesdir)
4102 $(INSTALL_DATA) gtype.state $(DESTDIR)$(plugin_resourcesdir)/gtype.state
4103 $(mkinstalldirs) $(DESTDIR)$(plugin_bindir)
4104 $(INSTALL_PROGRAM) gengtype$(exeext) $(DESTDIR)$(plugin_bindir)/gengtype$(exeext)
4105
4106 # Install the headers needed to build a plugin.
4107 install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype
4108 # We keep the directory structure for files in analyzer, config, common/config
4109 # or c-family and .def files.
4110 # All other files are flattened to a single directory.
4111 $(mkinstalldirs) $(DESTDIR)$(plugin_includedir)
4112 headers=`echo $(sort $(PLUGIN_HEADERS)) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \
4113 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \
4114 for file in $$headers; do \
4115 if [ -f $$file ] ; then \
4116 path=$$file; \
4117 elif [ -f $(srcdir)/$$file ]; then \
4118 path=$(srcdir)/$$file; \
4119 else continue; \
4120 fi; \
4121 case $$path in \
4122 "$(srcdir)"/analyzer/* \
4123 | "$(srcdir)"/config/* | "$(srcdir)"/common/config/* \
4124 | "$(srcdir)"/c-family/* | "$(srcdir)"/*.def ) \
4125 base=`echo "$$path" | sed -e "s|$$srcdirstrip/||"`;; \
4126 *) base=`basename $$path` ;; \
4127 esac; \
4128 dest=$(plugin_includedir)/$$base; \
4129 echo $(INSTALL_DATA) $$path $(DESTDIR)$$dest; \
4130 dir=`dirname $$dest`; \
4131 $(mkinstalldirs) $(DESTDIR)$$dir; \
4132 $(INSTALL_DATA) $$path $(DESTDIR)$$dest; \
4133 done
4134 $(INSTALL_DATA) b-header-vars $(DESTDIR)$(plugin_includedir)/b-header-vars
4135
4136 # Install the compiler executables built during cross compilation.
4137 install-common: native lang.install-common installdirs
4138 for file in $(COMPILERS); do \
4139 if [ -f $$file ] ; then \
4140 rm -f $(DESTDIR)$(libexecsubdir)/$$file; \
4141 $(INSTALL_PROGRAM) $$file $(DESTDIR)$(libexecsubdir)/$$file; \
4142 else true; \
4143 fi; \
4144 done
4145 for file in $(EXTRA_PROGRAMS) $(COLLECT2) ..; do \
4146 if [ x"$$file" != x.. ]; then \
4147 rm -f $(DESTDIR)$(libexecsubdir)/$$file; \
4148 $(INSTALL_PROGRAM) $$file $(DESTDIR)$(libexecsubdir)/$$file; \
4149 else true; fi; \
4150 done
4151 # We no longer install the specs file because its presence makes the
4152 # driver slower, and because people who need it can recreate it by
4153 # using -dumpspecs. We remove any old version because it would
4154 # otherwise override the specs built into the driver.
4155 rm -f $(DESTDIR)$(libsubdir)/specs
4156 # Install gcov if it was compiled.
4157 -if test "$(enable_as_accelerator)" != "yes" ; then \
4158 if [ -f gcov$(exeext) ]; \
4159 then \
4160 rm -f $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext); \
4161 $(INSTALL_PROGRAM) gcov$(exeext) $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext); \
4162 fi; \
4163 fi
4164 # Install gcov-tool if it was compiled.
4165 -if test "$(enable_as_accelerator)" != "yes" ; then \
4166 if [ -f gcov-tool$(exeext) ]; \
4167 then \
4168 rm -f $(DESTDIR)$(bindir)/$(GCOV_TOOL_INSTALL_NAME)$(exeext); \
4169 $(INSTALL_PROGRAM) \
4170 gcov-tool$(exeext) $(DESTDIR)$(bindir)/$(GCOV_TOOL_INSTALL_NAME)$(exeext); \
4171 fi; \
4172 fi
4173 # Install gcov-dump if it was compiled.
4174 -if test "$(enable_as_accelerator)" != "yes" ; then \
4175 if [ -f gcov-dump$(exeext) ]; \
4176 then \
4177 rm -f $(DESTDIR)$(bindir)/$(GCOV_DUMP_INSTALL_NAME)$(exeext); \
4178 $(INSTALL_PROGRAM) \
4179 gcov-dump$(exeext) $(DESTDIR)$(bindir)/$(GCOV_DUMP_INSTALL_NAME)$(exeext); \
4180 fi; \
4181 fi
4182
4183 # Install the driver program as $(target_noncanonical)-gcc,
4184 # $(target_noncanonical)-gcc-$(version), and also as gcc if native.
4185 install-driver: installdirs xgcc$(exeext)
4186 -rm -f $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
4187 -$(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
4188 -if test "$(enable_as_accelerator)" != "yes" ; then \
4189 if [ "$(GCC_INSTALL_NAME)" != "$(target_noncanonical)-gcc-$(version)" ]; then \
4190 rm -f $(DESTDIR)$(bindir)/$(FULL_DRIVER_NAME); \
4191 ( cd $(DESTDIR)$(bindir) && \
4192 $(LN) $(GCC_INSTALL_NAME)$(exeext) $(FULL_DRIVER_NAME) ); \
4193 fi; \
4194 if [ ! -f gcc-cross$(exeext) ] \
4195 && [ "$(GCC_INSTALL_NAME)" != "$(GCC_TARGET_INSTALL_NAME)" ]; then \
4196 rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-tmp$(exeext); \
4197 ( cd $(DESTDIR)$(bindir) && \
4198 $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-tmp$(exeext) && \
4199 mv -f $(target_noncanonical)-gcc-tmp$(exeext) $(GCC_TARGET_INSTALL_NAME)$(exeext) ); \
4200 fi; \
4201 fi
4202
4203 libgdiagnostics.install-headers: installdirs
4204 $(INSTALL_DATA) $(srcdir)/libgdiagnostics.h \
4205 $(DESTDIR)$(includedir)/libgdiagnostics.h
4206 $(INSTALL_DATA) $(srcdir)/libgdiagnostics++.h \
4207 $(DESTDIR)$(includedir)/libgdiagnostics++.h
4208
4209 ifneq (,$(findstring mingw,$(target)))
4210 libgdiagnostics.install-common: installdirs libgdiagnostics.install-headers
4211 # Install import library
4212 $(INSTALL_PROGRAM) $(LIBGDIAGNOSTICS_IMPORT_LIB) \
4213 $(DESTDIR)$(libdir)/$(LIBGDIAGNOSTICS_IMPORT_LIB)
4214 # Install DLL file
4215 $(INSTALL_PROGRAM) $(LIBGDIAGNOSTICS_FILENAME) \
4216 $(DESTDIR)$(bindir)/$(LIBGDIAGNOSTICS_FILENAME)
4217
4218 else
4219 ifneq (,$(findstring darwin,$(host)))
4220 # but only one level for Darwin
4221
4222 libgdiagnostics.install-common: installdirs libgdiagnostics.install-headers
4223 $(INSTALL_PROGRAM) $(LIBGDIAGNOSTICS_FILENAME) \
4224 $(DESTDIR)$(libdir)/$(LIBGDIAGNOSTICS_FILENAME)
4225 ln -sf \
4226 $(LIBGDIAGNOSTICS_SONAME_SYMLINK)\
4227 $(DESTDIR)$(libdir)/$(LIBGDIAGNOSTICS_LINKER_NAME_SYMLINK)
4228
4229 else
4230 libgdiagnostics.install-common: installdirs libgdiagnostics.install-headers
4231 $(INSTALL_PROGRAM) $(LIBGDIAGNOSTICS_FILENAME) \
4232 $(DESTDIR)$(libdir)/$(LIBGDIAGNOSTICS_FILENAME)
4233 ln -sf \
4234 $(LIBGDIAGNOSTICS_FILENAME) \
4235 $(DESTDIR)$(libdir)/$(LIBGDIAGNOSTICS_SONAME_SYMLINK)
4236 ln -sf \
4237 $(LIBGDIAGNOSTICS_SONAME_SYMLINK)\
4238 $(DESTDIR)$(libdir)/$(LIBGDIAGNOSTICS_LINKER_NAME_SYMLINK)
4239 endif
4240 endif
4241
4242 SARIF_REPLAY_INSTALL_NAME := $(shell echo sarif-replay|sed '$(program_transform_name)')
4243 install-libgdiagnostics: libgdiagnostics.install-common sarif-replay
4244 -rm -f $(DESTDIR)$(bindir)/$(SARIF_REPLAY_INSTALL_NAME)$(exeext)
4245 -$(INSTALL_PROGRAM) sarif-replay $(DESTDIR)$(bindir)/$(SARIF_REPLAY_INSTALL_NAME)$(exeext)
4246
4247 # Install the info files.
4248 # $(INSTALL_DATA) might be a relative pathname, so we can't cd into srcdir
4249 # to do the install.
4250 install-info:: doc installdirs \
4251 $(DESTDIR)$(infodir)/cpp.info \
4252 $(DESTDIR)$(infodir)/gcc.info \
4253 $(DESTDIR)$(infodir)/cppinternals.info \
4254 $(DESTDIR)$(infodir)/gccinstall.info \
4255 $(DESTDIR)$(infodir)/gccint.info \
4256 lang.install-info
4257
4258 $(DESTDIR)$(infodir)/%.info: doc/%.info installdirs
4259 rm -f $@
4260 if [ -f $< ]; then \
4261 for f in $(<)*; do \
4262 realfile=`echo $$f | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
4263 $(INSTALL_DATA) $$f $(DESTDIR)$(infodir)/$$realfile; \
4264 chmod a-x $(DESTDIR)$(infodir)/$$realfile; \
4265 done; \
4266 else true; fi
4267 -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
4268 if [ -f $@ ]; then \
4269 install-info --dir-file=$(DESTDIR)$(infodir)/dir $@; \
4270 else true; fi; \
4271 else true; fi;
4272
4273 dvi__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
4274
4275 install-dvi: $(DVIFILES) lang.install-dvi
4276 @$(NORMAL_INSTALL)
4277 test -z "$(dvidir)/gcc" || $(mkinstalldirs) "$(DESTDIR)$(dvidir)/gcc"
4278 @list='$(DVIFILES)'; for p in $$list; do \
4279 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
4280 f=$(dvi__strip_dir) \
4281 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(dvidir)/gcc/$$f'"; \
4282 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(dvidir)/gcc/$$f"; \
4283 done
4284
4285 pdf__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
4286
4287 install-pdf: $(PDFFILES) lang.install-pdf
4288 @$(NORMAL_INSTALL)
4289 test -z "$(pdfdir)/gcc" || $(mkinstalldirs) "$(DESTDIR)$(pdfdir)/gcc"
4290 @list='$(PDFFILES)'; for p in $$list; do \
4291 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
4292 f=$(pdf__strip_dir) \
4293 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/gcc/$$f'"; \
4294 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/gcc/$$f"; \
4295 done
4296
4297 html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
4298
4299 install-html: $(HTMLS_BUILD) lang.install-html
4300 @$(NORMAL_INSTALL)
4301 test -z "$(htmldir)" || $(mkinstalldirs) "$(DESTDIR)$(htmldir)"
4302 @list='$(HTMLS_INSTALL)'; for p in $$list; do \
4303 if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
4304 f=$(html__strip_dir) \
4305 if test -d "$$d$$p"; then \
4306 echo " $(mkinstalldirs) '$(DESTDIR)$(htmldir)/$$f'"; \
4307 $(mkinstalldirs) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
4308 echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
4309 $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
4310 else \
4311 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
4312 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
4313 fi; \
4314 done
4315
4316 # Install the man pages.
4317 install-man: lang.install-man \
4318 $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext) \
4319 $(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext) \
4320 $(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext) \
4321 $(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext) \
4322 $(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext) \
4323 $(if $(filter yes,@enable_lto@),$(DESTDIR)$(man1dir)/$(LTO_DUMP_INSTALL_NAME)$(man1ext)) \
4324 $(DESTDIR)$(man7dir)/fsf-funding$(man7ext) \
4325 $(DESTDIR)$(man7dir)/gfdl$(man7ext) \
4326 $(DESTDIR)$(man7dir)/gpl$(man7ext)
4327
4328 $(DESTDIR)$(man7dir)/%$(man7ext): doc/%.7 installdirs
4329 -rm -f $@
4330 -$(INSTALL_DATA) $< $@
4331 -chmod a-x $@
4332
4333 $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext): doc/gcc.1 installdirs
4334 -rm -f $@
4335 -$(INSTALL_DATA) $< $@
4336 -chmod a-x $@
4337
4338 $(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext): doc/cpp.1 installdirs
4339 -rm -f $@
4340 -$(INSTALL_DATA) $< $@
4341 -chmod a-x $@
4342
4343 $(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): doc/gcov.1 installdirs
4344 -rm -f $@
4345 -$(INSTALL_DATA) $< $@
4346 -chmod a-x $@
4347
4348 $(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext): doc/gcov-tool.1 installdirs
4349 -rm -f $@
4350 -$(INSTALL_DATA) $< $@
4351 -chmod a-x $@
4352
4353 $(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext): doc/gcov-dump.1 installdirs
4354 -rm -f $@
4355 -$(INSTALL_DATA) $< $@
4356 -chmod a-x $@
4357
4358 $(DESTDIR)$(man1dir)/$(LTO_DUMP_INSTALL_NAME)$(man1ext): doc/lto-dump.1 installdirs
4359 -rm -f $@
4360 -$(INSTALL_DATA) $< $@
4361 -chmod a-x $@
4362
4363 # Install all the header files built in the include subdirectory.
4364 install-headers: $(INSTALL_HEADERS_DIR)
4365 # Fix symlinks to absolute paths in the installed include directory to
4366 # point to the installed directory, not the build directory.
4367 # Don't need to use LN_S here since we really do need ln -s and no substitutes.
4368 -files=`cd $(DESTDIR)$(libsubdir)/include-fixed; find . -type l -print 2>/dev/null`; \
4369 if [ $$? -eq 0 ]; then \
4370 dir=`cd include-fixed; ${PWD_COMMAND}`; \
4371 for i in $$files; do \
4372 dest=`ls -ld $(DESTDIR)$(libsubdir)/include-fixed/$$i | sed -n 's/.*-> //p'`; \
4373 if expr "$$dest" : "$$dir.*" > /dev/null; then \
4374 rm -f $(DESTDIR)$(libsubdir)/include-fixed/$$i; \
4375 ln -s `echo $$i | sed "s|/[^/]*|/..|g" | sed 's|/..$$||'``echo "$$dest" | sed "s|$$dir||"` $(DESTDIR)$(libsubdir)/include-fixed/$$i; \
4376 fi; \
4377 done; \
4378 fi
4379
4380 # Create or recreate the gcc private include file directory.
4381 install-include-dir: installdirs
4382 $(mkinstalldirs) $(DESTDIR)$(libsubdir)/include
4383 -rm -rf $(DESTDIR)$(libsubdir)/include-fixed
4384 mkdir $(DESTDIR)$(libsubdir)/include-fixed
4385 -chmod a+rx $(DESTDIR)$(libsubdir)/include-fixed
4386
4387 # Create or recreate the install-tools include file directory.
4388 itoolsdir = $(libexecsubdir)/install-tools
4389 itoolsdatadir = $(libsubdir)/install-tools
4390 install-itoolsdirs: installdirs
4391 $(mkinstalldirs) $(DESTDIR)$(itoolsdatadir)/include
4392 $(mkinstalldirs) $(DESTDIR)$(itoolsdir)
4393
4394 # Install the include directory using tar.
4395 install-headers-tar: stmp-int-hdrs install-include-dir
4396 # We use `pwd`/include instead of just include to problems with CDPATH
4397 # Unless a full pathname is provided, some shells would print the new CWD,
4398 # found in CDPATH, corrupting the output. We could just redirect the
4399 # output of `cd', but some shells lose on redirection within `()'s
4400 (cd `${PWD_COMMAND}`/include ; \
4401 tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include; tar xpf - )
4402 (cd `${PWD_COMMAND}`/include-fixed ; \
4403 tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include-fixed; tar xpf - )
4404 # /bin/sh on some systems returns the status of the first tar,
4405 # and that can lose with GNU tar which always writes a full block.
4406 # So use `exit 0' to ignore its exit status.
4407
4408 # Install the include directory using cpio.
4409 install-headers-cpio: stmp-int-hdrs install-include-dir
4410 # See discussion about the use of `pwd` above
4411 cd `${PWD_COMMAND}`/include ; \
4412 find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include
4413 cd `${PWD_COMMAND}`/include-fixed ; \
4414 find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include-fixed
4415
4416 # Install the include directory using cp.
4417 install-headers-cp: stmp-int-hdrs install-include-dir
4418 cp -p -r include $(DESTDIR)$(libsubdir)
4419 cp -p -r include-fixed $(DESTDIR)$(libsubdir)
4420
4421 # Targets without dependencies, for use in prev-gcc during bootstrap.
4422 real-install-headers-tar:
4423 (cd `${PWD_COMMAND}`/include-fixed ; \
4424 tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include-fixed; tar xpf - )
4425
4426 real-install-headers-cpio:
4427 cd `${PWD_COMMAND}`/include-fixed ; \
4428 find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include-fixed
4429
4430 real-install-headers-cp:
4431 cp -p -r include-fixed $(DESTDIR)$(libsubdir)
4432
4433 # Install supporting files for fixincludes to be run later.
4434 install-mkheaders: stmp-int-hdrs install-itoolsdirs \
4435 macro_list fixinc_list
4436 $(INSTALL_DATA) $(srcdir)/gsyslimits.h \
4437 $(DESTDIR)$(itoolsdatadir)/gsyslimits.h
4438 $(INSTALL_DATA) macro_list $(DESTDIR)$(itoolsdatadir)/macro_list
4439 $(INSTALL_DATA) fixinc_list $(DESTDIR)$(itoolsdatadir)/fixinc_list
4440 set -e; for ml in `cat fixinc_list`; do \
4441 multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
4442 $(mkinstalldirs) $(DESTDIR)$(itoolsdatadir)/include$${multi_dir}; \
4443 $(INSTALL_DATA) include$${multi_dir}/limits.h $(DESTDIR)$(itoolsdatadir)/include$${multi_dir}/limits.h; \
4444 done
4445 $(INSTALL_SCRIPT) $(srcdir)/../mkinstalldirs \
4446 $(DESTDIR)$(itoolsdir)/mkinstalldirs ; \
4447 sysroot_headers_suffix='$${sysroot_headers_suffix}'; \
4448 echo 'SYSTEM_HEADER_DIR="'"$(SYSTEM_HEADER_DIR)"'"' \
4449 > $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
4450 echo 'OTHER_FIXINCLUDES_DIRS="$(OTHER_FIXINCLUDES_DIRS)"' \
4451 >> $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
4452 echo 'STMP_FIXINC="$(STMP_FIXINC)"' \
4453 >> $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
4454
4455 # Use this target to install the program `collect2' under the name `collect2'.
4456 install-collect2: collect2 installdirs
4457 $(INSTALL_PROGRAM) collect2$(exeext) $(DESTDIR)$(libexecsubdir)/collect2$(exeext)
4458 # Install the driver program as $(libsubdir)/gcc for collect2.
4459 $(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(libexecsubdir)/gcc$(exeext)
4460
4461 # Install lto-wrapper.
4462 install-lto-wrapper: lto-wrapper$(exeext)
4463 $(INSTALL_PROGRAM) lto-wrapper$(exeext) $(DESTDIR)$(libexecsubdir)/lto-wrapper$(exeext)
4464
4465 install-gcc-ar: installdirs gcc-ar$(exeext) gcc-nm$(exeext) gcc-ranlib$(exeext)
4466 if test "$(enable_as_accelerator)" != "yes" ; then \
4467 for i in gcc-ar gcc-nm gcc-ranlib; do \
4468 install_name=`echo $$i|sed '$(program_transform_name)'` ;\
4469 target_install_name=$(target_noncanonical)-`echo $$i|sed '$(program_transform_name)'` ; \
4470 rm -f $(DESTDIR)$(bindir)/$$install_name$(exeext) ; \
4471 $(INSTALL_PROGRAM) $$i$(exeext) $(DESTDIR)$(bindir)/$$install_name$(exeext) ;\
4472 if test -f gcc-cross$(exeext); then \
4473 :; \
4474 else \
4475 rm -f $(DESTDIR)$(bindir)/$$target_install_name$(exeext); \
4476 ( cd $(DESTDIR)$(bindir) && \
4477 $(LN) $$install_name$(exeext) $$target_install_name$(exeext) ) ; \
4478 fi ; \
4479 done; \
4480 fi
4481
4482 # Cancel installation by deleting the installed files.
4483 uninstall: lang.uninstall
4484 -rm -rf $(DESTDIR)$(libsubdir)
4485 -rm -rf $(DESTDIR)$(libexecsubdir)
4486 -rm -rf $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
4487 -rm -f $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext)
4488 -if [ x$(cpp_install_dir) != x ]; then \
4489 rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
4490 else true; fi
4491 -rm -rf $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext)
4492 -rm -rf $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext)
4493 -rm -rf $(DESTDIR)$(man1dir)/cpp$(man1ext)
4494 -rm -f $(DESTDIR)$(infodir)/cpp.info* $(DESTDIR)$(infodir)/gcc.info*
4495 -rm -f $(DESTDIR)$(infodir)/cppinternals.info* $(DESTDIR)$(infodir)/gccint.info*
4496 for i in ar nm ranlib ; do \
4497 install_name=`echo gcc-$$i|sed '$(program_transform_name)'`$(exeext) ;\
4498 target_install_name=$(target_noncanonical)-`echo gcc-$$i|sed '$(program_transform_name)'`$(exeext) ; \
4499 rm -f $(DESTDIR)$(bindir)/$$install_name ; \
4500 rm -f $(DESTDIR)$(bindir)/$$target_install_name ; \
4501 done
4502 #
4503 # These targets are for the dejagnu testsuites. The file site.exp
4504 # contains global variables that all the testsuites will use.
4505
4506 target_subdir = @target_subdir@
4507
4508 site.exp: ./config.status Makefile
4509 @echo "Making a new config file..."
4510 -@rm -f ./site.tmp
4511 @$(STAMP) site.exp
4512 -@mv site.exp site.bak
4513 @echo "## these variables are automatically generated by make ##" > ./site.tmp
4514 @echo "# Do not edit here. If you wish to override these values" >> ./site.tmp
4515 @echo "# add them to the last section" >> ./site.tmp
4516 @echo "set rootme \"`${PWD_COMMAND}`\"" >> ./site.tmp
4517 @echo "set srcdir \"`cd ${srcdir}; ${PWD_COMMAND}`\"" >> ./site.tmp
4518 @echo "set host_triplet $(host)" >> ./site.tmp
4519 @echo "set build_triplet $(build)" >> ./site.tmp
4520 @echo "set target_triplet $(target)" >> ./site.tmp
4521 @echo "set target_alias $(target_noncanonical)" >> ./site.tmp
4522 @echo "set libiconv \"$(LIBICONV)\"" >> ./site.tmp
4523 # CFLAGS is set even though it's empty to show we reserve the right to set it.
4524 @echo "set CFLAGS \"\"" >> ./site.tmp
4525 @echo "set CXXFLAGS \"\"" >> ./site.tmp
4526 @echo "set HOSTCC \"$(CC)\"" >> ./site.tmp
4527 @echo "set HOSTCXX \"$(CXX)\"" >> ./site.tmp
4528 @echo "set HOSTCFLAGS \"$(CFLAGS)\"" >> ./site.tmp
4529 @echo "set HOSTCXXFLAGS \"$(CXXFLAGS)\"" >> ./site.tmp
4530 # TEST_ALWAYS_FLAGS are flags that should be passed to every compilation.
4531 # They are passed first to allow individual tests to override them.
4532 @echo "set TEST_ALWAYS_FLAGS \"$(SYSROOT_CFLAGS_FOR_TARGET)\"" >> ./site.tmp
4533 # When running the tests we set GCC_EXEC_PREFIX to the install tree so that
4534 # files that have already been installed there will be found. The -B option
4535 # overrides it, so use of GCC_EXEC_PREFIX will not result in using GCC files
4536 # from the install tree.
4537 @echo "set TEST_GCC_EXEC_PREFIX \"$(libdir)/gcc/\"" >> ./site.tmp
4538 @echo "set TESTING_IN_BUILD_TREE 1" >> ./site.tmp
4539 @echo "set HAVE_LIBSTDCXX_V3 1" >> ./site.tmp
4540 @if test "@enable_plugin@" = "yes" ; then \
4541 echo "set ENABLE_PLUGIN 1" >> ./site.tmp; \
4542 echo "set PLUGINCC \"$(PLUGINCC)\"" >> ./site.tmp; \
4543 echo "set PLUGINCFLAGS \"$(PLUGINCFLAGS)\"" >> ./site.tmp; \
4544 echo "set GMPINC \"$(GMPINC)\"" >> ./site.tmp; \
4545 fi
4546 # If newlib has been configured, we need to pass -B to gcc so it can find
4547 # newlib's crt0.o if it exists. This will cause a "path prefix not used"
4548 # message if it doesn't, but the testsuite is supposed to ignore the message -
4549 # it's too difficult to tell when to and when not to pass -B (not all targets
4550 # have crt0's). We could only add the -B if ../newlib/crt0.o exists, but that
4551 # seems like too selective a test.
4552 # ??? Another way to solve this might be to rely on linker scripts. Then
4553 # theoretically the -B won't be needed.
4554 # We also need to pass -L ../ld so that the linker can find ldscripts.
4555 @if [ -d $(objdir)/../$(target_subdir)/newlib ] \
4556 && [ "${host}" != "${target}" ]; then \
4557 echo "set newlib_cflags \"-I$(objdir)/../$(target_subdir)/newlib/targ-include -I\$$srcdir/../newlib/libc/include\"" >> ./site.tmp; \
4558 echo "set newlib_ldflags \"-B$(objdir)/../$(target_subdir)/newlib/\"" >> ./site.tmp; \
4559 echo "append CFLAGS \" \$$newlib_cflags\"" >> ./site.tmp; \
4560 echo "append CXXFLAGS \" \$$newlib_cflags\"" >> ./site.tmp; \
4561 echo "append LDFLAGS \" \$$newlib_ldflags\"" >> ./site.tmp; \
4562 else true; \
4563 fi
4564 @if [ -d $(objdir)/../ld ] ; then \
4565 echo "append LDFLAGS \" -L$(objdir)/../ld\"" >> ./site.tmp; \
4566 else true; \
4567 fi
4568 echo "set tmpdir $(objdir)/testsuite" >> ./site.tmp
4569 @echo "set srcdir \"\$${srcdir}/testsuite\"" >> ./site.tmp
4570 @if [ "X$(ALT_CC_UNDER_TEST)" != "X" ] ; then \
4571 echo "set ALT_CC_UNDER_TEST \"$(ALT_CC_UNDER_TEST)\"" >> ./site.tmp; \
4572 else true; \
4573 fi
4574 @if [ "X$(ALT_CXX_UNDER_TEST)" != "X" ] ; then \
4575 echo "set ALT_CXX_UNDER_TEST \"$(ALT_CXX_UNDER_TEST)\"" >> ./site.tmp; \
4576 else true; \
4577 fi
4578 @if [ "X$(COMPAT_OPTIONS)" != "X" ] ; then \
4579 echo "set COMPAT_OPTIONS \"$(COMPAT_OPTIONS)\"" >> ./site.tmp; \
4580 else true; \
4581 fi
4582 @if test "X@ENABLE_DARWIN_AT_RPATH_TRUE@" != "X#" ; then \
4583 echo "set ENABLE_DARWIN_AT_RPATH 1" >> ./site.tmp; \
4584 fi
4585 @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./site.tmp
4586 @cat ./site.tmp > site.exp
4587 @cat site.bak | sed \
4588 -e '1,/^## All variables above are.*##/ d' >> site.exp
4589 -@rm -f ./site.tmp
4590
4591 CHECK_TARGETS = @check_languages@
4592
4593 check: $(CHECK_TARGETS)
4594
4595 check-subtargets: $(patsubst %,%-subtargets,$(CHECK_TARGETS))
4596
4597 # The idea is to parallelize testing of multilibs, for example:
4598 # make -j3 check-gcc//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu}
4599 # will run 3 concurrent sessions of check-gcc, eventually testing
4600 # all 10 combinations. GNU make is required, as is a shell that expands
4601 # alternations within braces.
4602 lang_checks_parallel = $(lang_checks:=//%)
4603 $(lang_checks_parallel): site.exp
4604 target=`echo "$@" | sed 's,//.*,,'`; \
4605 variant=`echo "$@" | sed 's,^[^/]*//,,'`; \
4606 vardots=`echo "$$variant" | sed 's,/,.,g'`; \
4607 $(MAKE) TESTSUITEDIR="testsuite.$$vardots" \
4608 RUNTESTFLAGS="--target_board=$$variant $(RUNTESTFLAGS)" \
4609 EXPECT=$(EXPECT) \
4610 "$$target"
4611
4612 TESTSUITEDIR = testsuite
4613
4614 $(TESTSUITEDIR)/site.exp: site.exp
4615 -test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR)
4616 -rm -f $@
4617 sed '/set tmpdir/ s|testsuite$$|$(TESTSUITEDIR)|' < site.exp > $@
4618
4619 # This is only used for check-% targets that aren't parallelized.
4620 $(filter-out $(lang_checks_parallelized),$(lang_checks)): check-% : site.exp
4621 -test -d plugin || mkdir plugin
4622 -test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR)
4623 test -d $(TESTSUITEDIR)/$* || mkdir $(TESTSUITEDIR)/$*
4624 -(rootme=`${PWD_COMMAND}`; export rootme; \
4625 srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
4626 cd $(TESTSUITEDIR)/$*; \
4627 rm -f tmp-site.exp; \
4628 sed '/set tmpdir/ s|testsuite$$|$(TESTSUITEDIR)/$*|' \
4629 < ../../site.exp > tmp-site.exp; \
4630 $(SHELL) $${srcdir}/../move-if-change tmp-site.exp site.exp; \
4631 EXPECT=${EXPECT} ; export EXPECT ; \
4632 if [ -f $${rootme}/../expect/expect ] ; then \
4633 TCL_LIBRARY=`cd .. ; cd $${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
4634 export TCL_LIBRARY ; fi ; \
4635 $(RUNTEST) --tool $* $(RUNTESTFLAGS))
4636
4637 $(patsubst %,%-subtargets,$(lang_checks)): check-%-subtargets:
4638 @echo check-$*
4639
4640 check_p_tool=$(firstword $(subst _, ,$*))
4641 check_p_count=$(check_$(check_p_tool)_parallelize)
4642 check_p_subno=$(word 2,$(subst _, ,$*))
4643 check_p_subdir=$(subst _,,$*)
4644 check_p_subdirs=$(wordlist 1,$(check_p_count),$(wordlist 1, \
4645 $(if $(GCC_TEST_PARALLEL_SLOTS),$(GCC_TEST_PARALLEL_SLOTS),128), \
4646 $(one_to_9999)))
4647
4648 # For parallelized check-% targets, this decides whether parallelization
4649 # is desirable (if -jN is used). If desirable, recursive make is run with
4650 # check-parallel-$lang{,1,2,3,4,5} etc. goals, which can be executed in
4651 # parallel, as they are run in separate directories.
4652 # check-parallel-$lang{,1,2,3,4,5} etc. goals invoke runtest with
4653 # GCC_RUNTEST_PARALLELIZE_DIR var in the environment and runtest_file_p
4654 # dejaGNU procedure is overridden to additionally synchronize through
4655 # a $lang-parallel directory which tests will be run by which runtest instance.
4656 # Afterwards contrib/dg-extract-results.sh is used to merge the sum and log
4657 # files. If parallelization isn't desirable, only one recursive make
4658 # is run with check-parallel-$lang goal and check_$lang_parallelize variable
4659 # cleared to say that no additional arguments beyond $(RUNTESTFLAGS)
4660 # should be passed to runtest.
4661 #
4662 # To parallelize some language check, add the corresponding check-$lang
4663 # to lang_checks_parallelized variable and define check_$lang_parallelize
4664 # variable. This is the upper limit to which it is useful to parallelize the
4665 # check-$lang target. It doesn't make sense to try e.g. 128 goals for small
4666 # testsuites like objc or go.
4667 $(lang_checks_parallelized): check-% : site.exp
4668 -rm -rf $(TESTSUITEDIR)/$*-parallel
4669 @if [ -n "$(filter -j%, $(MFLAGS))" ]; then \
4670 test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR) || true; \
4671 test -d $(TESTSUITEDIR)/$*-parallel || mkdir $(TESTSUITEDIR)/$*-parallel || true; \
4672 GCC_RUNTEST_PARALLELIZE_DIR=`${PWD_COMMAND}`/$(TESTSUITEDIR)/$(check_p_tool)-parallel ; \
4673 export GCC_RUNTEST_PARALLELIZE_DIR ; \
4674 $(MAKE) TESTSUITEDIR="$(TESTSUITEDIR)" RUNTESTFLAGS="$(RUNTESTFLAGS)" \
4675 EXPECT=$(EXPECT) \
4676 check-parallel-$* \
4677 $(patsubst %,check-parallel-$*_%, $(check_p_subdirs)); \
4678 sums= ; logs= ; \
4679 for dir in $(TESTSUITEDIR)/$* \
4680 $(patsubst %,$(TESTSUITEDIR)/$*%,$(check_p_subdirs));\
4681 do \
4682 if [ -d $$dir ]; then \
4683 mv -f $$dir/$*.sum $$dir/$*.sum.sep; mv -f $$dir/$*.log $$dir/$*.log.sep; \
4684 sums="$$sums $$dir/$*.sum.sep"; logs="$$logs $$dir/$*.log.sep"; \
4685 fi; \
4686 done; \
4687 $(SHELL) $(srcdir)/../contrib/dg-extract-results.sh $$sums \
4688 > $(TESTSUITEDIR)/$*/$*.sum; \
4689 $(SHELL) $(srcdir)/../contrib/dg-extract-results.sh -L $$logs \
4690 > $(TESTSUITEDIR)/$*/$*.log; \
4691 rm -rf $(TESTSUITEDIR)/$*-parallel || true; \
4692 else \
4693 $(MAKE) TESTSUITEDIR="$(TESTSUITEDIR)" RUNTESTFLAGS="$(RUNTESTFLAGS)" \
4694 EXPECT=$(EXPECT) \
4695 check_$*_parallelize= check-parallel-$*; \
4696 fi
4697
4698 check-parallel-% : site.exp
4699 -@test -d plugin || mkdir plugin
4700 -@test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR)
4701 @test -d $(TESTSUITEDIR)/$(check_p_subdir) || mkdir $(TESTSUITEDIR)/$(check_p_subdir)
4702 -$(if $(check_p_subno),@)(rootme=`${PWD_COMMAND}`; export rootme; \
4703 srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
4704 if [ -n "$(check_p_subno)" ] \
4705 && [ -n "$$GCC_RUNTEST_PARALLELIZE_DIR" ] \
4706 && [ -f $(TESTSUITEDIR)/$(check_p_tool)-parallel/finished ]; then \
4707 rm -rf $(TESTSUITEDIR)/$(check_p_subdir); \
4708 else \
4709 cd $(TESTSUITEDIR)/$(check_p_subdir); \
4710 rm -f tmp-site.exp; \
4711 sed '/set tmpdir/ s|testsuite$$|$(TESTSUITEDIR)/$(check_p_subdir)|' \
4712 < ../../site.exp > tmp-site.exp; \
4713 $(SHELL) $${srcdir}/../move-if-change tmp-site.exp site.exp; \
4714 EXPECT=${EXPECT} ; export EXPECT ; \
4715 if [ -f $${rootme}/../expect/expect ] ; then \
4716 TCL_LIBRARY=`cd .. ; cd $${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
4717 export TCL_LIBRARY ; \
4718 fi ; \
4719 $(RUNTEST) --tool $(check_p_tool) $(RUNTESTFLAGS); \
4720 if [ -n "$$GCC_RUNTEST_PARALLELIZE_DIR" ] ; then \
4721 touch $${rootme}/$(TESTSUITEDIR)/$(check_p_tool)-parallel/finished; \
4722 fi ; \
4723 fi )
4724
4725 # Run Paranoia on real.cc.
4726
4727 paranoia.o: $(srcdir)/../contrib/paranoia.cc $(CONFIG_H) $(SYSTEM_H) $(TREE_H)
4728 g++ -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $< $(OUTPUT_OPTION)
4729
4730 paranoia: paranoia.o real.o $(LIBIBERTY)
4731 g++ -o $@ paranoia.o real.o $(LIBIBERTY)
4732
4733 # These exist for maintenance purposes.
4734
4735 CTAGS=@CTAGS@
4736 ETAGS=@ETAGS@
4737 CSCOPE=@CSCOPE@
4738
4739 # Update the tags table.
4740 TAGS: lang.tags
4741 (cd $(srcdir); \
4742 incs= ; \
4743 list='$(SUBDIRS)'; for dir in $$list; do \
4744 if test -f $$dir/TAGS; then \
4745 incs="$$incs --include $$dir/TAGS.sub"; \
4746 fi; \
4747 done; \
4748 $(ETAGS) -o TAGS.sub c-family/*.h c-family/*.cc \
4749 *.h *.cc \
4750 ../include/*.h ../libiberty/*.c \
4751 ../libcpp/*.cc ../libcpp/include/*.h \
4752 --language=none --regex="/\(char\|unsigned int\|int\|bool\|void\|HOST_WIDE_INT\|enum [A-Za-z_0-9]+\) [*]?\([A-Za-z_0-9]+\)/\2/" common.opt \
4753 --language=none --regex="/\(DEF_RTL_EXPR\|DEFTREECODE\|DEFGSCODE\|DEFTIMEVAR\|DEFPARAM\|DEFPARAMENUM5\)[ ]?(\([A-Za-z_0-9]+\)/\2/" rtl.def tree.def gimple.def timevar.def \
4754 ; \
4755 $(ETAGS) --include TAGS.sub $$incs)
4756
4757 # -----------------------------------------------------
4758 # Rules for generating translated message descriptions.
4759 # Disabled by autoconf if the tools are not available.
4760 # -----------------------------------------------------
4761
4762 XGETTEXT = @XGETTEXT@
4763 GMSGFMT = @GMSGFMT@
4764 MSGMERGE = msgmerge
4765 CATALOGS = $(patsubst %,po/%,@CATALOGS@)
4766
4767 .PHONY: build- install- build-po install-po update-po
4768
4769 # Dummy rules to deal with dependencies produced by use of
4770 # "build-@POSUB@" and "install-@POSUB@" above, when NLS is disabled.
4771 build-: ; @true
4772 install-: ; @true
4773
4774 build-po: $(CATALOGS)
4775
4776 # This notation should be acceptable to all Make implementations used
4777 # by people who are interested in updating .po files.
4778 update-po: $(CATALOGS:.gmo=.pox)
4779
4780 # N.B. We do not attempt to copy these into $(srcdir). The snapshot
4781 # script does that.
4782 .po.gmo:
4783 $(mkinstalldirs) po
4784 $(GMSGFMT) --statistics -o $@ $<
4785
4786 # The new .po has to be gone over by hand, so we deposit it into
4787 # build/po with a different extension.
4788 # If build/po/gcc.pot exists, use it (it was just created),
4789 # else use the one in srcdir.
4790 .po.pox:
4791 $(mkinstalldirs) po
4792 $(MSGMERGE) $< `if test -f po/gcc.pot; \
4793 then echo po/gcc.pot; \
4794 else echo $(srcdir)/po/gcc.pot; fi` -o $@
4795
4796 # This rule has to look for .gmo modules in both srcdir and
4797 # the cwd, and has to check that we actually have a catalog
4798 # for each language, in case they weren't built or included
4799 # with the distribution.
4800 install-po:
4801 $(mkinstalldirs) $(DESTDIR)$(datadir)
4802 cats="$(CATALOGS)"; for cat in $$cats; do \
4803 lang=`basename $$cat | sed 's/\.gmo$$//'`; \
4804 if [ -f $$cat ]; then :; \
4805 elif [ -f $(srcdir)/$$cat ]; then cat=$(srcdir)/$$cat; \
4806 else continue; \
4807 fi; \
4808 dir=$(localedir)/$$lang/LC_MESSAGES; \
4809 echo $(mkinstalldirs) $(DESTDIR)$$dir; \
4810 $(mkinstalldirs) $(DESTDIR)$$dir || exit 1; \
4811 echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc.mo; \
4812 $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc.mo; \
4813 done
4814
4815 # Rule for regenerating the message template (gcc.pot).
4816 # Instead of forcing everyone to edit POTFILES.in, which proved impractical,
4817 # this rule has no dependencies and always regenerates gcc.pot. This is
4818 # relatively harmless since the .po files do not directly depend on it.
4819 # Note that exgettext has an awk script embedded in it which requires a
4820 # fairly modern (POSIX-compliant) awk.
4821 # The .pot file is left in the build directory.
4822 gcc.pot: po/gcc.pot
4823 po/gcc.pot: force
4824 $(mkinstalldirs) po
4825 $(MAKE) srcextra
4826 AWK=$(AWK) $(SHELL) $(srcdir)/po/exgettext \
4827 $(XGETTEXT) gcc $(srcdir)
4828
4829 #
4830
4831 # Dependency information.
4832
4833 # In order for parallel make to really start compiling the expensive
4834 # objects from $(OBJS) as early as possible, build all their
4835 # prerequisites strictly before all objects.
4836 $(ALL_HOST_OBJS) : | $(generated_files)
4837
4838 # Include the auto-generated dependencies for all host objects.
4839 DEPFILES = \
4840 $(foreach obj,$(ALL_HOST_OBJS),\
4841 $(dir $(obj))$(DEPDIR)/$(patsubst %.o,%.Po,$(notdir $(obj))))
4842 -include $(DEPFILES)