]>
Commit | Line | Data |
---|---|---|
966842d4 | 1 | # Makefile for GNU Compiler Collection |
2 | # Run 'configure' to generate Makefile from Makefile.in | |
3 | ||
aad93da1 | 4 | # Copyright (C) 1987-2017 Free Software Foundation, Inc. |
32e6d418 | 5 | |
f12b58b3 | 6 | #This file is part of GCC. |
32e6d418 | 7 | |
f12b58b3 | 8 | #GCC is free software; you can redistribute it and/or modify |
32e6d418 | 9 | #it under the terms of the GNU General Public License as published by |
8c4c00c1 | 10 | #the Free Software Foundation; either version 3, or (at your option) |
32e6d418 | 11 | #any later version. |
12 | ||
f12b58b3 | 13 | #GCC is distributed in the hope that it will be useful, |
32e6d418 | 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 | |
8c4c00c1 | 19 | #along with GCC; see the file COPYING3. If not see |
20 | #<http://www.gnu.org/licenses/>. | |
32e6d418 | 21 | |
22 | # The targets for external use include: | |
2b7a4d59 | 23 | # all, doc, install, install-cross, install-cross-rest, install-strip, |
e3ca137a | 24 | # uninstall, TAGS, mostlyclean, clean, distclean, maintainer-clean. |
32e6d418 | 25 | |
f5da66df | 26 | # This is the default target. |
966842d4 | 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 = | |
f5da66df | 40 | |
a6b4c5a9 | 41 | # Suppress smart makes who think they know how to automake yacc and flex file |
c6396a0b | 42 | .y.c: |
a6b4c5a9 | 43 | .l.c: |
c6396a0b | 44 | |
966842d4 | 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: | |
e79e977d | 51 | .SUFFIXES: .c .cc .o .po .pox .gmo |
966842d4 | 52 | |
53 | # ------------------------------- | |
54 | # Standard autoconf-set variables | |
55 | # ------------------------------- | |
56 | ||
4f442f07 | 57 | build=@build@ |
58 | host=@host@ | |
5788a324 | 59 | host_noncanonical=@host_noncanonical@ |
966842d4 | 60 | target=@target@ |
88a86c80 | 61 | target_noncanonical:=@target_noncanonical@ |
966842d4 | 62 | |
a3d93be3 | 63 | # Normally identical to target_noncanonical, except for compilers built |
64 | # as accelerator targets. | |
65 | real_target_noncanonical:=@real_target_noncanonical@ | |
66 | accel_dir_suffix = @accel_dir_suffix@ | |
67 | ||
966842d4 | 68 | # Sed command to transform gcc to installed name. |
88a86c80 | 69 | program_transform_name := @program_transform_name@ |
966842d4 | 70 | |
71 | # ----------------------------- | |
72 | # Directories used during build | |
73 | # ----------------------------- | |
74 | ||
75 | # Directory where sources are, from where we are. | |
76 | srcdir = @srcdir@ | |
77a85ce7 | 77 | gcc_docdir = @srcdir@/doc |
b5a57562 | 78 | |
79 | # Directory where sources are, absolute. | |
80 | abs_srcdir = @abs_srcdir@ | |
81 | abs_docdir = @abs_srcdir@/doc | |
15da80c1 | 82 | |
92827dbf | 83 | # Directory where sources are, relative to here. |
84 | top_srcdir = @top_srcdir@ | |
85 | ||
741b7726 | 86 | # Top build directory for this package, relative to here. |
87 | top_builddir = . | |
c7cc973b | 88 | |
794723c1 | 89 | # The absolute path to the current directory. |
90 | objdir := $(shell pwd) | |
966842d4 | 91 | |
c1eb9e31 | 92 | host_subdir=@host_subdir@ |
2b59cb05 | 93 | build_subdir=@build_subdir@ |
c7cc973b | 94 | target_subdir=@target_subdir@ |
3e427a9c | 95 | build_libsubdir=@build_libsubdir@ |
2b59cb05 | 96 | |
c7cc973b | 97 | # Top build directory for the "Cygnus tree", relative to $(top_builddir). |
c1eb9e31 | 98 | ifeq ($(host_subdir),.) |
c7cc973b | 99 | toplevel_builddir := .. |
c1eb9e31 | 100 | else |
c7cc973b | 101 | toplevel_builddir := ../.. |
c1eb9e31 | 102 | endif |
103 | ||
c7cc973b | 104 | build_objdir := $(toplevel_builddir)/$(build_subdir) |
105 | build_libobjdir := $(toplevel_builddir)/$(build_libsubdir) | |
106 | target_objdir := $(toplevel_builddir)/$(target_subdir) | |
107 | ||
089f59b9 | 108 | # -------- |
109 | # Defined vpaths | |
110 | # -------- | |
111 | ||
112 | # Directory where sources are, from where we are. | |
113 | VPATH = @srcdir@ | |
114 | ||
d3c27322 | 115 | # We define a vpath for the sources of the .texi files here because they |
089f59b9 | 116 | # are split between multiple directories and we would rather use one implicit |
117 | # pattern rule for everything. | |
118 | # This vpath could be extended within the Make-lang fragments. | |
119 | ||
097bd8a7 | 120 | vpath %.texi $(gcc_docdir) |
121 | vpath %.texi $(gcc_docdir)/include | |
089f59b9 | 122 | |
966842d4 | 123 | # -------- |
124 | # UNSORTED | |
125 | # -------- | |
126 | ||
a6ea4f19 | 127 | # Extra flags to pass to indicate cross compilation, which |
128 | # might be used or tested by Make-lang fragments. | |
129 | CROSS=@CROSS@ | |
130 | ||
32e6d418 | 131 | # Variables that exist for you to override. |
132 | # See below for how to change them for certain systems. | |
133 | ||
73027c94 | 134 | # List of language subdirectories. |
b809c9f2 | 135 | SUBDIRS =@subdirs@ build |
73027c94 | 136 | |
32e6d418 | 137 | # Selection of languages to be made. |
26526d23 | 138 | CONFIG_LANGUAGES = @all_selected_languages@ |
e76f6040 | 139 | LANGUAGES = c gcov$(exeext) gcov-dump$(exeext) gcov-tool$(exeext) \ |
140 | $(CONFIG_LANGUAGES) | |
32e6d418 | 141 | |
3bed0958 | 142 | # Default values for variables overridden in Makefile fragments. |
0355c121 | 143 | # CFLAGS is for the user to override to, e.g., do a cross build with -O2. |
f357ac87 | 144 | # TCFLAGS is used for compilations with the GCC just built. |
3bed0958 | 145 | # T_CFLAGS is used for all compilations and is overridden by t-* files. |
146 | T_CFLAGS = | |
f357ac87 | 147 | TCFLAGS = |
c81c13fb | 148 | CFLAGS = @CFLAGS@ |
7ab76cec | 149 | CXXFLAGS = @CXXFLAGS@ |
26526d23 | 150 | LDFLAGS = @LDFLAGS@ |
f357ac87 | 151 | |
2bd17377 | 152 | # Should we build position-independent host code? |
153 | PICFLAG = @PICFLAG@ | |
154 | ||
d5a37d75 | 155 | # Flags to determine code coverage. When coverage is disabled, this will |
156 | # contain the optimization flags, as you normally want code coverage | |
317ddc71 | 157 | # without optimization. |
d5a37d75 | 158 | COVERAGE_FLAGS = @coverage_flags@ |
b4d48d67 | 159 | coverageexts = .{gcda,gcno} |
d5a37d75 | 160 | |
e3ca137a | 161 | # The warning flags are separate from CFLAGS because people tend to |
b3ff31d3 | 162 | # override optimization flags and we'd like them to still have warnings |
163 | # turned on. These flags are also used to pass other stage dependent | |
164 | # flags from configure. The user is free to explicitly turn these flags | |
165 | # off if they wish. | |
f357ac87 | 166 | # LOOSE_WARN are the warning flags to use when compiling something |
ac242e0f | 167 | # which is only compiled with gcc, such as libgcc. |
7ab76cec | 168 | # C_LOOSE_WARN is similar, but with C-only warnings. |
e3ca137a | 169 | # STRICT_WARN are the additional warning flags to |
ac242e0f | 170 | # apply to the back end and some front ends, which may be compiled |
e3ca137a | 171 | # with other compilers. |
7ab76cec | 172 | # C_STRICT_WARN is similar, with C-only warnings. |
c7cc973b | 173 | LOOSE_WARN = @loose_warn@ |
7ab76cec | 174 | C_LOOSE_WARN = @c_loose_warn@ |
e3ca137a | 175 | STRICT_WARN = @strict_warn@ |
7ab76cec | 176 | C_STRICT_WARN = @c_strict_warn@ |
f357ac87 | 177 | |
0d74b24d | 178 | # This is set by --enable-checking. The idea is to catch forgotten |
179 | # "extern" tags in header files. | |
180 | NOCOMMON_FLAG = @nocommon_flag@ | |
181 | ||
7c801b60 | 182 | NOEXCEPTION_FLAGS = @noexception_flags@ |
183 | ||
605922af | 184 | ALIASING_FLAGS = @aliasing_flags@ |
185 | ||
17e2788d | 186 | # This is set by --disable-maintainer-mode (default) to "#" |
141d02d1 | 187 | # FIXME: 'MAINT' will always be set to an empty string, no matter if |
188 | # --disable-maintainer-mode is used or not. This is because the | |
189 | # following will expand to "MAINT := " in maintainer mode, and to | |
190 | # "MAINT := #" in non-maintainer mode, but because '#' starts a comment, | |
191 | # they mean exactly the same thing for make. | |
57eb42be | 192 | MAINT := @MAINT@ |
17e2788d | 193 | |
141d02d1 | 194 | # The following provides the variable ENABLE_MAINTAINER_RULES that can |
195 | # be used in language Make-lang.in makefile fragments to enable | |
196 | # maintainer rules. So, ENABLE_MAINTAINER_RULES is 'true' in | |
197 | # maintainer mode, and '' otherwise. | |
198 | @MAINT@ ENABLE_MAINTAINER_RULES = true | |
199 | ||
0fa54ff1 | 200 | # These are set by --enable-checking=valgrind. |
201 | RUN_GEN = @valgrind_command@ | |
202 | VALGRIND_DRIVER_DEFINES = @valgrind_path_defines@ | |
203 | ||
f357ac87 | 204 | # This is how we control whether or not the additional warnings are applied. |
205 | .-warn = $(STRICT_WARN) | |
26222a19 | 206 | build-warn = $(STRICT_WARN) |
7ab76cec | 207 | GCC_WARN_CFLAGS = $(LOOSE_WARN) $(C_LOOSE_WARN) $($(@D)-warn) $(if $(filter-out $(STRICT_WARN),$($(@D)-warn)),,$(C_STRICT_WARN)) $(NOCOMMON_FLAG) $($@-warn) |
3ff34605 | 208 | GCC_WARN_CXXFLAGS = $(LOOSE_WARN) $($(@D)-warn) $(NOCOMMON_FLAG) $($@-warn) |
a179eb24 | 209 | |
1d752508 | 210 | # These files are to have specific diagnostics suppressed, or are not to |
211 | # be subject to -Werror: | |
5125036e | 212 | # flex output may yield harmless "no previous prototype" warnings |
11ce2c7a | 213 | build/gengtype-lex.o-warn = -Wno-error |
6d70c713 | 214 | gengtype-lex.o-warn = -Wno-error |
e76f6040 | 215 | libgcov-util.o-warn = -Wno-error |
216 | libgcov-driver-tool.o-warn = -Wno-error | |
217 | libgcov-merge-tool.o-warn = -Wno-error | |
9acb8552 | 218 | gimple-match.o-warn = -Wno-unused |
219 | generic-match.o-warn = -Wno-unused | |
e8a68f8c | 220 | dfp.o-warn = -Wno-strict-aliasing |
f357ac87 | 221 | |
222 | # All warnings have to be shut off in stage1 if the compiler used then | |
223 | # isn't gcc; configure determines that. WARN_CFLAGS will be either | |
7ab76cec | 224 | # $(GCC_WARN_CFLAGS), or nothing. Similarly, WARN_CXXFLAGS will be |
225 | # either $(GCC_WARN_CXXFLAGS), or nothing. | |
f357ac87 | 226 | WARN_CFLAGS = @warn_cflags@ |
7ab76cec | 227 | WARN_CXXFLAGS = @warn_cxxflags@ |
f357ac87 | 228 | |
37343e91 | 229 | CPPFLAGS = @CPPFLAGS@ |
230 | ||
be2828ce | 231 | AWK = @AWK@ |
38bce124 | 232 | CC = @CC@ |
7ab76cec | 233 | CXX = @CXX@ |
345a1501 | 234 | BISON = @BISON@ |
3f1608f3 | 235 | BISONFLAGS = |
345a1501 | 236 | FLEX = @FLEX@ |
237 | FLEXFLAGS = | |
6ac26439 | 238 | AR = @AR@ |
32e6d418 | 239 | AR_FLAGS = rc |
6ac26439 | 240 | NM = @NM@ |
8c74272d | 241 | RANLIB = @RANLIB@ |
72318bfa | 242 | RANLIB_FLAGS = @ranlib_flags@ |
966842d4 | 243 | |
d6dfe18a | 244 | # Libraries to use on the host. |
245 | HOST_LIBS = @HOST_LIBS@ | |
246 | ||
7ab76cec | 247 | # The name of the compiler to use. |
7ab76cec | 248 | COMPILER = $(CXX) |
249 | COMPILER_FLAGS = $(CXXFLAGS) | |
d6dfe18a | 250 | # If HOST_LIBS is set, then the user is controlling the libraries to |
251 | # link against. In that case, link with $(CC) so that the -lstdc++ | |
252 | # library is not introduced. If HOST_LIBS is not set, link with | |
253 | # $(CXX) to pick up -lstdc++. | |
254 | ifeq ($(HOST_LIBS),) | |
7ab76cec | 255 | LINKER = $(CXX) |
256 | LINKER_FLAGS = $(CXXFLAGS) | |
d6dfe18a | 257 | else |
258 | LINKER = $(CC) | |
259 | LINKER_FLAGS = $(CFLAGS) | |
260 | endif | |
585d4848 | 261 | |
571e5fe1 | 262 | NO_PIE_CFLAGS = @NO_PIE_CFLAGS@ |
263 | NO_PIE_FLAG = @NO_PIE_FLAG@ | |
264 | ||
e9abca4f | 265 | # We don't want to compile the compilers with -fPIE, it make PCH fail. |
571e5fe1 | 266 | COMPILER += $(NO_PIE_CFLAGS) |
e9abca4f | 267 | |
268 | # Link with -no-pie since we compile the compiler with -fno-PIE. | |
571e5fe1 | 269 | LINKER += $(NO_PIE_FLAG) |
e9abca4f | 270 | |
be5f9e46 | 271 | # Like LINKER, but use a mutex for serializing front end links. |
272 | ifeq (@DO_LINK_MUTEX@,true) | |
273 | LLINKER = $(SHELL) $(srcdir)/lock-and-run.sh linkfe.lck $(LINKER) | |
274 | else | |
275 | LLINKER = $(LINKER) | |
276 | endif | |
277 | ||
655e3fb1 | 278 | THIN_ARCHIVE_SUPPORT = @thin_archive_support@ |
279 | ||
280 | USE_THIN_ARCHIVES = no | |
281 | ifeq ($(THIN_ARCHIVE_SUPPORT),yes) | |
282 | ifeq ($(AR_FLAGS),rc) | |
283 | ifeq ($(RANLIB_FLAGS),) | |
284 | USE_THIN_ARCHIVES = yes | |
285 | endif | |
286 | endif | |
287 | endif | |
288 | ||
966842d4 | 289 | # ------------------------------------------- |
290 | # Programs which operate on the build machine | |
291 | # ------------------------------------------- | |
292 | ||
89dc5e05 | 293 | SHELL = @SHELL@ |
3354d061 | 294 | # pwd command to use. Allow user to override default by setting PWDCMD in |
295 | # the environment to account for automounters. The make variable must not | |
296 | # be called PWDCMD, otherwise the value set here is passed to make | |
297 | # subprocesses and overrides the setting from the user's environment. | |
7a8ca04a | 298 | # Don't use PWD since it is a common shell environment variable and we |
299 | # don't want to corrupt it. | |
300 | PWD_COMMAND = $${PWDCMD-pwd} | |
32e6d418 | 301 | # on sysV, define this as cp. |
87c0ad1b | 302 | INSTALL = @INSTALL@ |
ea4a6c81 | 303 | # Some systems may be missing symbolic links, regular links, or both. |
304 | # Allow configure to check this and use "ln -s", "ln", or "cp" as appropriate. | |
305 | LN=@LN@ | |
306 | LN_S=@LN_S@ | |
32e6d418 | 307 | # These permit overriding just for certain files. |
74086405 | 308 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
309 | INSTALL_DATA = @INSTALL_DATA@ | |
4da7cd36 | 310 | INSTALL_SCRIPT = @INSTALL@ |
2b7a4d59 | 311 | install_sh = $(SHELL) $(srcdir)/../install-sh |
312 | INSTALL_STRIP_PROGRAM = $(install_sh) -c -s | |
049ccec1 | 313 | MAKEINFO = @MAKEINFO@ |
ca6eabd1 | 314 | MAKEINFOFLAGS = --no-split |
f345940f | 315 | TEXI2DVI = texi2dvi |
51f93521 | 316 | TEXI2PDF = texi2pdf |
61a98835 | 317 | TEXI2HTML = $(MAKEINFO) --html |
fefb5ea6 | 318 | TEXI2POD = perl $(srcdir)/../contrib/texi2pod.pl |
bd5ac53b | 319 | POD2MAN = pod2man --center="GNU" --release="gcc-$(version)" --date=$(shell sed 's/\(....\)\(..\)\(..\)/\1-\2-\3/' <$(DATESTAMP)) |
8a34c73b | 320 | # Some versions of `touch' (such as the version on Solaris 2.8) |
5ec97d31 | 321 | # do not correctly set the timestamp due to buggy versions of `utime' |
8a34c73b | 322 | # in the kernel. So, we use `echo' instead. |
5ec97d31 | 323 | STAMP = echo timestamp > |
d45cdac2 | 324 | # If necessary (e.g., when using the MSYS shell on Microsoft Windows) |
325 | # translate the shell's notion of absolute pathnames to the native | |
326 | # spelling. | |
fbf9447e | 327 | build_file_translate = @build_file_translate@ |
5ec97d31 | 328 | |
966842d4 | 329 | # Make sure the $(MAKE) variable is defined. |
330 | @SET_MAKE@ | |
331 | ||
ca08f0d3 | 332 | # Locate mkinstalldirs. |
333 | mkinstalldirs=$(SHELL) $(srcdir)/../mkinstalldirs | |
334 | ||
bdaa15c6 | 335 | # write_entries_to_file - writes each entry in a list |
336 | # to the specified file. Entries are written in chunks of | |
9d75589a | 337 | # $(write_entries_to_file_split) to accommodate systems with |
bdaa15c6 | 338 | # severe command-line-length limitations. |
339 | # Parameters: | |
340 | # $(1): variable containing entries to iterate over | |
341 | # $(2): output file | |
342 | write_entries_to_file_split = 50 | |
343 | write_entries_to_file = $(shell rm -f $(2) || :) $(shell touch $(2)) \ | |
344 | $(foreach range, \ | |
345 | $(shell i=1; while test $$i -le $(words $(1)); do \ | |
346 | echo $$i; i=`expr $$i + $(write_entries_to_file_split)`; done), \ | |
fd4a16cd | 347 | $(shell echo "$(wordlist $(range), \ |
348 | $(shell expr $(range) + $(write_entries_to_file_split) - 1), $(1))" \ | |
f5763863 | 349 | | tr ' ' '\012' >> $(2))) |
bdaa15c6 | 350 | |
863e76f9 | 351 | # The jit documentation looks better if built with sphinx, but can be |
352 | # built with texinfo if sphinx is not available. | |
353 | # configure sets "doc_build_sys" to "sphinx" or "texinfo" accordingly | |
354 | doc_build_sys=@doc_build_sys@ | |
355 | ||
966842d4 | 356 | # -------- |
357 | # UNSORTED | |
358 | # -------- | |
359 | ||
b8bd120b | 360 | # Dependency tracking stuff. |
b0e45289 | 361 | CXXDEPMODE = @CXXDEPMODE@ |
b8bd120b | 362 | DEPDIR = @DEPDIR@ |
363 | depcomp = $(SHELL) $(srcdir)/../depcomp | |
364 | ||
e7c8aa66 | 365 | # In the past we used AC_PROG_CC_C_O and set this properly, but |
366 | # it was discovered that this hadn't worked in a long time, so now | |
367 | # we just hard-code. | |
368 | OUTPUT_OPTION = -o $@ | |
966842d4 | 369 | |
f357ac87 | 370 | # This is where we get zlib from. zlibdir is -L../zlib and zlibinc is |
371 | # -I../zlib, unless we were configured with --with-system-zlib, in which | |
372 | # case both are empty. | |
373 | ZLIB = @zlibdir@ -lz | |
374 | ZLIBINC = @zlibinc@ | |
32e6d418 | 375 | |
4ee9c684 | 376 | # How to find GMP |
377 | GMPLIBS = @GMPLIBS@ | |
378 | GMPINC = @GMPINC@ | |
379 | ||
71130ef8 | 380 | # How to find isl. |
429cca51 | 381 | ISLLIBS = @ISLLIBS@ |
87e20041 | 382 | ISLINC = @ISLINC@ |
255b6be7 | 383 | |
7bfefa9d | 384 | # Set to 'yes' if the LTO front end is enabled. |
385 | enable_lto = @enable_lto@ | |
386 | ||
5299ef9d | 387 | # Compiler and flags needed for plugin support |
5299ef9d | 388 | PLUGINCC = @CXX@ |
389 | PLUGINCFLAGS = @CXXFLAGS@ | |
9d58ff65 | 390 | |
391 | # Libs and linker options needed for plugin support | |
9227b6fc | 392 | PLUGINLIBS = @pluginlibs@ |
393 | ||
912f2b18 | 394 | enable_plugin = @enable_plugin@ |
395 | ||
2bd17377 | 396 | enable_host_shared = @enable_host_shared@ |
397 | ||
a3d93be3 | 398 | enable_as_accelerator = @enable_as_accelerator@ |
399 | ||
3824453e | 400 | CPPLIB = ../libcpp/libcpp.a |
d856c8a6 | 401 | CPPINC = -I$(srcdir)/../libcpp/include |
402 | ||
3c28f41a | 403 | # Where to find decNumber |
10de71e1 | 404 | enable_decimal_float = @enable_decimal_float@ |
3c28f41a | 405 | DECNUM = $(srcdir)/../libdecnumber |
10de71e1 | 406 | DECNUMFMT = $(srcdir)/../libdecnumber/$(enable_decimal_float) |
407 | DECNUMINC = -I$(DECNUM) -I$(DECNUMFMT) -I../libdecnumber | |
3c28f41a | 408 | LIBDECNUMBER = ../libdecnumber/libdecnumber.a |
409 | ||
3f425711 | 410 | # The backtrace library. |
411 | BACKTRACE = $(srcdir)/../libbacktrace | |
412 | BACKTRACEINC = -I$(BACKTRACE) | |
413 | LIBBACKTRACE = ../libbacktrace/.libs/libbacktrace.a | |
414 | ||
2cfd79fe | 415 | # Target to use when installing include directory. Either |
ffe38693 | 416 | # install-headers-tar, install-headers-cpio or install-headers-cp. |
87c0ad1b | 417 | INSTALL_HEADERS_DIR = @build_install_headers_dir@ |
2cfd79fe | 418 | |
c8763215 | 419 | # Header files that are made available under the same name |
420 | # to programs compiled with GCC. | |
2675096e | 421 | USER_H = $(srcdir)/ginclude/float.h \ |
f3dde807 | 422 | $(srcdir)/ginclude/iso646.h \ |
423 | $(srcdir)/ginclude/stdarg.h \ | |
424 | $(srcdir)/ginclude/stdbool.h \ | |
425 | $(srcdir)/ginclude/stddef.h \ | |
426 | $(srcdir)/ginclude/varargs.h \ | |
68a556d6 | 427 | $(srcdir)/ginclude/stdfix.h \ |
985c6e3a | 428 | $(srcdir)/ginclude/stdnoreturn.h \ |
83e25171 | 429 | $(srcdir)/ginclude/stdalign.h \ |
0fadac62 | 430 | $(srcdir)/ginclude/stdatomic.h \ |
f3dde807 | 431 | $(EXTRA_HEADERS) |
c8763215 | 432 | |
ac0366be | 433 | USER_H_INC_NEXT_PRE = @user_headers_inc_next_pre@ |
434 | USER_H_INC_NEXT_POST = @user_headers_inc_next_post@ | |
435 | ||
894a47b4 | 436 | # The GCC to use for compiling crt*.o. |
b3781cc4 | 437 | # Usually the one we just built. |
894a47b4 | 438 | # Don't use this as a dependency--use $(GCC_PASSES). |
805e22b2 | 439 | GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include -L$(objdir)/../ld |
32e6d418 | 440 | |
224d9f3d | 441 | # Set if the compiler was configured with --with-build-sysroot. |
442 | SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@ | |
443 | ||
32e6d418 | 444 | # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET. |
794723c1 | 445 | # It specifies -B./. |
d23f832c | 446 | # It also specifies -isystem ./include to find, e.g., stddef.h. |
7ab76cec | 447 | GCC_CFLAGS=$(CFLAGS_FOR_TARGET) $(INTERNAL_CFLAGS) $(T_CFLAGS) $(LOOSE_WARN) $(C_LOOSE_WARN) -Wold-style-definition $($@-warn) -isystem ./include $(TCFLAGS) |
32e6d418 | 448 | |
966842d4 | 449 | # --------------------------------------------------- |
450 | # Programs which produce files for the target machine | |
451 | # --------------------------------------------------- | |
fbc57885 | 452 | |
50088060 | 453 | AR_FOR_TARGET := $(shell \ |
fbc57885 | 454 | if [ -f $(objdir)/../binutils/ar ] ; then \ |
455 | echo $(objdir)/../binutils/ar ; \ | |
456 | else \ | |
4f442f07 | 457 | if [ "$(host)" = "$(target)" ] ; then \ |
6ac26439 | 458 | echo $(AR); \ |
fbc57885 | 459 | else \ |
2b7a4d59 | 460 | t='$(program_transform_name)'; echo ar | sed -e "$$t" ; \ |
fbc57885 | 461 | fi; \ |
50088060 | 462 | fi) |
8a34c73b | 463 | AR_FLAGS_FOR_TARGET = |
aa787722 | 464 | AR_CREATE_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) rc |
465 | AR_EXTRACT_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) x | |
80556f23 | 466 | LIPO_FOR_TARGET = lipo |
f32e3360 | 467 | ORIGINAL_AS_FOR_TARGET = @ORIGINAL_AS_FOR_TARGET@ |
50088060 | 468 | RANLIB_FOR_TARGET := $(shell \ |
fbc57885 | 469 | if [ -f $(objdir)/../binutils/ranlib ] ; then \ |
470 | echo $(objdir)/../binutils/ranlib ; \ | |
471 | else \ | |
4f442f07 | 472 | if [ "$(host)" = "$(target)" ] ; then \ |
6d7e356a | 473 | echo $(RANLIB); \ |
fbc57885 | 474 | else \ |
2b7a4d59 | 475 | t='$(program_transform_name)'; echo ranlib | sed -e "$$t" ; \ |
fbc57885 | 476 | fi; \ |
50088060 | 477 | fi) |
f32e3360 | 478 | ORIGINAL_LD_FOR_TARGET = @ORIGINAL_LD_FOR_TARGET@ |
479 | ORIGINAL_NM_FOR_TARGET = @ORIGINAL_NM_FOR_TARGET@ | |
480 | NM_FOR_TARGET = ./nm | |
80556f23 | 481 | STRIP_FOR_TARGET := $(shell \ |
2b7a4d59 | 482 | if [ -f $(objdir)/../binutils/strip-new ] ; then \ |
483 | echo $(objdir)/../binutils/strip-new ; \ | |
80556f23 | 484 | else \ |
485 | if [ "$(host)" = "$(target)" ] ; then \ | |
486 | echo strip; \ | |
487 | else \ | |
2b7a4d59 | 488 | t='$(program_transform_name)'; echo strip | sed -e "$$t" ; \ |
80556f23 | 489 | fi; \ |
490 | fi) | |
fbc57885 | 491 | |
966842d4 | 492 | # -------- |
493 | # UNSORTED | |
494 | # -------- | |
495 | ||
8a5b87ad | 496 | # Where to find some libiberty headers. |
497 | HASHTAB_H = $(srcdir)/../include/hashtab.h | |
21886706 | 498 | OBSTACK_H = $(srcdir)/../include/obstack.h |
bb96e316 | 499 | SPLAY_TREE_H= $(srcdir)/../include/splay-tree.h |
21886706 | 500 | MD5_H = $(srcdir)/../include/md5.h |
eb3dd80d | 501 | XREGEX_H = $(srcdir)/../include/xregex.h |
2334f0df | 502 | FNMATCH_H = $(srcdir)/../include/fnmatch.h |
8a5b87ad | 503 | |
7bfefa9d | 504 | # Linker plugin API headers |
505 | LINKER_PLUGIN_API_H = $(srcdir)/../include/plugin-api.h | |
7bfefa9d | 506 | |
0fc07c25 | 507 | # Default native SYSTEM_HEADER_DIR, to be overridden by targets. |
638454a1 | 508 | NATIVE_SYSTEM_HEADER_DIR = @NATIVE_SYSTEM_HEADER_DIR@ |
397f1574 | 509 | # Default cross SYSTEM_HEADER_DIR, to be overridden by targets. |
805e22b2 | 510 | CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@ |
397f1574 | 511 | |
0fc07c25 | 512 | # autoconf sets SYSTEM_HEADER_DIR to one of the above. |
9d75589a | 513 | # Purge it of unnecessary internal relative paths |
4a62cbb1 | 514 | # to directories that might not exist yet. |
515 | # The sed idiom for this is to repeat the search-and-replace until it doesn't match, using :a ... ta. | |
01916651 | 516 | # Use single quotes here to avoid nested double- and backquotes, this |
517 | # macro is also used in a double-quoted context. | |
518 | SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta` | |
0fc07c25 | 519 | |
1f87fb84 | 520 | # Path to the system headers on the build machine. |
521 | BUILD_SYSTEM_HEADER_DIR = `echo @BUILD_SYSTEM_HEADER_DIR@ | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta` | |
522 | ||
f2397fc4 | 523 | # Control whether to run fixincludes. |
280d5c1a | 524 | STMP_FIXINC = @STMP_FIXINC@ |
a5889b74 | 525 | |
0848b369 | 526 | # Test to see whether <limits.h> exists in the system header files. |
1f87fb84 | 527 | LIMITS_H_TEST = [ -f $(BUILD_SYSTEM_HEADER_DIR)/limits.h ] |
0848b369 | 528 | |
805e22b2 | 529 | # Directory for prefix to system directories, for |
530 | # each of $(system_prefix)/usr/include, $(system_prefix)/usr/lib, etc. | |
531 | TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@ | |
1a035bcc | 532 | TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@ |
805e22b2 | 533 | |
a455468e | 534 | xmake_file=@xmake_file@ |
535 | tmake_file=@tmake_file@ | |
f555bf81 | 536 | TM_ENDIAN_CONFIG=@TM_ENDIAN_CONFIG@ |
537 | TM_MULTILIB_CONFIG=@TM_MULTILIB_CONFIG@ | |
538 | TM_MULTILIB_EXCEPTIONS_CONFIG=@TM_MULTILIB_EXCEPTIONS_CONFIG@ | |
87c0ad1b | 539 | out_file=$(srcdir)/config/@out_file@ |
540 | out_object_file=@out_object_file@ | |
3e87b980 | 541 | common_out_file=$(srcdir)/common/config/@common_out_file@ |
542 | common_out_object_file=@common_out_object_file@ | |
69449463 | 543 | md_file=$(srcdir)/common.md $(srcdir)/config/@md_file@ |
805e22b2 | 544 | tm_file_list=@tm_file_list@ |
4dcab8b7 | 545 | tm_include_list=@tm_include_list@ |
8d4f8d46 | 546 | tm_defines=@tm_defines@ |
83b8e55b | 547 | tm_p_file_list=@tm_p_file_list@ |
4dcab8b7 | 548 | tm_p_include_list=@tm_p_include_list@ |
83b8e55b | 549 | build_xm_file_list=@build_xm_file_list@ |
4dcab8b7 | 550 | build_xm_include_list=@build_xm_include_list@ |
83b8e55b | 551 | build_xm_defines=@build_xm_defines@ |
552 | host_xm_file_list=@host_xm_file_list@ | |
4dcab8b7 | 553 | host_xm_include_list=@host_xm_include_list@ |
83b8e55b | 554 | host_xm_defines=@host_xm_defines@ |
4dcab8b7 | 555 | xm_file_list=@xm_file_list@ |
556 | xm_include_list=@xm_include_list@ | |
8b24e546 | 557 | xm_defines=@xm_defines@ |
e53d55e7 | 558 | lang_checks= |
559 | lang_checks_parallelized= | |
7bedc3a0 | 560 | lang_opt_files=@lang_opt_files@ $(srcdir)/c-family/c.opt $(srcdir)/common.opt |
87c0ad1b | 561 | lang_specs_files=@lang_specs_files@ |
c3cc26e1 | 562 | lang_tree_files=@lang_tree_files@ |
83b8e55b | 563 | target_cpu_default=@target_cpu_default@ |
5c872430 | 564 | OBJC_BOEHM_GC=@objc_boehm_gc@ |
47a2c1d4 | 565 | extra_modes_file=@extra_modes_file@ |
ff05e09e | 566 | extra_opt_files=@extra_opt_files@ |
b197fbcf | 567 | host_hook_obj=@out_host_hook_obj@ |
32e6d418 | 568 | |
77adc39e | 569 | # Multiarch support |
570 | enable_multiarch = @enable_multiarch@ | |
af69b10a | 571 | with_cpu = @with_cpu@ |
77adc39e | 572 | with_float = @with_float@ |
573 | ifeq ($(enable_multiarch),yes) | |
574 | if_multiarch = $(1) | |
77adc39e | 575 | else |
91cf035d | 576 | ifeq ($(enable_multiarch),auto) |
577 | # SYSTEM_HEADER_DIR is makefile syntax, cannot be evaluated in configure.ac | |
1f87fb84 | 578 | if_multiarch = $(if $(wildcard $(shell echo $(BUILD_SYSTEM_HEADER_DIR))/../../usr/lib/*/crti.o),$(1)) |
91cf035d | 579 | else |
580 | if_multiarch = | |
581 | endif | |
77adc39e | 582 | endif |
583 | ||
966842d4 | 584 | # ------------------------ |
585 | # Installation directories | |
586 | # ------------------------ | |
587 | ||
32e6d418 | 588 | # Common prefix for installation directories. |
589 | # NOTE: This directory must exist when you start installation. | |
87c0ad1b | 590 | prefix = @prefix@ |
2ffdcadf | 591 | # Directory in which to put localized header files. On the systems with |
592 | # gcc as the native cc, `local_prefix' may not be `prefix' which is | |
593 | # `/usr'. | |
a2aa0fc1 | 594 | # NOTE: local_prefix *should not* default from prefix. |
87c0ad1b | 595 | local_prefix = @local_prefix@ |
c6396a0b | 596 | # Directory in which to put host dependent programs and libraries |
87c0ad1b | 597 | exec_prefix = @exec_prefix@ |
32e6d418 | 598 | # Directory in which to put the executable for the command `gcc' |
87c0ad1b | 599 | bindir = @bindir@ |
32e6d418 | 600 | # Directory in which to put the directories used by the compiler. |
87c0ad1b | 601 | libdir = @libdir@ |
9db45a87 | 602 | # Directory in which GCC puts its executables. |
603 | libexecdir = @libexecdir@ | |
966842d4 | 604 | |
605 | # -------- | |
606 | # UNSORTED | |
607 | # -------- | |
608 | ||
9db45a87 | 609 | # Directory in which the compiler finds libraries etc. |
a3d93be3 | 610 | libsubdir = $(libdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix) |
9db45a87 | 611 | # Directory in which the compiler finds executables |
a3d93be3 | 612 | libexecsubdir = $(libexecdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix) |
6d70c713 | 613 | # Directory in which all plugin resources are installed |
614 | plugin_resourcesdir = $(libsubdir)/plugin | |
615 | # Directory in which plugin headers are installed | |
616 | plugin_includedir = $(plugin_resourcesdir)/include | |
617 | # Directory in which plugin specific executables are installed | |
618 | plugin_bindir = $(libexecsubdir)/plugin | |
40cb25f2 | 619 | # Used to produce a relative $(gcc_tooldir) in gcc.o |
a3d93be3 | 620 | ifeq ($(enable_as_accelerator),yes) |
621 | unlibsubdir = ../../../../.. | |
622 | else | |
8099945b | 623 | unlibsubdir = ../../.. |
a3d93be3 | 624 | endif |
fc5f9e0c | 625 | # $(prefix), expressed as a path relative to $(libsubdir). |
626 | # | |
627 | # An explanation of the sed strings: | |
628 | # -e 's|^$(prefix)||' matches and eliminates 'prefix' from 'exec_prefix' | |
629 | # -e 's|/$$||' match a trailing forward slash and eliminates it | |
630 | # -e 's|^[^/]|/|' forces the string to start with a forward slash (*) | |
631 | # -e 's|/[^/]*|../|g' replaces each occurrence of /<directory> with ../ | |
632 | # | |
633 | # (*) Note this pattern overwrites the first character of the string | |
634 | # with a forward slash if one is not already present. This is not a | |
635 | # problem because the exact names of the sub-directories concerned is | |
636 | # unimportant, just the number of them matters. | |
637 | # | |
638 | # The practical upshot of these patterns is like this: | |
639 | # | |
640 | # prefix exec_prefix result | |
641 | # ------ ----------- ------ | |
642 | # /foo /foo/bar ../ | |
643 | # /foo/ /foo/bar ../ | |
644 | # /foo /foo/bar/ ../ | |
645 | # /foo/ /foo/bar/ ../ | |
646 | # /foo /foo/bar/ugg ../../ | |
647 | libsubdir_to_prefix := \ | |
648 | $(unlibsubdir)/$(shell echo "$(libdir)" | \ | |
649 | sed -e 's|^$(prefix)||' -e 's|/$$||' -e 's|^[^/]|/|' \ | |
650 | -e 's|/[^/]*|../|g') | |
651 | # $(exec_prefix), expressed as a path relative to $(prefix). | |
652 | prefix_to_exec_prefix := \ | |
653 | $(shell echo "$(exec_prefix)" | \ | |
654 | sed -e 's|^$(prefix)||' -e 's|^/||' -e '/./s|$$|/|') | |
f22b529a | 655 | # Directory in which to find other cross-compilation tools and headers. |
066520ea | 656 | dollar = @dollar@ |
f22b529a | 657 | # Used in install-cross. |
658 | gcc_tooldir = @gcc_tooldir@ | |
976ceec9 | 659 | # Since gcc_tooldir does not exist at build-time, use -B$(build_tooldir)/bin/ |
d58156a1 | 660 | build_tooldir = $(exec_prefix)/$(target_noncanonical) |
e23b9583 | 661 | # Directory in which the compiler finds target-independent g++ includes. |
662 | gcc_gxx_include_dir = @gcc_gxx_include_dir@ | |
36ddd5fe | 663 | gcc_gxx_include_dir_add_sysroot = @gcc_gxx_include_dir_add_sysroot@ |
35df828f | 664 | # Directory to search for site-specific includes. |
759d75c3 | 665 | local_includedir = $(local_prefix)/include |
666 | includedir = $(prefix)/include | |
a2aa0fc1 | 667 | # where the info files go |
87c0ad1b | 668 | infodir = @infodir@ |
3e2f90b9 | 669 | # Where cpp should go besides $prefix/bin if necessary |
670 | cpp_install_dir = @cpp_install_dir@ | |
be2828ce | 671 | # where the locale files go |
eb718689 | 672 | datadir = @datadir@ |
be2828ce | 673 | localedir = $(datadir)/locale |
32e6d418 | 674 | # Extension (if any) to put in installed man-page filename. |
7a16ce2c | 675 | man1ext = .1 |
676 | man7ext = .7 | |
f403cbcb | 677 | objext = .o |
2aa3e87b | 678 | exeext = @host_exeext@ |
679 | build_exeext = @build_exeext@ | |
f403cbcb | 680 | |
32e6d418 | 681 | # Directory in which to put man pages. |
3cf6a465 | 682 | mandir = @mandir@ |
683 | man1dir = $(mandir)/man1 | |
7a16ce2c | 684 | man7dir = $(mandir)/man7 |
f32abccb | 685 | # Dir for temp files. |
686 | tmpdir = /tmp | |
32e6d418 | 687 | |
85690e4d | 688 | datarootdir = @datarootdir@ |
689 | docdir = @docdir@ | |
18f327f7 | 690 | # Directory in which to build HTML |
85690e4d | 691 | build_htmldir = $(objdir)/HTML/gcc-$(version) |
61a98835 | 692 | # Directory in which to put HTML |
85690e4d | 693 | htmldir = @htmldir@ |
61a98835 | 694 | |
be2828ce | 695 | # Whether we were configured with NLS. |
696 | USE_NLS = @USE_NLS@ | |
697 | ||
698 | # Internationalization library. | |
c6976b58 | 699 | LIBINTL = @LIBINTL@ |
700 | LIBINTL_DEP = @LIBINTL_DEP@ | |
be2828ce | 701 | |
39000f9a | 702 | # Character encoding conversion library. |
703 | LIBICONV = @LIBICONV@ | |
c6976b58 | 704 | LIBICONV_DEP = @LIBICONV_DEP@ |
39000f9a | 705 | |
05513b45 | 706 | # If a supplementary library is being used for the GC. |
707 | GGC_LIB= | |
708 | ||
a99be165 | 709 | # "true" if the target C library headers are unavailable; "false" |
710 | # otherwise. | |
711 | inhibit_libc = @inhibit_libc@ | |
712 | ifeq ($(inhibit_libc),true) | |
713 | INHIBIT_LIBC_CFLAGS = -Dinhibit_libc | |
714 | endif | |
715 | ||
32e6d418 | 716 | # List of extra executables that should be compiled for this target machine |
7151decb | 717 | # that are used when linking. |
32e6d418 | 718 | # The rules for compiling them should be in the t-* file for the machine. |
87c0ad1b | 719 | EXTRA_PROGRAMS = @extra_programs@ |
c6396a0b | 720 | |
c6396a0b | 721 | # List of extra object files that should be compiled and linked with |
722 | # compiler proper (cc1, cc1obj, cc1plus). | |
87c0ad1b | 723 | EXTRA_OBJS = @extra_objs@ |
c6396a0b | 724 | |
17108b2b | 725 | # List of extra object files that should be compiled and linked with |
726 | # the gcc driver. | |
69eb04f7 | 727 | EXTRA_GCC_OBJS =@extra_gcc_objs@ |
17108b2b | 728 | |
76fd9e61 | 729 | # List of extra libraries that should be linked with the gcc driver. |
730 | EXTRA_GCC_LIBS = @EXTRA_GCC_LIBS@ | |
731 | ||
630c76ba | 732 | # List of additional header files to install. |
87c0ad1b | 733 | EXTRA_HEADERS =@extra_headers_list@ |
630c76ba | 734 | |
f3449a3c | 735 | # How to handle <stdint.h>. |
736 | USE_GCC_STDINT = @use_gcc_stdint@ | |
737 | ||
e08c7853 | 738 | # The configure script will set this to collect2$(exeext), except on a |
739 | # (non-Unix) host which can not build collect2, for which it will be | |
740 | # set to empty. | |
741 | COLLECT2 = @collect2@ | |
79f818d0 | 742 | |
32e6d418 | 743 | # Program to convert libraries. |
c6221df9 | 744 | LIBCONVERT = |
32e6d418 | 745 | |
746 | # Control whether header files are installed. | |
336ff1b3 | 747 | INSTALL_HEADERS=install-headers install-mkheaders |
32e6d418 | 748 | |
049ccec1 | 749 | # Control whether Info documentation is built and installed. |
750 | BUILD_INFO = @BUILD_INFO@ | |
049ccec1 | 751 | |
fefb5ea6 | 752 | # Control whether manpages generated by texi2pod.pl can be rebuilt. |
753 | GENERATED_MANPAGES = @GENERATED_MANPAGES@ | |
754 | ||
106a27e5 | 755 | # Additional directories of header files to run fixincludes on. |
af731fc2 | 756 | # These should be directories searched automatically by default |
757 | # just as /usr/include is. | |
c6221df9 | 758 | # *Do not* use this for directories that happen to contain |
af731fc2 | 759 | # header files, but are not searched automatically by default. |
106a27e5 | 760 | # On most systems, this is empty. |
761 | OTHER_FIXINCLUDES_DIRS= | |
762 | ||
fc0b8ef8 | 763 | # A list of all the language-specific executables. |
e53d55e7 | 764 | COMPILERS = @all_compilers@ |
fc0b8ef8 | 765 | |
77a164d8 | 766 | # List of things which should already be built whenever we try to use xgcc |
32e6d418 | 767 | # to compile anything (without linking). |
e53d55e7 | 768 | GCC_PASSES=xgcc$(exeext) specs |
32e6d418 | 769 | |
32e6d418 | 770 | # Directory to link to, when using the target `maketest'. |
771 | DIR = ../gcc | |
772 | ||
0fc07c25 | 773 | # Native compiler for the build machine and its switches. |
58933515 | 774 | CC_FOR_BUILD = @CC_FOR_BUILD@ |
a44c8c3b | 775 | CXX_FOR_BUILD = @CXX_FOR_BUILD@ |
571e5fe1 | 776 | NO_PIE_CFLAGS_FOR_BUILD = @NO_PIE_CFLAGS_FOR_BUILD@ |
777 | NO_PIE_FLAG_FOR_BUILD = @NO_PIE_FLAG_FOR_BUILD@ | |
805e22b2 | 778 | BUILD_CFLAGS= @BUILD_CFLAGS@ -DGENERATOR_FILE |
a44c8c3b | 779 | BUILD_CXXFLAGS = @BUILD_CXXFLAGS@ -DGENERATOR_FILE |
571e5fe1 | 780 | BUILD_NO_PIE_CFLAGS = @BUILD_NO_PIE_CFLAGS@ |
781 | BUILD_CFLAGS += $(BUILD_NO_PIE_CFLAGS) | |
782 | BUILD_CXXFLAGS += $(BUILD_NO_PIE_CFLAGS) | |
0fc07c25 | 783 | |
585d4848 | 784 | # Native compiler that we use. This may be C++ some day. |
a44c8c3b | 785 | COMPILER_FOR_BUILD = $(CXX_FOR_BUILD) |
786 | BUILD_COMPILERFLAGS = $(BUILD_CXXFLAGS) | |
585d4848 | 787 | |
40b6e20e | 788 | # Native linker that we use. |
a44c8c3b | 789 | LINKER_FOR_BUILD = $(CXX_FOR_BUILD) |
790 | BUILD_LINKERFLAGS = $(BUILD_CXXFLAGS) | |
40b6e20e | 791 | |
0fc07c25 | 792 | # Native linker and preprocessor flags. For x-fragment overrides. |
9841cd80 | 793 | BUILD_LDFLAGS=@BUILD_LDFLAGS@ |
571e5fe1 | 794 | BUILD_NO_PIE_FLAG = @BUILD_NO_PIE_FLAG@ |
795 | BUILD_LDFLAGS += $(BUILD_NO_PIE_FLAG) | |
18350b2e | 796 | BUILD_CPPFLAGS= -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \ |
797 | -I$(srcdir)/../include @INCINTL@ $(CPPINC) $(CPPFLAGS) | |
32e6d418 | 798 | |
b541ad9d | 799 | # Actual name to use when installing a native compiler. |
88a86c80 | 800 | GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)') |
801 | GCC_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo gcc|sed '$(program_transform_name)') | |
802 | CPP_INSTALL_NAME := $(shell echo cpp|sed '$(program_transform_name)') | |
88a86c80 | 803 | GCOV_INSTALL_NAME := $(shell echo gcov|sed '$(program_transform_name)') |
e76f6040 | 804 | GCOV_TOOL_INSTALL_NAME := $(shell echo gcov-tool|sed '$(program_transform_name)') |
c6a9dcea | 805 | GCOV_DUMP_INSTALL_NAME := $(shell echo gcov-dump|sed '$(program_transform_name)') |
b541ad9d | 806 | |
6c08487b | 807 | # Setup the testing framework, if you have one |
808 | EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \ | |
809 | echo $${rootme}/../expect/expect ; \ | |
810 | else echo expect ; fi` | |
811 | ||
812 | RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \ | |
813 | echo $${srcdir}/../dejagnu/runtest ; \ | |
814 | else echo runtest; fi` | |
815 | RUNTESTFLAGS = | |
816 | ||
d0faeb9d | 817 | # This should name the specs file that we're going to install. Target |
818 | # Makefiles may override it and name another file to be generated from | |
819 | # the built-in specs and installed as the default spec, as long as | |
820 | # they also introduce a rule to generate a file name specs, to be used | |
821 | # at build time. | |
822 | SPECS = specs | |
823 | ||
755fa783 | 824 | # Extra include files that are defined by HeaderInclude directives in |
825 | # the .opt files | |
826 | OPTIONS_H_EXTRA = | |
827 | ||
828 | # Extra include files that are defined by SourceInclude directives in | |
829 | # the .opt files | |
0f246197 | 830 | OPTIONS_C_EXTRA = $(PRETTY_PRINT_H) |
755fa783 | 831 | |
832 | @option_includes@ | |
833 | ||
32e6d418 | 834 | # End of variables for you to override. |
835 | ||
805e22b2 | 836 | # GTM_H lists the config files that the generator files depend on, |
837 | # while TM_H lists the ones ordinary gcc files depend on, which | |
838 | # includes several files generated by those generators. | |
21886706 | 839 | BCONFIG_H = bconfig.h $(build_xm_file_list) |
805e22b2 | 840 | CONFIG_H = config.h $(host_xm_file_list) |
e23a6527 | 841 | TCONFIG_H = tconfig.h $(xm_file_list) |
805e22b2 | 842 | TM_P_H = tm_p.h $(tm_p_file_list) |
c50b68d2 | 843 | GTM_H = tm.h $(tm_file_list) insn-constants.h |
022a2799 | 844 | TM_H = $(GTM_H) insn-flags.h $(OPTIONS_H) |
805e22b2 | 845 | |
1af67e62 | 846 | # Variables for version information. |
ff84d87f | 847 | BASEVER := $(srcdir)/BASE-VER # 4.x.y |
848 | DEVPHASE := $(srcdir)/DEV-PHASE # experimental, prerelease, "" | |
849 | DATESTAMP := $(srcdir)/DATESTAMP # YYYYMMDD or empty | |
a2b17a85 | 850 | REVISION := $(srcdir)/REVISION # [BRANCH revision XXXXXX] |
1af67e62 | 851 | |
ff84d87f | 852 | BASEVER_c := $(shell cat $(BASEVER)) |
853 | DEVPHASE_c := $(shell cat $(DEVPHASE)) | |
854 | DATESTAMP_c := $(shell cat $(DATESTAMP)) | |
1af67e62 | 855 | |
a2b17a85 | 856 | ifeq (,$(wildcard $(REVISION))) |
857 | REVISION_c := | |
1fdf44f0 | 858 | REVISION := |
a2b17a85 | 859 | else |
860 | REVISION_c := $(shell cat $(REVISION)) | |
861 | endif | |
862 | ||
0812bb06 | 863 | version := $(shell @get_gcc_base_ver@ $(BASEVER)) |
1af67e62 | 864 | |
47cccfda | 865 | PATCHLEVEL_c := \ |
866 | $(shell echo $(BASEVER_c) | sed -e 's/^[0-9]*\.[0-9]*\.\([0-9]*\)$$/\1/') | |
867 | ||
868 | ||
1af67e62 | 869 | # For use in version.c - double quoted strings, with appropriate |
870 | # surrounding punctuation and spaces, and with the datestamp and | |
871 | # development phase collapsed to the empty string in release mode | |
47cccfda | 872 | # (i.e. if DEVPHASE_c is empty and PATCHLEVEL_c is 0). The space |
873 | # immediately after the comma in the $(if ...) constructs is | |
874 | # significant - do not remove it. | |
ff84d87f | 875 | BASEVER_s := "\"$(BASEVER_c)\"" |
876 | DEVPHASE_s := "\"$(if $(DEVPHASE_c), ($(DEVPHASE_c)))\"" | |
47cccfda | 877 | DATESTAMP_s := \ |
878 | "\"$(if $(DEVPHASE_c)$(filter-out 0,$(PATCHLEVEL_c)), $(DATESTAMP_c))\"" | |
d25dc80e | 879 | PKGVERSION_s:= "\"@PKGVERSION@\"" |
880 | BUGURL_s := "\"@REPORT_BUGS_TO@\"" | |
881 | ||
882 | PKGVERSION := @PKGVERSION@ | |
883 | BUGURL_TEXI := @REPORT_BUGS_TEXI@ | |
1af67e62 | 884 | |
a2b17a85 | 885 | ifdef REVISION_c |
47cccfda | 886 | REVISION_s := \ |
887 | "\"$(if $(DEVPHASE_c)$(filter-out 0,$(PATCHLEVEL_c)), $(REVISION_c))\"" | |
a2b17a85 | 888 | else |
c80cefd7 | 889 | REVISION_s := "\"\"" |
a2b17a85 | 890 | endif |
891 | ||
21886706 | 892 | # Shorthand variables for dependency lists. |
c7d89805 | 893 | DUMPFILE_H = $(srcdir)/../libcpp/include/line-map.h dumpfile.h |
f1f41a6c | 894 | VEC_H = vec.h statistics.h $(GGC_H) |
28544f39 | 895 | HASH_TABLE_H = $(HASHTAB_H) hash-table.h $(GGC_H) |
f1f41a6c | 896 | EXCEPT_H = except.h $(HASHTAB_H) |
5da5e283 | 897 | TARGET_DEF = target.def target-hooks-macros.h target-insns.def |
c94b1d0e | 898 | C_TARGET_DEF = c-family/c-target.def target-hooks-macros.h |
3e87b980 | 899 | COMMON_TARGET_DEF = common/common-target.def target-hooks-macros.h |
e7a88601 | 900 | TARGET_H = $(TM_H) target.h $(TARGET_DEF) insn-modes.h insn-codes.h |
c94b1d0e | 901 | C_TARGET_H = c-family/c-target.h $(C_TARGET_DEF) |
218e3e4e | 902 | COMMON_TARGET_H = common/common-target.h $(INPUT_H) $(COMMON_TARGET_DEF) |
8734172d | 903 | MACHMODE_H = machmode.h mode-classes.def |
21886706 | 904 | HOOKS_H = hooks.h $(MACHMODE_H) |
905 | HOSTHOOKS_DEF_H = hosthooks-def.h $(HOOKS_H) | |
906 | LANGHOOKS_DEF_H = langhooks-def.h $(HOOKS_H) | |
202d6e5f | 907 | TARGET_DEF_H = target-def.h target-hooks-def.h $(HOOKS_H) targhooks.h |
c94b1d0e | 908 | C_TARGET_DEF_H = c-family/c-target-def.h c-family/c-target-hooks-def.h \ |
218e3e4e | 909 | $(TREE_H) $(C_COMMON_H) $(HOOKS_H) common/common-targhooks.h |
8734172d | 910 | CORETYPES_H = coretypes.h insn-modes.h insn-modes-inline.h |
911 | RTL_BASE_H = $(CORETYPES_H) rtl.h rtl.def $(MACHMODE_H) reg-notes.def \ | |
50a8e74c | 912 | insn-notes.def $(INPUT_H) $(REAL_H) statistics.h $(VEC_H) \ |
913 | $(FIXED_VALUE_H) alias.h $(HASHTAB_H) | |
36eba48c | 914 | FIXED_VALUE_H = fixed-value.h $(MACHMODE_H) double-int.h |
1044c79e | 915 | RTL_H = $(RTL_BASE_H) $(FLAGS_H) genrtl.h |
ac0640e5 | 916 | READ_MD_H = $(OBSTACK_H) $(HASHTAB_H) read-md.h |
df423ec7 | 917 | PARAMS_H = params.h params-enum.h params.def |
4c0315d0 | 918 | BUILTINS_DEF = builtins.def sync-builtins.def omp-builtins.def \ |
da80a82f | 919 | gtm-builtins.def sanitizer.def cilkplus.def cilk-builtins.def \ |
920 | hsa-builtins.def | |
fb049fba | 921 | INTERNAL_FN_DEF = internal-fn.def |
922 | INTERNAL_FN_H = internal-fn.h $(INTERNAL_FN_DEF) | |
8734172d | 923 | TREE_CORE_H = tree-core.h $(CORETYPES_H) all-tree.def tree.def \ |
96423453 | 924 | c-family/c-common.def $(lang_tree_files) $(MACHMODE_H) \ |
925 | $(BUILTINS_DEF) $(INPUT_H) statistics.h \ | |
926 | $(VEC_H) treestruct.def $(HASHTAB_H) \ | |
f1f41a6c | 927 | double-int.h alias.h $(SYMTAB_H) $(FLAGS_H) \ |
7bedc3a0 | 928 | $(REAL_H) $(FIXED_VALUE_H) |
96423453 | 929 | TREE_H = tree.h $(TREE_CORE_H) tree-check.h |
0f71a633 | 930 | REGSET_H = regset.h $(BITMAP_H) hard-reg-set.h |
a0235af9 | 931 | BASIC_BLOCK_H = basic-block.h $(PREDICT_H) $(VEC_H) $(FUNCTION_H) \ |
db9cef39 | 932 | cfg-flags.def cfghooks.h profile-count.h |
7149db5f | 933 | GIMPLE_H = gimple.h gimple.def gsstruct.def $(VEC_H) \ |
f1f41a6c | 934 | $(GGC_H) $(BASIC_BLOCK_H) $(TREE_H) tree-ssa-operands.h \ |
de6bd75e | 935 | tree-ssa-alias.h $(INTERNAL_FN_H) $(HASH_TABLE_H) is-a.h |
e76f6040 | 936 | GCOV_IO_H = gcov-io.h gcov-iov.h auto-host.h gcov-counter.def |
21886706 | 937 | RECOG_H = recog.h |
21886706 | 938 | EMIT_RTL_H = emit-rtl.h |
50a8e74c | 939 | FLAGS_H = flags.h flag-types.h $(OPTIONS_H) |
755fa783 | 940 | OPTIONS_H = options.h flag-types.h $(OPTIONS_H_EXTRA) |
f1f41a6c | 941 | FUNCTION_H = function.h $(HASHTAB_H) $(TM_H) hard-reg-set.h \ |
942 | $(VEC_H) $(INPUT_H) $(MACHMODE_H) | |
21886706 | 943 | EXPR_H = expr.h insn-config.h $(FUNCTION_H) $(RTL_H) $(FLAGS_H) $(TREE_H) $(MACHMODE_H) $(EMIT_RTL_H) |
ee65118b | 944 | OPTABS_H = optabs.h insn-codes.h insn-opinit.h |
c6e9953d | 945 | REGS_H = regs.h $(MACHMODE_H) hard-reg-set.h |
1044c79e | 946 | CFGLOOP_H = cfgloop.h $(BASIC_BLOCK_H) double-int.h \ |
0f71a633 | 947 | $(BITMAP_H) sbitmap.h |
21886706 | 948 | IPA_UTILS_H = ipa-utils.h $(TREE_H) $(CGRAPH_H) |
36eba48c | 949 | IPA_REFERENCE_H = ipa-reference.h $(BITMAP_H) $(TREE_H) |
ea269688 | 950 | CGRAPH_H = cgraph.h $(VEC_H) $(TREE_H) $(BASIC_BLOCK_H) $(FUNCTION_H) \ |
51ce5652 | 951 | cif-code.def ipa-ref.h $(LINKER_PLUGIN_API_H) is-a.h |
0f71a633 | 952 | DF_H = df.h $(BITMAP_H) $(REGSET_H) sbitmap.h $(BASIC_BLOCK_H) \ |
953 | alloc-pool.h $(TIMEVAR_H) | |
21886706 | 954 | RESOURCE_H = resource.h hard-reg-set.h $(DF_H) |
460b8bb3 | 955 | GCC_H = gcc.h version.h $(DIAGNOSTIC_CORE_H) |
36eba48c | 956 | GGC_H = ggc.h gtype-desc.h statistics.h |
21886706 | 957 | TIMEVAR_H = timevar.h timevar.def |
808674b1 | 958 | INSN_ATTR_H = insn-attr.h insn-attr-common.h $(INSN_ADDR_H) |
f1f41a6c | 959 | INSN_ADDR_H = $(srcdir)/insn-addr.h |
4a020a8c | 960 | C_COMMON_H = c-family/c-common.h c-family/c-common.def $(TREE_H) \ |
1044c79e | 961 | $(SPLAY_TREE_H) $(CPPLIB_H) $(GGC_H) $(DIAGNOSTIC_CORE_H) |
7bedc3a0 | 962 | C_PRAGMA_H = c-family/c-pragma.h $(CPPLIB_H) |
3ce7d1bd | 963 | C_TREE_H = c/c-tree.h $(C_COMMON_H) $(DIAGNOSTIC_H) |
36eba48c | 964 | SYSTEM_H = system.h hwint.h $(srcdir)/../include/libiberty.h \ |
965 | $(srcdir)/../include/safe-ctype.h $(srcdir)/../include/filenames.h | |
21886706 | 966 | PREDICT_H = predict.h predict.def |
c39ed964 | 967 | CPPLIB_H = $(srcdir)/../libcpp/include/line-map.h \ |
968 | $(srcdir)/../libcpp/include/cpplib.h | |
36eba48c | 969 | INPUT_H = $(srcdir)/../libcpp/include/line-map.h input.h |
ba30d337 | 970 | OPTS_H = $(INPUT_H) $(VEC_H) opts.h $(OBSTACK_H) |
36eba48c | 971 | SYMTAB_H = $(srcdir)/../libcpp/include/symtab.h $(OBSTACK_H) |
c39ed964 | 972 | CPP_ID_DATA_H = $(CPPLIB_H) $(srcdir)/../libcpp/include/cpp-id-data.h |
36eba48c | 973 | CPP_INTERNAL_H = $(srcdir)/../libcpp/internal.h $(CPP_ID_DATA_H) |
c7d89805 | 974 | TREE_DUMP_H = tree-dump.h $(SPLAY_TREE_H) $(DUMPFILE_H) |
975 | TREE_PASS_H = tree-pass.h $(TIMEVAR_H) $(DUMPFILE_H) | |
f6d8a42a | 976 | TREE_SSA_H = tree-ssa.h tree-ssa-operands.h \ |
0f71a633 | 977 | $(BITMAP_H) sbitmap.h $(BASIC_BLOCK_H) $(GIMPLE_H) \ |
dd277d48 | 978 | $(HASHTAB_H) $(CGRAPH_H) $(IPA_REFERENCE_H) \ |
1044c79e | 979 | tree-ssa-alias.h |
bf59d04a | 980 | PRETTY_PRINT_H = pretty-print.h $(INPUT_H) $(OBSTACK_H) wide-int-print.h |
eb3dd80d | 981 | TREE_PRETTY_PRINT_H = tree-pretty-print.h $(PRETTY_PRINT_H) |
982 | GIMPLE_PRETTY_PRINT_H = gimple-pretty-print.h $(TREE_PRETTY_PRINT_H) | |
92468061 | 983 | DIAGNOSTIC_CORE_H = diagnostic-core.h $(INPUT_H) bversion.h diagnostic.def |
852f689e | 984 | DIAGNOSTIC_H = diagnostic.h $(DIAGNOSTIC_CORE_H) $(PRETTY_PRINT_H) |
7bedc3a0 | 985 | C_PRETTY_PRINT_H = c-family/c-pretty-print.h $(PRETTY_PRINT_H) \ |
986 | $(C_COMMON_H) $(TREE_H) | |
f1f41a6c | 987 | TREE_INLINE_H = tree-inline.h |
1044c79e | 988 | REAL_H = real.h $(MACHMODE_H) |
7bfefa9d | 989 | LTO_STREAMER_H = lto-streamer.h $(LINKER_PLUGIN_API_H) $(TARGET_H) \ |
d9dd21a8 | 990 | $(CGRAPH_H) $(VEC_H) $(HASH_TABLE_H) $(TREE_H) $(GIMPLE_H) \ |
7149db5f | 991 | $(GCOV_IO_H) $(DIAGNOSTIC_H) alloc-pool.h |
821d0e0f | 992 | IPA_PROP_H = ipa-prop.h $(TREE_H) $(VEC_H) $(CGRAPH_H) $(GIMPLE_H) alloc-pool.h |
36eba48c | 993 | BITMAP_H = bitmap.h $(HASHTAB_H) statistics.h |
eb3dd80d | 994 | GCC_PLUGIN_H = gcc-plugin.h highlev-plugin-common.h plugin.def \ |
995 | $(CONFIG_H) $(SYSTEM_H) $(HASHTAB_H) | |
a0b14cdf | 996 | PLUGIN_H = plugin.h $(GCC_PLUGIN_H) |
e8ad34e4 | 997 | PLUGIN_VERSION_H = plugin-version.h configargs.h |
8d0badf1 | 998 | CONTEXT_H = context.h |
592e7d69 | 999 | GENSUPPORT_H = gensupport.h read-md.h optabs.def |
41d1788c | 1000 | |
2e9d8ccf | 1001 | #\f |
32e6d418 | 1002 | # Now figure out from those variables how to compile and link. |
1003 | ||
0fc07c25 | 1004 | # IN_GCC distinguishes between code compiled into GCC itself and other |
1005 | # programs built during a bootstrap. | |
29d774d0 | 1006 | # autoconf inserts -DCROSS_DIRECTORY_STRUCTURE if we are building a |
1007 | # cross compiler which does not use the native headers and libraries. | |
2bd17377 | 1008 | INTERNAL_CFLAGS = -DIN_GCC $(PICFLAG) @CROSS@ |
32e6d418 | 1009 | |
c19ee476 | 1010 | # This is the variable actually used when we compile. If you change this, |
c0450c4b | 1011 | # you probably want to update BUILD_CFLAGS in configure.ac |
141acd01 | 1012 | ALL_CFLAGS = $(T_CFLAGS) $(CFLAGS-$@) \ |
794723c1 | 1013 | $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) @DEFS@ |
32e6d418 | 1014 | |
7ab76cec | 1015 | # The C++ version. |
cbc8c5f6 | 1016 | ALL_CXXFLAGS = $(T_CFLAGS) $(CFLAGS-$@) $(CXXFLAGS) $(INTERNAL_CFLAGS) \ |
605922af | 1017 | $(COVERAGE_FLAGS) $(ALIASING_FLAGS) $(NOEXCEPTION_FLAGS) \ |
1018 | $(WARN_CXXFLAGS) @DEFS@ | |
7ab76cec | 1019 | |
dd350d42 | 1020 | # Likewise. Put INCLUDES at the beginning: this way, if some autoconf macro |
1021 | # puts -I options in CPPFLAGS, our include files in the srcdir will always | |
1022 | # win against random include files in /usr/include. | |
794723c1 | 1023 | ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS) |
32e6d418 | 1024 | |
585d4848 | 1025 | # This is the variable to use when using $(COMPILER). |
7ab76cec | 1026 | ALL_COMPILERFLAGS = $(ALL_CXXFLAGS) |
585d4848 | 1027 | |
40b6e20e | 1028 | # This is the variable to use when using $(LINKER). |
7ab76cec | 1029 | ALL_LINKERFLAGS = $(ALL_CXXFLAGS) |
40b6e20e | 1030 | |
2b59cb05 | 1031 | # Build and host support libraries. |
2bd17377 | 1032 | |
1033 | # Use the "pic" build of libiberty if --enable-host-shared. | |
1034 | ifeq ($(enable_host_shared),yes) | |
1035 | LIBIBERTY = ../libiberty/pic/libiberty.a | |
1036 | BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/pic/libiberty.a | |
1037 | else | |
883c44aa | 1038 | LIBIBERTY = ../libiberty/libiberty.a |
3e427a9c | 1039 | BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a |
2bd17377 | 1040 | endif |
32e6d418 | 1041 | |
ad0f3983 | 1042 | # Dependencies on the intl and portability libraries. |
0b4f4daf | 1043 | LIBDEPS= libcommon.a $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) \ |
3f425711 | 1044 | $(LIBDECNUMBER) $(LIBBACKTRACE) |
32e6d418 | 1045 | |
1046 | # Likewise, for use in the tools that must run on this machine | |
1047 | # even if we are cross-building GCC. | |
805e22b2 | 1048 | BUILD_LIBDEPS= $(BUILD_LIBIBERTY) |
32e6d418 | 1049 | |
1050 | # How to link with both our special library facilities | |
1051 | # and the system's installed libraries. | |
3f425711 | 1052 | LIBS = @LIBS@ libcommon.a $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBBACKTRACE) \ |
1053 | $(LIBIBERTY) $(LIBDECNUMBER) $(HOST_LIBS) | |
0045121d | 1054 | BACKENDLIBS = $(ISLLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \ |
832cb92a | 1055 | $(ZLIB) |
0ba0ef70 | 1056 | # Any system libraries needed just for GNAT. |
1057 | SYSLIBS = @GNAT_LIBEXC@ | |
1058 | ||
75f488d0 | 1059 | # Used from ada/gcc-interface/Make-lang.in |
f1984c57 | 1060 | GNATBIND = @GNATBIND@ |
1061 | GNATMAKE = @GNATMAKE@ | |
1062 | ||
96b74343 | 1063 | # Libs needed (at present) just for jcf-dump. |
1064 | LDEXP_LIB = @LDEXP_LIB@ | |
1065 | ||
32e6d418 | 1066 | # Likewise, for use in the tools that must run on this machine |
1067 | # even if we are cross-building GCC. | |
805e22b2 | 1068 | BUILD_LIBS = $(BUILD_LIBIBERTY) |
32e6d418 | 1069 | |
664c5888 | 1070 | BUILD_RTL = build/rtl.o build/read-rtl.o build/ggc-none.o \ |
960ebfe7 | 1071 | build/vec.o build/min-insn-modes.o build/gensupport.o \ |
0ff42de5 | 1072 | build/print-rtl.o build/hash-table.o |
664c5888 | 1073 | BUILD_MD = build/read-md.o |
524a54cf | 1074 | BUILD_ERRORS = build/errors.o |
32e6d418 | 1075 | |
1076 | # Specify the directories to be searched for header files. | |
1077 | # Both . and srcdir are used, in that order, | |
d826737c | 1078 | # so that *config.h will be found in the compilation |
32e6d418 | 1079 | # subdirectory rather than in the source directory. |
f357ac87 | 1080 | # -I$(@D) and -I$(srcdir)/$(@D) cause the subdirectory of the file |
1081 | # currently being compiled, in both source trees, to be examined as well. | |
1e12d536 | 1082 | # libintl.h will be found in ../intl if we are using the included libintl. |
f357ac87 | 1083 | INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \ |
4ee9c684 | 1084 | -I$(srcdir)/../include @INCINTL@ \ |
3f425711 | 1085 | $(CPPINC) $(GMPINC) $(DECNUMINC) $(BACKTRACEINC) \ |
0045121d | 1086 | $(ISLINC) |
32e6d418 | 1087 | |
b8bd120b | 1088 | COMPILE.base = $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) -o $@ |
b0e45289 | 1089 | ifeq ($(CXXDEPMODE),depmode=gcc3) |
b8bd120b | 1090 | # Note a subtlety here: we use $(@D) for the directory part, to make |
1091 | # things like the go/%.o rule work properly; but we use $(*F) for the | |
1092 | # file part, as we just want the file part of the stem, not the entire | |
1093 | # file name. | |
1094 | COMPILE = $(COMPILE.base) -MT $@ -MMD -MP -MF $(@D)/$(DEPDIR)/$(*F).TPo | |
1095 | POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(*F).TPo $(@D)/$(DEPDIR)/$(*F).Po | |
1096 | else | |
1097 | COMPILE = source='$<' object='$@' libtool=no \ | |
b0e45289 | 1098 | DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) $(COMPILE.base) |
b8bd120b | 1099 | POSTCOMPILE = |
1100 | endif | |
1101 | ||
e79e977d | 1102 | .cc.o .c.o: |
b8bd120b | 1103 | $(COMPILE) $< |
1104 | $(POSTCOMPILE) | |
32e6d418 | 1105 | |
2e9d8ccf | 1106 | #\f |
966842d4 | 1107 | # Support for additional languages (other than C). |
1108 | # C can be supported this way too (leave for later). | |
73027c94 | 1109 | |
a455468e | 1110 | LANG_MAKEFRAGS = @all_lang_makefrags@ |
73027c94 | 1111 | |
1112 | # Flags to pass to recursive makes. | |
e3ca137a | 1113 | # CC is set by configure. |
73027c94 | 1114 | # ??? The choices here will need some experimenting with. |
c8694ccd | 1115 | |
1116 | export AR_FOR_TARGET | |
1117 | export AR_CREATE_FOR_TARGET | |
1118 | export AR_FLAGS_FOR_TARGET | |
1119 | export AR_EXTRACT_FOR_TARGET | |
1120 | export AWK | |
c8694ccd | 1121 | export DESTDIR |
1122 | export GCC_FOR_TARGET | |
1123 | export INCLUDES | |
1124 | export INSTALL_DATA | |
9fec3fa8 | 1125 | export LIPO_FOR_TARGET |
c8694ccd | 1126 | export MACHMODE_H |
1127 | export NM_FOR_TARGET | |
9fec3fa8 | 1128 | export STRIP_FOR_TARGET |
c8694ccd | 1129 | export RANLIB_FOR_TARGET |
1130 | export libsubdir | |
c8694ccd | 1131 | |
e3ca137a | 1132 | FLAGS_TO_PASS = \ |
794723c1 | 1133 | "ADA_CFLAGS=$(ADA_CFLAGS)" \ |
73027c94 | 1134 | "BISON=$(BISON)" \ |
1135 | "BISONFLAGS=$(BISONFLAGS)" \ | |
b3ff31d3 | 1136 | "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \ |
73027c94 | 1137 | "LDFLAGS=$(LDFLAGS)" \ |
345a1501 | 1138 | "FLEX=$(FLEX)" \ |
1139 | "FLEXFLAGS=$(FLEXFLAGS)" \ | |
ee56250e | 1140 | "INSTALL=$(INSTALL)" \ |
1141 | "INSTALL_DATA=$(INSTALL_DATA)" \ | |
1142 | "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ | |
1143 | "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ | |
ea4a6c81 | 1144 | "LN=$(LN)" \ |
1145 | "LN_S=$(LN_S)" \ | |
73027c94 | 1146 | "MAKEINFO=$(MAKEINFO)" \ |
1147 | "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \ | |
e01fe443 | 1148 | "MAKEOVERRIDES=" \ |
73027c94 | 1149 | "SHELL=$(SHELL)" \ |
62268150 | 1150 | "exeext=$(exeext)" \ |
2aa3e87b | 1151 | "build_exeext=$(build_exeext)" \ |
62268150 | 1152 | "objext=$(objext)" \ |
73027c94 | 1153 | "exec_prefix=$(exec_prefix)" \ |
1154 | "prefix=$(prefix)" \ | |
933b38ee | 1155 | "local_prefix=$(local_prefix)" \ |
8ffadb5b | 1156 | "gxx_include_dir=$(gcc_gxx_include_dir)" \ |
976ceec9 | 1157 | "build_tooldir=$(build_tooldir)" \ |
40cb25f2 | 1158 | "gcc_tooldir=$(gcc_tooldir)" \ |
73027c94 | 1159 | "bindir=$(bindir)" \ |
01922927 | 1160 | "libexecsubdir=$(libexecsubdir)" \ |
b9de6413 | 1161 | "datarootdir=$(datarootdir)" \ |
be2828ce | 1162 | "datadir=$(datadir)" \ |
be2828ce | 1163 | "localedir=$(localedir)" |
2e9d8ccf | 1164 | #\f |
32e6d418 | 1165 | # Lists of files for various purposes. |
1166 | ||
ff05e09e | 1167 | # All option source files |
1168 | ALL_OPT_FILES=$(lang_opt_files) $(extra_opt_files) | |
1169 | ||
8daa9e98 | 1170 | # Target specific, C specific object file |
1171 | C_TARGET_OBJS=@c_target_objs@ | |
1172 | ||
1173 | # Target specific, C++ specific object file | |
1174 | CXX_TARGET_OBJS=@cxx_target_objs@ | |
1175 | ||
32006f36 | 1176 | # Target specific, Fortran specific object file |
1177 | FORTRAN_TARGET_OBJS=@fortran_target_objs@ | |
1178 | ||
e53d55e7 | 1179 | # Object files for gcc many-languages driver. |
56f34f03 | 1180 | GCC_OBJS = gcc.o gcc-main.o ggc-none.o |
a1baa5f1 | 1181 | |
6b77556b | 1182 | c-family-warn = $(STRICT_WARN) |
1183 | ||
7bedc3a0 | 1184 | # Language-specific object files shared by all C-family front ends. |
1185 | C_COMMON_OBJS = c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o \ | |
e5f01cba | 1186 | c-family/c-format.o c-family/c-gimplify.o c-family/c-indentation.o \ |
1187 | c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o \ | |
7bedc3a0 | 1188 | c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o \ |
b1c06ff9 | 1189 | c-family/c-semantics.o c-family/c-ada-spec.o \ |
f2697631 | 1190 | c-family/c-cilkplus.o \ |
0f4cea33 | 1191 | c-family/array-notation-common.o c-family/cilk.o c-family/c-ubsan.o \ |
b0c98c23 | 1192 | c-family/c-attribs.o c-family/c-warn.o |
6cba4ca3 | 1193 | |
32e6d418 | 1194 | # Language-independent object files. |
18c03b46 | 1195 | # We put the *-match.o and insn-*.o files first so that a parallel make |
1196 | # will build them sooner, because they are large and otherwise tend to be | |
1197 | # the last objects to finish building. | |
aef23a85 | 1198 | OBJS = \ |
18c03b46 | 1199 | gimple-match.o \ |
1200 | generic-match.o \ | |
cfcda0e0 | 1201 | insn-attrtab.o \ |
1202 | insn-automata.o \ | |
73ed0c67 | 1203 | insn-dfatab.o \ |
cfcda0e0 | 1204 | insn-emit.o \ |
1205 | insn-extract.o \ | |
73ed0c67 | 1206 | insn-latencytab.o \ |
cfcda0e0 | 1207 | insn-modes.o \ |
1208 | insn-opinit.o \ | |
1209 | insn-output.o \ | |
1210 | insn-peep.o \ | |
1211 | insn-preds.o \ | |
1212 | insn-recog.o \ | |
15f255bd | 1213 | insn-enums.o \ |
5cc13354 | 1214 | ggc-page.o \ |
cfcda0e0 | 1215 | alias.o \ |
1216 | alloc-pool.o \ | |
3072d30e | 1217 | auto-inc-dec.o \ |
94bed7c3 | 1218 | auto-profile.o \ |
cfcda0e0 | 1219 | bb-reorder.o \ |
1220 | bitmap.o \ | |
1221 | bt-load.o \ | |
1222 | builtins.o \ | |
1223 | caller-save.o \ | |
1224 | calls.o \ | |
9336ad57 | 1225 | ccmp.o \ |
cfcda0e0 | 1226 | cfg.o \ |
1227 | cfganal.o \ | |
1228 | cfgbuild.o \ | |
1229 | cfgcleanup.o \ | |
1230 | cfgexpand.o \ | |
1231 | cfghooks.o \ | |
cfcda0e0 | 1232 | cfgloop.o \ |
1233 | cfgloopanal.o \ | |
1234 | cfgloopmanip.o \ | |
1235 | cfgrtl.o \ | |
0704fb2e | 1236 | symtab.o \ |
aef23a85 | 1237 | cgraph.o \ |
1238 | cgraphbuild.o \ | |
1239 | cgraphunit.o \ | |
f41db742 | 1240 | cgraphclones.o \ |
d037099f | 1241 | cilk-common.o \ |
cfcda0e0 | 1242 | combine.o \ |
e1caca42 | 1243 | combine-stack-adj.o \ |
a50372fe | 1244 | compare-elim.o \ |
8d0badf1 | 1245 | context.o \ |
cfcda0e0 | 1246 | convert.o \ |
1247 | coverage.o \ | |
aef23a85 | 1248 | cppbuiltin.o \ |
1249 | cppdefault.o \ | |
07abdb66 | 1250 | cprop.o \ |
cfcda0e0 | 1251 | cse.o \ |
1252 | cselib.o \ | |
2541503d | 1253 | data-streamer.o \ |
1254 | data-streamer-in.o \ | |
1255 | data-streamer-out.o \ | |
cfcda0e0 | 1256 | dbxout.o \ |
3072d30e | 1257 | dbgcnt.o \ |
1258 | dce.o \ | |
cfcda0e0 | 1259 | ddg.o \ |
1260 | debug.o \ | |
1261 | df-core.o \ | |
1262 | df-problems.o \ | |
1263 | df-scan.o \ | |
1264 | dfp.o \ | |
cfcda0e0 | 1265 | dojump.o \ |
1266 | dominance.o \ | |
1267 | domwalk.o \ | |
1268 | double-int.o \ | |
3072d30e | 1269 | dse.o \ |
7bd765d4 | 1270 | dumpfile.o \ |
cfcda0e0 | 1271 | dwarf2asm.o \ |
dcdf448e | 1272 | dwarf2cfi.o \ |
cfcda0e0 | 1273 | dwarf2out.o \ |
1274 | emit-rtl.o \ | |
1275 | et-forest.o \ | |
1276 | except.o \ | |
1277 | explow.o \ | |
1278 | expmed.o \ | |
1279 | expr.o \ | |
77ddb3e5 | 1280 | fibonacci_heap.o \ |
cfcda0e0 | 1281 | final.o \ |
5efd9b45 | 1282 | fixed-value.o \ |
cfcda0e0 | 1283 | fold-const.o \ |
6c21be92 | 1284 | fold-const-call.o \ |
cfcda0e0 | 1285 | function.o \ |
99b4f3a2 | 1286 | function-tests.o \ |
cfcda0e0 | 1287 | fwprop.o \ |
a96cefb2 | 1288 | gcc-rich-location.o \ |
cfcda0e0 | 1289 | gcse.o \ |
d2ac64b1 | 1290 | gcse-common.o \ |
cfcda0e0 | 1291 | ggc-common.o \ |
f61d7248 | 1292 | ggc-tests.o \ |
75a70cf9 | 1293 | gimple.o \ |
9a4a3348 | 1294 | gimple-builder.o \ |
46a19abf | 1295 | gimple-expr.o \ |
75a70cf9 | 1296 | gimple-iterator.o \ |
2d18b16d | 1297 | gimple-fold.o \ |
07d294f7 | 1298 | gimple-laddress.o \ |
cfcda0e0 | 1299 | gimple-low.o \ |
75a70cf9 | 1300 | gimple-pretty-print.o \ |
7fc2f613 | 1301 | gimple-ssa-backprop.o \ |
db242b6d | 1302 | gimple-ssa-isolate-paths.o \ |
7675e968 | 1303 | gimple-ssa-nonnull-compare.o \ |
b0e3fe96 | 1304 | gimple-ssa-split-paths.o \ |
3d3e04ac | 1305 | gimple-ssa-store-merging.o \ |
4502f5d0 | 1306 | gimple-ssa-strength-reduction.o \ |
b9833bfd | 1307 | gimple-ssa-sprintf.o \ |
da6cf191 | 1308 | gimple-ssa-warn-alloca.o \ |
2541503d | 1309 | gimple-streamer-in.o \ |
1310 | gimple-streamer-out.o \ | |
dcf1a1ec | 1311 | gimple-walk.o \ |
cfcda0e0 | 1312 | gimplify.o \ |
e795d6e1 | 1313 | gimplify-me.o \ |
929d2a90 | 1314 | godump.o \ |
cfcda0e0 | 1315 | graph.o \ |
3f9439d7 | 1316 | graphds.o \ |
255b6be7 | 1317 | graphite.o \ |
5eb0077d | 1318 | graphite-isl-ast-to-gimple.o \ |
26c166eb | 1319 | graphite-dependences.o \ |
89049f25 | 1320 | graphite-optimize-isl.o \ |
26c166eb | 1321 | graphite-poly.o \ |
26c166eb | 1322 | graphite-scop-detection.o \ |
1323 | graphite-sese-to-poly.o \ | |
cfcda0e0 | 1324 | gtype-desc.o \ |
1325 | haifa-sched.o \ | |
99b4f3a2 | 1326 | hash-map-tests.o \ |
1327 | hash-set-tests.o \ | |
ef2beaf2 | 1328 | hsa-common.o \ |
56686608 | 1329 | hsa-gen.o \ |
1330 | hsa-regalloc.o \ | |
1331 | hsa-brig.o \ | |
1332 | hsa-dump.o \ | |
1b727a0a | 1333 | hw-doloop.o \ |
b96c136c | 1334 | hwint.o \ |
cfcda0e0 | 1335 | ifcvt.o \ |
1d4227c3 | 1336 | ree.o \ |
6b214d09 | 1337 | inchash.o \ |
aef23a85 | 1338 | incpath.o \ |
3072d30e | 1339 | init-regs.o \ |
fb049fba | 1340 | internal-fn.o \ |
058a1b7a | 1341 | ipa-chkp.o \ |
aef23a85 | 1342 | ipa-cp.o \ |
5514adf9 | 1343 | ipa-devirt.o \ |
b9a58fc5 | 1344 | ipa-fnsummary.o \ |
8d326f11 | 1345 | ipa-polymorphic-call.o \ |
aef23a85 | 1346 | ipa-split.o \ |
1347 | ipa-inline.o \ | |
cf8b23bb | 1348 | ipa-comdats.o \ |
7aeffc5f | 1349 | ipa-visibility.o \ |
aef23a85 | 1350 | ipa-inline-analysis.o \ |
1351 | ipa-inline-transform.o \ | |
4669dd83 | 1352 | ipa-predicate.o \ |
6eaf903b | 1353 | ipa-profile.o \ |
aef23a85 | 1354 | ipa-prop.o \ |
1355 | ipa-pure-const.o \ | |
52200d03 | 1356 | ipa-icf.o \ |
1357 | ipa-icf-gimple.o \ | |
aef23a85 | 1358 | ipa-reference.o \ |
56686608 | 1359 | ipa-hsa.o \ |
aef23a85 | 1360 | ipa-ref.o \ |
1361 | ipa-utils.o \ | |
1362 | ipa.o \ | |
47dd2e78 | 1363 | ira.o \ |
1364 | ira-build.o \ | |
1365 | ira-costs.o \ | |
1366 | ira-conflicts.o \ | |
1367 | ira-color.o \ | |
1368 | ira-emit.o \ | |
1369 | ira-lives.o \ | |
cfcda0e0 | 1370 | jump.o \ |
cfcda0e0 | 1371 | langhooks.o \ |
1372 | lcm.o \ | |
1373 | lists.o \ | |
cfcda0e0 | 1374 | loop-doloop.o \ |
1375 | loop-init.o \ | |
1376 | loop-invariant.o \ | |
1377 | loop-iv.o \ | |
1378 | loop-unroll.o \ | |
1a6a0f2a | 1379 | lower-subreg.o \ |
c6a6cdaa | 1380 | lra.o \ |
1381 | lra-assigns.o \ | |
1382 | lra-coalesce.o \ | |
1383 | lra-constraints.o \ | |
1384 | lra-eliminations.o \ | |
1385 | lra-lives.o \ | |
497ba60f | 1386 | lra-remat.o \ |
c6a6cdaa | 1387 | lra-spills.o \ |
7bfefa9d | 1388 | lto-cgraph.o \ |
2541503d | 1389 | lto-streamer.o \ |
7bfefa9d | 1390 | lto-streamer-in.o \ |
1391 | lto-streamer-out.o \ | |
1392 | lto-section-in.o \ | |
1393 | lto-section-out.o \ | |
7bfefa9d | 1394 | lto-opts.o \ |
7bfefa9d | 1395 | lto-compress.o \ |
e0dc6f2b | 1396 | mcf.o \ |
cfcda0e0 | 1397 | mode-switching.o \ |
1398 | modulo-sched.o \ | |
ab50af2a | 1399 | multiple_target.o \ |
4954efd4 | 1400 | omp-offload.o \ |
1401 | omp-expand.o \ | |
1402 | omp-general.o \ | |
1403 | omp-grid.o \ | |
cfcda0e0 | 1404 | omp-low.o \ |
4e4f3d27 | 1405 | omp-simd-clone.o \ |
cfcda0e0 | 1406 | optabs.o \ |
947ed59a | 1407 | optabs-libfuncs.o \ |
1408 | optabs-query.o \ | |
1409 | optabs-tree.o \ | |
0bfbe373 | 1410 | options-save.o \ |
f0da0668 | 1411 | opts-global.o \ |
cfcda0e0 | 1412 | passes.o \ |
9227b6fc | 1413 | plugin.o \ |
cfcda0e0 | 1414 | postreload-gcse.o \ |
1415 | postreload.o \ | |
1416 | predict.o \ | |
cfcda0e0 | 1417 | print-rtl.o \ |
a91c8b01 | 1418 | print-rtl-function.o \ |
cfcda0e0 | 1419 | print-tree.o \ |
1420 | profile.o \ | |
db9cef39 | 1421 | profile-count.o \ |
836c1c68 | 1422 | read-md.o \ |
1423 | read-rtl.o \ | |
1424 | read-rtl-function.o \ | |
cfcda0e0 | 1425 | real.o \ |
dae0b5cb | 1426 | realmpfr.o \ |
cfcda0e0 | 1427 | recog.o \ |
1428 | reg-stack.o \ | |
2d4749b6 | 1429 | regcprop.o \ |
cf709bf6 | 1430 | reginfo.o \ |
cfcda0e0 | 1431 | regrename.o \ |
3072d30e | 1432 | regstat.o \ |
cfcda0e0 | 1433 | reload.o \ |
1434 | reload1.o \ | |
1435 | reorg.o \ | |
1436 | resource.o \ | |
058a1b7a | 1437 | rtl-chkp.o \ |
cfcda0e0 | 1438 | rtl-error.o \ |
99b4f3a2 | 1439 | rtl-tests.o \ |
cfcda0e0 | 1440 | rtl.o \ |
bb1f44ab | 1441 | rtlhash.o \ |
cfcda0e0 | 1442 | rtlanal.o \ |
1443 | rtlhooks.o \ | |
175e0d6b | 1444 | run-rtl-passes.o \ |
cfcda0e0 | 1445 | sched-deps.o \ |
1446 | sched-ebb.o \ | |
1447 | sched-rgn.o \ | |
cfcda0e0 | 1448 | sdbout.o \ |
e1ab7874 | 1449 | sel-sched-ir.o \ |
1450 | sel-sched-dump.o \ | |
1451 | sel-sched.o \ | |
836c1c68 | 1452 | selftest-rtl.o \ |
99b4f3a2 | 1453 | selftest-run-tests.o \ |
26c166eb | 1454 | sese.o \ |
c562205f | 1455 | shrink-wrap.o \ |
cfcda0e0 | 1456 | simplify-rtx.o \ |
981db194 | 1457 | sparseset.o \ |
b67f0560 | 1458 | spellcheck.o \ |
b279775f | 1459 | spellcheck-tree.o \ |
cfcda0e0 | 1460 | sreal.o \ |
3072d30e | 1461 | stack-ptr-mod.o \ |
9659d177 | 1462 | statistics.o \ |
cfcda0e0 | 1463 | stmt.o \ |
1464 | stor-layout.o \ | |
4b673aa1 | 1465 | store-motion.o \ |
2541503d | 1466 | streamer-hooks.o \ |
cfcda0e0 | 1467 | stringpool.o \ |
3da97ff7 | 1468 | substring-locations.o \ |
821d4118 | 1469 | target-globals.o \ |
cfcda0e0 | 1470 | targhooks.o \ |
1471 | timevar.o \ | |
1472 | toplev.o \ | |
1473 | tracer.o \ | |
4c0315d0 | 1474 | trans-mem.o \ |
cfcda0e0 | 1475 | tree-affine.o \ |
b92cccf4 | 1476 | asan.o \ |
b077695d | 1477 | tsan.o \ |
9e46467d | 1478 | ubsan.o \ |
6b5813f5 | 1479 | sanopt.o \ |
d29e939c | 1480 | sancov.o \ |
e6a23add | 1481 | tree-call-cdce.o \ |
cfcda0e0 | 1482 | tree-cfg.o \ |
1483 | tree-cfgcleanup.o \ | |
1484 | tree-chrec.o \ | |
1485 | tree-complex.o \ | |
1486 | tree-data-ref.o \ | |
1487 | tree-dfa.o \ | |
ce084dfc | 1488 | tree-diagnostic.o \ |
cfcda0e0 | 1489 | tree-dump.o \ |
1490 | tree-eh.o \ | |
cffbbb9d | 1491 | tree-emutls.o \ |
cfcda0e0 | 1492 | tree-if-conv.o \ |
aef23a85 | 1493 | tree-inline.o \ |
cfcda0e0 | 1494 | tree-into-ssa.o \ |
1495 | tree-iterator.o \ | |
801c5610 | 1496 | tree-loop-distribution.o \ |
cfcda0e0 | 1497 | tree-nested.o \ |
1498 | tree-nrv.o \ | |
1499 | tree-object-size.o \ | |
cfcda0e0 | 1500 | tree-outof-ssa.o \ |
28c92cbb | 1501 | tree-parloops.o \ |
cfcda0e0 | 1502 | tree-phinodes.o \ |
058a1b7a | 1503 | tree-chkp.o \ |
1504 | tree-chkp-opt.o \ | |
ad4a85ad | 1505 | tree-predcom.o \ |
cfcda0e0 | 1506 | tree-pretty-print.o \ |
1507 | tree-profile.o \ | |
1508 | tree-scalar-evolution.o \ | |
1509 | tree-sra.o \ | |
a347af29 | 1510 | tree-switch-conversion.o \ |
cfcda0e0 | 1511 | tree-ssa-address.o \ |
1512 | tree-ssa-alias.o \ | |
1513 | tree-ssa-ccp.o \ | |
1514 | tree-ssa-coalesce.o \ | |
1515 | tree-ssa-copy.o \ | |
cfcda0e0 | 1516 | tree-ssa-dce.o \ |
1517 | tree-ssa-dom.o \ | |
1518 | tree-ssa-dse.o \ | |
1519 | tree-ssa-forwprop.o \ | |
8530c7be | 1520 | tree-ssa-ifcombine.o \ |
cfcda0e0 | 1521 | tree-ssa-live.o \ |
1522 | tree-ssa-loop-ch.o \ | |
1523 | tree-ssa-loop-im.o \ | |
1524 | tree-ssa-loop-ivcanon.o \ | |
1525 | tree-ssa-loop-ivopts.o \ | |
1526 | tree-ssa-loop-manip.o \ | |
1527 | tree-ssa-loop-niter.o \ | |
1528 | tree-ssa-loop-prefetch.o \ | |
92a2a716 | 1529 | tree-ssa-loop-split.o \ |
cfcda0e0 | 1530 | tree-ssa-loop-unswitch.o \ |
1531 | tree-ssa-loop.o \ | |
1532 | tree-ssa-math-opts.o \ | |
1533 | tree-ssa-operands.o \ | |
f1ebffbe | 1534 | tree-ssa-phionlycprop.o \ |
cfcda0e0 | 1535 | tree-ssa-phiopt.o \ |
a2fd87ad | 1536 | tree-ssa-phiprop.o \ |
cfcda0e0 | 1537 | tree-ssa-pre.o \ |
1538 | tree-ssa-propagate.o \ | |
1539 | tree-ssa-reassoc.o \ | |
9e9e6e3e | 1540 | tree-ssa-sccvn.o \ |
545372c5 | 1541 | tree-ssa-scopedtables.o \ |
cfcda0e0 | 1542 | tree-ssa-sink.o \ |
9efe50a4 | 1543 | tree-ssa-strlen.o \ |
cfcda0e0 | 1544 | tree-ssa-structalias.o \ |
51385f30 | 1545 | tree-ssa-tail-merge.o \ |
cfcda0e0 | 1546 | tree-ssa-ter.o \ |
2039eb2e | 1547 | tree-ssa-threadbackward.o \ |
cfcda0e0 | 1548 | tree-ssa-threadedge.o \ |
1549 | tree-ssa-threadupdate.o \ | |
1550 | tree-ssa-uncprop.o \ | |
a7d4604b | 1551 | tree-ssa-uninit.o \ |
cfcda0e0 | 1552 | tree-ssa.o \ |
1553 | tree-ssanames.o \ | |
1554 | tree-stdarg.o \ | |
2541503d | 1555 | tree-streamer.o \ |
1556 | tree-streamer-in.o \ | |
1557 | tree-streamer-out.o \ | |
cfcda0e0 | 1558 | tree-tailcall.o \ |
cfcda0e0 | 1559 | tree-vect-generic.o \ |
1560 | tree-vect-patterns.o \ | |
aef23a85 | 1561 | tree-vect-data-refs.o \ |
1562 | tree-vect-stmts.o \ | |
1563 | tree-vect-loop.o \ | |
1564 | tree-vect-loop-manip.o \ | |
1565 | tree-vect-slp.o \ | |
cfcda0e0 | 1566 | tree-vectorizer.o \ |
cfcda0e0 | 1567 | tree-vrp.o \ |
1568 | tree.o \ | |
f1b96af2 | 1569 | typed-splay-tree.o \ |
e6637753 | 1570 | valtrack.o \ |
cfcda0e0 | 1571 | value-prof.o \ |
1572 | var-tracking.o \ | |
1573 | varasm.o \ | |
aef23a85 | 1574 | varpool.o \ |
cfcda0e0 | 1575 | vmsdbgout.o \ |
b710ec85 | 1576 | vtable-verify.o \ |
cfcda0e0 | 1577 | web.o \ |
e913b5cd | 1578 | wide-int.o \ |
1579 | wide-int-print.o \ | |
aef23a85 | 1580 | xcoffout.o \ |
1581 | $(out_object_file) \ | |
cfcda0e0 | 1582 | $(EXTRA_OBJS) \ |
aef23a85 | 1583 | $(host_hook_obj) |
40109983 | 1584 | |
0b4f4daf | 1585 | # Objects in libcommon.a, potentially used by all host binaries and with |
1586 | # no target dependencies. | |
fee30e05 | 1587 | OBJS-libcommon = diagnostic.o diagnostic-color.o diagnostic-show-locus.o \ |
fe066ce3 | 1588 | edit-context.o \ |
fee30e05 | 1589 | pretty-print.o intl.o \ |
43eb649e | 1590 | sbitmap.o \ |
99b4f3a2 | 1591 | vec.o input.o version.o hash-table.o ggc-none.o memory-block.o \ |
1592 | selftest.o | |
0b4f4daf | 1593 | |
eb65953e | 1594 | # Objects in libcommon-target.a, used by drivers and by the core |
1595 | # compiler and containing target-dependent code. | |
6a2fc14e | 1596 | OBJS-libcommon-target = $(common_out_object_file) prefix.o params.o \ |
2b15d2ba | 1597 | opts.o opts-common.o options.o vec.o hooks.o common/common-targhooks.o \ |
99b4f3a2 | 1598 | hash-table.o file-find.o spellcheck.o selftest.o |
eb65953e | 1599 | |
141acd01 | 1600 | # This lists all host objects for the front ends. |
e53d55e7 | 1601 | ALL_HOST_FRONTEND_OBJS = $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS)) |
141acd01 | 1602 | |
0b4f4daf | 1603 | ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OBJS) $(OBJS-libcommon) \ |
894a34ef | 1604 | $(OBJS-libcommon-target) main.o c-family/cppspec.o \ |
ea38f4be | 1605 | $(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) $(GCOV_OBJS) $(GCOV_DUMP_OBJS) \ |
ed89620f | 1606 | $(GCOV_TOOL_OBJS) $(GENGTYPE_OBJS) gcc-ar.o gcc-nm.o gcc-ranlib.o \ |
1607 | lto-wrapper.o collect-utils.o | |
6fb2153a | 1608 | |
b4c71cbb | 1609 | # for anything that is shared use the cc1plus profile data, as that |
1610 | # is likely the most exercised during the build | |
6eb2402f | 1611 | ifeq ($(if $(wildcard ../stage_current),$(shell cat \ |
1612 | ../stage_current)),stageautofeedback) | |
b4c71cbb | 1613 | $(ALL_HOST_BACKEND_OBJS): ALL_COMPILERFLAGS += -fauto-profile=cc1plus.fda |
1614 | $(ALL_HOST_BACKEND_OBJS): cc1plus.fda | |
1615 | endif | |
1616 | ||
141acd01 | 1617 | # This lists all host object files, whether they are included in this |
1618 | # compilation or not. | |
1619 | ALL_HOST_OBJS = $(ALL_HOST_FRONTEND_OBJS) $(ALL_HOST_BACKEND_OBJS) | |
1620 | ||
894a34ef | 1621 | BACKEND = libbackend.a main.o libcommon-target.a libcommon.a \ |
eb65953e | 1622 | $(CPPLIB) $(LIBDECNUMBER) |
0f221fb7 | 1623 | |
1410e798 | 1624 | # This is defined to "yes" if Tree checking is enabled, which roughly means |
1625 | # front-end checking. | |
1626 | TREECHECKING = @TREECHECKING@ | |
1627 | ||
863e76f9 | 1628 | # The full name of the driver on installation |
1629 | FULL_DRIVER_NAME=$(target_noncanonical)-gcc-$(version)$(exeext) | |
1630 | ||
e3ca137a | 1631 | MOSTLYCLEANFILES = insn-flags.h insn-config.h insn-codes.h \ |
32e6d418 | 1632 | insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \ |
73ed0c67 | 1633 | insn-attr.h insn-attr-common.h insn-attrtab.c insn-dfatab.c \ |
ee65118b | 1634 | insn-latencytab.c insn-opinit.c insn-opinit.h insn-preds.c insn-constants.h \ |
2165588a | 1635 | tm-preds.h tm-constrs.h checksum-options gimple-match.c generic-match.c \ |
8734172d | 1636 | tree-check.h min-insn-modes.c insn-modes.c insn-modes.h insn-modes-inline.h \ |
b6762859 | 1637 | genrtl.h gt-*.h gtype-*.h gtype-desc.c gtyp-input.list \ |
ff690865 | 1638 | case-cfn-macros.h cfn-operators.pd \ |
863e76f9 | 1639 | xgcc$(exeext) cpp$(exeext) $(FULL_DRIVER_NAME) \ |
237490bf | 1640 | $(EXTRA_PROGRAMS) gcc-cross$(exeext) \ |
46215dc9 | 1641 | $(SPECS) collect2$(exeext) gcc-ar$(exeext) gcc-nm$(exeext) \ |
1642 | gcc-ranlib$(exeext) \ | |
805e22b2 | 1643 | gcov-iov$(build_exeext) gcov$(exeext) gcov-dump$(exeext) \ |
e76f6040 | 1644 | gcov-tool$(exeect) \ |
6d70c713 | 1645 | gengtype$(exeext) *.[0-9][0-9].* *.[si] *-checksum.c libbackend.a \ |
b4c71cbb | 1646 | libcommon-target.a libcommon.a libgcc.mk perf.data |
32e6d418 | 1647 | |
863e76f9 | 1648 | # This symlink makes the full installation name of the driver be available |
1649 | # from within the *build* directory, for use when running the JIT library | |
1650 | # from there (e.g. when running its testsuite). | |
1651 | $(FULL_DRIVER_NAME): ./xgcc | |
96439bf2 | 1652 | rm -f $@ |
1653 | $(LN_S) $< $@ | |
863e76f9 | 1654 | |
2e9d8ccf | 1655 | #\f |
73027c94 | 1656 | # Language makefile fragments. |
1657 | ||
1658 | # The following targets define the interface between us and the languages. | |
1659 | # | |
0fc07c25 | 1660 | # all.cross, start.encap, rest.encap, |
ae6555f9 | 1661 | # install-common, install-info, install-man, |
98fb2ff8 | 1662 | # uninstall, |
80e909c6 | 1663 | # mostlyclean, clean, distclean, maintainer-clean, |
73027c94 | 1664 | # |
d5cd09c5 | 1665 | # Each language is linked in with a series of hooks. The name of each |
1666 | # hooked is "lang.${target_name}" (eg: lang.info). Configure computes | |
1667 | # and adds these here. We use double-colon rules for some of the hooks; | |
1668 | # double-colon rules should be preferred for any new hooks. | |
73027c94 | 1669 | |
a455468e | 1670 | # language hooks, generated by configure |
87c0ad1b | 1671 | @language_hooks@ |
73027c94 | 1672 | |
a455468e | 1673 | # per-language makefile fragments |
1674 | ifneq ($(LANG_MAKEFRAGS),) | |
1675 | include $(LANG_MAKEFRAGS) | |
1676 | endif | |
73027c94 | 1677 | |
e0fa47cd | 1678 | # target and host overrides must follow the per-language makefile fragments |
1679 | # so they can override or augment language-specific variables | |
1680 | ||
1681 | # target overrides | |
1682 | ifneq ($(tmake_file),) | |
1683 | include $(tmake_file) | |
1684 | endif | |
1685 | ||
1686 | # host overrides | |
1687 | ifneq ($(xmake_file),) | |
1688 | include $(xmake_file) | |
1689 | endif | |
1690 | ||
e014fc6a | 1691 | # all-tree.def includes all the tree.def files. |
1692 | all-tree.def: s-alltree; @true | |
1693 | s-alltree: Makefile | |
1694 | rm -f tmp-all-tree.def | |
1695 | echo '#include "tree.def"' > tmp-all-tree.def | |
1696 | echo 'END_OF_BASE_TREE_CODES' >> tmp-all-tree.def | |
7bedc3a0 | 1697 | echo '#include "c-family/c-common.def"' >> tmp-all-tree.def |
e014fc6a | 1698 | ltf="$(lang_tree_files)"; for f in $$ltf; do \ |
1699 | echo "#include \"$$f\""; \ | |
1700 | done | sed 's|$(srcdir)/||' >> tmp-all-tree.def | |
1701 | $(SHELL) $(srcdir)/../move-if-change tmp-all-tree.def all-tree.def | |
1702 | $(STAMP) s-alltree | |
1703 | ||
141acd01 | 1704 | # Now that LANG_MAKEFRAGS are included, we can add special flags to the |
1705 | # objects that belong to the front ends. We add an extra define that | |
1706 | # causes back-end specific include files to be poisoned, in the hope that | |
1707 | # we can avoid introducing dependencies of the front ends on things that | |
1708 | # no front end should ever look at (e.g. everything RTL related). | |
1709 | $(foreach file,$(ALL_HOST_FRONTEND_OBJS),$(eval CFLAGS-$(file) += -DIN_GCC_FRONTEND)) | |
1710 | ||
2e9d8ccf | 1711 | #\f |
32e6d418 | 1712 | |
966842d4 | 1713 | # ----------------------------- |
1714 | # Rebuilding this configuration | |
1715 | # ----------------------------- | |
1716 | ||
58e540b8 | 1717 | # On the use of stamps: |
1718 | # Consider the example of tree-check.h. It is constructed with build/gencheck. | |
1719 | # A simple rule to build tree-check.h would be | |
1720 | # tree-check.h: build/gencheck$(build_exeext) | |
1721 | # $(RUN_GEN) build/gencheck$(build_exeext) > tree-check.h | |
1722 | # | |
1723 | # but tree-check.h doesn't change every time gencheck changes. It would the | |
21886706 | 1724 | # nice if targets that depend on tree-check.h wouldn't be rebuild |
58e540b8 | 1725 | # unnecessarily when tree-check.h is unchanged. To make this, tree-check.h |
1726 | # must not be overwritten with a identical copy. One solution is to use a | |
1727 | # temporary file | |
1728 | # tree-check.h: build/gencheck$(build_exeext) | |
f0ecf45a | 1729 | # $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h |
58e540b8 | 1730 | # $(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h |
1731 | # | |
1732 | # This solution has a different problem. Since the time stamp of tree-check.h | |
1733 | # is unchanged, make will try to update tree-check.h every time it runs. | |
1734 | # To prevent this, one can add a stamp | |
1735 | # tree-check.h: s-check | |
1736 | # s-check : build/gencheck$(build_exeext) | |
f0ecf45a | 1737 | # $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h |
58e540b8 | 1738 | # $(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h |
1739 | # $(STAMP) s-check | |
1740 | # | |
1741 | # The problem with this solution is that make thinks that tree-check.h is | |
1742 | # always unchanged. Make must be deceived into thinking that tree-check.h is | |
f0ecf45a | 1743 | # rebuild by the "tree-check.h: s-check" rule. To do this, add a dummy command: |
58e540b8 | 1744 | # tree-check.h: s-check; @true |
1745 | # s-check : build/gencheck$(build_exeext) | |
f0ecf45a | 1746 | # $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h |
58e540b8 | 1747 | # $(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h |
1748 | # $(STAMP) s-check | |
1749 | # | |
1750 | # This is what is done in this makefile. Note that mkconfig.sh has a | |
1751 | # move-if-change built-in | |
1752 | ||
1af67e62 | 1753 | Makefile: config.status $(srcdir)/Makefile.in $(LANG_MAKEFRAGS) |
a455468e | 1754 | LANGUAGES="$(CONFIG_LANGUAGES)" \ |
1755 | CONFIG_HEADERS= \ | |
3a6fbbb0 | 1756 | CONFIG_SHELL="$(SHELL)" \ |
a455468e | 1757 | CONFIG_FILES=$@ $(SHELL) config.status |
32e6d418 | 1758 | |
83b8e55b | 1759 | config.h: cs-config.h ; @true |
805e22b2 | 1760 | bconfig.h: cs-bconfig.h ; @true |
83b8e55b | 1761 | tconfig.h: cs-tconfig.h ; @true |
805e22b2 | 1762 | tm.h: cs-tm.h ; @true |
83b8e55b | 1763 | tm_p.h: cs-tm_p.h ; @true |
1764 | ||
1765 | cs-config.h: Makefile | |
805e22b2 | 1766 | TARGET_CPU_DEFAULT="" \ |
4dcab8b7 | 1767 | HEADERS="$(host_xm_include_list)" DEFINES="$(host_xm_defines)" \ |
83b8e55b | 1768 | $(SHELL) $(srcdir)/mkconfig.sh config.h |
1769 | ||
805e22b2 | 1770 | cs-bconfig.h: Makefile |
1771 | TARGET_CPU_DEFAULT="" \ | |
4dcab8b7 | 1772 | HEADERS="$(build_xm_include_list)" DEFINES="$(build_xm_defines)" \ |
805e22b2 | 1773 | $(SHELL) $(srcdir)/mkconfig.sh bconfig.h |
83b8e55b | 1774 | |
a1a7e9d5 | 1775 | cs-tconfig.h: Makefile |
8b24e546 | 1776 | TARGET_CPU_DEFAULT="" \ |
fcd42b1e | 1777 | HEADERS="$(xm_include_list)" DEFINES="USED_FOR_TARGET $(xm_defines)" \ |
83b8e55b | 1778 | $(SHELL) $(srcdir)/mkconfig.sh tconfig.h |
1779 | ||
805e22b2 | 1780 | cs-tm.h: Makefile |
1781 | TARGET_CPU_DEFAULT="$(target_cpu_default)" \ | |
4dcab8b7 | 1782 | HEADERS="$(tm_include_list)" DEFINES="$(tm_defines)" \ |
805e22b2 | 1783 | $(SHELL) $(srcdir)/mkconfig.sh tm.h |
1784 | ||
83b8e55b | 1785 | cs-tm_p.h: Makefile |
805e22b2 | 1786 | TARGET_CPU_DEFAULT="" \ |
4dcab8b7 | 1787 | HEADERS="$(tm_p_include_list)" DEFINES="" \ |
83b8e55b | 1788 | $(SHELL) $(srcdir)/mkconfig.sh tm_p.h |
1789 | ||
c0450c4b | 1790 | # Don't automatically run autoconf, since configure.ac might be accidentally |
67afd3f0 | 1791 | # newer than configure. Also, this writes into the source directory which |
1792 | # might be on a read-only file system. If configured for maintainer mode | |
1793 | # then do allow autoconf to be run. | |
1794 | ||
a2655af1 | 1795 | AUTOCONF = autoconf |
1796 | ACLOCAL = aclocal | |
1797 | ACLOCAL_AMFLAGS = -I ../config -I .. | |
1798 | aclocal_deps = \ | |
1799 | $(srcdir)/../libtool.m4 \ | |
1800 | $(srcdir)/../ltoptions.m4 \ | |
1801 | $(srcdir)/../ltsugar.m4 \ | |
1802 | $(srcdir)/../ltversion.m4 \ | |
1803 | $(srcdir)/../lt~obsolete.m4 \ | |
1804 | $(srcdir)/../config/acx.m4 \ | |
1805 | $(srcdir)/../config/codeset.m4 \ | |
cb7a0f1d | 1806 | $(srcdir)/../config/depstand.m4 \ |
1807 | $(srcdir)/../config/dfp.m4 \ | |
ab103e33 | 1808 | $(srcdir)/../config/gcc-plugin.m4 \ |
cb7a0f1d | 1809 | $(srcdir)/../config/gettext-sister.m4 \ |
a2655af1 | 1810 | $(srcdir)/../config/iconv.m4 \ |
1811 | $(srcdir)/../config/lcmessage.m4 \ | |
cb7a0f1d | 1812 | $(srcdir)/../config/lead-dot.m4 \ |
a2655af1 | 1813 | $(srcdir)/../config/lib-ld.m4 \ |
1814 | $(srcdir)/../config/lib-link.m4 \ | |
1815 | $(srcdir)/../config/lib-prefix.m4 \ | |
cb7a0f1d | 1816 | $(srcdir)/../config/mmap.m4 \ |
a2655af1 | 1817 | $(srcdir)/../config/override.m4 \ |
cb7a0f1d | 1818 | $(srcdir)/../config/picflag.m4 \ |
a2655af1 | 1819 | $(srcdir)/../config/progtest.m4 \ |
82e964b0 | 1820 | $(srcdir)/../config/stdint.m4 \ |
a2655af1 | 1821 | $(srcdir)/../config/warnings.m4 \ |
cb7a0f1d | 1822 | $(srcdir)/../config/zlib.m4 \ |
a2655af1 | 1823 | $(srcdir)/acinclude.m4 |
1824 | ||
1825 | $(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/aclocal.m4 | |
1826 | (cd $(srcdir) && $(AUTOCONF)) | |
1827 | ||
1828 | $(srcdir)/aclocal.m4 : @MAINT@ $(aclocal_deps) | |
1829 | (cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)) | |
87c0ad1b | 1830 | |
0d9d9ae4 | 1831 | # cstamp-h.in controls rebuilding of config.in. |
d44645af | 1832 | # It is named cstamp-h.in and not stamp-h.in so the mostlyclean rule doesn't |
1833 | # delete it. A stamp file is needed as autoheader won't update the file if | |
1834 | # nothing has changed. | |
0d9d9ae4 | 1835 | # It remains in the source directory and is part of the distribution. |
1836 | # This follows what is done in shellutils, fileutils, etc. | |
c3b8daa3 | 1837 | # "echo timestamp" is used instead of touch to be consistent with other |
1838 | # packages that use autoconf (??? perhaps also to avoid problems with patch?). | |
0d9d9ae4 | 1839 | # ??? Newer versions have a maintainer mode that may be useful here. |
67afd3f0 | 1840 | |
1841 | # Don't run autoheader automatically either. | |
1842 | # Only run it if maintainer mode is enabled. | |
a2655af1 | 1843 | @MAINT@ AUTOHEADER = autoheader |
67afd3f0 | 1844 | @MAINT@ $(srcdir)/config.in: $(srcdir)/cstamp-h.in |
c0450c4b | 1845 | @MAINT@ $(srcdir)/cstamp-h.in: $(srcdir)/configure.ac |
a2655af1 | 1846 | @MAINT@ (cd $(srcdir) && $(AUTOHEADER)) |
67afd3f0 | 1847 | @MAINT@ @rm -f $(srcdir)/cstamp-h.in |
1848 | @MAINT@ echo timestamp > $(srcdir)/cstamp-h.in | |
764fc592 | 1849 | auto-host.h: cstamp-h ; @true |
0d9d9ae4 | 1850 | cstamp-h: config.in config.status |
a455468e | 1851 | CONFIG_HEADERS=auto-host.h:config.in \ |
1852 | CONFIG_FILES= \ | |
1853 | LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status | |
5539b206 | 1854 | |
d44645af | 1855 | # Really, really stupid make features, such as SUN's KEEP_STATE, may force |
1856 | # a target to build even if it is up-to-date. So we must verify that | |
1857 | # config.status does not exist before failing. | |
1af67e62 | 1858 | config.status: $(srcdir)/configure $(srcdir)/config.gcc |
d44645af | 1859 | @if [ ! -f config.status ] ; then \ |
98fb2ff8 | 1860 | echo You must configure gcc. Look at http://gcc.gnu.org/install/ for details.; \ |
d44645af | 1861 | false; \ |
1862 | else \ | |
76103b2c | 1863 | LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status --recheck; \ |
d44645af | 1864 | fi |
1865 | ||
966842d4 | 1866 | # -------- |
1867 | # UNSORTED | |
1868 | # -------- | |
1869 | ||
c7cc973b | 1870 | # Provide quickstrap as a target that people can type into the gcc directory, |
1871 | # and that fails if you're not into it. | |
1872 | quickstrap: all | |
1873 | cd $(toplevel_builddir) && $(MAKE) all-target-libgcc | |
1874 | ||
99b4f3a2 | 1875 | all.internal: start.encap rest.encap doc selftest |
32e6d418 | 1876 | # This is what to compile if making a cross-compiler. |
a01acf14 | 1877 | all.cross: native gcc-cross$(exeext) cpp$(exeext) specs \ |
99b4f3a2 | 1878 | libgcc-support lang.all.cross doc selftest @GENINSRC@ srcextra |
32e6d418 | 1879 | # This is what must be made before installing GCC and converting libraries. |
dd6a91ba | 1880 | start.encap: native xgcc$(exeext) cpp$(exeext) specs \ |
6ea4242f | 1881 | libgcc-support lang.start.encap @GENINSRC@ srcextra |
335ebf8f | 1882 | # These can't be made until after GCC can run. |
f2397fc4 | 1883 | rest.encap: lang.rest.encap |
32e6d418 | 1884 | # This is what is made with the host's compiler |
1885 | # whether making a cross compiler or not. | |
1e12d536 | 1886 | native: config.status auto-host.h build-@POSUB@ $(LANGUAGES) \ |
7151decb | 1887 | $(EXTRA_PROGRAMS) $(COLLECT2) lto-wrapper$(exeext) \ |
46215dc9 | 1888 | gcc-ar$(exeext) gcc-nm$(exeext) gcc-ranlib$(exeext) |
32e6d418 | 1889 | |
6d70c713 | 1890 | ifeq ($(enable_plugin),yes) |
1891 | native: gengtype$(exeext) | |
1892 | endif | |
1893 | ||
840a6e8d | 1894 | # On the target machine, finish building a cross compiler. |
1895 | # This does the things that can't be done on the host machine. | |
894a47b4 | 1896 | rest.cross: specs |
840a6e8d | 1897 | |
44175146 | 1898 | # GCC's selftests. |
1899 | # Specify a dummy input file to placate the driver. | |
c2d86129 | 1900 | # Specify -nostdinc to work around missing WIND_BASE environment variable |
1901 | # required for *-wrs-vxworks-* targets. | |
a37e1058 | 1902 | # Specify -o /dev/null so the output of -S is discarded. More importantly |
1903 | # It does not try to create a file with the name "null.s" on POSIX and | |
1904 | # "nul.s" on Windows. Because on Windows "nul" is a reserved file name. | |
c081d2fc | 1905 | # Specify the path to gcc/testsuite/selftests within the srcdir |
1906 | # as an argument to -fself-test. | |
7051d239 | 1907 | SELFTEST_FLAGS = -nostdinc /dev/null -S -o /dev/null \ |
c081d2fc | 1908 | -fself-test=$(srcdir)/testsuite/selftests |
44175146 | 1909 | |
7051d239 | 1910 | C_SELFTEST_FLAGS = -xc $(SELFTEST_FLAGS) |
1911 | CPP_SELFTEST_FLAGS = -xc++ $(SELFTEST_FLAGS) | |
1912 | ||
1913 | SELFTEST_DEPS = $(GCC_PASSES) stmp-int-hdrs $(srcdir)/testsuite/selftests | |
1914 | ||
1915 | C_SELFTEST_DEPS = cc1$(exeext) $(SELFTEST_DEPS) | |
1916 | CPP_SELFTEST_DEPS = cc1plus$(exeext) $(SELFTEST_DEPS) | |
1917 | ||
1918 | # Run the selftests during the build once we have a driver and the frontend, | |
99b4f3a2 | 1919 | # so that self-test failures are caught as early as possible. |
7051d239 | 1920 | # Use "s-selftest-FE" to ensure that we only run the selftests if the |
1921 | # driver, frontend, or selftest data change. | |
99b4f3a2 | 1922 | .PHONY: selftest |
7051d239 | 1923 | selftest: s-selftest-c s-selftest-c++ |
1924 | ||
1925 | # C selftests | |
1926 | s-selftest-c: $(C_SELFTEST_DEPS) | |
1927 | $(GCC_FOR_TARGET) $(C_SELFTEST_FLAGS) | |
99b4f3a2 | 1928 | $(STAMP) $@ |
1929 | ||
7051d239 | 1930 | # Convenience methods for running C selftests under gdb: |
1931 | .PHONY: selftest-c-gdb | |
1932 | selftest-c-gdb: $(C_SELFTEST_DEPS) | |
1933 | $(GCC_FOR_TARGET) $(C_SELFTEST_FLAGS) \ | |
44175146 | 1934 | -wrapper gdb,--args |
99b4f3a2 | 1935 | |
7051d239 | 1936 | .PHONY: selftest-gdb |
1937 | selftest-gdb: selftest-c-gdb | |
1938 | ||
1939 | # Convenience methods for running C selftests under valgrind: | |
1940 | .PHONY: selftest-c-valgrind | |
1941 | selftest-c-valgrind: $(C_SELFTEST_DEPS) | |
1942 | $(GCC_FOR_TARGET) $(C_SELFTEST_FLAGS) \ | |
1943 | -wrapper valgrind,--leak-check=full | |
1944 | ||
60be9705 | 1945 | .PHONY: selftest-valgrind |
7051d239 | 1946 | selftest-valgrind: selftest-c-valgrind |
1947 | ||
1948 | # C++ selftests | |
1949 | s-selftest-c++: $(CPP_SELFTEST_DEPS) | |
1950 | $(GCC_FOR_TARGET) $(CPP_SELFTEST_FLAGS) | |
1951 | $(STAMP) $@ | |
1952 | ||
1953 | # Convenience method for running C++ selftests under gdb: | |
1954 | .PHONY: selftest-c++-gdb | |
1955 | selftest-c++-gdb: $(CPP_SELFTEST_DEPS) | |
1956 | $(GCC_FOR_TARGET) $(CPP_SELFTEST_FLAGS) \ | |
1957 | -wrapper gdb,--args | |
1958 | ||
1959 | # Convenience method for running C++ selftests under valgrind: | |
1960 | .PHONY: selftest-c++-valgrind | |
1961 | selftest-c++-valgrind: $(CPP_SELFTEST_DEPS) | |
1962 | $(GCC_FOR_TARGET) $(CPP_SELFTEST_FLAGS) \ | |
60be9705 | 1963 | -wrapper valgrind,--leak-check=full |
1964 | ||
840a6e8d | 1965 | # Recompile all the language-independent object files. |
1966 | # This is used only if the user explicitly asks for it. | |
0f221fb7 | 1967 | compilations: $(BACKEND) |
32e6d418 | 1968 | |
d856c8a6 | 1969 | # This archive is strictly for the host. |
66548868 | 1970 | libbackend.a: $(OBJS) |
0f221fb7 | 1971 | -rm -rf libbackend.a |
655e3fb1 | 1972 | @# Build libbackend.a as a thin archive if possible, as doing so |
1973 | @# significantly reduces build times. | |
1974 | ifeq ($(USE_THIN_ARCHIVES),yes) | |
1975 | $(AR) $(AR_FLAGS)T libbackend.a $(OBJS) | |
1976 | else | |
66548868 | 1977 | $(AR) $(AR_FLAGS) libbackend.a $(OBJS) |
72318bfa | 1978 | -$(RANLIB) $(RANLIB_FLAGS) libbackend.a |
655e3fb1 | 1979 | endif |
03f51dea | 1980 | |
eb65953e | 1981 | libcommon-target.a: $(OBJS-libcommon-target) |
1982 | -rm -rf libcommon-target.a | |
1983 | $(AR) $(AR_FLAGS) libcommon-target.a $(OBJS-libcommon-target) | |
1984 | -$(RANLIB) $(RANLIB_FLAGS) libcommon-target.a | |
1985 | ||
0b4f4daf | 1986 | libcommon.a: $(OBJS-libcommon) |
1987 | -rm -rf libcommon.a | |
1988 | $(AR) $(AR_FLAGS) libcommon.a $(OBJS-libcommon) | |
1989 | -$(RANLIB) $(RANLIB_FLAGS) libcommon.a | |
1990 | ||
77a164d8 | 1991 | # We call this executable `xgcc' rather than `gcc' |
1992 | # to avoid confusion if the current directory is in the path | |
1993 | # and CC is `gcc'. It is renamed to `gcc' when it is installed. | |
e53d55e7 | 1994 | xgcc$(exeext): $(GCC_OBJS) c/gccspec.o libcommon-target.a $(LIBDEPS) \ |
eb65953e | 1995 | $(EXTRA_GCC_OBJS) |
70293f47 | 1996 | +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) \ |
e53d55e7 | 1997 | c/gccspec.o $(EXTRA_GCC_OBJS) libcommon-target.a \ |
76fd9e61 | 1998 | $(EXTRA_GCC_LIBS) $(LIBS) |
840a6e8d | 1999 | |
e53d55e7 | 2000 | # cpp is to cpp0 as e.g. g++ is to cc1plus: Just another driver. |
2001 | # It is part of c-family because the handled extensions are hard-coded | |
2002 | # and only contain c-family extensions (see known_suffixes). | |
2003 | cpp$(exeext): $(GCC_OBJS) c-family/cppspec.o libcommon-target.a $(LIBDEPS) \ | |
eb65953e | 2004 | $(EXTRA_GCC_OBJS) |
70293f47 | 2005 | +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) \ |
e53d55e7 | 2006 | c-family/cppspec.o $(EXTRA_GCC_OBJS) libcommon-target.a \ |
76fd9e61 | 2007 | $(EXTRA_GCC_LIBS) $(LIBS) |
28c11b39 | 2008 | |
840a6e8d | 2009 | # Dump a specs file to make -B./ read these specs over installed ones. |
d0faeb9d | 2010 | $(SPECS): xgcc$(exeext) |
c92e16d4 | 2011 | $(GCC_FOR_TARGET) -dumpspecs > tmp-specs |
d0faeb9d | 2012 | mv tmp-specs $(SPECS) |
32e6d418 | 2013 | |
77a164d8 | 2014 | # We do want to create an executable named `xgcc', so we can use it to |
32e6d418 | 2015 | # compile libgcc2.a. |
2016 | # Also create gcc-cross, so that install-common will install properly. | |
a01acf14 | 2017 | gcc-cross$(exeext): xgcc$(exeext) |
62268150 | 2018 | cp xgcc$(exeext) gcc-cross$(exeext) |
32e6d418 | 2019 | |
18cfeada | 2020 | checksum-options: |
2021 | echo "$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS)" > checksum-options.tmp \ | |
2022 | && $(srcdir)/../move-if-change checksum-options.tmp checksum-options | |
21886706 | 2023 | |
2e9d8ccf | 2024 | #\f |
32e6d418 | 2025 | # Build libgcc.a. |
a20b21eb | 2026 | |
f2397fc4 | 2027 | libgcc-support: libgcc.mvars stmp-int-hdrs $(TCONFIG_H) \ |
4dc4ff49 | 2028 | $(MACHMODE_H) gcov-iov.h |
894a47b4 | 2029 | |
4dc4ff49 | 2030 | libgcc.mvars: config.status Makefile specs xgcc$(exeext) |
894a47b4 | 2031 | : > tmp-libgcc.mvars |
237490bf | 2032 | echo GCC_CFLAGS = '$(GCC_CFLAGS)' >> tmp-libgcc.mvars |
2033 | echo INHIBIT_LIBC_CFLAGS = '$(INHIBIT_LIBC_CFLAGS)' >> tmp-libgcc.mvars | |
5b69e2e1 | 2034 | echo TARGET_SYSTEM_ROOT = '$(TARGET_SYSTEM_ROOT)' >> tmp-libgcc.mvars |
e9abca4f | 2035 | if test @enable_default_pie@ = yes; then \ |
2036 | NO_PIE_CFLAGS="-fno-PIE"; \ | |
2037 | else \ | |
2038 | NO_PIE_CFLAGS=; \ | |
2039 | fi; \ | |
2040 | echo NO_PIE_CFLAGS = "$$NO_PIE_CFLAGS" >> tmp-libgcc.mvars | |
894a47b4 | 2041 | |
2042 | mv tmp-libgcc.mvars libgcc.mvars | |
32e6d418 | 2043 | |
f1ad3130 | 2044 | # Use the genmultilib shell script to generate the information the gcc |
2045 | # driver program needs to select the library directory based on the | |
2046 | # switches. | |
997d68fe | 2047 | multilib.h: s-mlib; @true |
2048 | s-mlib: $(srcdir)/genmultilib Makefile | |
a2770a85 | 2049 | if test @enable_multilib@ = yes \ |
2050 | || test -n "$(MULTILIB_OSDIRNAMES)"; then \ | |
7a94134d | 2051 | $(SHELL) $(srcdir)/genmultilib \ |
2052 | "$(MULTILIB_OPTIONS)" \ | |
2053 | "$(MULTILIB_DIRNAMES)" \ | |
2054 | "$(MULTILIB_MATCHES)" \ | |
2055 | "$(MULTILIB_EXCEPTIONS)" \ | |
2056 | "$(MULTILIB_EXTRA_OPTS)" \ | |
2057 | "$(MULTILIB_EXCLUSIONS)" \ | |
c954ff02 | 2058 | "$(MULTILIB_OSDIRNAMES)" \ |
cec45616 | 2059 | "$(MULTILIB_REQUIRED)" \ |
8915b6c8 | 2060 | "$(if $(MULTILIB_OSDIRNAMES),,$(MULTIARCH_DIRNAME))" \ |
7137cdac | 2061 | "$(MULTILIB_REUSE)" \ |
a2770a85 | 2062 | "@enable_multilib@" \ |
7a94134d | 2063 | > tmp-mlib.h; \ |
2064 | else \ | |
7137cdac | 2065 | $(SHELL) $(srcdir)/genmultilib '' '' '' '' '' '' '' '' \ |
2066 | "$(MULTIARCH_DIRNAME)" '' no \ | |
a2770a85 | 2067 | > tmp-mlib.h; \ |
7a94134d | 2068 | fi |
ed90d522 | 2069 | $(SHELL) $(srcdir)/../move-if-change tmp-mlib.h multilib.h |
5ec97d31 | 2070 | $(STAMP) s-mlib |
2e9d8ccf | 2071 | #\f |
32e6d418 | 2072 | # Compiling object files from source files. |
2073 | ||
21886706 | 2074 | # Note that dependencies on obstack.h are not written |
2075 | # because that file is not part of GCC. | |
2076 | ||
6bc11008 | 2077 | srcextra: gcc.srcextra lang.srcextra |
2078 | ||
1e837561 | 2079 | gcc.srcextra: gengtype-lex.c |
a6b4c5a9 | 2080 | -cp -p $^ $(srcdir) |
2081 | ||
cdd7a5a4 | 2082 | AR_OBJS = file-find.o |
46215dc9 | 2083 | AR_LIBS = @COLLECT2_LIBS@ |
2084 | ||
cdd7a5a4 | 2085 | gcc-ar$(exeext): gcc-ar.o $(AR_OBJS) $(LIBDEPS) |
46215dc9 | 2086 | +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) gcc-ar.o -o $@ \ |
cdd7a5a4 | 2087 | $(AR_OBJS) $(LIBS) $(AR_LIBS) |
46215dc9 | 2088 | |
cdd7a5a4 | 2089 | gcc-nm$(exeext): gcc-nm.o $(AR_OBJS) $(LIBDEPS) |
46215dc9 | 2090 | +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) gcc-nm.o -o $@ \ |
cdd7a5a4 | 2091 | $(AR_OBJS) $(LIBS) $(AR_LIBS) |
46215dc9 | 2092 | |
cdd7a5a4 | 2093 | gcc-ranlib$(exeext): gcc-ranlib.o $(AR_OBJS) $(LIBDEPS) |
46215dc9 | 2094 | +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) gcc-ranlib.o -o $@ \ |
cdd7a5a4 | 2095 | $(AR_OBJS) $(LIBS) $(AR_LIBS) |
46215dc9 | 2096 | |
2097 | CFLAGS-gcc-ar.o += $(DRIVER_DEFINES) \ | |
2098 | -DTARGET_MACHINE=\"$(target_noncanonical)\" \ | |
2099 | @TARGET_SYSTEM_ROOT_DEFINE@ -DPERSONALITY=\"ar\" | |
2100 | ||
46215dc9 | 2101 | CFLAGS-gcc-ranlib.o += $(DRIVER_DEFINES) \ |
2102 | -DTARGET_MACHINE=\"$(target_noncanonical)\" \ | |
2103 | @TARGET_SYSTEM_ROOT_DEFINE@ -DPERSONALITY=\"ranlib\" | |
2104 | ||
46215dc9 | 2105 | CFLAGS-gcc-nm.o += $(DRIVER_DEFINES) \ |
2106 | -DTARGET_MACHINE=\"$(target_noncanonical)\" \ | |
2107 | @TARGET_SYSTEM_ROOT_DEFINE@ -DPERSONALITY=\"nm\" | |
2108 | ||
46215dc9 | 2109 | # ??? the implicit rules dont trigger if the source file has a different name |
2110 | # so copy instead | |
2111 | gcc-ranlib.c: gcc-ar.c | |
2112 | cp $^ $@ | |
2113 | ||
2114 | gcc-nm.c: gcc-ar.c | |
2115 | cp $^ $@ | |
2116 | ||
39ef03bb | 2117 | COLLECT2_OBJS = collect2.o collect2-aix.o tlink.o vec.o ggc-none.o \ |
99b4f3a2 | 2118 | collect-utils.o file-find.o hash-table.o selftest.o |
45449d9f | 2119 | COLLECT2_LIBS = @COLLECT2_LIBS@ |
67ce0331 | 2120 | collect2$(exeext): $(COLLECT2_OBJS) $(LIBDEPS) |
e77fd588 | 2121 | # Don't try modifying collect2 (aka ld) in place--it might be linking this. |
70293f47 | 2122 | +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o T$@ \ |
45449d9f | 2123 | $(COLLECT2_OBJS) $(LIBS) $(COLLECT2_LIBS) |
8e920924 | 2124 | mv -f T$@ $@ |
32e6d418 | 2125 | |
fc3bd902 | 2126 | CFLAGS-collect2.o += -DTARGET_MACHINE=\"$(target_noncanonical)\" \ |
2127 | @TARGET_SYSTEM_ROOT_DEFINE@ | |
21886706 | 2128 | |
eb9ccb01 | 2129 | LTO_WRAPPER_OBJS = lto-wrapper.o collect-utils.o ggc-none.o |
2130 | lto-wrapper$(exeext): $(LTO_WRAPPER_OBJS) libcommon-target.a $(LIBDEPS) | |
00d389c8 | 2131 | +$(LINKER) $(ALL_COMPILERFLAGS) $(LDFLAGS) -o T$@ \ |
eb9ccb01 | 2132 | $(LTO_WRAPPER_OBJS) libcommon-target.a $(LIBS) |
7bfefa9d | 2133 | mv -f T$@ $@ |
2134 | ||
e53d55e7 | 2135 | # Files used by all variants of C or by the stand-alone pre-processor. |
7bedc3a0 | 2136 | |
fc3bd902 | 2137 | CFLAGS-c-family/c-opts.o += @TARGET_SYSTEM_ROOT_DEFINE@ |
21886706 | 2138 | |
fc3bd902 | 2139 | CFLAGS-c-family/c-pch.o += -DHOST_MACHINE=\"$(host)\" \ |
2140 | -DTARGET_MACHINE=\"$(target)\" | |
7bedc3a0 | 2141 | |
c1485012 | 2142 | default-c.o: config/default-c.c |
2143 | $(COMPILE) $< | |
2144 | $(POSTCOMPILE) | |
7bedc3a0 | 2145 | |
7bedc3a0 | 2146 | # Files used by all variants of C and some other languages. |
7bedc3a0 | 2147 | |
fc3bd902 | 2148 | CFLAGS-prefix.o += -DPREFIX=\"$(prefix)\" -DBASEVER=$(BASEVER_s) |
1d7f9a87 | 2149 | prefix.o: $(BASEVER) |
32e6d418 | 2150 | |
21886706 | 2151 | # Language-independent files. |
277b05bb | 2152 | |
4813bdd4 | 2153 | DRIVER_DEFINES = \ |
b155ba2f | 2154 | -DSTANDARD_STARTFILE_PREFIX=\"$(unlibsubdir)/\" \ |
9db45a87 | 2155 | -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \ |
2156 | -DSTANDARD_LIBEXEC_PREFIX=\"$(libexecdir)/gcc/\" \ | |
7df9e578 | 2157 | -DDEFAULT_TARGET_VERSION=\"$(version)\" \ |
a3d93be3 | 2158 | -DDEFAULT_REAL_TARGET_MACHINE=\"$(real_target_noncanonical)\" \ |
d58156a1 | 2159 | -DDEFAULT_TARGET_MACHINE=\"$(target_noncanonical)\" \ |
b155ba2f | 2160 | -DSTANDARD_BINDIR_PREFIX=\"$(bindir)/\" \ |
fc5f9e0c | 2161 | -DTOOLDIR_BASE_PREFIX=\"$(libsubdir_to_prefix)$(prefix_to_exec_prefix)\" \ |
a3d93be3 | 2162 | -DACCEL_DIR_SUFFIX=\"$(accel_dir_suffix)\" \ |
805e22b2 | 2163 | @TARGET_SYSTEM_ROOT_DEFINE@ \ |
0fa54ff1 | 2164 | $(VALGRIND_DRIVER_DEFINES) \ |
396044e4 | 2165 | $(if $(SHLIB),$(if $(filter yes,@enable_shared@),-DENABLE_SHARED_LIBGCC)) \ |
a24a71cc | 2166 | -DCONFIGURE_SPECS="\"@CONFIGURE_SPECS@\"" |
21886706 | 2167 | |
0812bb06 | 2168 | CFLAGS-gcc.o += $(DRIVER_DEFINES) -DBASEVER=$(BASEVER_s) |
2169 | gcc.o: $(BASEVER) | |
21886706 | 2170 | |
a1a7e9d5 | 2171 | specs.h : s-specs ; @true |
2172 | s-specs : Makefile | |
108251d9 | 2173 | lsf="$(lang_specs_files)"; for f in $$lsf; do \ |
2174 | echo "#include \"$$f\""; \ | |
a1a7e9d5 | 2175 | done | sed 's|$(srcdir)/||' > tmp-specs.h |
ed90d522 | 2176 | $(SHELL) $(srcdir)/../move-if-change tmp-specs.h specs.h |
a1a7e9d5 | 2177 | $(STAMP) s-specs |
2178 | ||
e8b212b8 | 2179 | optionlist: s-options ; @true |
ff05e09e | 2180 | s-options: $(ALL_OPT_FILES) Makefile $(srcdir)/opt-gather.awk |
a86a19c0 | 2181 | LC_ALL=C ; export LC_ALL ; \ |
ff05e09e | 2182 | $(AWK) -f $(srcdir)/opt-gather.awk $(ALL_OPT_FILES) > tmp-optionlist |
e8b212b8 | 2183 | $(SHELL) $(srcdir)/../move-if-change tmp-optionlist optionlist |
0e6605c4 | 2184 | $(STAMP) s-options |
2185 | ||
1e127302 | 2186 | options.c: optionlist $(srcdir)/opt-functions.awk $(srcdir)/opt-read.awk \ |
2187 | $(srcdir)/optc-gen.awk | |
2188 | $(AWK) -f $(srcdir)/opt-functions.awk -f $(srcdir)/opt-read.awk \ | |
2189 | -f $(srcdir)/optc-gen.awk \ | |
abe01860 | 2190 | -v header_name="config.h system.h coretypes.h options.h tm.h" < $< > $@ |
e8b212b8 | 2191 | |
0bfbe373 | 2192 | options-save.c: optionlist $(srcdir)/opt-functions.awk $(srcdir)/opt-read.awk \ |
2193 | $(srcdir)/optc-save-gen.awk | |
2194 | $(AWK) -f $(srcdir)/opt-functions.awk -f $(srcdir)/opt-read.awk \ | |
2195 | -f $(srcdir)/optc-save-gen.awk \ | |
2196 | -v header_name="config.h system.h coretypes.h tm.h" < $< > $@ | |
2197 | ||
ff05e09e | 2198 | options.h: s-options-h ; @true |
1e127302 | 2199 | s-options-h: optionlist $(srcdir)/opt-functions.awk $(srcdir)/opt-read.awk \ |
2200 | $(srcdir)/opth-gen.awk | |
2201 | $(AWK) -f $(srcdir)/opt-functions.awk -f $(srcdir)/opt-read.awk \ | |
2202 | -f $(srcdir)/opth-gen.awk \ | |
ff05e09e | 2203 | < $< > tmp-options.h |
2204 | $(SHELL) $(srcdir)/../move-if-change tmp-options.h options.h | |
2205 | $(STAMP) $@ | |
e8b212b8 | 2206 | |
32e6d418 | 2207 | dumpvers: dumpvers.c |
2208 | ||
fc3bd902 | 2209 | CFLAGS-version.o += -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \ |
21886706 | 2210 | -DREVISION=$(REVISION_s) \ |
2211 | -DDEVPHASE=$(DEVPHASE_s) -DPKGVERSION=$(PKGVERSION_s) \ | |
fc3bd902 | 2212 | -DBUGURL=$(BUGURL_s) |
83f25bf0 | 2213 | version.o: $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE) |
21886706 | 2214 | |
7bfefa9d | 2215 | # lto-compress.o needs $(ZLIBINC) added to the include flags. |
fc3bd902 | 2216 | CFLAGS-lto-compress.o += $(ZLIBINC) |
21886706 | 2217 | |
b384c0ce | 2218 | bversion.h: s-bversion; @true |
2219 | s-bversion: BASE-VER | |
2220 | echo "#define BUILDING_GCC_MAJOR `echo $(BASEVER_c) | sed -e 's/^\([0-9]*\).*$$/\1/'`" > bversion.h | |
2221 | echo "#define BUILDING_GCC_MINOR `echo $(BASEVER_c) | sed -e 's/^[0-9]*\.\([0-9]*\).*$$/\1/'`" >> bversion.h | |
2222 | echo "#define BUILDING_GCC_PATCHLEVEL `echo $(BASEVER_c) | sed -e 's/^[0-9]*\.[0-9]*\.\([0-9]*\)$$/\1/'`" >> bversion.h | |
2223 | echo "#define BUILDING_GCC_VERSION (BUILDING_GCC_MAJOR * 1000 + BUILDING_GCC_MINOR)" >> bversion.h | |
2224 | $(STAMP) s-bversion | |
2225 | ||
fc3bd902 | 2226 | CFLAGS-toplev.o += -DTARGET_NAME=\"$(target_noncanonical)\" |
b96c136c | 2227 | |
97812c47 | 2228 | pass-instances.def: $(srcdir)/passes.def $(PASSES_EXTRA) \ |
2229 | $(srcdir)/gen-pass-instances.awk | |
743d5ab7 | 2230 | $(AWK) -f $(srcdir)/gen-pass-instances.awk \ |
97812c47 | 2231 | $(srcdir)/passes.def $(PASSES_EXTRA) > pass-instances.def |
743d5ab7 | 2232 | |
3965816e | 2233 | $(out_object_file): $(out_file) |
2234 | $(COMPILE) $< | |
2235 | $(POSTCOMPILE) | |
21886706 | 2236 | |
c1485012 | 2237 | $(common_out_object_file): $(common_out_file) |
2238 | $(COMPILE) $< | |
2239 | $(POSTCOMPILE) | |
2e9d8ccf | 2240 | #\f |
c6221df9 | 2241 | # Generate header and source files from the machine description, |
32e6d418 | 2242 | # and compile them. |
2243 | ||
e23a6527 | 2244 | .PRECIOUS: insn-config.h insn-flags.h insn-codes.h insn-constants.h \ |
32e6d418 | 2245 | insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c \ |
73ed0c67 | 2246 | insn-attr.h insn-attr-common.h insn-attrtab.c insn-dfatab.c \ |
5da5e283 | 2247 | insn-latencytab.c insn-preds.c gimple-match.c generic-match.c \ |
2248 | insn-target-def.h | |
32e6d418 | 2249 | |
96128417 | 2250 | # Dependencies for the md file. The first time through, we just assume |
2251 | # the md file itself and the generated dependency file (in order to get | |
2252 | # it built). The second time through we have the dependency file. | |
2253 | -include mddeps.mk | |
2254 | MD_DEPS = s-mddeps $(md_file) $(MD_INCLUDES) | |
2255 | ||
2256 | s-mddeps: $(md_file) $(MD_INCLUDES) build/genmddeps$(build_exeext) | |
2257 | $(RUN_GEN) build/genmddeps$(build_exeext) $(md_file) > tmp-mddeps | |
2258 | $(SHELL) $(srcdir)/../move-if-change tmp-mddeps mddeps.mk | |
2259 | $(STAMP) s-mddeps | |
2260 | ||
f196fb10 | 2261 | # For each of the files generated by running a generator program over |
664c5888 | 2262 | # the machine description, the following static pattern rules run the |
2263 | # generator program only if the machine description has changed, | |
2264 | # but touch the target file only when its contents actually change. | |
2265 | # The "; @true" construct forces Make to recheck the timestamp on | |
2266 | # the target file. | |
f196fb10 | 2267 | |
808674b1 | 2268 | simple_rtl_generated_h = insn-attr.h insn-attr-common.h insn-codes.h \ |
5da5e283 | 2269 | insn-config.h insn-flags.h insn-target-def.h |
f196fb10 | 2270 | |
73ed0c67 | 2271 | simple_rtl_generated_c = insn-automata.c insn-emit.c \ |
ee65118b | 2272 | insn-extract.c insn-output.c \ |
664c5888 | 2273 | insn-peep.c insn-recog.c |
2274 | ||
2275 | simple_generated_h = $(simple_rtl_generated_h) insn-constants.h | |
2276 | ||
15f255bd | 2277 | simple_generated_c = $(simple_rtl_generated_c) insn-enums.c |
664c5888 | 2278 | |
2279 | $(simple_generated_h:insn-%.h=s-%) \ | |
2280 | $(simple_generated_c:insn-%.c=s-%): s-%: $(MD_DEPS) | |
2281 | ||
2282 | $(simple_rtl_generated_h:insn-%.h=s-%) \ | |
2283 | $(simple_rtl_generated_c:insn-%.c=s-%): s-%: insn-conditions.md | |
f196fb10 | 2284 | |
2285 | $(simple_generated_h): insn-%.h: s-%; @true | |
2286 | ||
664c5888 | 2287 | $(simple_generated_h:insn-%.h=s-%): s-%: build/gen%$(build_exeext) |
af908c02 | 2288 | $(RUN_GEN) build/gen$*$(build_exeext) $(md_file) \ |
664c5888 | 2289 | $(filter insn-conditions.md,$^) > tmp-$*.h |
f196fb10 | 2290 | $(SHELL) $(srcdir)/../move-if-change tmp-$*.h insn-$*.h |
2291 | $(STAMP) s-$* | |
2292 | ||
2293 | $(simple_generated_c): insn-%.c: s-%; @true | |
664c5888 | 2294 | $(simple_generated_c:insn-%.c=s-%): s-%: build/gen%$(build_exeext) |
af908c02 | 2295 | $(RUN_GEN) build/gen$*$(build_exeext) $(md_file) \ |
664c5888 | 2296 | $(filter insn-conditions.md,$^) > tmp-$*.c |
f196fb10 | 2297 | $(SHELL) $(srcdir)/../move-if-change tmp-$*.c insn-$*.c |
2298 | $(STAMP) s-$* | |
2299 | ||
2300 | # gencheck doesn't read the machine description, and the file produced | |
2301 | # doesn't use the insn-* convention. | |
2302 | tree-check.h: s-check ; @true | |
2303 | s-check : build/gencheck$(build_exeext) | |
2304 | $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h | |
2305 | $(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h | |
2306 | $(STAMP) s-check | |
b70bd542 | 2307 | |
73ed0c67 | 2308 | # genattrtab produces three files: tmp-{attrtab.c,dfatab.c,latencytab.c} |
2309 | insn-attrtab.c insn-dfatab.c insn-latencytab.c: s-attrtab ; @true | |
2310 | s-attrtab : $(MD_DEPS) build/genattrtab$(build_exeext) \ | |
2311 | insn-conditions.md | |
2312 | $(RUN_GEN) build/genattrtab$(build_exeext) $(md_file) insn-conditions.md \ | |
2313 | -Atmp-attrtab.c -Dtmp-dfatab.c -Ltmp-latencytab.c | |
2314 | $(SHELL) $(srcdir)/../move-if-change tmp-attrtab.c insn-attrtab.c | |
2315 | $(SHELL) $(srcdir)/../move-if-change tmp-dfatab.c insn-dfatab.c | |
2316 | $(SHELL) $(srcdir)/../move-if-change tmp-latencytab.c insn-latencytab.c | |
2317 | $(STAMP) s-attrtab | |
2318 | ||
ee65118b | 2319 | # genopinit produces two files. |
2320 | insn-opinit.c insn-opinit.h: s-opinit ; @true | |
2321 | s-opinit: $(MD_DEPS) build/genopinit$(build_exeext) insn-conditions.md | |
2322 | $(RUN_GEN) build/genopinit$(build_exeext) $(md_file) \ | |
2323 | insn-conditions.md -htmp-opinit.h -ctmp-opinit.c | |
2324 | $(SHELL) $(srcdir)/../move-if-change tmp-opinit.h insn-opinit.h | |
2325 | $(SHELL) $(srcdir)/../move-if-change tmp-opinit.c insn-opinit.c | |
2326 | $(STAMP) s-opinit | |
2327 | ||
af908c02 | 2328 | # gencondmd doesn't use the standard naming convention. |
21886706 | 2329 | build/gencondmd.c: s-conditions; @true |
af908c02 | 2330 | s-conditions: $(MD_DEPS) build/genconditions$(build_exeext) |
2331 | $(RUN_GEN) build/genconditions$(build_exeext) $(md_file) > tmp-condmd.c | |
21886706 | 2332 | $(SHELL) $(srcdir)/../move-if-change tmp-condmd.c build/gencondmd.c |
af908c02 | 2333 | $(STAMP) s-conditions |
2334 | ||
2335 | insn-conditions.md: s-condmd; @true | |
2336 | s-condmd: build/gencondmd$(build_exeext) | |
2337 | $(RUN_GEN) build/gencondmd$(build_exeext) > tmp-cond.md | |
2338 | $(SHELL) $(srcdir)/../move-if-change tmp-cond.md insn-conditions.md | |
2339 | $(STAMP) s-condmd | |
2340 | ||
2341 | ||
f196fb10 | 2342 | # These files are generated by running the same generator more than |
2343 | # once with different options, so they have custom rules. The | |
2344 | # stampfile idiom is the same. | |
f196fb10 | 2345 | genrtl.h: s-genrtl-h; @true |
b70bd542 | 2346 | |
f196fb10 | 2347 | s-genrtl-h: build/gengenrtl$(build_exeext) |
b6762859 | 2348 | $(RUN_GEN) build/gengenrtl$(build_exeext) > tmp-genrtl.h |
f196fb10 | 2349 | $(SHELL) $(srcdir)/../move-if-change tmp-genrtl.h genrtl.h |
2350 | $(STAMP) s-genrtl-h | |
2351 | ||
2352 | insn-modes.c: s-modes; @true | |
2353 | insn-modes.h: s-modes-h; @true | |
8734172d | 2354 | insn-modes-inline.h: s-modes-inline-h; @true |
f196fb10 | 2355 | min-insn-modes.c: s-modes-m; @true |
47a2c1d4 | 2356 | |
524a54cf | 2357 | s-modes: build/genmodes$(build_exeext) |
f196fb10 | 2358 | $(RUN_GEN) build/genmodes$(build_exeext) > tmp-modes.c |
2359 | $(SHELL) $(srcdir)/../move-if-change tmp-modes.c insn-modes.c | |
2360 | $(STAMP) s-modes | |
2361 | ||
2362 | s-modes-h: build/genmodes$(build_exeext) | |
524a54cf | 2363 | $(RUN_GEN) build/genmodes$(build_exeext) -h > tmp-modes.h |
ed90d522 | 2364 | $(SHELL) $(srcdir)/../move-if-change tmp-modes.h insn-modes.h |
f196fb10 | 2365 | $(STAMP) s-modes-h |
2366 | ||
8734172d | 2367 | s-modes-inline-h: build/genmodes$(build_exeext) |
2368 | $(RUN_GEN) build/genmodes$(build_exeext) -i > tmp-modes-inline.h | |
2369 | $(SHELL) $(srcdir)/../move-if-change tmp-modes-inline.h \ | |
2370 | insn-modes-inline.h | |
2371 | $(STAMP) s-modes-inline-h | |
2372 | ||
f196fb10 | 2373 | s-modes-m: build/genmodes$(build_exeext) |
524a54cf | 2374 | $(RUN_GEN) build/genmodes$(build_exeext) -m > tmp-min-modes.c |
ed90d522 | 2375 | $(SHELL) $(srcdir)/../move-if-change tmp-min-modes.c min-insn-modes.c |
f196fb10 | 2376 | $(STAMP) s-modes-m |
47a2c1d4 | 2377 | |
f196fb10 | 2378 | insn-preds.c: s-preds; @true |
2379 | tm-preds.h: s-preds-h; @true | |
a014ec0f | 2380 | tm-constrs.h: s-constrs-h; @true |
e23a6527 | 2381 | |
376b1415 | 2382 | .PHONY: mddump |
2383 | mddump: $(BUILD_RTL) $(MD_DEPS) build/genmddump$(build_exeext) | |
2384 | $(RUN_GEN) build/genmddump$(build_exeext) $(md_file) > tmp-mddump.md | |
2385 | ||
96128417 | 2386 | s-preds: $(MD_DEPS) build/genpreds$(build_exeext) |
524a54cf | 2387 | $(RUN_GEN) build/genpreds$(build_exeext) $(md_file) > tmp-preds.c |
cbf464bd | 2388 | $(SHELL) $(srcdir)/../move-if-change tmp-preds.c insn-preds.c |
e23a6527 | 2389 | $(STAMP) s-preds |
2390 | ||
f196fb10 | 2391 | s-preds-h: $(MD_DEPS) build/genpreds$(build_exeext) |
2392 | $(RUN_GEN) build/genpreds$(build_exeext) -h $(md_file) > tmp-preds.h | |
2393 | $(SHELL) $(srcdir)/../move-if-change tmp-preds.h tm-preds.h | |
2394 | $(STAMP) s-preds-h | |
cbf464bd | 2395 | |
a014ec0f | 2396 | s-constrs-h: $(MD_DEPS) build/genpreds$(build_exeext) |
2397 | $(RUN_GEN) build/genpreds$(build_exeext) -c $(md_file) > tmp-constrs.h | |
2398 | $(SHELL) $(srcdir)/../move-if-change tmp-constrs.h tm-constrs.h | |
2399 | $(STAMP) s-constrs-h | |
2400 | ||
28544f39 | 2401 | s-case-cfn-macros: build/gencfn-macros$(build_exeext) |
2402 | $(RUN_GEN) build/gencfn-macros$(build_exeext) -c \ | |
2403 | > tmp-case-cfn-macros.h | |
2404 | $(SHELL) $(srcdir)/../move-if-change tmp-case-cfn-macros.h \ | |
2405 | case-cfn-macros.h | |
2406 | $(STAMP) s-case-cfn-macros | |
2407 | case-cfn-macros.h: s-case-cfn-macros; @true | |
2408 | ||
ff690865 | 2409 | s-cfn-operators: build/gencfn-macros$(build_exeext) |
2410 | $(RUN_GEN) build/gencfn-macros$(build_exeext) -o \ | |
2411 | > tmp-cfn-operators.pd | |
2412 | $(SHELL) $(srcdir)/../move-if-change tmp-cfn-operators.pd \ | |
2413 | cfn-operators.pd | |
2414 | $(STAMP) s-cfn-operators | |
2415 | cfn-operators.pd: s-cfn-operators; @true | |
2416 | ||
202d6e5f | 2417 | target-hooks-def.h: s-target-hooks-def-h; @true |
50a6486c | 2418 | # make sure that when we build info files, the used tm.texi is up to date. |
2419 | $(srcdir)/doc/tm.texi: s-tm-texi; @true | |
202d6e5f | 2420 | |
2421 | s-target-hooks-def-h: build/genhooks$(build_exeext) | |
c94b1d0e | 2422 | $(RUN_GEN) build/genhooks$(build_exeext) "Target Hook" \ |
2423 | > tmp-target-hooks-def.h | |
202d6e5f | 2424 | $(SHELL) $(srcdir)/../move-if-change tmp-target-hooks-def.h \ |
2425 | target-hooks-def.h | |
2426 | $(STAMP) s-target-hooks-def-h | |
2427 | ||
c94b1d0e | 2428 | c-family/c-target-hooks-def.h: s-c-target-hooks-def-h; @true |
2429 | ||
2430 | s-c-target-hooks-def-h: build/genhooks$(build_exeext) | |
2431 | $(RUN_GEN) build/genhooks$(build_exeext) "C Target Hook" \ | |
2432 | > tmp-c-target-hooks-def.h | |
2433 | $(SHELL) $(srcdir)/../move-if-change tmp-c-target-hooks-def.h \ | |
2434 | c-family/c-target-hooks-def.h | |
2435 | $(STAMP) s-c-target-hooks-def-h | |
2436 | ||
3e87b980 | 2437 | common/common-target-hooks-def.h: s-common-target-hooks-def-h; @true |
2438 | ||
2439 | s-common-target-hooks-def-h: build/genhooks$(build_exeext) | |
2440 | $(RUN_GEN) build/genhooks$(build_exeext) "Common Target Hook" \ | |
2441 | > tmp-common-target-hooks-def.h | |
2442 | $(SHELL) $(srcdir)/../move-if-change tmp-common-target-hooks-def.h \ | |
2443 | common/common-target-hooks-def.h | |
2444 | $(STAMP) s-common-target-hooks-def-h | |
2445 | ||
202d6e5f | 2446 | # check if someone mistakenly only changed tm.texi. |
50a6486c | 2447 | # We use a different pathname here to avoid a circular dependency. |
2448 | s-tm-texi: $(srcdir)/doc/../doc/tm.texi | |
2de5bbf2 | 2449 | |
636142d8 | 2450 | # The tm.texi we want to compare against / check into svn should have |
2451 | # unix-style line endings. To make this work on MinGW, remove \r. | |
2452 | # \r is not portable to Solaris tr, therefore we have a special | |
2453 | # case for ASCII. We use \r for other encodings like EBCDIC. | |
202d6e5f | 2454 | s-tm-texi: build/genhooks$(build_exeext) $(srcdir)/doc/tm.texi.in |
c94b1d0e | 2455 | $(RUN_GEN) build/genhooks$(build_exeext) -d \ |
202d6e5f | 2456 | $(srcdir)/doc/tm.texi.in > tmp-tm.texi |
636142d8 | 2457 | case `echo X|tr X '\101'` in \ |
2458 | A) tr -d '\015' < tmp-tm.texi > tmp2-tm.texi ;; \ | |
d3a16c52 | 2459 | *) tr -d '\r' < tmp-tm.texi > tmp2-tm.texi ;; \ |
636142d8 | 2460 | esac |
2461 | mv tmp2-tm.texi tmp-tm.texi | |
202d6e5f | 2462 | $(SHELL) $(srcdir)/../move-if-change tmp-tm.texi tm.texi |
2463 | @if cmp -s $(srcdir)/doc/tm.texi tm.texi; then \ | |
2464 | $(STAMP) $@; \ | |
2465 | elif test $(srcdir)/doc/tm.texi -nt $(srcdir)/doc/tm.texi.in \ | |
c94b1d0e | 2466 | && ( test $(srcdir)/doc/tm.texi -nt $(srcdir)/target.def \ |
2467 | || test $(srcdir)/doc/tm.texi -nt $(srcdir)/c-family/c-target.def \ | |
3e87b980 | 2468 | || test $(srcdir)/doc/tm.texi -nt $(srcdir)/common/common-target.def \ |
c94b1d0e | 2469 | ); then \ |
202d6e5f | 2470 | echo >&2 ; \ |
2471 | echo You should edit $(srcdir)/doc/tm.texi.in rather than $(srcdir)/doc/tm.texi . >&2 ; \ | |
2472 | false; \ | |
2473 | else \ | |
2474 | echo >&2 ; \ | |
2475 | echo Verify that you have permission to grant a GFDL license for all >&2 ; \ | |
2476 | echo new text in tm.texi, then copy it to $(srcdir)/doc/tm.texi. >&2 ; \ | |
2477 | false; \ | |
2478 | fi | |
2479 | ||
2165588a | 2480 | gimple-match.c: s-match gimple-match-head.c ; @true |
2481 | generic-match.c: s-match generic-match-head.c ; @true | |
2482 | ||
ff690865 | 2483 | s-match: build/genmatch$(build_exeext) $(srcdir)/match.pd cfn-operators.pd |
2165588a | 2484 | $(RUN_GEN) build/genmatch$(build_exeext) --gimple $(srcdir)/match.pd \ |
2485 | > tmp-gimple-match.c | |
2486 | $(RUN_GEN) build/genmatch$(build_exeext) --generic $(srcdir)/match.pd \ | |
2487 | > tmp-generic-match.c | |
2488 | $(SHELL) $(srcdir)/../move-if-change tmp-gimple-match.c \ | |
2489 | gimple-match.c | |
2490 | $(SHELL) $(srcdir)/../move-if-change tmp-generic-match.c \ | |
2491 | generic-match.c | |
2492 | $(STAMP) s-match | |
2493 | ||
9c85a98a | 2494 | GTFILES = $(CPP_ID_DATA_H) $(srcdir)/input.h $(srcdir)/coretypes.h \ |
2495 | $(host_xm_file_list) \ | |
d856c8a6 | 2496 | $(tm_file_list) $(HASHTAB_H) $(SPLAY_TREE_H) $(srcdir)/bitmap.h \ |
217f00a7 | 2497 | $(srcdir)/wide-int.h $(srcdir)/alias.h $(srcdir)/cilk.h \ |
2498 | $(srcdir)/cilk-common.c $(srcdir)/coverage.c $(srcdir)/rtl.h \ | |
96423453 | 2499 | $(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/tree-core.h \ |
2500 | $(srcdir)/libfuncs.h $(SYMTAB_H) \ | |
4dd3de56 | 2501 | $(srcdir)/real.h $(srcdir)/function.h $(srcdir)/insn-addr.h $(srcdir)/hwint.h \ |
5efd9b45 | 2502 | $(srcdir)/fixed-value.h \ |
db9cef39 | 2503 | $(srcdir)/output.h $(srcdir)/cfgloop.h $(srcdir)/cfg.h $(srcdir)/profile-count.h \ |
8d810329 | 2504 | $(srcdir)/cselib.h $(srcdir)/basic-block.h $(srcdir)/ipa-ref.h $(srcdir)/cgraph.h \ |
cfbe30aa | 2505 | $(srcdir)/reload.h $(srcdir)/caller-save.c $(srcdir)/symtab.c \ |
639e4be4 | 2506 | $(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c $(srcdir)/cgraph.c \ |
5514adf9 | 2507 | $(srcdir)/ipa-prop.c $(srcdir)/ipa-cp.c $(srcdir)/ipa-utils.h \ |
dcdf448e | 2508 | $(srcdir)/dbxout.c \ |
e913b5cd | 2509 | $(srcdir)/signop.h \ |
dcdf448e | 2510 | $(srcdir)/dwarf2out.h \ |
2511 | $(srcdir)/dwarf2asm.c \ | |
2512 | $(srcdir)/dwarf2cfi.c \ | |
2513 | $(srcdir)/dwarf2out.c \ | |
75a70cf9 | 2514 | $(srcdir)/tree-vect-generic.c \ |
73bde8df | 2515 | $(srcdir)/dojump.c $(srcdir)/emit-rtl.h \ |
576cc2fe | 2516 | $(srcdir)/emit-rtl.c $(srcdir)/except.h $(srcdir)/explow.c $(srcdir)/expr.c \ |
d8f74faa | 2517 | $(srcdir)/expr.h \ |
576cc2fe | 2518 | $(srcdir)/function.c $(srcdir)/except.c \ |
f61d7248 | 2519 | $(srcdir)/ggc-tests.c \ |
929d2a90 | 2520 | $(srcdir)/gcse.c $(srcdir)/godump.c \ |
947ed59a | 2521 | $(srcdir)/lists.c $(srcdir)/optabs-libfuncs.c \ |
75f8637a | 2522 | $(srcdir)/profile.c $(srcdir)/mcf.c \ |
23a070f3 | 2523 | $(srcdir)/reg-stack.c $(srcdir)/cfgrtl.c \ |
fcb807f8 | 2524 | $(srcdir)/sdbout.c $(srcdir)/stor-layout.c \ |
32b8be60 | 2525 | $(srcdir)/stringpool.c $(srcdir)/tree.c $(srcdir)/varasm.c \ |
700d6a0b | 2526 | $(srcdir)/gimple.h \ |
b1c06ff9 | 2527 | $(srcdir)/gimple-ssa.h \ |
058a1b7a | 2528 | $(srcdir)/tree-chkp.c \ |
aed164c3 | 2529 | $(srcdir)/tree-ssanames.c $(srcdir)/tree-eh.c $(srcdir)/tree-ssa-address.c \ |
5a81ada0 | 2530 | $(srcdir)/tree-cfg.c $(srcdir)/tree-ssa-loop-ivopts.c \ |
75a70cf9 | 2531 | $(srcdir)/tree-dfa.c \ |
a8783bee | 2532 | $(srcdir)/tree-iterator.c $(srcdir)/gimple-expr.c \ |
75a70cf9 | 2533 | $(srcdir)/tree-chrec.h \ |
2534 | $(srcdir)/tree-scalar-evolution.c \ | |
fcbe34ba | 2535 | $(srcdir)/tree-ssa-operands.h \ |
ed4294da | 2536 | $(srcdir)/tree-profile.c $(srcdir)/tree-nested.c \ |
4954efd4 | 2537 | $(srcdir)/omp-offload.h \ |
2538 | $(srcdir)/omp-offload.c \ | |
2539 | $(srcdir)/omp-expand.c \ | |
75a70cf9 | 2540 | $(srcdir)/omp-low.c \ |
a861fe52 | 2541 | $(srcdir)/targhooks.c $(out_file) $(srcdir)/passes.c $(srcdir)/cgraphunit.c \ |
f41db742 | 2542 | $(srcdir)/cgraphclones.c \ |
75a70cf9 | 2543 | $(srcdir)/tree-phinodes.c \ |
dd277d48 | 2544 | $(srcdir)/tree-ssa-alias.h \ |
9e2e2283 | 2545 | $(srcdir)/tree-ssanames.h \ |
c296f633 | 2546 | $(srcdir)/tree-vrp.h \ |
8867b500 | 2547 | $(srcdir)/ipa-prop.h \ |
4c0315d0 | 2548 | $(srcdir)/trans-mem.c \ |
57305941 | 2549 | $(srcdir)/lto-streamer.h \ |
821d4118 | 2550 | $(srcdir)/target-globals.h \ |
4669dd83 | 2551 | $(srcdir)/ipa-predicate.h \ |
b9a58fc5 | 2552 | $(srcdir)/ipa-fnsummary.h \ |
b710ec85 | 2553 | $(srcdir)/vtable-verify.c \ |
5d5c682b | 2554 | $(srcdir)/asan.c \ |
9e46467d | 2555 | $(srcdir)/ubsan.c \ |
64d5d3e8 | 2556 | $(srcdir)/tsan.c \ |
6b5813f5 | 2557 | $(srcdir)/sanopt.c \ |
d29e939c | 2558 | $(srcdir)/sancov.c \ |
64d5d3e8 | 2559 | $(srcdir)/ipa-devirt.c \ |
2560 | $(srcdir)/internal-fn.h \ | |
ef2beaf2 | 2561 | $(srcdir)/hsa-common.c \ |
3f82fe35 | 2562 | $(srcdir)/calls.c \ |
1f3233d1 | 2563 | @all_gtfiles@ |
2564 | ||
2ac441f7 | 2565 | # Compute the list of GT header files from the corresponding C sources, |
2566 | # possibly nested within config or language subdirectories. Match gengtype's | |
2567 | # behavior in this respect: gt-LANG-file.h for "file" anywhere within a LANG | |
2568 | # language subdir, gt-file.h otherwise (no subdir indication for config/ | |
2569 | # related sources). | |
2570 | ||
2571 | GTFILES_H = $(subst /,-, \ | |
2572 | $(shell echo $(patsubst $(srcdir)/%,gt-%, \ | |
2573 | $(patsubst %.c,%.h, \ | |
2574 | $(filter %.c, $(GTFILES)))) \ | |
fcbc7faf | 2575 | | sed -e "s|/[^ ]*/|/|g" -e "s|gt-config/|gt-|g")) |
570af75a | 2576 | |
2577 | GTFILES_LANG_H = $(patsubst [%], gtype-%.h, $(filter [%], $(GTFILES))) | |
2578 | ALL_GTFILES_H := $(sort $(GTFILES_H) $(GTFILES_LANG_H)) | |
2579 | ||
2580 | # $(GTFILES) may be too long to put on a command line, so we have to | |
2581 | # write it out to a file (taking care not to do that in a way that | |
2582 | # overflows a command line!) and then have gengtype read the file in. | |
16979163 | 2583 | |
6d70c713 | 2584 | $(ALL_GTFILES_H) gtype-desc.c gtype-desc.h gtype.state: s-gtype ; @true |
570af75a | 2585 | |
463ae493 | 2586 | ### Common flags to gengtype [e.g. -v or -B backupdir] |
2587 | GENGTYPE_FLAGS= | |
2588 | ||
570af75a | 2589 | gtyp-input.list: s-gtyp-input ; @true |
2590 | s-gtyp-input: Makefile | |
bdaa15c6 | 2591 | @: $(call write_entries_to_file,$(GTFILES),tmp-gi.list) |
570af75a | 2592 | $(SHELL) $(srcdir)/../move-if-change tmp-gi.list gtyp-input.list |
2593 | $(STAMP) s-gtyp-input | |
2594 | ||
2595 | s-gtype: build/gengtype$(build_exeext) $(filter-out [%], $(GTFILES)) \ | |
2596 | gtyp-input.list | |
463ae493 | 2597 | # First, parse all files and save a state file. |
2598 | $(RUN_GEN) build/gengtype$(build_exeext) $(GENGTYPE_FLAGS) \ | |
6d70c713 | 2599 | -S $(srcdir) -I gtyp-input.list -w tmp-gtype.state |
463ae493 | 2600 | # Second, read the state file and generate all files. This ensure that |
2601 | # gtype.state is correctly read: | |
6d70c713 | 2602 | $(SHELL) $(srcdir)/../move-if-change tmp-gtype.state gtype.state |
463ae493 | 2603 | $(RUN_GEN) build/gengtype$(build_exeext) $(GENGTYPE_FLAGS) \ |
2604 | -r gtype.state | |
1f3233d1 | 2605 | $(STAMP) s-gtype |
2606 | ||
7bedc3a0 | 2607 | generated_files = config.h tm.h $(TM_P_H) $(TM_H) multilib.h \ |
2608 | $(simple_generated_h) specs.h \ | |
8734172d | 2609 | tree-check.h genrtl.h insn-modes.h insn-modes-inline.h \ |
2610 | tm-preds.h tm-constrs.h \ | |
bbd12626 | 2611 | $(ALL_GTFILES_H) gtype-desc.c gtype-desc.h gcov-iov.h \ |
2612 | options.h target-hooks-def.h insn-opinit.h \ | |
2613 | common/common-target-hooks-def.h pass-instances.def \ | |
94ee1e9c | 2614 | c-family/c-target-hooks-def.h params.list params.options case-cfn-macros.h \ |
ff690865 | 2615 | cfn-operators.pd |
7bedc3a0 | 2616 | |
2e9d8ccf | 2617 | #\f |
f196fb10 | 2618 | # How to compile object files to run on the build machine. |
c061bf74 | 2619 | |
21886706 | 2620 | build/%.o : # dependencies provided by explicit rule later |
585d4848 | 2621 | $(COMPILER_FOR_BUILD) -c $(BUILD_COMPILERFLAGS) $(BUILD_CPPFLAGS) \ |
2622 | -o $@ $< | |
21886706 | 2623 | |
1fdf44f0 | 2624 | ## build/version.o is compiled by the $(COMPILER_FOR_BUILD) but needs |
2625 | ## several C macro definitions, just like version.o | |
2626 | build/version.o: version.c version.h \ | |
2627 | $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE) | |
2628 | $(COMPILER_FOR_BUILD) -c $(BUILD_COMPILERFLAGS) $(BUILD_CPPFLAGS) \ | |
2629 | -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \ | |
2630 | -DREVISION=$(REVISION_s) \ | |
2631 | -DDEVPHASE=$(DEVPHASE_s) -DPKGVERSION=$(PKGVERSION_s) \ | |
2632 | -DBUGURL=$(BUGURL_s) -o $@ $< | |
2633 | ||
21886706 | 2634 | # Header dependencies for the programs that generate source code. |
2635 | # These are library modules... | |
2636 | build/errors.o : errors.c $(BCONFIG_H) $(SYSTEM_H) errors.h | |
8734172d | 2637 | build/gensupport.o: gensupport.c $(BCONFIG_H) $(SYSTEM_H) \ |
2638 | $(CORETYPES_H) $(GTM_H) $(RTL_BASE_H) $(OBSTACK_H) errors.h \ | |
2639 | $(HASHTAB_H) $(READ_MD_H) $(GENSUPPORT_H) | |
2640 | build/ggc-none.o : ggc-none.c $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) \ | |
21886706 | 2641 | $(GGC_H) |
2642 | build/min-insn-modes.o : min-insn-modes.c $(BCONFIG_H) $(SYSTEM_H) \ | |
2643 | $(MACHMODE_H) | |
8734172d | 2644 | build/print-rtl.o: print-rtl.c $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) \ |
21886706 | 2645 | $(GTM_H) $(RTL_BASE_H) |
8734172d | 2646 | build/read-md.o: read-md.c $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) \ |
b638f5c8 | 2647 | $(HASHTAB_H) errors.h $(READ_MD_H) |
8734172d | 2648 | build/read-rtl.o: read-rtl.c $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) \ |
960ebfe7 | 2649 | $(GTM_H) $(RTL_BASE_H) $(OBSTACK_H) $(HASHTAB_H) $(READ_MD_H) \ |
592e7d69 | 2650 | $(GENSUPPORT_H) |
8734172d | 2651 | build/rtl.o: rtl.c $(BCONFIG_H) $(CORETYPES_H) $(GTM_H) $(SYSTEM_H) \ |
a7a46268 | 2652 | $(RTL_H) $(GGC_H) errors.h |
8734172d | 2653 | build/vec.o : vec.c $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) $(VEC_H) \ |
2654 | $(GGC_H) toplev.h $(DIAGNOSTIC_CORE_H) | |
2655 | build/hash-table.o : hash-table.c $(BCONFIG_H) $(SYSTEM_H) \ | |
2656 | $(CORETYPES_H) $(HASH_TABLE_H) $(GGC_H) toplev.h $(DIAGNOSTIC_CORE_H) | |
2657 | build/inchash.o : inchash.c $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) \ | |
2658 | $(HASHTAB_H) inchash.h | |
21886706 | 2659 | build/gencondmd.o : build/gencondmd.c $(BCONFIG_H) $(SYSTEM_H) \ |
8734172d | 2660 | $(CORETYPES_H) $(GTM_H) insn-constants.h \ |
387a6c35 | 2661 | $(filter-out insn-flags.h, $(RTL_H) $(TM_P_H) $(FUNCTION_H) $(REGS_H) \ |
92468061 | 2662 | $(RECOG_H) output.h $(FLAGS_H) $(RESOURCE_H) toplev.h $(DIAGNOSTIC_CORE_H) reload.h \ |
387a6c35 | 2663 | $(EXCEPT_H) tm-constrs.h) |
f508ba97 | 2664 | # This pulls in tm-pred.h which contains inline functions wrapping up |
2665 | # predicates from the back-end so those functions must be discarded. | |
2666 | # No big deal since gencondmd.c is a dummy file for non-GCC compilers. | |
2667 | build/gencondmd.o : \ | |
2668 | BUILD_CFLAGS := $(filter-out -fkeep-inline-functions, $(BUILD_CFLAGS)) | |
805e22b2 | 2669 | |
21886706 | 2670 | # ...these are the programs themselves. |
2671 | build/genattr.o : genattr.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ | |
8734172d | 2672 | $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) |
808674b1 | 2673 | build/genattr-common.o : genattr-common.c $(RTL_BASE_H) $(BCONFIG_H) \ |
8734172d | 2674 | $(SYSTEM_H) $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) |
21886706 | 2675 | build/genattrtab.o : genattrtab.c $(RTL_BASE_H) $(OBSTACK_H) \ |
8734172d | 2676 | $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) $(GTM_H) errors.h $(GGC_H) \ |
592e7d69 | 2677 | $(READ_MD_H) $(GENSUPPORT_H) $(FNMATCH_H) |
21886706 | 2678 | build/genautomata.o : genautomata.c $(RTL_BASE_H) $(OBSTACK_H) \ |
8734172d | 2679 | $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) $(GTM_H) errors.h $(VEC_H) \ |
592e7d69 | 2680 | $(HASHTAB_H) $(GENSUPPORT_H) $(FNMATCH_H) |
b20df6d7 | 2681 | build/gencheck.o : gencheck.c all-tree.def $(BCONFIG_H) $(GTM_H) \ |
8734172d | 2682 | $(SYSTEM_H) $(CORETYPES_H) tree.def c-family/c-common.def \ |
d5fe1e53 | 2683 | $(lang_tree_files) gimple.def |
21886706 | 2684 | build/genchecksum.o : genchecksum.c $(BCONFIG_H) $(SYSTEM_H) $(MD5_H) |
2685 | build/gencodes.o : gencodes.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ | |
8734172d | 2686 | $(CORETYPES_H) $(GTM_H) errors.h $(GENSUPPORT_H) |
21886706 | 2687 | build/genconditions.o : genconditions.c $(RTL_BASE_H) $(BCONFIG_H) \ |
8734172d | 2688 | $(SYSTEM_H) $(CORETYPES_H) $(GTM_H) errors.h $(HASHTAB_H) \ |
2689 | $(READ_MD_H) $(GENSUPPORT_H) | |
21886706 | 2690 | build/genconfig.o : genconfig.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ |
8734172d | 2691 | $(CORETYPES_H) $(GTM_H) errors.h $(GENSUPPORT_H) |
664c5888 | 2692 | build/genconstants.o : genconstants.c $(BCONFIG_H) $(SYSTEM_H) \ |
8734172d | 2693 | $(CORETYPES_H) errors.h $(READ_MD_H) |
21886706 | 2694 | build/genemit.o : genemit.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ |
8734172d | 2695 | $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) internal-fn.def |
15f255bd | 2696 | build/genenums.o : genenums.c $(BCONFIG_H) $(SYSTEM_H) \ |
8734172d | 2697 | $(CORETYPES_H) errors.h $(READ_MD_H) |
21886706 | 2698 | build/genextract.o : genextract.c $(RTL_BASE_H) $(BCONFIG_H) \ |
8734172d | 2699 | $(SYSTEM_H) $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) |
21886706 | 2700 | build/genflags.o : genflags.c $(RTL_BASE_H) $(OBSTACK_H) $(BCONFIG_H) \ |
8734172d | 2701 | $(SYSTEM_H) $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) |
5da5e283 | 2702 | build/gentarget-def.o : gentarget-def.c $(BCONFIG_H) $(SYSTEM_H) \ |
8734172d | 2703 | $(CORETYPES_H) $(GTM_H) $(RTL_BASE_H) errors.h $(READ_MD_H) \ |
2704 | $(GENSUPPORT_H) $(HASH_TABLE_H) target-insns.def | |
21886706 | 2705 | build/gengenrtl.o : gengenrtl.c $(BCONFIG_H) $(SYSTEM_H) rtl.def |
c833363a | 2706 | |
2707 | # The gengtype generator program is special: Two versions are built. | |
2708 | # One is for the build machine, and one is for the host to allow | |
2709 | # plugins to define their types and generate the supporting GGC | |
2710 | # datastructures and routines with GTY markers. | |
2711 | # The host object files depend on CONFIG_H, and the build objects | |
2712 | # on BCONFIG_H. For the build objects, add -DGENERATOR_FILE manually, | |
2713 | # the build-%: rule doesn't apply to them. | |
2714 | ||
ed89620f | 2715 | GENGTYPE_OBJS = gengtype.o gengtype-parse.o gengtype-state.o \ |
2716 | gengtype-lex.o errors.o | |
2717 | ||
6d70c713 | 2718 | gengtype-lex.o build/gengtype-lex.o : gengtype-lex.c gengtype.h $(SYSTEM_H) |
ed89620f | 2719 | CFLAGS-gengtype-lex.o += -DHOST_GENERATOR_FILE |
6d70c713 | 2720 | build/gengtype-lex.o: $(BCONFIG_H) |
c833363a | 2721 | |
6d70c713 | 2722 | gengtype-parse.o build/gengtype-parse.o : gengtype-parse.c gengtype.h \ |
21886706 | 2723 | $(SYSTEM_H) |
ed89620f | 2724 | CFLAGS-gengtype-parse.o += -DHOST_GENERATOR_FILE |
6d70c713 | 2725 | build/gengtype-parse.o: $(BCONFIG_H) |
c833363a | 2726 | |
6d70c713 | 2727 | gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \ |
1044c79e | 2728 | gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \ |
2729 | $(XREGEX_H) | |
ed89620f | 2730 | CFLAGS-gengtype-state.o += -DHOST_GENERATOR_FILE |
6d70c713 | 2731 | build/gengtype-state.o: $(BCONFIG_H) |
2732 | gengtype.o build/gengtype.o : gengtype.c $(SYSTEM_H) gengtype.h \ | |
e913b5cd | 2733 | rtl.def insn-notes.def errors.h double-int.h version.h \ |
2734 | $(HASHTAB_H) $(OBSTACK_H) $(XREGEX_H) | |
ed89620f | 2735 | CFLAGS-gengtype.o += -DHOST_GENERATOR_FILE |
6d70c713 | 2736 | build/gengtype.o: $(BCONFIG_H) |
c833363a | 2737 | |
ed89620f | 2738 | CFLAGS-errors.o += -DHOST_GENERATOR_FILE |
2739 | ||
8734172d | 2740 | build/genmddeps.o: genmddeps.c $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) \ |
664c5888 | 2741 | errors.h $(READ_MD_H) |
21886706 | 2742 | build/genmodes.o : genmodes.c $(BCONFIG_H) $(SYSTEM_H) errors.h \ |
2743 | $(HASHTAB_H) machmode.def $(extra_modes_file) | |
2744 | build/genopinit.o : genopinit.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ | |
8734172d | 2745 | $(CORETYPES_H) $(GTM_H) errors.h $(GENSUPPORT_H) optabs.def |
21886706 | 2746 | build/genoutput.o : genoutput.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ |
8734172d | 2747 | $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) |
21886706 | 2748 | build/genpeep.o : genpeep.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ |
8734172d | 2749 | $(CORETYPES_H) $(GTM_H) errors.h $(GENSUPPORT_H) toplev.h \ |
2750 | $(DIAGNOSTIC_CORE_H) | |
21886706 | 2751 | build/genpreds.o : genpreds.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ |
8734172d | 2752 | $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) $(OBSTACK_H) |
21886706 | 2753 | build/genrecog.o : genrecog.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ |
8734172d | 2754 | $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) \ |
59250a8d | 2755 | $(HASH_TABLE_H) inchash.h |
c94b1d0e | 2756 | build/genhooks.o : genhooks.c $(TARGET_DEF) $(C_TARGET_DEF) \ |
3e87b980 | 2757 | $(COMMON_TARGET_DEF) $(BCONFIG_H) $(SYSTEM_H) errors.h |
376b1415 | 2758 | build/genmddump.o : genmddump.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ |
8734172d | 2759 | $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) |
2165588a | 2760 | build/genmatch.o : genmatch.c $(BCONFIG_H) $(SYSTEM_H) \ |
8734172d | 2761 | $(CORETYPES_H) errors.h $(HASH_TABLE_H) hash-map.h $(GGC_H) is-a.h \ |
e068cee4 | 2762 | tree.def builtins.def internal-fn.def |
28544f39 | 2763 | build/gencfn-macros.o : gencfn-macros.c $(BCONFIG_H) $(SYSTEM_H) \ |
8734172d | 2764 | $(CORETYPES_H) errors.h $(HASH_TABLE_H) hash-set.h builtins.def \ |
2765 | internal-fn.def | |
21886706 | 2766 | |
f196fb10 | 2767 | # Compile the programs that generate insn-* from the machine description. |
585d4848 | 2768 | # They are compiled with $(COMPILER_FOR_BUILD), and associated libraries, |
f196fb10 | 2769 | # since they need to run on this machine |
2770 | # even if GCC is being compiled to run on some other machine. | |
e23a6527 | 2771 | |
664c5888 | 2772 | # All these programs use the RTL reader ($(BUILD_RTL)). |
808674b1 | 2773 | genprogrtl = attr attr-common attrtab automata codes conditions config emit \ |
5da5e283 | 2774 | extract flags mddump opinit output peep preds recog target-def |
664c5888 | 2775 | $(genprogrtl:%=build/gen%$(build_exeext)): $(BUILD_RTL) |
2776 | ||
2777 | # All these programs use the MD reader ($(BUILD_MD)). | |
15f255bd | 2778 | genprogmd = $(genprogrtl) mddeps constants enums |
664c5888 | 2779 | $(genprogmd:%=build/gen%$(build_exeext)): $(BUILD_MD) |
2780 | ||
b0b2c910 | 2781 | # All these programs need to report errors. |
28544f39 | 2782 | genprogerr = $(genprogmd) genrtl modes gtype hooks cfn-macros |
b0b2c910 | 2783 | $(genprogerr:%=build/gen%$(build_exeext)): $(BUILD_ERRORS) |
2784 | ||
2785 | # Remaining build programs. | |
2165588a | 2786 | genprog = $(genprogerr) check checksum condmd match |
af908c02 | 2787 | |
f508ba97 | 2788 | # These programs need libs over and above what they get from the above list. |
0f7f3d52 | 2789 | build/genautomata$(build_exeext) : BUILD_LIBS += -lm |
583fa9e0 | 2790 | |
59250a8d | 2791 | build/genrecog$(build_exeext) : build/hash-table.o build/inchash.o |
28544f39 | 2792 | build/gencfn-macros$(build_exeext) : build/hash-table.o build/ggc-none.o |
59250a8d | 2793 | |
50ad7ed9 | 2794 | # For stage1 and when cross-compiling use the build libcpp which is |
2795 | # built with NLS disabled. For stage2+ use the host library and | |
2796 | # its dependencies. | |
2797 | ifeq ($(build_objdir),$(build_libobjdir)) | |
2798 | BUILD_CPPLIB = $(build_libobjdir)/libcpp/libcpp.a | |
2799 | else | |
2800 | BUILD_CPPLIB = $(CPPLIB) $(LIBIBERTY) | |
2801 | build/genmatch$(build_exeext): BUILD_LIBDEPS += $(LIBINTL_DEP) $(LIBICONV_DEP) | |
2802 | build/genmatch$(build_exeext): BUILD_LIBS += $(LIBINTL) $(LIBICONV) | |
2803 | endif | |
2804 | ||
9245d2c5 | 2805 | build/genmatch$(build_exeext) : $(BUILD_CPPLIB) \ |
2165588a | 2806 | $(BUILD_ERRORS) build/vec.o build/hash-table.o |
2807 | ||
343695df | 2808 | # These programs are not linked with the MD reader. |
1fdf44f0 | 2809 | build/gengtype$(build_exeext) : build/gengtype-lex.o build/gengtype-parse.o \ |
6d70c713 | 2810 | build/gengtype-state.o build/version.o build/errors.o |
2811 | ||
2812 | gengtype$(exeext) : gengtype.o gengtype-lex.o gengtype-parse.o \ | |
2813 | gengtype-state.o version.o errors.o $(LIBDEPS) | |
77eb3c2f | 2814 | +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \ |
2815 | $(filter-out ($LIBDEPS), $^) $(LIBS) | |
b0b2c910 | 2816 | |
2817 | # Rule for the generator programs: | |
2818 | $(genprog:%=build/gen%$(build_exeext)): build/gen%$(build_exeext): build/gen%.o $(BUILD_LIBDEPS) | |
70293f47 | 2819 | +$(LINKER_FOR_BUILD) $(BUILD_LINKERFLAGS) $(BUILD_LDFLAGS) -o $@ \ |
b0b2c910 | 2820 | $(filter-out $(BUILD_LIBDEPS), $^) $(BUILD_LIBS) |
1f3233d1 | 2821 | |
c99a98bc | 2822 | # Generated source files for gengtype. Prepend inclusion of |
2823 | # bconfig.h because AIX requires _LARGE_FILES to be defined before | |
2824 | # any system header is included. | |
a6b4c5a9 | 2825 | gengtype-lex.c : gengtype-lex.l |
e9992746 | 2826 | -$(FLEX) $(FLEXFLAGS) -o$@ $< && { \ |
2827 | echo '#include "bconfig.h"' > $@.tmp; \ | |
2828 | cat $@ >> $@.tmp; \ | |
2829 | mv $@.tmp $@; \ | |
2830 | } | |
bea4bad2 | 2831 | |
21886706 | 2832 | #\f |
2833 | # Remake internationalization support. | |
fc3bd902 | 2834 | CFLAGS-intl.o += -DLOCALEDIR=\"$(localedir)\" |
21886706 | 2835 | |
2e9d8ccf | 2836 | #\f |
f2397fc4 | 2837 | # Remake cpp. |
32e6d418 | 2838 | |
e2d3326d | 2839 | PREPROCESSOR_DEFINES = \ |
2840 | -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \ | |
d3036f42 | 2841 | -DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \ |
33f5262e | 2842 | -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \ |
36ddd5fe | 2843 | -DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \ |
33f5262e | 2844 | -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \ |
2845 | -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \ | |
759d75c3 | 2846 | -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \ |
805e22b2 | 2847 | -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \ |
17acc97a | 2848 | -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \ |
33f5262e | 2849 | -DNATIVE_SYSTEM_HEADER_DIR=\"$(NATIVE_SYSTEM_HEADER_DIR)\" \ |
72d997cb | 2850 | -DPREFIX=\"$(prefix)/\" \ |
2851 | -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \ | |
17acc97a | 2852 | @TARGET_SYSTEM_ROOT_DEFINE@ |
32e6d418 | 2853 | |
fc3bd902 | 2854 | CFLAGS-cppbuiltin.o += $(PREPROCESSOR_DEFINES) -DBASEVER=$(BASEVER_s) |
1d7f9a87 | 2855 | cppbuiltin.o: $(BASEVER) |
41acdfa4 | 2856 | |
fc3bd902 | 2857 | CFLAGS-cppdefault.o += $(PREPROCESSOR_DEFINES) |
21886706 | 2858 | |
876dc5b0 | 2859 | # Note for the stamp targets, we run the program `true' instead of |
2860 | # having an empty command (nothing following the semicolon). | |
2861 | ||
21886706 | 2862 | # gcov-iov.c is run on the build machine to generate gcov-iov.h from version.c |
8734172d | 2863 | build/gcov-iov.o: gcov-iov.c $(BCONFIG_H) $(CORETYPES_H) $(GTM_H) \ |
2864 | $(SYSTEM_H) $(CORETYPES_H) $(TM_H) | |
21886706 | 2865 | |
524a54cf | 2866 | build/gcov-iov$(build_exeext): build/gcov-iov.o |
70293f47 | 2867 | +$(LINKER_FOR_BUILD) $(BUILD_LINKERFLAGS) $(BUILD_LDFLAGS) \ |
585d4848 | 2868 | build/gcov-iov.o -o $@ |
524a54cf | 2869 | |
90ac3c3e | 2870 | gcov-iov.h: s-iov; @true |
1af67e62 | 2871 | s-iov: build/gcov-iov$(build_exeext) $(BASEVER) $(DEVPHASE) |
2872 | build/gcov-iov$(build_exeext) '$(BASEVER_c)' '$(DEVPHASE_c)' \ | |
2873 | > tmp-gcov-iov.h | |
ed90d522 | 2874 | $(SHELL) $(srcdir)/../move-if-change tmp-gcov-iov.h gcov-iov.h |
32e9529f | 2875 | $(STAMP) s-iov |
805e22b2 | 2876 | |
0b4f4daf | 2877 | GCOV_OBJS = gcov.o |
be2828ce | 2878 | gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS) |
0ff42de5 | 2879 | +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) \ |
64c0d78b | 2880 | hash-table.o ggc-none.o $(LIBS) -o $@ |
0b4f4daf | 2881 | GCOV_DUMP_OBJS = gcov-dump.o |
805e22b2 | 2882 | gcov-dump$(exeext): $(GCOV_DUMP_OBJS) $(LIBDEPS) |
70293f47 | 2883 | +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_DUMP_OBJS) \ |
91fa0dbf | 2884 | hash-table.o ggc-none.o\ |
585d4848 | 2885 | $(LIBS) -o $@ |
e76f6040 | 2886 | |
2887 | GCOV_TOOL_DEP_FILES = $(srcdir)/../libgcc/libgcov-util.c gcov-io.c $(GCOV_IO_H) \ | |
2888 | $(srcdir)/../libgcc/libgcov-driver.c $(srcdir)/../libgcc/libgcov-driver-system.c \ | |
8ceaa1ef | 2889 | $(srcdir)/../libgcc/libgcov-merge.c $(srcdir)/../libgcc/libgcov.h \ |
e76f6040 | 2890 | $(SYSTEM_H) coretypes.h $(TM_H) $(CONFIG_H) version.h intl.h $(DIAGNOSTIC_H) |
2891 | libgcov-util.o: $(srcdir)/../libgcc/libgcov-util.c $(GCOV_TOOL_DEP_FILES) | |
2892 | +$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -o $@ $< | |
2893 | libgcov-driver-tool.o: $(srcdir)/../libgcc/libgcov-driver.c $(GCOV_TOOL_DEP_FILES) | |
2894 | +$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ | |
2895 | -DIN_GCOV_TOOL=1 -o $@ $< | |
2896 | libgcov-merge-tool.o: $(srcdir)/../libgcc/libgcov-merge.c $(GCOV_TOOL_DEP_FILES) | |
2897 | +$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ | |
2898 | -DIN_GCOV_TOOL=1 -o $@ $< | |
2899 | GCOV_TOOL_OBJS = gcov-tool.o libgcov-util.o libgcov-driver-tool.o libgcov-merge-tool.o | |
2900 | gcov-tool$(exeext): $(GCOV_TOOL_OBJS) $(LIBDEPS) | |
2901 | +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_TOOL_OBJS) $(LIBS) -o $@ | |
2e9d8ccf | 2902 | #\f |
d3036f42 | 2903 | # Build the include directories. The stamp files are stmp-* rather than |
997d68fe | 2904 | # s-* so that mostlyclean does not force the include directory to |
2cfd79fe | 2905 | # be rebuilt. |
2906 | ||
d3036f42 | 2907 | # Build the include directories. |
e59be7e3 | 2908 | stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) fixinc_list |
2cfd79fe | 2909 | # Copy in the headers provided with gcc. |
9281483c | 2910 | # |
2cfd79fe | 2911 | # The sed command gets just the last file name component; |
2912 | # this is necessary because VPATH could add a dirname. | |
2913 | # Using basename would be simpler, but some systems don't have it. | |
9281483c | 2914 | # |
220345e0 | 2915 | # The touch command is here to workaround an AIX/Linux NFS bug. |
9281483c | 2916 | # |
2917 | # The move-if-change + cp -p twists for limits.h are intended to preserve | |
2918 | # the time stamp when we regenerate, to prevent pointless rebuilds during | |
2919 | # e.g. install-no-fixedincludes. | |
dc901594 | 2920 | -if [ -d include ] ; then true; else mkdir include; chmod a+rx include; fi |
d3036f42 | 2921 | -if [ -d include-fixed ] ; then true; else mkdir include-fixed; chmod a+rx include-fixed; fi |
c8763215 | 2922 | for file in .. $(USER_H); do \ |
2923 | if [ X$$file != X.. ]; then \ | |
2924 | realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \ | |
5ec97d31 | 2925 | $(STAMP) include/$$realfile; \ |
1941d7da | 2926 | rm -f include/$$realfile; \ |
2927 | cp $$file include; \ | |
2928 | chmod a+r include/$$realfile; \ | |
c8763215 | 2929 | fi; \ |
2cfd79fe | 2930 | done |
ac0366be | 2931 | for file in .. $(USER_H_INC_NEXT_PRE); do \ |
2932 | if [ X$$file != X.. ]; then \ | |
2933 | mv include/$$file include/x_$$file; \ | |
2934 | echo "#include_next <$$file>" >include/$$file; \ | |
2935 | cat include/x_$$file >>include/$$file; \ | |
2936 | rm -f include/x_$$file; \ | |
2937 | chmod a+r include/$$file; \ | |
2938 | fi; \ | |
2939 | done | |
2940 | for file in .. $(USER_H_INC_NEXT_POST); do \ | |
2941 | if [ X$$file != X.. ]; then \ | |
2942 | echo "#include_next <$$file>" >>include/$$file; \ | |
2943 | chmod a+r include/$$file; \ | |
2944 | fi; \ | |
2945 | done | |
f3449a3c | 2946 | rm -f include/stdint.h |
2947 | if [ $(USE_GCC_STDINT) = wrap ]; then \ | |
2948 | rm -f include/stdint-gcc.h; \ | |
2949 | cp $(srcdir)/ginclude/stdint-gcc.h include/stdint-gcc.h; \ | |
ca4b7618 | 2950 | chmod a+r include/stdint-gcc.h; \ |
f3449a3c | 2951 | cp $(srcdir)/ginclude/stdint-wrap.h include/stdint.h; \ |
3564f003 | 2952 | chmod a+r include/stdint.h; \ |
f3449a3c | 2953 | elif [ $(USE_GCC_STDINT) = provide ]; then \ |
2954 | cp $(srcdir)/ginclude/stdint-gcc.h include/stdint.h; \ | |
3564f003 | 2955 | chmod a+r include/stdint.h; \ |
f3449a3c | 2956 | fi |
6ea4242f | 2957 | set -e; for ml in `cat fixinc_list`; do \ |
2958 | sysroot_headers_suffix=`echo $${ml} | sed -e 's/;.*$$//'`; \ | |
2959 | multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \ | |
2960 | fix_dir=include-fixed$${multi_dir}; \ | |
2961 | if $(LIMITS_H_TEST) ; then \ | |
2962 | cat $(srcdir)/limitx.h $(srcdir)/glimits.h $(srcdir)/limity.h > tmp-xlimits.h; \ | |
2963 | else \ | |
2964 | cat $(srcdir)/glimits.h > tmp-xlimits.h; \ | |
2965 | fi; \ | |
2966 | $(mkinstalldirs) $${fix_dir}; \ | |
2967 | chmod a+rx $${fix_dir} || true; \ | |
9281483c | 2968 | $(SHELL) $(srcdir)/../move-if-change \ |
2969 | tmp-xlimits.h tmp-limits.h; \ | |
6ea4242f | 2970 | rm -f $${fix_dir}/limits.h; \ |
9281483c | 2971 | cp -p tmp-limits.h $${fix_dir}/limits.h; \ |
6ea4242f | 2972 | chmod a+r $${fix_dir}/limits.h; \ |
2973 | done | |
d54b81e0 | 2974 | # Install the README |
d3036f42 | 2975 | rm -f include-fixed/README |
2976 | cp $(srcdir)/../fixincludes/README-fixinc include-fixed/README | |
2977 | chmod a+r include-fixed/README | |
5ec97d31 | 2978 | $(STAMP) $@ |
d54b81e0 | 2979 | |
805e22b2 | 2980 | .PHONY: install-gcc-tooldir |
2981 | install-gcc-tooldir: | |
ca08f0d3 | 2982 | $(mkinstalldirs) $(DESTDIR)$(gcc_tooldir) |
805e22b2 | 2983 | |
7679bd15 | 2984 | macro_list: s-macro_list; @true |
af780f1a | 2985 | s-macro_list : $(GCC_PASSES) cc1$(exeext) |
50e7e370 | 2986 | echo | $(GCC_FOR_TARGET) -E -dM - | \ |
85cc1e72 | 2987 | sed -n -e 's/^#define \([^_][a-zA-Z0-9_]*\).*/\1/p' \ |
2988 | -e 's/^#define \(_[^_A-Z][a-zA-Z0-9_]*\).*/\1/p' | \ | |
7679bd15 | 2989 | sort -u > tmp-macro_list |
2990 | $(SHELL) $(srcdir)/../move-if-change tmp-macro_list macro_list | |
2991 | $(STAMP) s-macro_list | |
50e7e370 | 2992 | |
6ea4242f | 2993 | fixinc_list: s-fixinc_list; @true |
2994 | s-fixinc_list : $(GCC_PASSES) | |
2995 | # Build up a list of multilib directories and corresponding sysroot | |
2996 | # suffixes, in form sysroot;multilib. | |
2997 | if $(GCC_FOR_TARGET) -print-sysroot-headers-suffix > /dev/null 2>&1; then \ | |
2998 | set -e; for ml in `$(GCC_FOR_TARGET) -print-multi-lib`; do \ | |
2999 | multi_dir=`echo $${ml} | sed -e 's/;.*$$//'`; \ | |
3000 | flags=`echo $${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \ | |
3001 | sfx=`$(GCC_FOR_TARGET) $${flags} -print-sysroot-headers-suffix`; \ | |
3002 | if [ "$${multi_dir}" = "." ]; \ | |
3003 | then multi_dir=""; \ | |
3004 | else \ | |
3005 | multi_dir=/$${multi_dir}; \ | |
3006 | fi; \ | |
3007 | echo "$${sfx};$${multi_dir}"; \ | |
3008 | done; \ | |
3009 | else \ | |
3010 | echo ";"; \ | |
3011 | fi > tmp-fixinc_list | |
3012 | $(SHELL) $(srcdir)/../move-if-change tmp-fixinc_list fixinc_list | |
3013 | $(STAMP) s-fixinc_list | |
3014 | ||
6b9a84ac | 3015 | # The line below is supposed to avoid accidentally matching the |
3016 | # built-in suffix rule `.o:' to build fixincl out of fixincl.o. You'd | |
3017 | # expect fixincl to be newer than fixincl.o, such that this situation | |
3018 | # would never come up. As it turns out, if you use ccache with | |
3019 | # CCACHE_HARDLINK enabled, the compiler doesn't embed the current | |
3020 | # working directory in object files (-g absent, or -fno-working-dir | |
3021 | # present), and build and host are the same, fixincl for the host will | |
3022 | # build after fixincl for the build machine, getting a cache hit, | |
3ce7ff97 | 3023 | # thereby updating the timestamp of fixincl.o in the host tree. |
6b9a84ac | 3024 | # Because of CCACHE_HARDLINK, this will also update the timestamp in |
3025 | # the build tree, and so fixincl in the build tree will appear to be | |
3026 | # out of date. Yuck. | |
3027 | ../$(build_subdir)/fixincludes/fixincl: ; @ : | |
3028 | ||
2cfd79fe | 3029 | # Build fixed copies of system files. |
4a62cbb1 | 3030 | # Abort if no system headers available, unless building a crosscompiler. |
3031 | # FIXME: abort unless building --without-headers would be more accurate and less ugly | |
6ea4242f | 3032 | stmp-fixinc: gsyslimits.h macro_list fixinc_list \ |
c1eb9e31 | 3033 | $(build_objdir)/fixincludes/fixincl \ |
3034 | $(build_objdir)/fixincludes/fixinc.sh | |
d3036f42 | 3035 | rm -rf include-fixed; mkdir include-fixed |
3036 | -chmod a+rx include-fixed | |
26526d23 | 3037 | if [ -d ../prev-gcc ]; then \ |
3038 | cd ../prev-gcc && \ | |
ccdd426b | 3039 | $(MAKE) real-$(INSTALL_HEADERS_DIR) DESTDIR=`pwd`/../gcc/ \ |
26526d23 | 3040 | libsubdir=. ; \ |
b7d4d520 | 3041 | else \ |
6ea4242f | 3042 | set -e; for ml in `cat fixinc_list`; do \ |
3043 | sysroot_headers_suffix=`echo $${ml} | sed -e 's/;.*$$//'`; \ | |
3044 | multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \ | |
3045 | fix_dir=include-fixed$${multi_dir}; \ | |
1f87fb84 | 3046 | if ! $(inhibit_libc) && test ! -d ${BUILD_SYSTEM_HEADER_DIR}; then \ |
6ea4242f | 3047 | echo The directory that should contain system headers does not exist: >&2 ; \ |
1f87fb84 | 3048 | echo " ${BUILD_SYSTEM_HEADER_DIR}" >&2 ; \ |
6ea4242f | 3049 | tooldir_sysinc=`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`; \ |
1f87fb84 | 3050 | if test "x${BUILD_SYSTEM_HEADER_DIR}" = "x$${tooldir_sysinc}"; \ |
6ea4242f | 3051 | then sleep 1; else exit 1; fi; \ |
3052 | fi; \ | |
3053 | $(mkinstalldirs) $${fix_dir}; \ | |
3054 | chmod a+rx $${fix_dir} || true; \ | |
3055 | (TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD_COMMAND}`; \ | |
3056 | SHELL='$(SHELL)'; MACRO_LIST=`${PWD_COMMAND}`/macro_list ; \ | |
97f0faf7 | 3057 | gcc_dir=`${PWD_COMMAND}` ; \ |
6ea4242f | 3058 | export TARGET_MACHINE srcdir SHELL MACRO_LIST && \ |
3059 | cd $(build_objdir)/fixincludes && \ | |
97f0faf7 | 3060 | $(SHELL) ./fixinc.sh "$${gcc_dir}/$${fix_dir}" \ |
1f87fb84 | 3061 | $(BUILD_SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS) ); \ |
6ea4242f | 3062 | rm -f $${fix_dir}/syslimits.h; \ |
3063 | if [ -f $${fix_dir}/limits.h ]; then \ | |
3064 | mv $${fix_dir}/limits.h $${fix_dir}/syslimits.h; \ | |
3065 | else \ | |
3066 | cp $(srcdir)/gsyslimits.h $${fix_dir}/syslimits.h; \ | |
3067 | fi; \ | |
3068 | chmod a+r $${fix_dir}/syslimits.h; \ | |
3069 | done; \ | |
50e7e370 | 3070 | fi |
5ec97d31 | 3071 | $(STAMP) stmp-fixinc |
2e9d8ccf | 3072 | #\f |
9281483c | 3073 | |
3074 | # Install with the gcc headers files, not the fixed include files, which we | |
3075 | # are typically not allowed to distribute. The general idea is to: | |
3076 | # - Get to "install" with a bare set of internal headers, not the | |
3077 | # fixed system ones, | |
3078 | # - Prevent rebuilds of what normally depends on the headers, which is | |
3079 | # useless for installation purposes and would rely on improper headers. | |
3080 | # - Restore as much of the original state as possible. | |
3081 | ||
3082 | .PHONY: install-no-fixedincludes | |
3083 | ||
3084 | install-no-fixedincludes: | |
3085 | # Stash the current set of headers away, save stamps we're going to | |
3086 | # alter explicitly, and arrange for fixincludes not to run next time | |
3087 | # we trigger a headers rebuild. | |
3088 | -rm -rf tmp-include | |
3089 | -mv include tmp-include 2>/dev/null | |
3090 | -mv include-fixed tmp-include-fixed 2>/dev/null | |
3091 | -mv stmp-int-hdrs tmp-stmp-int-hdrs 2>/dev/null | |
3092 | -mv stmp-fixinc tmp-stmp-fixinc 2>/dev/null | |
3093 | -mkdir include | |
3094 | -cp -p $(srcdir)/gsyslimits.h include/syslimits.h | |
3095 | -touch stmp-fixinc | |
3096 | ||
3097 | # Rebuild our internal headers, restore the original stamps so that | |
3098 | # "install" doesn't trigger pointless rebuilds because of that update, | |
3099 | # then do install | |
3100 | $(MAKE) $(FLAGS_TO_PASS) stmp-int-hdrs | |
3101 | -mv tmp-stmp-int-hdrs stmp-int-hdrs 2>/dev/null | |
3102 | -mv tmp-stmp-fixinc stmp-fixinc 2>/dev/null | |
3103 | $(MAKE) $(FLAGS_TO_PASS) install | |
3104 | ||
3105 | # Restore the original set of maybe-fixed headers | |
3106 | -rm -rf include; mv tmp-include include 2>/dev/null | |
3107 | -rm -rf include-fixed; mv tmp-include-fixed include-fixed 2>/dev/null | |
3108 | ||
32e6d418 | 3109 | # Remake the info files. |
3110 | ||
210263ee | 3111 | doc: $(BUILD_INFO) $(GENERATED_MANPAGES) |
ca6eabd1 | 3112 | |
3113 | INFOFILES = doc/cpp.info doc/gcc.info doc/gccint.info \ | |
3114 | doc/gccinstall.info doc/cppinternals.info | |
3115 | ||
3116 | info: $(INFOFILES) lang.info @GENINSRC@ srcinfo lang.srcinfo | |
3117 | ||
3118 | srcinfo: $(INFOFILES) | |
3119 | -cp -p $^ $(srcdir)/doc | |
089f59b9 | 3120 | |
1af67e62 | 3121 | TEXI_CPP_FILES = cpp.texi fdl.texi cppenv.texi cppopts.texi \ |
3122 | gcc-common.texi gcc-vers.texi | |
089f59b9 | 3123 | |
1af67e62 | 3124 | TEXI_GCC_FILES = gcc.texi gcc-common.texi gcc-vers.texi frontends.texi \ |
3125 | standards.texi invoke.texi extend.texi md.texi objc.texi \ | |
3126 | gcov.texi trouble.texi bugreport.texi service.texi \ | |
eae7da65 | 3127 | contribute.texi compat.texi funding.texi gnu.texi gpl_v3.texi \ |
8a92b4c3 | 3128 | fdl.texi contrib.texi cppenv.texi cppopts.texi avr-mmcu.texi \ |
afcd1af2 | 3129 | implement-c.texi implement-cxx.texi gcov-tool.texi gcov-dump.texi |
089f59b9 | 3130 | |
50a6486c | 3131 | # we explicitly use $(srcdir)/doc/tm.texi here to avoid confusion with |
3132 | # the generated tm.texi; the latter might have a more recent timestamp, | |
3133 | # but we don't want to rebuild the info files unless the contents of | |
3134 | # the *.texi files have changed. | |
1af67e62 | 3135 | TEXI_GCCINT_FILES = gccint.texi gcc-common.texi gcc-vers.texi \ |
3136 | contribute.texi makefile.texi configterms.texi options.texi \ | |
50a6486c | 3137 | portability.texi interface.texi passes.texi rtl.texi md.texi \ |
3138 | $(srcdir)/doc/tm.texi hostconfig.texi fragments.texi \ | |
1af67e62 | 3139 | configfiles.texi collect2.texi headerdirs.texi funding.texi \ |
eae7da65 | 3140 | gnu.texi gpl_v3.texi fdl.texi contrib.texi languages.texi \ |
93d414c9 | 3141 | sourcebuild.texi gty.texi libgcc.texi cfg.texi tree-ssa.texi \ |
2165588a | 3142 | loop.texi generic.texi gimple.texi plugins.texi optinfo.texi \ |
3143 | match-and-simplify.texi | |
089f59b9 | 3144 | |
3a8843c6 | 3145 | TEXI_GCCINSTALL_FILES = install.texi install-old.texi fdl.texi \ |
ac30c31e | 3146 | gcc-common.texi gcc-vers.texi |
089f59b9 | 3147 | |
1af67e62 | 3148 | TEXI_CPPINT_FILES = cppinternals.texi gcc-common.texi gcc-vers.texi |
3149 | ||
3150 | # gcc-vers.texi is generated from the version files. | |
3151 | gcc-vers.texi: $(BASEVER) $(DEVPHASE) | |
3152 | (echo "@set version-GCC $(BASEVER_c)"; \ | |
3153 | if [ "$(DEVPHASE_c)" = "experimental" ]; \ | |
3154 | then echo "@set DEVELOPMENT"; \ | |
3155 | else echo "@clear DEVELOPMENT"; \ | |
3156 | fi) > $@T | |
fbf9447e | 3157 | $(build_file_translate) echo @set srcdir $(abs_srcdir) >> $@T |
d25dc80e | 3158 | if [ -n "$(PKGVERSION)" ]; then \ |
3159 | echo "@set VERSION_PACKAGE $(PKGVERSION)" >> $@T; \ | |
3160 | fi | |
3161 | echo "@set BUGURL $(BUGURL_TEXI)" >> $@T; \ | |
1af67e62 | 3162 | mv -f $@T $@ |
3163 | ||
089f59b9 | 3164 | |
51f93521 | 3165 | # The *.1, *.7, *.info, *.dvi, and *.pdf files are being generated from implicit |
08c53a6e | 3166 | # patterns. To use them, put each of the specific targets with its |
089f59b9 | 3167 | # specific dependencies but no build commands. |
1f3233d1 | 3168 | |
ca6eabd1 | 3169 | doc/cpp.info: $(TEXI_CPP_FILES) |
3170 | doc/gcc.info: $(TEXI_GCC_FILES) | |
3171 | doc/gccint.info: $(TEXI_GCCINT_FILES) | |
3172 | doc/cppinternals.info: $(TEXI_CPPINT_FILES) | |
f1dfae08 | 3173 | |
ca6eabd1 | 3174 | doc/%.info: %.texi |
634d5d15 | 3175 | if [ x$(BUILD_INFO) = xinfo ]; then \ |
77a85ce7 | 3176 | $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \ |
3177 | -I $(gcc_docdir)/include -o $@ $<; \ | |
634d5d15 | 3178 | fi |
215d428d | 3179 | |
1e94fc11 | 3180 | # Duplicate entry to handle renaming of gccinstall.info |
ca6eabd1 | 3181 | doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES) |
1e94fc11 | 3182 | if [ x$(BUILD_INFO) = xinfo ]; then \ |
77a85ce7 | 3183 | $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \ |
3184 | -I $(gcc_docdir)/include -o $@ $<; \ | |
1e94fc11 | 3185 | fi |
3186 | ||
ca6eabd1 | 3187 | doc/cpp.dvi: $(TEXI_CPP_FILES) |
3188 | doc/gcc.dvi: $(TEXI_GCC_FILES) | |
3189 | doc/gccint.dvi: $(TEXI_GCCINT_FILES) | |
3190 | doc/cppinternals.dvi: $(TEXI_CPPINT_FILES) | |
1e94fc11 | 3191 | |
51f93521 | 3192 | doc/cpp.pdf: $(TEXI_CPP_FILES) |
3193 | doc/gcc.pdf: $(TEXI_GCC_FILES) | |
3194 | doc/gccint.pdf: $(TEXI_GCCINT_FILES) | |
3195 | doc/cppinternals.pdf: $(TEXI_CPPINT_FILES) | |
3196 | ||
85690e4d | 3197 | $(build_htmldir)/cpp/index.html: $(TEXI_CPP_FILES) |
3198 | $(build_htmldir)/gcc/index.html: $(TEXI_GCC_FILES) | |
3199 | $(build_htmldir)/gccint/index.html: $(TEXI_GCCINT_FILES) | |
3200 | $(build_htmldir)/cppinternals/index.html: $(TEXI_CPPINT_FILES) | |
61a98835 | 3201 | |
ca6eabd1 | 3202 | dvi:: doc/gcc.dvi doc/gccint.dvi doc/gccinstall.dvi doc/cpp.dvi \ |
352ea6ae | 3203 | doc/cppinternals.dvi lang.dvi |
627defc4 | 3204 | |
ca6eabd1 | 3205 | doc/%.dvi: %.texi |
1af67e62 | 3206 | $(TEXI2DVI) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $< |
03217bce | 3207 | |
1e94fc11 | 3208 | # Duplicate entry to handle renaming of gccinstall.dvi |
ca6eabd1 | 3209 | doc/gccinstall.dvi: $(TEXI_GCCINSTALL_FILES) |
1af67e62 | 3210 | $(TEXI2DVI) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $< |
f1dfae08 | 3211 | |
ba5147c6 | 3212 | PDFFILES = doc/gcc.pdf doc/gccint.pdf doc/gccinstall.pdf doc/cpp.pdf \ |
3213 | doc/cppinternals.pdf | |
3214 | ||
3215 | pdf:: $(PDFFILES) lang.pdf | |
51f93521 | 3216 | |
3217 | doc/%.pdf: %.texi | |
3218 | $(TEXI2PDF) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $< | |
3219 | ||
3220 | # Duplicate entry to handle renaming of gccinstall.pdf | |
3221 | doc/gccinstall.pdf: $(TEXI_GCCINSTALL_FILES) | |
3222 | $(TEXI2PDF) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $< | |
3223 | ||
18f327f7 | 3224 | # List the directories or single hmtl files which are installed by |
3225 | # install-html. The lang.html file triggers language fragments to build | |
fb433b0b | 3226 | # html documentation. |
18f327f7 | 3227 | HTMLS_INSTALL=$(build_htmldir)/cpp $(build_htmldir)/gcc \ |
3228 | $(build_htmldir)/gccinstall $(build_htmldir)/gccint \ | |
3229 | $(build_htmldir)/cppinternals | |
3230 | ||
3231 | # List the html file targets. | |
3232 | HTMLS_BUILD=$(build_htmldir)/cpp/index.html $(build_htmldir)/gcc/index.html \ | |
85690e4d | 3233 | $(build_htmldir)/gccinstall/index.html $(build_htmldir)/gccint/index.html \ |
3234 | $(build_htmldir)/cppinternals/index.html lang.html | |
61a98835 | 3235 | |
18f327f7 | 3236 | html:: $(HTMLS_BUILD) |
85690e4d | 3237 | |
3238 | $(build_htmldir)/%/index.html: %.texi | |
61a98835 | 3239 | $(mkinstalldirs) $(@D) |
3240 | rm -f $(@D)/* | |
3241 | $(TEXI2HTML) -I $(abs_docdir) -I $(abs_docdir)/include -o $(@D) $< | |
3242 | ||
3243 | # Duplicate entry to handle renaming of gccinstall | |
85690e4d | 3244 | $(build_htmldir)/gccinstall/index.html: $(TEXI_GCCINSTALL_FILES) |
61a98835 | 3245 | $(mkinstalldirs) $(@D) |
3246 | echo rm -f $(@D)/* | |
120a0e58 | 3247 | SOURCEDIR=$(abs_docdir) \ |
3248 | DESTDIR=$(@D) \ | |
3249 | $(SHELL) $(srcdir)/doc/install.texi2html | |
61a98835 | 3250 | |
e76f6040 | 3251 | MANFILES = doc/gcov.1 doc/cpp.1 doc/gcc.1 doc/gfdl.7 doc/gpl.7 \ |
afcd1af2 | 3252 | doc/fsf-funding.7 doc/gcov-tool.1 doc/gcov-dump.1 |
ca6eabd1 | 3253 | |
d3c27322 | 3254 | generated-manpages: man |
b510ee9c | 3255 | |
3256 | man: $(MANFILES) lang.man @GENINSRC@ srcman lang.srcman | |
ca6eabd1 | 3257 | |
3258 | srcman: $(MANFILES) | |
3259 | -cp -p $^ $(srcdir)/doc | |
7534b8df | 3260 | |
ca6eabd1 | 3261 | doc/%.1: %.pod |
81fea989 | 3262 | $(STAMP) $@ |
089f59b9 | 3263 | -($(POD2MAN) --section=1 $< > $(@).T$$$$ && \ |
81fea989 | 3264 | mv -f $(@).T$$$$ $@) || \ |
3265 | (rm -f $(@).T$$$$ && exit 1) | |
81fea989 | 3266 | |
ca6eabd1 | 3267 | doc/%.7: %.pod |
81fea989 | 3268 | $(STAMP) $@ |
089f59b9 | 3269 | -($(POD2MAN) --section=7 $< > $(@).T$$$$ && \ |
81fea989 | 3270 | mv -f $(@).T$$$$ $@) || \ |
3271 | (rm -f $(@).T$$$$ && exit 1) | |
089f59b9 | 3272 | |
3273 | %.pod: %.texi | |
3274 | $(STAMP) $@ | |
d25dc80e | 3275 | -$(TEXI2POD) -DBUGURL="$(BUGURL_TEXI)" $< > $@ |
089f59b9 | 3276 | |
8fa77b73 | 3277 | .INTERMEDIATE: cpp.pod gcc.pod gfdl.pod fsf-funding.pod gpl.pod |
089f59b9 | 3278 | cpp.pod: cpp.texi cppenv.texi cppopts.texi |
3279 | ||
3280 | # These next rules exist because the output name is not the same as | |
08c53a6e | 3281 | # the input name, so our implicit %.pod rule will not work. |
089f59b9 | 3282 | |
b475d084 | 3283 | gcc.pod: invoke.texi cppenv.texi cppopts.texi gcc-vers.texi |
089f59b9 | 3284 | $(STAMP) $@ |
3285 | -$(TEXI2POD) $< > $@ | |
3286 | gfdl.pod: fdl.texi | |
3287 | $(STAMP) $@ | |
3288 | -$(TEXI2POD) $< > $@ | |
3289 | fsf-funding.pod: funding.texi | |
3290 | $(STAMP) $@ | |
3291 | -$(TEXI2POD) $< > $@ | |
eae7da65 | 3292 | gpl.pod: gpl_v3.texi |
3293 | $(STAMP) $@ | |
3294 | -$(TEXI2POD) $< > $@ | |
7a16ce2c | 3295 | |
2e9d8ccf | 3296 | #\f |
32e6d418 | 3297 | # Deletion of files made during compilation. |
3298 | # There are four levels of this: | |
a8514488 | 3299 | # `mostlyclean', `clean', `distclean' and `maintainer-clean'. |
32e6d418 | 3300 | # `mostlyclean' is useful while working on a particular type of machine. |
c6396a0b | 3301 | # It deletes most, but not all, of the files made by compilation. |
32e6d418 | 3302 | # It does not delete libgcc.a or its parts, so it won't have to be recompiled. |
c6396a0b | 3303 | # `clean' deletes everything made by running `make all'. |
79f818d0 | 3304 | # `distclean' also deletes the files made by config. |
a8514488 | 3305 | # `maintainer-clean' also deletes everything that could be regenerated |
1f42ecdc | 3306 | # automatically, except for `configure'. |
3307 | # We remove as much from the language subdirectories as we can | |
73027c94 | 3308 | # (less duplicated code). |
32e6d418 | 3309 | |
1e12d536 | 3310 | mostlyclean: lang.mostlyclean |
e3ca137a | 3311 | -rm -f $(MOSTLYCLEANFILES) |
f8988513 | 3312 | -rm -f *$(objext) c-family/*$(objext) |
d5a37d75 | 3313 | -rm -f *$(coverageexts) |
524a54cf | 3314 | # Delete build programs |
3315 | -rm -f build/* | |
96128417 | 3316 | -rm -f mddeps.mk |
997d68fe | 3317 | # Delete other built files. |
0bfbe373 | 3318 | -rm -f specs.h options.c options.h options-save.c |
997d68fe | 3319 | # Delete the stamp and temporary files. |
3320 | -rm -f s-* tmp-* stamp-* stmp-* | |
73027c94 | 3321 | -rm -f */stamp-* */tmp-* |
c6396a0b | 3322 | # Delete debugging dump files. |
713a4057 | 3323 | -rm -f *.[0-9][0-9].* */*.[0-9][0-9].* |
c6396a0b | 3324 | # Delete some files made during installation. |
f2397fc4 | 3325 | -rm -f specs $(SPECS) |
f8d49ce1 | 3326 | -rm -f collect collect2 mips-tfile mips-tdump |
c6396a0b | 3327 | # Delete unwanted output files from TeX. |
3328 | -rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg | |
73027c94 | 3329 | -rm -f */*.toc */*.log */*.vr */*.fn */*.cp */*.tp */*.ky */*.pg |
79f818d0 | 3330 | # Delete sorted indices we don't actually use. |
3331 | -rm -f gcc.vrs gcc.kys gcc.tps gcc.pgs gcc.fns | |
c6396a0b | 3332 | # Delete core dumps. |
73027c94 | 3333 | -rm -f core */core |
570af75a | 3334 | # Delete file generated for gengtype |
3335 | -rm -f gtyp-input.list | |
463ae493 | 3336 | # Delete files generated by gengtype |
776c30b8 | 3337 | -rm -f gtype-* |
3338 | -rm -f gt-* | |
463ae493 | 3339 | -rm -f gtype.state |
f1035767 | 3340 | # Delete genchecksum outputs |
3341 | -rm -f *-checksum.c | |
be5f9e46 | 3342 | # Delete lock-and-run bits |
3343 | -rm -rf linkfe.lck lock-stamp.* | |
32e6d418 | 3344 | |
79f818d0 | 3345 | # Delete all files made by compilation |
3346 | # that don't exist in the distribution. | |
1e12d536 | 3347 | clean: mostlyclean lang.clean |
ad8617cf | 3348 | -rm -f libgcc.a libgcc_eh.a libgcov.a |
6fb158d1 | 3349 | -rm -f libgcc_s* |
8bdf23ae | 3350 | -rm -f libunwind* |
022a2799 | 3351 | -rm -f config.h tconfig.h bconfig.h tm_p.h tm.h |
e8b212b8 | 3352 | -rm -f options.c options.h optionlist |
83b8e55b | 3353 | -rm -f cs-* |
ca6eabd1 | 3354 | -rm -f doc/*.dvi |
51f93521 | 3355 | -rm -f doc/*.pdf |
6ea4242f | 3356 | # Delete the include directories. |
3357 | -rm -rf include include-fixed | |
d73a48cc | 3358 | # Delete files used by the "multilib" facility (including libgcc subdirs). |
f1ad3130 | 3359 | -rm -f multilib.h tmpmultilib* |
d73a48cc | 3360 | -if [ "x$(MULTILIB_DIRNAMES)" != x ] ; then \ |
3361 | rm -rf $(MULTILIB_DIRNAMES); \ | |
3362 | else if [ "x$(MULTILIB_OPTIONS)" != x ] ; then \ | |
3363 | rm -rf `echo $(MULTILIB_OPTIONS) | sed -e 's/\// /g'`; \ | |
3364 | fi ; fi | |
32e6d418 | 3365 | |
79f818d0 | 3366 | # Delete all files that users would normally create |
3367 | # while building and installing GCC. | |
1e12d536 | 3368 | distclean: clean lang.distclean |
83b8e55b | 3369 | -rm -f auto-host.h auto-build.h |
ec255163 | 3370 | -rm -f cstamp-h |
1f42ecdc | 3371 | -rm -f config.status config.run config.cache config.bak |
160b6fa9 | 3372 | -rm -f Make-lang Make-hooks Make-host Make-target |
48121e86 | 3373 | -rm -f Makefile *.oaux |
58febf9e | 3374 | -rm -f gthr-default.h |
1576dec7 | 3375 | -rm -f TAGS */TAGS |
b541ad9d | 3376 | -rm -f *.asm |
45e01ea1 | 3377 | -rm -f site.exp site.bak testsuite/site.exp testsuite/site.bak |
48121e86 | 3378 | -rm -f testsuite/*.log testsuite/*.sum |
e0d053a6 | 3379 | -cd testsuite && rm -f x *.x *.x? *.exe *.rpo *.o *.s *.S *.c |
805e22b2 | 3380 | -cd testsuite && rm -f *.out *.gcov *$(coverageexts) |
7f52823c | 3381 | -rm -rf ${QMTEST_DIR} stamp-qmtest |
883c44aa | 3382 | -rm -f cxxmain.c |
210263ee | 3383 | -rm -f .gdbinit configargs.h |
7534b8df | 3384 | -rm -f gcov.pod |
48121e86 | 3385 | # Delete po/*.gmo only if we are not building in the source directory. |
3386 | -if [ ! -f po/exgettext ]; then rm -f po/*.gmo; fi | |
19bc000d | 3387 | -rmdir ada cp f java objc intl po testsuite plugin 2>/dev/null |
c6396a0b | 3388 | |
1f42ecdc | 3389 | # Get rid of every file that's generated from some other file, except for `configure'. |
32e6d418 | 3390 | # Most of these files ARE PRESENT in the GCC distribution. |
1f42ecdc | 3391 | maintainer-clean: |
3392 | @echo 'This command is intended for maintainers to use; it' | |
3393 | @echo 'deletes files that may need special tools to rebuild.' | |
1e12d536 | 3394 | $(MAKE) lang.maintainer-clean distclean |
c94ba072 | 3395 | -rm -f cpp.??s cpp.*aux |
3396 | -rm -f gcc.??s gcc.*aux | |
51f93521 | 3397 | -rm -f $(gcc_docdir)/*.info $(gcc_docdir)/*.1 $(gcc_docdir)/*.7 $(gcc_docdir)/*.dvi $(gcc_docdir)/*.pdf |
2e9d8ccf | 3398 | #\f |
2b7a4d59 | 3399 | # Entry points `install', `install-strip', and `uninstall'. |
c6396a0b | 3400 | # Also use `install-collect2' to install collect2 when the config files don't. |
32e6d418 | 3401 | |
2cfd79fe | 3402 | # Copy the compiler files into directories where they will be run. |
62268150 | 3403 | # Install the driver last so that the window when things are |
3404 | # broken is small. | |
894a47b4 | 3405 | install: install-common $(INSTALL_HEADERS) \ |
1e12d536 | 3406 | install-cpp install-man install-info install-@POSUB@ \ |
46215dc9 | 3407 | install-driver install-lto-wrapper install-gcc-ar |
32e6d418 | 3408 | |
912f2b18 | 3409 | ifeq ($(enable_plugin),yes) |
3410 | install: install-plugin | |
3411 | endif | |
3412 | ||
2b7a4d59 | 3413 | install-strip: override INSTALL_PROGRAM = $(INSTALL_STRIP_PROGRAM) |
3414 | ifneq ($(STRIP),) | |
3415 | install-strip: STRIPPROG = $(STRIP) | |
3416 | export STRIPPROG | |
3417 | endif | |
3418 | install-strip: install | |
3419 | ||
3e2f90b9 | 3420 | # Handle cpp installation. |
87b6be85 | 3421 | install-cpp: installdirs cpp$(exeext) |
a3d93be3 | 3422 | -if test "$(enable_as_accelerator)" != "yes" ; then \ |
3423 | rm -f $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext); \ | |
3424 | $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext); \ | |
3425 | if [ x$(cpp_install_dir) != x ]; then \ | |
3426 | rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \ | |
3427 | $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \ | |
3428 | else true; fi; \ | |
3429 | fi | |
3e2f90b9 | 3430 | |
0d5bce1b | 3431 | # Create the installation directories. |
9db45a87 | 3432 | # $(libdir)/gcc/include isn't currently searched by cpp. |
0d5bce1b | 3433 | installdirs: |
ca08f0d3 | 3434 | $(mkinstalldirs) $(DESTDIR)$(libsubdir) |
3435 | $(mkinstalldirs) $(DESTDIR)$(libexecsubdir) | |
3436 | $(mkinstalldirs) $(DESTDIR)$(bindir) | |
3437 | $(mkinstalldirs) $(DESTDIR)$(includedir) | |
3438 | $(mkinstalldirs) $(DESTDIR)$(infodir) | |
ca08f0d3 | 3439 | $(mkinstalldirs) $(DESTDIR)$(man1dir) |
3440 | $(mkinstalldirs) $(DESTDIR)$(man7dir) | |
32e6d418 | 3441 | |
0a259d8d | 3442 | params.list: s-params.list; @true |
3443 | s-params.list: $(srcdir)/params-list.h $(srcdir)/params.def | |
3444 | $(CPP) $(srcdir)/params-list.h | sed 's/^#.*//;/^$$/d' > tmp-params.list | |
3445 | $(SHELL) $(srcdir)/../move-if-change tmp-params.list params.list | |
3446 | $(STAMP) s-params.list | |
3447 | ||
94ee1e9c | 3448 | params.options: s-params.options; @true |
3449 | s-params.options: $(srcdir)/params-options.h $(srcdir)/params.def | |
3450 | $(CPP) $(srcdir)/params-options.h | sed 's/^#.*//;/^$$/d' > tmp-params.options | |
3451 | $(SHELL) $(srcdir)/../move-if-change tmp-params.options params.options | |
3452 | $(STAMP) s-params.options | |
3453 | ||
3454 | ||
912f2b18 | 3455 | PLUGIN_HEADERS = $(TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ |
7149db5f | 3456 | toplev.h $(DIAGNOSTIC_CORE_H) $(BASIC_BLOCK_H) $(HASH_TABLE_H) \ |
bc61cadb | 3457 | tree-ssa-alias.h $(INTERNAL_FN_H) gimple-fold.h tree-eh.h gimple-expr.h \ |
ad7b10a2 | 3458 | gimple.h is-a.h memmodel.h $(TREE_PASS_H) $(GCC_PLUGIN_H) \ |
eb3dd80d | 3459 | $(GGC_H) $(TREE_DUMP_H) $(PRETTY_PRINT_H) $(OPTS_H) $(PARAMS_H) \ |
a933e912 | 3460 | $(tm_file_list) $(tm_include_list) $(tm_p_file_list) $(tm_p_include_list) \ |
3461 | $(host_xm_file_list) $(host_xm_include_list) $(xm_include_list) \ | |
02ea0cd9 | 3462 | intl.h $(PLUGIN_VERSION_H) $(DIAGNOSTIC_H) ${C_TREE_H} \ |
6c536c4f | 3463 | $(C_COMMON_H) c-family/c-objc.h $(C_PRETTY_PRINT_H) \ |
69ee5dbb | 3464 | tree-iterator.h $(PLUGIN_H) $(TREE_SSA_H) langhooks.h incpath.h debug.h \ |
596981c8 | 3465 | $(EXCEPT_H) tree-ssa-sccvn.h real.h output.h $(IPA_UTILS_H) \ |
1118ebc8 | 3466 | $(C_PRAGMA_H) $(CPPLIB_H) $(FUNCTION_H) \ |
df423ec7 | 3467 | cppdefault.h flags.h $(MD5_H) params.def params.h params-enum.h \ |
3468 | prefix.h tree-inline.h $(GIMPLE_PRETTY_PRINT_H) realmpfr.h \ | |
86642a49 | 3469 | $(IPA_PROP_H) $(TARGET_H) $(RTL_H) $(TM_P_H) $(CFGLOOP_H) $(EMIT_RTL_H) \ |
10d41ed3 | 3470 | version.h stringpool.h gimplify.h gimple-iterator.h gimple-ssa.h \ |
6c21be92 | 3471 | fold-const.h fold-const-call.h tree-cfg.h tree-into-ssa.h tree-ssanames.h \ |
3472 | print-tree.h varasm.h context.h tree-phinodes.h stor-layout.h \ | |
3473 | ssa-iterators.h $(RESOURCE_H) tree-cfgcleanup.h attribs.h calls.h \ | |
3474 | cfgexpand.h diagnostic-color.h gcc-symtab.h gimple-builder.h gimple-low.h \ | |
d78cc47b | 3475 | gimple-walk.h gimplify-me.h pass_manager.h print-rtl.h stmt.h \ |
3476 | tree-dfa.h tree-hasher.h tree-nested.h tree-object-size.h tree-outof-ssa.h \ | |
3477 | tree-parloops.h tree-ssa-address.h tree-ssa-coalesce.h tree-ssa-dom.h \ | |
3478 | tree-ssa-loop.h tree-ssa-loop-ivopts.h tree-ssa-loop-manip.h \ | |
3479 | tree-ssa-loop-niter.h tree-ssa-ter.h tree-ssa-threadedge.h \ | |
7f7933b1 | 3480 | tree-ssa-threadupdate.h inchash.h wide-int.h signop.h hash-map.h \ |
2fe70ee1 | 3481 | hash-set.h dominance.h cfg.h cfgrtl.h cfganal.h cfgbuild.h cfgcleanup.h \ |
3eb5e6f1 | 3482 | lcm.h cfgloopmanip.h builtins.def chkp-builtins.def pass-instances.def \ |
3483 | params.list | |
912f2b18 | 3484 | |
c9036234 | 3485 | # generate the 'build fragment' b-header-vars |
3486 | s-header-vars: Makefile | |
3487 | rm -f tmp-header-vars | |
136fa403 | 3488 | # The first sed gets the list "header variables" as the list variables |
3489 | # assigned in Makefile and having _H at the end of the name. "sed -n" proved | |
3490 | # more portable than a trailing "-e d" to filter out the uninteresting lines, | |
3491 | # in particular on ia64-hpux where "s/.../p" only prints if -n was requested | |
3492 | # as well. | |
3493 | $(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~\.\.\..*/~~') >> tmp-header-vars;) \ | |
c9036234 | 3494 | $(SHELL) $(srcdir)/../move-if-change tmp-header-vars b-header-vars |
3495 | $(STAMP) s-header-vars | |
3496 | ||
6d70c713 | 3497 | # Install gengtype |
3498 | install-gengtype: installdirs gengtype$(exeext) gtype.state | |
3499 | $(mkinstalldirs) $(DESTDIR)$(plugin_resourcesdir) | |
3500 | $(INSTALL_DATA) gtype.state $(DESTDIR)$(plugin_resourcesdir)/gtype.state | |
3501 | $(mkinstalldirs) $(DESTDIR)$(plugin_bindir) | |
3502 | $(INSTALL_PROGRAM) gengtype$(exeext) $(DESTDIR)$(plugin_bindir)/gengtype$(exeext) | |
3503 | ||
912f2b18 | 3504 | # Install the headers needed to build a plugin. |
6d70c713 | 3505 | install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype |
6ee97920 | 3506 | # We keep the directory structure for files in config or c-family and .def |
3507 | # files. All other files are flattened to a single directory. | |
912f2b18 | 3508 | $(mkinstalldirs) $(DESTDIR)$(plugin_includedir) |
b67fc3b2 | 3509 | headers=`echo $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \ |
537bb6bf | 3510 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \ |
912f2b18 | 3511 | for file in $$headers; do \ |
3512 | if [ -f $$file ] ; then \ | |
3513 | path=$$file; \ | |
3514 | elif [ -f $(srcdir)/$$file ]; then \ | |
3515 | path=$(srcdir)/$$file; \ | |
3516 | else continue; \ | |
3517 | fi; \ | |
3518 | case $$path in \ | |
6ee97920 | 3519 | "$(srcdir)"/config/* | "$(srcdir)"/c-family/* | "$(srcdir)"/*.def ) \ |
b3c73487 | 3520 | base=`echo "$$path" | sed -e "s|$$srcdirstrip/||"`;; \ |
912f2b18 | 3521 | *) base=`basename $$path` ;; \ |
3522 | esac; \ | |
3523 | dest=$(plugin_includedir)/$$base; \ | |
19b30c2a | 3524 | echo $(INSTALL_DATA) $$path $(DESTDIR)$$dest; \ |
912f2b18 | 3525 | dir=`dirname $$dest`; \ |
19b30c2a | 3526 | $(mkinstalldirs) $(DESTDIR)$$dir; \ |
3527 | $(INSTALL_DATA) $$path $(DESTDIR)$$dest; \ | |
912f2b18 | 3528 | done |
c9036234 | 3529 | $(INSTALL_DATA) b-header-vars $(DESTDIR)$(plugin_includedir)/b-header-vars |
912f2b18 | 3530 | |
32e6d418 | 3531 | # Install the compiler executables built during cross compilation. |
894a47b4 | 3532 | install-common: native lang.install-common installdirs |
32e6d418 | 3533 | for file in $(COMPILERS); do \ |
3534 | if [ -f $$file ] ; then \ | |
9db45a87 | 3535 | rm -f $(DESTDIR)$(libexecsubdir)/$$file; \ |
3536 | $(INSTALL_PROGRAM) $$file $(DESTDIR)$(libexecsubdir)/$$file; \ | |
32e6d418 | 3537 | else true; \ |
3538 | fi; \ | |
3539 | done | |
7151decb | 3540 | for file in $(EXTRA_PROGRAMS) $(COLLECT2) ..; do \ |
32e6d418 | 3541 | if [ x"$$file" != x.. ]; then \ |
9db45a87 | 3542 | rm -f $(DESTDIR)$(libexecsubdir)/$$file; \ |
3543 | $(INSTALL_PROGRAM) $$file $(DESTDIR)$(libexecsubdir)/$$file; \ | |
32e6d418 | 3544 | else true; fi; \ |
3545 | done | |
f394bd30 | 3546 | # We no longer install the specs file because its presence makes the |
3547 | # driver slower, and because people who need it can recreate it by | |
3548 | # using -dumpspecs. We remove any old version because it would | |
3549 | # otherwise override the specs built into the driver. | |
f987497d | 3550 | rm -f $(DESTDIR)$(libsubdir)/specs |
e2a2be99 | 3551 | # Install gcov if it was compiled. |
a3d93be3 | 3552 | -if test "$(enable_as_accelerator)" != "yes" ; then \ |
3553 | if [ -f gcov$(exeext) ]; \ | |
3554 | then \ | |
931f506f | 3555 | rm -f $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext); \ |
36f95905 | 3556 | $(INSTALL_PROGRAM) gcov$(exeext) $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext); \ |
a3d93be3 | 3557 | fi; \ |
2b55270a | 3558 | fi |
e76f6040 | 3559 | # Install gcov-tool if it was compiled. |
a3d93be3 | 3560 | -if test "$(enable_as_accelerator)" != "yes" ; then \ |
3561 | if [ -f gcov-tool$(exeext) ]; \ | |
3562 | then \ | |
e76f6040 | 3563 | rm -f $(DESTDIR)$(bindir)/$(GCOV_TOOL_INSTALL_NAME)$(exeext); \ |
3564 | $(INSTALL_PROGRAM) \ | |
3565 | gcov-tool$(exeext) $(DESTDIR)$(bindir)/$(GCOV_TOOL_INSTALL_NAME)$(exeext); \ | |
a3d93be3 | 3566 | fi; \ |
e76f6040 | 3567 | fi |
c6a9dcea | 3568 | # Install gcov-dump if it was compiled. |
3569 | -if test "$(enable_as_accelerator)" != "yes" ; then \ | |
3570 | if [ -f gcov-dump$(exeext) ]; \ | |
3571 | then \ | |
3572 | rm -f $(DESTDIR)$(bindir)/$(GCOV_DUMP_INSTALL_NAME)$(exeext); \ | |
3573 | $(INSTALL_PROGRAM) \ | |
3574 | gcov-dump$(exeext) $(DESTDIR)$(bindir)/$(GCOV_DUMP_INSTALL_NAME)$(exeext); \ | |
3575 | fi; \ | |
3576 | fi | |
62268150 | 3577 | |
d3c27322 | 3578 | # Install the driver program as $(target_noncanonical)-gcc, |
955edcde | 3579 | # $(target_noncanonical)-gcc-$(version), and also as gcc if native. |
414d46fe | 3580 | install-driver: installdirs xgcc$(exeext) |
994974c8 | 3581 | -rm -f $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext) |
3582 | -$(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext) | |
a3d93be3 | 3583 | -if test "$(enable_as_accelerator)" != "yes" ; then \ |
3584 | if [ "$(GCC_INSTALL_NAME)" != "$(target_noncanonical)-gcc-$(version)" ]; then \ | |
3585 | rm -f $(DESTDIR)$(bindir)/$(FULL_DRIVER_NAME); \ | |
3586 | ( cd $(DESTDIR)$(bindir) && \ | |
3587 | $(LN) $(GCC_INSTALL_NAME)$(exeext) $(FULL_DRIVER_NAME) ); \ | |
3588 | fi; \ | |
3589 | if [ ! -f gcc-cross$(exeext) ] \ | |
3590 | && [ "$(GCC_INSTALL_NAME)" != "$(GCC_TARGET_INSTALL_NAME)" ]; then \ | |
3591 | rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-tmp$(exeext); \ | |
3592 | ( cd $(DESTDIR)$(bindir) && \ | |
3593 | $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-tmp$(exeext) && \ | |
3594 | mv -f $(target_noncanonical)-gcc-tmp$(exeext) $(GCC_TARGET_INSTALL_NAME)$(exeext) ); \ | |
3595 | fi; \ | |
32e6d418 | 3596 | fi |
32e6d418 | 3597 | |
a2aa0fc1 | 3598 | # Install the info files. |
dff6b323 | 3599 | # $(INSTALL_DATA) might be a relative pathname, so we can't cd into srcdir |
509d95a7 | 3600 | # to do the install. |
e9d2d60f | 3601 | install-info:: doc installdirs \ |
3602 | $(DESTDIR)$(infodir)/cpp.info \ | |
3603 | $(DESTDIR)$(infodir)/gcc.info \ | |
3604 | $(DESTDIR)$(infodir)/cppinternals.info \ | |
c5d817c0 | 3605 | $(DESTDIR)$(infodir)/gccinstall.info \ |
352ea6ae | 3606 | $(DESTDIR)$(infodir)/gccint.info \ |
3607 | lang.install-info | |
e9d2d60f | 3608 | |
ca6eabd1 | 3609 | $(DESTDIR)$(infodir)/%.info: doc/%.info installdirs |
e9d2d60f | 3610 | rm -f $@ |
3611 | if [ -f $< ]; then \ | |
3612 | for f in $(<)*; do \ | |
c94ba072 | 3613 | realfile=`echo $$f | sed -e 's|.*/\([^/]*\)$$|\1|'`; \ |
36f95905 | 3614 | $(INSTALL_DATA) $$f $(DESTDIR)$(infodir)/$$realfile; \ |
47743619 | 3615 | chmod a-x $(DESTDIR)$(infodir)/$$realfile; \ |
c94ba072 | 3616 | done; \ |
3617 | else true; fi | |
509d95a7 | 3618 | -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ |
50ef8532 | 3619 | if [ -f $@ ]; then \ |
3620 | install-info --dir-file=$(DESTDIR)$(infodir)/dir $@; \ | |
530e88cf | 3621 | else true; fi; \ |
89980492 | 3622 | else true; fi; |
a2aa0fc1 | 3623 | |
ba5147c6 | 3624 | pdf__strip_dir = `echo $$p | sed -e 's|^.*/||'`; |
3625 | ||
3626 | install-pdf: $(PDFFILES) lang.install-pdf | |
3627 | @$(NORMAL_INSTALL) | |
3628 | test -z "$(pdfdir)/gcc" || $(mkinstalldirs) "$(DESTDIR)$(pdfdir)/gcc" | |
3629 | @list='$(PDFFILES)'; for p in $$list; do \ | |
3630 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ | |
3631 | f=$(pdf__strip_dir) \ | |
3632 | echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/gcc/$$f'"; \ | |
3633 | $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/gcc/$$f"; \ | |
3634 | done | |
3635 | ||
18f327f7 | 3636 | html__strip_dir = `echo $$p | sed -e 's|^.*/||'`; |
32abc985 | 3637 | |
fb433b0b | 3638 | install-html: $(HTMLS_BUILD) lang.install-html |
18f327f7 | 3639 | @$(NORMAL_INSTALL) |
581a3a99 | 3640 | test -z "$(htmldir)" || $(mkinstalldirs) "$(DESTDIR)$(htmldir)" |
18f327f7 | 3641 | @list='$(HTMLS_INSTALL)'; for p in $$list; do \ |
3642 | if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \ | |
3643 | f=$(html__strip_dir) \ | |
3644 | if test -d "$$d$$p"; then \ | |
581a3a99 | 3645 | echo " $(mkinstalldirs) '$(DESTDIR)$(htmldir)/$$f'"; \ |
3646 | $(mkinstalldirs) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ | |
18f327f7 | 3647 | echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \ |
3648 | $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \ | |
3649 | else \ | |
3650 | echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \ | |
3651 | $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \ | |
3652 | fi; \ | |
3653 | done | |
3654 | ||
32e6d418 | 3655 | # Install the man pages. |
01ac74a6 | 3656 | install-man: lang.install-man \ |
ca6eabd1 | 3657 | $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext) \ |
f0738865 | 3658 | $(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext) \ |
3659 | $(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext) \ | |
afcd1af2 | 3660 | $(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext) \ |
3661 | $(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext) \ | |
ca6eabd1 | 3662 | $(DESTDIR)$(man7dir)/fsf-funding$(man7ext) \ |
3663 | $(DESTDIR)$(man7dir)/gfdl$(man7ext) \ | |
3664 | $(DESTDIR)$(man7dir)/gpl$(man7ext) | |
3665 | ||
01ac74a6 | 3666 | $(DESTDIR)$(man7dir)/%$(man7ext): doc/%.7 installdirs |
ca6eabd1 | 3667 | -rm -f $@ |
3668 | -$(INSTALL_DATA) $< $@ | |
3669 | -chmod a-x $@ | |
3670 | ||
01ac74a6 | 3671 | $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext): doc/gcc.1 installdirs |
ca6eabd1 | 3672 | -rm -f $@ |
d3c27322 | 3673 | -$(INSTALL_DATA) $< $@ |
ca6eabd1 | 3674 | -chmod a-x $@ |
3675 | ||
01ac74a6 | 3676 | $(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext): doc/cpp.1 installdirs |
f0738865 | 3677 | -rm -f $@ |
d3c27322 | 3678 | -$(INSTALL_DATA) $< $@ |
f0738865 | 3679 | -chmod a-x $@ |
3680 | ||
01ac74a6 | 3681 | $(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): doc/gcov.1 installdirs |
ca6eabd1 | 3682 | -rm -f $@ |
d3c27322 | 3683 | -$(INSTALL_DATA) $< $@ |
ca6eabd1 | 3684 | -chmod a-x $@ |
32e6d418 | 3685 | |
e76f6040 | 3686 | $(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext): doc/gcov-tool.1 installdirs |
3687 | -rm -f $@ | |
3688 | -$(INSTALL_DATA) $< $@ | |
3689 | -chmod a-x $@ | |
3690 | ||
afcd1af2 | 3691 | $(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext): doc/gcov-dump.1 installdirs |
3692 | -rm -f $@ | |
3693 | -$(INSTALL_DATA) $< $@ | |
3694 | -chmod a-x $@ | |
3695 | ||
2cfd79fe | 3696 | # Install all the header files built in the include subdirectory. |
c872ef71 | 3697 | install-headers: $(INSTALL_HEADERS_DIR) |
2cfd79fe | 3698 | # Fix symlinks to absolute paths in the installed include directory to |
3699 | # point to the installed directory, not the build directory. | |
ea4a6c81 | 3700 | # Don't need to use LN_S here since we really do need ln -s and no substitutes. |
d3036f42 | 3701 | -files=`cd $(DESTDIR)$(libsubdir)/include-fixed; find . -type l -print 2>/dev/null`; \ |
2cfd79fe | 3702 | if [ $$? -eq 0 ]; then \ |
d3036f42 | 3703 | dir=`cd include-fixed; ${PWD_COMMAND}`; \ |
2cfd79fe | 3704 | for i in $$files; do \ |
d3036f42 | 3705 | dest=`ls -ld $(DESTDIR)$(libsubdir)/include-fixed/$$i | sed -n 's/.*-> //p'`; \ |
2cfd79fe | 3706 | if expr "$$dest" : "$$dir.*" > /dev/null; then \ |
d3036f42 | 3707 | rm -f $(DESTDIR)$(libsubdir)/include-fixed/$$i; \ |
3708 | ln -s `echo $$i | sed "s|/[^/]*|/..|g" | sed 's|/..$$||'``echo "$$dest" | sed "s|$$dir||"` $(DESTDIR)$(libsubdir)/include-fixed/$$i; \ | |
2cfd79fe | 3709 | fi; \ |
3710 | done; \ | |
3711 | fi | |
32e6d418 | 3712 | |
2cfd79fe | 3713 | # Create or recreate the gcc private include file directory. |
0d5bce1b | 3714 | install-include-dir: installdirs |
32abc985 | 3715 | $(mkinstalldirs) $(DESTDIR)$(libsubdir)/include |
d3036f42 | 3716 | -rm -rf $(DESTDIR)$(libsubdir)/include-fixed |
d3036f42 | 3717 | mkdir $(DESTDIR)$(libsubdir)/include-fixed |
d3036f42 | 3718 | -chmod a+rx $(DESTDIR)$(libsubdir)/include-fixed |
2cfd79fe | 3719 | |
ff84d87f | 3720 | # Create or recreate the install-tools include file directory. |
3721 | itoolsdir = $(libexecsubdir)/install-tools | |
3722 | itoolsdatadir = $(libsubdir)/install-tools | |
3723 | install-itoolsdirs: installdirs | |
3724 | $(mkinstalldirs) $(DESTDIR)$(itoolsdatadir)/include | |
3725 | $(mkinstalldirs) $(DESTDIR)$(itoolsdir) | |
3726 | ||
2cfd79fe | 3727 | # Install the include directory using tar. |
f2397fc4 | 3728 | install-headers-tar: stmp-int-hdrs install-include-dir |
aa2760ef | 3729 | # We use `pwd`/include instead of just include to problems with CDPATH |
3730 | # Unless a full pathname is provided, some shells would print the new CWD, | |
3731 | # found in CDPATH, corrupting the output. We could just redirect the | |
3732 | # output of `cd', but some shells lose on redirection within `()'s | |
7a8ca04a | 3733 | (cd `${PWD_COMMAND}`/include ; \ |
36f95905 | 3734 | tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include; tar xpf - ) |
d3036f42 | 3735 | (cd `${PWD_COMMAND}`/include-fixed ; \ |
3736 | tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include-fixed; tar xpf - ) | |
16db1e2d | 3737 | # /bin/sh on some systems returns the status of the first tar, |
3738 | # and that can lose with GNU tar which always writes a full block. | |
3739 | # So use `exit 0' to ignore its exit status. | |
2cfd79fe | 3740 | |
3741 | # Install the include directory using cpio. | |
f2397fc4 | 3742 | install-headers-cpio: stmp-int-hdrs install-include-dir |
aa2760ef | 3743 | # See discussion about the use of `pwd` above |
7a8ca04a | 3744 | cd `${PWD_COMMAND}`/include ; \ |
36f95905 | 3745 | find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include |
d3036f42 | 3746 | cd `${PWD_COMMAND}`/include-fixed ; \ |
3747 | find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include-fixed | |
32e6d418 | 3748 | |
ffe38693 | 3749 | # Install the include directory using cp. |
f2397fc4 | 3750 | install-headers-cp: stmp-int-hdrs install-include-dir |
36f95905 | 3751 | cp -p -r include $(DESTDIR)$(libsubdir) |
d3036f42 | 3752 | cp -p -r include-fixed $(DESTDIR)$(libsubdir) |
ffe38693 | 3753 | |
ccdd426b | 3754 | # Targets without dependencies, for use in prev-gcc during bootstrap. |
3755 | real-install-headers-tar: | |
d3036f42 | 3756 | (cd `${PWD_COMMAND}`/include-fixed ; \ |
3757 | tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include-fixed; tar xpf - ) | |
ccdd426b | 3758 | |
3759 | real-install-headers-cpio: | |
d3036f42 | 3760 | cd `${PWD_COMMAND}`/include-fixed ; \ |
3761 | find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include-fixed | |
ccdd426b | 3762 | |
3763 | real-install-headers-cp: | |
d3036f42 | 3764 | cp -p -r include-fixed $(DESTDIR)$(libsubdir) |
ccdd426b | 3765 | |
50e7e370 | 3766 | # Install supporting files for fixincludes to be run later. |
f2397fc4 | 3767 | install-mkheaders: stmp-int-hdrs install-itoolsdirs \ |
6ea4242f | 3768 | macro_list fixinc_list |
50e7e370 | 3769 | $(INSTALL_DATA) $(srcdir)/gsyslimits.h \ |
3770 | $(DESTDIR)$(itoolsdatadir)/gsyslimits.h | |
3771 | $(INSTALL_DATA) macro_list $(DESTDIR)$(itoolsdatadir)/macro_list | |
6ea4242f | 3772 | $(INSTALL_DATA) fixinc_list $(DESTDIR)$(itoolsdatadir)/fixinc_list |
3773 | set -e; for ml in `cat fixinc_list`; do \ | |
3774 | multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \ | |
3775 | $(mkinstalldirs) $(DESTDIR)$(itoolsdatadir)/include$${multi_dir}; \ | |
3776 | $(INSTALL_DATA) include-fixed$${multidir}/limits.h $(DESTDIR)$(itoolsdatadir)/include$${multi_dir}/limits.h; \ | |
3777 | done | |
3778 | $(INSTALL_SCRIPT) $(srcdir)/../mkinstalldirs \ | |
36f95905 | 3779 | $(DESTDIR)$(itoolsdir)/mkinstalldirs ; \ |
6ea4242f | 3780 | sysroot_headers_suffix='$${sysroot_headers_suffix}'; \ |
3781 | echo 'SYSTEM_HEADER_DIR="'"$(SYSTEM_HEADER_DIR)"'"' \ | |
9db45a87 | 3782 | > $(DESTDIR)$(itoolsdatadir)/mkheaders.conf |
336ff1b3 | 3783 | echo 'OTHER_FIXINCLUDES_DIRS="$(OTHER_FIXINCLUDES_DIRS)"' \ |
9db45a87 | 3784 | >> $(DESTDIR)$(itoolsdatadir)/mkheaders.conf |
9db45a87 | 3785 | echo 'STMP_FIXINC="$(STMP_FIXINC)"' \ |
3786 | >> $(DESTDIR)$(itoolsdatadir)/mkheaders.conf | |
336ff1b3 | 3787 | |
0c787992 | 3788 | # Use this target to install the program `collect2' under the name `collect2'. |
0d5bce1b | 3789 | install-collect2: collect2 installdirs |
9db45a87 | 3790 | $(INSTALL_PROGRAM) collect2$(exeext) $(DESTDIR)$(libexecsubdir)/collect2$(exeext) |
c6396a0b | 3791 | # Install the driver program as $(libsubdir)/gcc for collect2. |
9db45a87 | 3792 | $(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(libexecsubdir)/gcc$(exeext) |
c6396a0b | 3793 | |
7bfefa9d | 3794 | # Install lto-wrapper. |
3795 | install-lto-wrapper: lto-wrapper$(exeext) | |
3796 | $(INSTALL_PROGRAM) lto-wrapper$(exeext) $(DESTDIR)$(libexecsubdir)/lto-wrapper$(exeext) | |
329786f7 | 3797 | |
3f9e8673 | 3798 | install-gcc-ar: installdirs gcc-ar$(exeext) gcc-nm$(exeext) gcc-ranlib$(exeext) |
a3d93be3 | 3799 | if test "$(enable_as_accelerator)" != "yes" ; then \ |
3800 | for i in gcc-ar gcc-nm gcc-ranlib; do \ | |
3801 | install_name=`echo $$i|sed '$(program_transform_name)'` ;\ | |
3802 | target_install_name=$(target_noncanonical)-`echo $$i|sed '$(program_transform_name)'` ; \ | |
3803 | rm -f $(DESTDIR)$(bindir)/$$install_name$(exeext) ; \ | |
3804 | $(INSTALL_PROGRAM) $$i$(exeext) $(DESTDIR)$(bindir)/$$install_name$(exeext) ;\ | |
3805 | if test -f gcc-cross$(exeext); then \ | |
3806 | :; \ | |
3807 | else \ | |
3808 | rm -f $(DESTDIR)$(bindir)/$$target_install_name$(exeext); \ | |
3809 | ( cd $(DESTDIR)$(bindir) && \ | |
3810 | $(LN) $$install_name$(exeext) $$target_install_name$(exeext) ) ; \ | |
3811 | fi ; \ | |
3812 | done; \ | |
3813 | fi | |
46215dc9 | 3814 | |
32e6d418 | 3815 | # Cancel installation by deleting the installed files. |
1e12d536 | 3816 | uninstall: lang.uninstall |
36f95905 | 3817 | -rm -rf $(DESTDIR)$(libsubdir) |
9db45a87 | 3818 | -rm -rf $(DESTDIR)$(libexecsubdir) |
36f95905 | 3819 | -rm -rf $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext) |
36f95905 | 3820 | -rm -f $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext) |
caa6c567 | 3821 | -if [ x$(cpp_install_dir) != x ]; then \ |
36f95905 | 3822 | rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \ |
caa6c567 | 3823 | else true; fi |
36f95905 | 3824 | -rm -rf $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext) |
3825 | -rm -rf $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext) | |
36f95905 | 3826 | -rm -rf $(DESTDIR)$(man1dir)/cpp$(man1ext) |
36f95905 | 3827 | -rm -f $(DESTDIR)$(infodir)/cpp.info* $(DESTDIR)$(infodir)/gcc.info* |
3828 | -rm -f $(DESTDIR)$(infodir)/cppinternals.info* $(DESTDIR)$(infodir)/gccint.info* | |
46215dc9 | 3829 | for i in ar nm ranlib ; do \ |
3830 | install_name=`echo gcc-$$i|sed '$(program_transform_name)'`$(exeext) ;\ | |
3831 | target_install_name=$(target_noncanonical)-`echo gcc-$$i|sed '$(program_transform_name)'`$(exeext) ; \ | |
3832 | rm -f $(DESTDIR)$(bindir)/$$install_name ; \ | |
3833 | rm -f $(DESTDIR)$(bindir)/$$target_install_name ; \ | |
3834 | done | |
2e9d8ccf | 3835 | #\f |
c6221df9 | 3836 | # These targets are for the dejagnu testsuites. The file site.exp |
6c08487b | 3837 | # contains global variables that all the testsuites will use. |
3838 | ||
6c08487b | 3839 | target_subdir = @target_subdir@ |
3840 | ||
3841 | site.exp: ./config.status Makefile | |
3842 | @echo "Making a new config file..." | |
a49d1bae | 3843 | -@rm -f ./site.tmp |
5ec97d31 | 3844 | @$(STAMP) site.exp |
6c08487b | 3845 | -@mv site.exp site.bak |
a49d1bae | 3846 | @echo "## these variables are automatically generated by make ##" > ./site.tmp |
3847 | @echo "# Do not edit here. If you wish to override these values" >> ./site.tmp | |
3848 | @echo "# add them to the last section" >> ./site.tmp | |
3849 | @echo "set rootme \"`${PWD_COMMAND}`\"" >> ./site.tmp | |
3850 | @echo "set srcdir \"`cd ${srcdir}; ${PWD_COMMAND}`\"" >> ./site.tmp | |
3851 | @echo "set host_triplet $(host)" >> ./site.tmp | |
3852 | @echo "set build_triplet $(build)" >> ./site.tmp | |
3853 | @echo "set target_triplet $(target)" >> ./site.tmp | |
3854 | @echo "set target_alias $(target_noncanonical)" >> ./site.tmp | |
3855 | @echo "set libiconv \"$(LIBICONV)\"" >> ./site.tmp | |
6c08487b | 3856 | # CFLAGS is set even though it's empty to show we reserve the right to set it. |
a49d1bae | 3857 | @echo "set CFLAGS \"\"" >> ./site.tmp |
3858 | @echo "set CXXFLAGS \"\"" >> ./site.tmp | |
3859 | @echo "set HOSTCC \"$(CC)\"" >> ./site.tmp | |
e67d3d38 | 3860 | @echo "set HOSTCXX \"$(CXX)\"" >> ./site.tmp |
a49d1bae | 3861 | @echo "set HOSTCFLAGS \"$(CFLAGS)\"" >> ./site.tmp |
e67d3d38 | 3862 | @echo "set HOSTCXXFLAGS \"$(CXXFLAGS)\"" >> ./site.tmp |
224d9f3d | 3863 | # TEST_ALWAYS_FLAGS are flags that should be passed to every compilation. |
3864 | # They are passed first to allow individual tests to override them. | |
3865 | @echo "set TEST_ALWAYS_FLAGS \"$(SYSROOT_CFLAGS_FOR_TARGET)\"" >> ./site.tmp | |
c158ae09 | 3866 | # When running the tests we set GCC_EXEC_PREFIX to the install tree so that |
3867 | # files that have already been installed there will be found. The -B option | |
3868 | # overrides it, so use of GCC_EXEC_PREFIX will not result in using GCC files | |
3869 | # from the install tree. | |
a49d1bae | 3870 | @echo "set TEST_GCC_EXEC_PREFIX \"$(libdir)/gcc/\"" >> ./site.tmp |
3871 | @echo "set TESTING_IN_BUILD_TREE 1" >> ./site.tmp | |
3872 | @echo "set HAVE_LIBSTDCXX_V3 1" >> ./site.tmp | |
9227b6fc | 3873 | @if test "@enable_plugin@" = "yes" ; then \ |
a49d1bae | 3874 | echo "set ENABLE_PLUGIN 1" >> ./site.tmp; \ |
3875 | echo "set PLUGINCC \"$(PLUGINCC)\"" >> ./site.tmp; \ | |
3876 | echo "set PLUGINCFLAGS \"$(PLUGINCFLAGS)\"" >> ./site.tmp; \ | |
3877 | echo "set GMPINC \"$(GMPINC)\"" >> ./site.tmp; \ | |
9227b6fc | 3878 | fi |
6c08487b | 3879 | # If newlib has been configured, we need to pass -B to gcc so it can find |
3880 | # newlib's crt0.o if it exists. This will cause a "path prefix not used" | |
3881 | # message if it doesn't, but the testsuite is supposed to ignore the message - | |
3882 | # it's too difficult to tell when to and when not to pass -B (not all targets | |
3883 | # have crt0's). We could only add the -B if ../newlib/crt0.o exists, but that | |
3884 | # seems like too selective a test. | |
3885 | # ??? Another way to solve this might be to rely on linker scripts. Then | |
3886 | # theoretically the -B won't be needed. | |
3887 | # We also need to pass -L ../ld so that the linker can find ldscripts. | |
109d4e8d | 3888 | @if [ -d $(objdir)/../$(target_subdir)/newlib ] \ |
4f442f07 | 3889 | && [ "${host}" != "${target}" ]; then \ |
a49d1bae | 3890 | echo "set newlib_cflags \"-I$(objdir)/../$(target_subdir)/newlib/targ-include -I\$$srcdir/../newlib/libc/include\"" >> ./site.tmp; \ |
3891 | echo "set newlib_ldflags \"-B$(objdir)/../$(target_subdir)/newlib/\"" >> ./site.tmp; \ | |
3892 | echo "append CFLAGS \" \$$newlib_cflags\"" >> ./site.tmp; \ | |
3893 | echo "append CXXFLAGS \" \$$newlib_cflags\"" >> ./site.tmp; \ | |
3894 | echo "append LDFLAGS \" \$$newlib_ldflags\"" >> ./site.tmp; \ | |
6c08487b | 3895 | else true; \ |
3896 | fi | |
3897 | @if [ -d $(objdir)/../ld ] ; then \ | |
a49d1bae | 3898 | echo "append LDFLAGS \" -L$(objdir)/../ld\"" >> ./site.tmp; \ |
6c08487b | 3899 | else true; \ |
3900 | fi | |
a49d1bae | 3901 | echo "set tmpdir $(objdir)/testsuite" >> ./site.tmp |
3902 | @echo "set srcdir \"\$${srcdir}/testsuite\"" >> ./site.tmp | |
2a04f36a | 3903 | @if [ "X$(ALT_CC_UNDER_TEST)" != "X" ] ; then \ |
a49d1bae | 3904 | echo "set ALT_CC_UNDER_TEST \"$(ALT_CC_UNDER_TEST)\"" >> ./site.tmp; \ |
2a04f36a | 3905 | else true; \ |
3906 | fi | |
9745a094 | 3907 | @if [ "X$(ALT_CXX_UNDER_TEST)" != "X" ] ; then \ |
a49d1bae | 3908 | echo "set ALT_CXX_UNDER_TEST \"$(ALT_CXX_UNDER_TEST)\"" >> ./site.tmp; \ |
9745a094 | 3909 | else true; \ |
3910 | fi | |
3911 | @if [ "X$(COMPAT_OPTIONS)" != "X" ] ; then \ | |
a49d1bae | 3912 | echo "set COMPAT_OPTIONS \"$(COMPAT_OPTIONS)\"" >> ./site.tmp; \ |
9745a094 | 3913 | else true; \ |
3914 | fi | |
a49d1bae | 3915 | @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./site.tmp |
3916 | @cat ./site.tmp > site.exp | |
6c08487b | 3917 | @cat site.bak | sed \ |
3918 | -e '1,/^## All variables above are.*##/ d' >> site.exp | |
a49d1bae | 3919 | -@rm -f ./site.tmp |
6c08487b | 3920 | |
e53d55e7 | 3921 | CHECK_TARGETS = @check_languages@ |
21fa82cb | 3922 | |
6c08487b | 3923 | check: $(CHECK_TARGETS) |
3924 | ||
a0d20ccb | 3925 | check-subtargets: $(patsubst %,%-subtargets,$(CHECK_TARGETS)) |
3926 | ||
567bfdbb | 3927 | # The idea is to parallelize testing of multilibs, for example: |
9469a2e2 | 3928 | # make -j3 check-gcc//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu} |
567bfdbb | 3929 | # will run 3 concurrent sessions of check-gcc, eventually testing |
3930 | # all 10 combinations. GNU make is required, as is a shell that expands | |
3931 | # alternations within braces. | |
71a3866b | 3932 | lang_checks_parallel = $(lang_checks:=//%) |
3933 | $(lang_checks_parallel): site.exp | |
9469a2e2 | 3934 | target=`echo "$@" | sed 's,//.*,,'`; \ |
3935 | variant=`echo "$@" | sed 's,^[^/]*//,,'`; \ | |
567bfdbb | 3936 | vardots=`echo "$$variant" | sed 's,/,.,g'`; \ |
3937 | $(MAKE) TESTSUITEDIR="testsuite.$$vardots" \ | |
cb0b036f | 3938 | RUNTESTFLAGS="--target_board=$$variant $(RUNTESTFLAGS)" \ |
567bfdbb | 3939 | "$$target" |
3940 | ||
3941 | TESTSUITEDIR = testsuite | |
3942 | ||
3943 | $(TESTSUITEDIR)/site.exp: site.exp | |
632ec442 | 3944 | -test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR) |
567bfdbb | 3945 | -rm -f $@ |
1b374b02 | 3946 | sed '/set tmpdir/ s|testsuite$$|$(TESTSUITEDIR)|' < site.exp > $@ |
567bfdbb | 3947 | |
a0d20ccb | 3948 | # This is only used for check-% targets that aren't parallelized. |
3949 | $(filter-out $(lang_checks_parallelized),$(lang_checks)): check-% : site.exp | |
19bc000d | 3950 | -test -d plugin || mkdir plugin |
632ec442 | 3951 | -test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR) |
6c24ebbe | 3952 | test -d $(TESTSUITEDIR)/$* || mkdir $(TESTSUITEDIR)/$* |
7a8ca04a | 3953 | -(rootme=`${PWD_COMMAND}`; export rootme; \ |
3954 | srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \ | |
6c24ebbe | 3955 | cd $(TESTSUITEDIR)/$*; \ |
3956 | rm -f tmp-site.exp; \ | |
1b374b02 | 3957 | sed '/set tmpdir/ s|testsuite$$|$(TESTSUITEDIR)/$*|' \ |
6c24ebbe | 3958 | < ../../site.exp > tmp-site.exp; \ |
cadadacb | 3959 | $(SHELL) $${srcdir}/../move-if-change tmp-site.exp site.exp; \ |
5c872430 | 3960 | EXPECT=${EXPECT} ; export EXPECT ; \ |
3961 | if [ -f $${rootme}/../expect/expect ] ; then \ | |
cadadacb | 3962 | TCL_LIBRARY=`cd .. ; cd $${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \ |
5c872430 | 3963 | export TCL_LIBRARY ; fi ; \ |
c061bf74 | 3964 | $(RUNTEST) --tool $* $(RUNTESTFLAGS)) |
5c872430 | 3965 | |
eb9bd3cc | 3966 | $(patsubst %,%-subtargets,$(lang_checks)): check-%-subtargets: |
a0d20ccb | 3967 | @echo check-$* |
3968 | ||
3969 | check_p_tool=$(firstword $(subst _, ,$*)) | |
eb9bd3cc | 3970 | check_p_count=$(check_$(check_p_tool)_parallelize) |
a0d20ccb | 3971 | check_p_subno=$(word 2,$(subst _, ,$*)) |
eb9bd3cc | 3972 | check_p_numbers0:=1 2 3 4 5 6 7 8 9 |
3973 | check_p_numbers1:=0 $(check_p_numbers0) | |
3974 | check_p_numbers2:=$(foreach i,$(check_p_numbers0),$(addprefix $(i),$(check_p_numbers1))) | |
3975 | check_p_numbers3:=$(addprefix 0,$(check_p_numbers1)) $(check_p_numbers2) | |
3976 | check_p_numbers4:=$(foreach i,$(check_p_numbers0),$(addprefix $(i),$(check_p_numbers3))) | |
3977 | check_p_numbers5:=$(addprefix 0,$(check_p_numbers3)) $(check_p_numbers4) | |
3978 | check_p_numbers6:=$(foreach i,$(check_p_numbers0),$(addprefix $(i),$(check_p_numbers5))) | |
3979 | check_p_numbers:=$(check_p_numbers0) $(check_p_numbers2) $(check_p_numbers4) $(check_p_numbers6) | |
a0d20ccb | 3980 | check_p_subdir=$(subst _,,$*) |
eb9bd3cc | 3981 | check_p_subdirs=$(wordlist 1,$(check_p_count),$(wordlist 1, \ |
3982 | $(if $(GCC_TEST_PARALLEL_SLOTS),$(GCC_TEST_PARALLEL_SLOTS),128), \ | |
3983 | $(check_p_numbers))) | |
a0d20ccb | 3984 | |
3985 | # For parallelized check-% targets, this decides whether parallelization | |
b708755f | 3986 | # is desirable (if -jN is used). If desirable, recursive make is run with |
3987 | # check-parallel-$lang{,1,2,3,4,5} etc. goals, which can be executed in | |
3988 | # parallel, as they are run in separate directories. | |
eb9bd3cc | 3989 | # check-parallel-$lang{,1,2,3,4,5} etc. goals invoke runtest with |
3990 | # GCC_RUNTEST_PARALLELIZE_DIR var in the environment and runtest_file_p | |
3991 | # dejaGNU procedure is overridden to additionally synchronize through | |
3992 | # a $lang-parallel directory which tests will be run by which runtest instance. | |
a0d20ccb | 3993 | # Afterwards contrib/dg-extract-results.sh is used to merge the sum and log |
3994 | # files. If parallelization isn't desirable, only one recursive make | |
3995 | # is run with check-parallel-$lang goal and check_$lang_parallelize variable | |
3996 | # cleared to say that no additional arguments beyond $(RUNTESTFLAGS) | |
3997 | # should be passed to runtest. | |
3998 | # | |
3999 | # To parallelize some language check, add the corresponding check-$lang | |
4000 | # to lang_checks_parallelized variable and define check_$lang_parallelize | |
eeec71b4 | 4001 | # variable. This is the upper limit to which it is useful to parallelize the |
4002 | # check-$lang target. It doesn't make sense to try e.g. 128 goals for small | |
4003 | # testsuites like objc or go. | |
a0d20ccb | 4004 | $(lang_checks_parallelized): check-% : site.exp |
eb9bd3cc | 4005 | -rm -rf $(TESTSUITEDIR)/$*-parallel |
b0af2874 | 4006 | @if [ -n "$(filter -j%, $(MFLAGS))" ]; then \ |
eb9bd3cc | 4007 | test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR) || true; \ |
4008 | test -d $(TESTSUITEDIR)/$*-parallel || mkdir $(TESTSUITEDIR)/$*-parallel || true; \ | |
4009 | GCC_RUNTEST_PARALLELIZE_DIR=`${PWD_COMMAND}`/$(TESTSUITEDIR)/$(check_p_tool)-parallel ; \ | |
4010 | export GCC_RUNTEST_PARALLELIZE_DIR ; \ | |
cb0b036f | 4011 | $(MAKE) TESTSUITEDIR="$(TESTSUITEDIR)" RUNTESTFLAGS="$(RUNTESTFLAGS)" \ |
a0d20ccb | 4012 | check-parallel-$* \ |
4013 | $(patsubst %,check-parallel-$*_%, $(check_p_subdirs)); \ | |
eb9bd3cc | 4014 | sums= ; logs= ; \ |
4015 | for dir in $(TESTSUITEDIR)/$* \ | |
4016 | $(patsubst %,$(TESTSUITEDIR)/$*%,$(check_p_subdirs));\ | |
a0d20ccb | 4017 | do \ |
eb9bd3cc | 4018 | if [ -d $$dir ]; then \ |
4019 | mv -f $$dir/$*.sum $$dir/$*.sum.sep; mv -f $$dir/$*.log $$dir/$*.log.sep; \ | |
4020 | sums="$$sums $$dir/$*.sum.sep"; logs="$$logs $$dir/$*.log.sep"; \ | |
4021 | fi; \ | |
a0d20ccb | 4022 | done; \ |
eb9bd3cc | 4023 | $(SHELL) $(srcdir)/../contrib/dg-extract-results.sh $$sums \ |
a0d20ccb | 4024 | > $(TESTSUITEDIR)/$*/$*.sum; \ |
eb9bd3cc | 4025 | $(SHELL) $(srcdir)/../contrib/dg-extract-results.sh -L $$logs \ |
a0d20ccb | 4026 | > $(TESTSUITEDIR)/$*/$*.log; \ |
eb9bd3cc | 4027 | rm -rf $(TESTSUITEDIR)/$*-parallel || true; \ |
a0d20ccb | 4028 | else \ |
cb0b036f | 4029 | $(MAKE) TESTSUITEDIR="$(TESTSUITEDIR)" RUNTESTFLAGS="$(RUNTESTFLAGS)" \ |
a0d20ccb | 4030 | check_$*_parallelize= check-parallel-$*; \ |
4031 | fi | |
4032 | ||
a0d20ccb | 4033 | check-parallel-% : site.exp |
f94ce7d0 | 4034 | -@test -d plugin || mkdir plugin |
4035 | -@test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR) | |
4036 | @test -d $(TESTSUITEDIR)/$(check_p_subdir) || mkdir $(TESTSUITEDIR)/$(check_p_subdir) | |
4037 | -$(if $(check_p_subno),@)(rootme=`${PWD_COMMAND}`; export rootme; \ | |
a0d20ccb | 4038 | srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \ |
eb9bd3cc | 4039 | if [ -n "$(check_p_subno)" ] \ |
4040 | && [ -n "$$GCC_RUNTEST_PARALLELIZE_DIR" ] \ | |
4041 | && [ -f $(TESTSUITEDIR)/$(check_p_tool)-parallel/finished ]; then \ | |
4042 | rm -rf $(TESTSUITEDIR)/$(check_p_subdir); \ | |
4043 | else \ | |
4044 | cd $(TESTSUITEDIR)/$(check_p_subdir); \ | |
4045 | rm -f tmp-site.exp; \ | |
4046 | sed '/set tmpdir/ s|testsuite$$|$(TESTSUITEDIR)/$(check_p_subdir)|' \ | |
a0d20ccb | 4047 | < ../../site.exp > tmp-site.exp; \ |
eb9bd3cc | 4048 | $(SHELL) $${srcdir}/../move-if-change tmp-site.exp site.exp; \ |
4049 | EXPECT=${EXPECT} ; export EXPECT ; \ | |
4050 | if [ -f $${rootme}/../expect/expect ] ; then \ | |
4051 | TCL_LIBRARY=`cd .. ; cd $${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \ | |
4052 | export TCL_LIBRARY ; \ | |
4053 | fi ; \ | |
4054 | $(RUNTEST) --tool $(check_p_tool) $(RUNTESTFLAGS); \ | |
4055 | if [ -n "$$GCC_RUNTEST_PARALLELIZE_DIR" ] ; then \ | |
4056 | touch $${rootme}/$(TESTSUITEDIR)/$(check_p_tool)-parallel/finished; \ | |
4057 | fi ; \ | |
4058 | fi ) | |
a0d20ccb | 4059 | |
7f52823c | 4060 | # QMTest targets |
4061 | ||
4062 | # The path to qmtest. | |
4063 | QMTEST_PATH=qmtest | |
4064 | ||
4065 | # The flags to pass to qmtest. | |
4066 | QMTESTFLAGS= | |
4067 | ||
4068 | # The flags to pass to "qmtest run". | |
cb770a56 | 4069 | QMTESTRUNFLAGS=-f none --result-stream dejagnu_stream.DejaGNUStream |
7f52823c | 4070 | |
4071 | # The command to use to invoke qmtest. | |
4072 | QMTEST=${QMTEST_PATH} ${QMTESTFLAGS} | |
4073 | ||
4074 | # The tests (or suites) to run. | |
cb770a56 | 4075 | QMTEST_GPP_TESTS=g++ |
7f52823c | 4076 | |
4077 | # The subdirectory of the OBJDIR that will be used to store the QMTest | |
4078 | # test database configuration and that will be used for temporary | |
4079 | # scratch space during QMTest's execution. | |
2940220d | 4080 | QMTEST_DIR=qmtestsuite |
7f52823c | 4081 | |
4082 | # Create the QMTest database configuration. | |
4083 | ${QMTEST_DIR} stamp-qmtest: | |
cb770a56 | 4084 | ${QMTEST} -D ${QMTEST_DIR} create-tdb \ |
4085 | -c gcc_database.GCCDatabase \ | |
a0d20ccb | 4086 | -a srcdir=`cd ${srcdir}/testsuite && ${PWD_COMMAND}` && \ |
cb770a56 | 4087 | $(STAMP) stamp-qmtest |
7f52823c | 4088 | |
4089 | # Create the QMTest context file. | |
4090 | ${QMTEST_DIR}/context: stamp-qmtest | |
cb770a56 | 4091 | rm -f $@ |
4092 | echo "CompilerTable.languages=c cplusplus" >> $@ | |
4093 | echo "CompilerTable.c_kind=GCC" >> $@ | |
4094 | echo "CompilerTable.c_path=${objdir}/xgcc" >> $@ | |
4095 | echo "CompilerTable.c_options=-B${objdir}/" >> $@ | |
4096 | echo "CompilerTable.cplusplus_kind=GCC" >> $@ | |
3e54888f | 4097 | echo "CompilerTable.cplusplus_path=${objdir}/xg++" >> $@ |
cb770a56 | 4098 | echo "CompilerTable.cplusplus_options=-B${objdir}/" >> $@ |
d58156a1 | 4099 | echo "DejaGNUTest.target=${target_noncanonical}" >> $@ |
7f52823c | 4100 | |
4101 | # Run the G++ testsuite using QMTest. | |
cb770a56 | 4102 | qmtest-g++: ${QMTEST_DIR}/context |
7f52823c | 4103 | cd ${QMTEST_DIR} && ${QMTEST} run ${QMTESTRUNFLAGS} -C context \ |
cb770a56 | 4104 | -o g++.qmr ${QMTEST_GPP_TESTS} |
7f52823c | 4105 | |
4106 | # Use the QMTest GUI. | |
4107 | qmtest-gui: ${QMTEST_DIR}/context | |
4108 | cd ${QMTEST_DIR} && ${QMTEST} gui -C context | |
4109 | ||
7f52823c | 4110 | .PHONY: qmtest-g++ |
4111 | ||
aa870c1b | 4112 | # Run Paranoia on real.c. |
4113 | ||
a7a46268 | 4114 | paranoia.o: $(srcdir)/../contrib/paranoia.cc $(CONFIG_H) $(SYSTEM_H) $(TREE_H) |
dd350d42 | 4115 | g++ -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $< $(OUTPUT_OPTION) |
aa870c1b | 4116 | |
4117 | paranoia: paranoia.o real.o $(LIBIBERTY) | |
4118 | g++ -o $@ paranoia.o real.o $(LIBIBERTY) | |
4119 | ||
32e6d418 | 4120 | # These exist for maintenance purposes. |
4121 | ||
4122 | # Update the tags table. | |
c835a482 | 4123 | TAGS: lang.tags |
39aebbc3 | 4124 | (cd $(srcdir); \ |
4125 | incs= ; \ | |
4126 | list='$(SUBDIRS)'; for dir in $$list; do \ | |
4127 | if test -f $$dir/TAGS; then \ | |
4128 | incs="$$incs --include $$dir/TAGS.sub"; \ | |
4129 | fi; \ | |
4130 | done; \ | |
023cabf8 | 4131 | etags -o TAGS.sub c-family/*.h c-family/*.c *.h *.c *.cc \ |
e4ea9bef | 4132 | ../include/*.h ../libiberty/*.c \ |
4133 | ../libcpp/*.c ../libcpp/include/*.h \ | |
023cabf8 | 4134 | --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 \ |
4135 | --language=none --regex="/\(DEF_RTL_EXPR\|DEFTREECODE\|DEFGSCODE\).*(\([A-Za-z_0-9]+\)/\2/" rtl.def tree.def gimple.def \ | |
54ea2042 | 4136 | --language=none --regex="/DEFTIMEVAR (\([A-Za-z_0-9]+\)/\1/" timevar.def \ |
023cabf8 | 4137 | ; \ |
39aebbc3 | 4138 | etags --include TAGS.sub $$incs) |
32e6d418 | 4139 | |
f55a1a89 | 4140 | # ----------------------------------------------------- |
67881e18 | 4141 | # Rules for generating translated message descriptions. |
4142 | # Disabled by autoconf if the tools are not available. | |
f55a1a89 | 4143 | # ----------------------------------------------------- |
67881e18 | 4144 | |
4145 | XGETTEXT = @XGETTEXT@ | |
4146 | GMSGFMT = @GMSGFMT@ | |
4147 | MSGMERGE = msgmerge | |
49688a56 | 4148 | CATALOGS = $(patsubst %,po/%,@CATALOGS@) |
67881e18 | 4149 | |
c1fd6dd4 | 4150 | .PHONY: build- install- build-po install-po update-po |
67881e18 | 4151 | |
4152 | # Dummy rules to deal with dependencies produced by use of | |
4153 | # "build-@POSUB@" and "install-@POSUB@" above, when NLS is disabled. | |
4154 | build-: ; @true | |
4155 | install-: ; @true | |
4156 | ||
4157 | build-po: $(CATALOGS) | |
4158 | ||
4159 | # This notation should be acceptable to all Make implementations used | |
4160 | # by people who are interested in updating .po files. | |
4161 | update-po: $(CATALOGS:.gmo=.pox) | |
4162 | ||
48c772de | 4163 | # N.B. We do not attempt to copy these into $(srcdir). The snapshot |
4164 | # script does that. | |
67881e18 | 4165 | .po.gmo: |
e7ae053d | 4166 | $(mkinstalldirs) po |
7e5b3e48 | 4167 | $(GMSGFMT) --statistics -o $@ $< |
67881e18 | 4168 | |
48c772de | 4169 | # The new .po has to be gone over by hand, so we deposit it into |
4170 | # build/po with a different extension. | |
1af67e62 | 4171 | # If build/po/gcc.pot exists, use it (it was just created), |
428a0ce6 | 4172 | # else use the one in srcdir. |
67881e18 | 4173 | .po.pox: |
e7ae053d | 4174 | $(mkinstalldirs) po |
1af67e62 | 4175 | $(MSGMERGE) $< `if test -f po/gcc.pot; \ |
4176 | then echo po/gcc.pot; \ | |
4177 | else echo $(srcdir)/po/gcc.pot; fi` -o $@ | |
67881e18 | 4178 | |
48c772de | 4179 | # This rule has to look for .gmo modules in both srcdir and |
4180 | # the cwd, and has to check that we actually have a catalog | |
4181 | # for each language, in case they weren't built or included | |
4182 | # with the distribution. | |
67881e18 | 4183 | install-po: |
ca08f0d3 | 4184 | $(mkinstalldirs) $(DESTDIR)$(datadir) |
e34242a4 | 4185 | cats="$(CATALOGS)"; for cat in $$cats; do \ |
48c772de | 4186 | lang=`basename $$cat | sed 's/\.gmo$$//'`; \ |
4187 | if [ -f $$cat ]; then :; \ | |
4188 | elif [ -f $(srcdir)/$$cat ]; then cat=$(srcdir)/$$cat; \ | |
4189 | else continue; \ | |
4190 | fi; \ | |
67881e18 | 4191 | dir=$(localedir)/$$lang/LC_MESSAGES; \ |
ca08f0d3 | 4192 | echo $(mkinstalldirs) $(DESTDIR)$$dir; \ |
4193 | $(mkinstalldirs) $(DESTDIR)$$dir || exit 1; \ | |
1af67e62 | 4194 | echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc.mo; \ |
4195 | $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc.mo; \ | |
67881e18 | 4196 | done |
4197 | ||
4198 | # Rule for regenerating the message template (gcc.pot). | |
4199 | # Instead of forcing everyone to edit POTFILES.in, which proved impractical, | |
4200 | # this rule has no dependencies and always regenerates gcc.pot. This is | |
4201 | # relatively harmless since the .po files do not directly depend on it. | |
4202 | # Note that exgettext has an awk script embedded in it which requires a | |
4203 | # fairly modern (POSIX-compliant) awk. | |
428a0ce6 | 4204 | # The .pot file is left in the build directory. |
1af67e62 | 4205 | gcc.pot: po/gcc.pot |
b1fcce27 | 4206 | po/gcc.pot: force |
e7ae053d | 4207 | $(mkinstalldirs) po |
6bc11008 | 4208 | $(MAKE) srcextra |
67881e18 | 4209 | AWK=$(AWK) $(SHELL) $(srcdir)/po/exgettext \ |
1af67e62 | 4210 | $(XGETTEXT) gcc $(srcdir) |
ea38f4be | 4211 | |
b8bd120b | 4212 | #\f |
4213 | ||
4214 | # Dependency information. | |
4215 | ||
ea38f4be | 4216 | # In order for parallel make to really start compiling the expensive |
4217 | # objects from $(OBJS) as early as possible, build all their | |
4218 | # prerequisites strictly before all objects. | |
4219 | $(ALL_HOST_OBJS) : | $(generated_files) | |
b8bd120b | 4220 | |
4221 | # Include the auto-generated dependencies for all host objects. | |
4222 | DEPFILES = \ | |
4223 | $(foreach obj,$(ALL_HOST_OBJS),\ | |
4224 | $(dir $(obj))$(DEPDIR)/$(patsubst %.o,%.Po,$(notdir $(obj)))) | |
4225 | -include $(DEPFILES) |