]>
Commit | Line | Data |
---|---|---|
d3ac17c9 | 1 | [+ AutoGen5 template -*- Mode: Makefile -*- |
95ddd785 NN |
2 | in |
3 | +] | |
4 | ||
5 | # Makefile.in is generated from Makefile.tpl by 'autogen Makefile.def'. | |
6 | # | |
7 | # Makefile for directory with subdirs to build. | |
8 | # Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, | |
f9989b51 | 9 | # 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 |
309c24a9 | 10 | # Free Software Foundation |
95ddd785 NN |
11 | # |
12 | # This file is free software; you can redistribute it and/or modify | |
13 | # it under the terms of the GNU General Public License as published by | |
309c24a9 | 14 | # the Free Software Foundation; either version 3 of the License, or |
95ddd785 NN |
15 | # (at your option) any later version. |
16 | # | |
17 | # This program is distributed in the hope that it will be useful, | |
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 | # GNU General Public License for more details. | |
21 | # | |
22 | # You should have received a copy of the GNU General Public License | |
309c24a9 JJ |
23 | # along with this program; see the file COPYING3. If not see |
24 | # <http://www.gnu.org/licenses/>. | |
95ddd785 NN |
25 | # |
26 | ||
295e261a HPN |
27 | # First, test for a proper version of make, but only where one is required. |
28 | ||
29 | @if gcc | |
30 | ifeq (,$(.VARIABLES)) # The variable .VARIABLES, new with 3.80, is never empty. | |
31 | $(error GNU make version 3.80 or newer is required.) | |
32 | endif | |
33 | @endif gcc | |
34 | ||
df0f0674 NN |
35 | # ------------------------------- |
36 | # Standard Autoconf-set variables | |
37 | # ------------------------------- | |
4977bab6 | 38 | VPATH=@srcdir@ |
4977bab6 | 39 | |
1c710c3c | 40 | build_alias=@build_noncanonical@ |
e69bf64b PB |
41 | build_vendor=@build_vendor@ |
42 | build_os=@build_os@ | |
e89fbdfe | 43 | build=@build@ |
1c710c3c | 44 | host_alias=@host_noncanonical@ |
e69bf64b PB |
45 | host_vendor=@host_vendor@ |
46 | host_os=@host_os@ | |
e89fbdfe | 47 | host=@host@ |
1c710c3c | 48 | target_alias=@target_noncanonical@ |
e69bf64b PB |
49 | target_vendor=@target_vendor@ |
50 | target_os=@target_os@ | |
e89fbdfe | 51 | target=@target@ |
4977bab6 | 52 | |
df0f0674 | 53 | program_transform_name = @program_transform_name@ |
0dffceed NN |
54 | |
55 | prefix = @prefix@ | |
56 | exec_prefix = @exec_prefix@ | |
57 | ||
df0f0674 NN |
58 | srcdir = @srcdir@ |
59 | ||
0dffceed NN |
60 | bindir = @bindir@ |
61 | sbindir = @sbindir@ | |
62 | libexecdir = @libexecdir@ | |
63 | datadir = @datadir@ | |
64 | sysconfdir = @sysconfdir@ | |
65 | sharedstatedir = @sharedstatedir@ | |
66 | localstatedir = @localstatedir@ | |
67 | libdir = @libdir@ | |
68 | includedir = @includedir@ | |
69 | oldincludedir = @oldincludedir@ | |
70 | infodir = @infodir@ | |
65d6e994 CD |
71 | datarootdir = @datarootdir@ |
72 | docdir = @docdir@ | |
9c4d2493 | 73 | pdfdir = @pdfdir@ |
65d6e994 | 74 | htmldir = @htmldir@ |
0dffceed | 75 | mandir = @mandir@ |
95ddd785 NN |
76 | man1dir = $(mandir)/man1 |
77 | man2dir = $(mandir)/man2 | |
78 | man3dir = $(mandir)/man3 | |
79 | man4dir = $(mandir)/man4 | |
80 | man5dir = $(mandir)/man5 | |
81 | man6dir = $(mandir)/man6 | |
82 | man7dir = $(mandir)/man7 | |
83 | man8dir = $(mandir)/man8 | |
84 | man9dir = $(mandir)/man9 | |
95ddd785 | 85 | |
775956d0 NN |
86 | INSTALL = @INSTALL@ |
87 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
88 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | |
89 | INSTALL_DATA = @INSTALL_DATA@ | |
ad6717df PB |
90 | LN = @LN@ |
91 | LN_S = @LN_S@ | |
58e24147 AM |
92 | MAINT = @MAINT@ |
93 | MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ | |
94 | MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ | |
95ddd785 | 95 | |
df0f0674 NN |
96 | # ------------------------------------------------- |
97 | # Miscellaneous non-standard autoconf-set variables | |
98 | # ------------------------------------------------- | |
95ddd785 | 99 | |
df0f0674 NN |
100 | # The gcc driver likes to know the arguments it was configured with. |
101 | TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@ | |
95ddd785 | 102 | |
df0f0674 NN |
103 | tooldir = @tooldir@ |
104 | build_tooldir = @build_tooldir@ | |
95ddd785 | 105 | |
df0f0674 NN |
106 | # This is the name of the environment variable used for the path to |
107 | # the libraries. | |
108 | RPATH_ENVVAR = @RPATH_ENVVAR@ | |
95ddd785 | 109 | |
d89f0ad6 AL |
110 | # On targets where RPATH_ENVVAR is PATH, a subdirectory of the GCC build path |
111 | # is used instead of the directory itself to avoid including built | |
112 | # executables in PATH. | |
113 | GCC_SHLIB_SUBDIR = @GCC_SHLIB_SUBDIR@ | |
114 | ||
df0f0674 NN |
115 | # Build programs are put under this directory. |
116 | BUILD_SUBDIR = @build_subdir@ | |
117 | # This is set by the configure script to the arguments to use when configuring | |
118 | # directories built for the build system. | |
25b42232 | 119 | BUILD_CONFIGARGS = @build_configargs@ --with-build-subdir="$(BUILD_SUBDIR)" |
23f6b2f9 | 120 | |
00020c16 ILT |
121 | # Linker flags to use on the host, for stage1 or when not |
122 | # bootstrapping. | |
123 | STAGE1_LDFLAGS = @stage1_ldflags@ | |
124 | ||
125 | # Libraries to use on the host, for stage1 or when not bootstrapping. | |
126 | STAGE1_LIBS = @stage1_libs@ | |
127 | ||
128 | # Linker flags to use for stage2 and later. | |
129 | POSTSTAGE1_LDFLAGS = @poststage1_ldflags@ | |
130 | ||
131 | # Libraries to use for stage2 and later. | |
132 | POSTSTAGE1_LIBS = @poststage1_libs@ | |
133 | ||
23f6b2f9 PB |
134 | # This is the list of variables to export in the environment when |
135 | # configuring any subdirectory. It must also be exported whenever | |
136 | # recursing into a build directory in case that directory's Makefile | |
137 | # re-runs configure. | |
138 | BASE_EXPORTS = \ | |
139 | FLEX="$(FLEX)"; export FLEX; \ | |
140 | LEX="$(LEX)"; export LEX; \ | |
141 | BISON="$(BISON)"; export BISON; \ | |
142 | YACC="$(YACC)"; export YACC; \ | |
143 | M4="$(M4)"; export M4; \ | |
87264276 | 144 | SED="$(SED)"; export SED; \ |
f945e229 | 145 | AWK="$(AWK)"; export AWK; \ |
23f6b2f9 PB |
146 | MAKEINFO="$(MAKEINFO)"; export MAKEINFO; |
147 | ||
4fc4dd12 | 148 | # This is the list of variables to export in the environment when |
23f6b2f9 | 149 | # configuring subdirectories for the build system. |
4fc4dd12 | 150 | BUILD_EXPORTS = \ |
23f6b2f9 | 151 | $(BASE_EXPORTS) \ |
4fc4dd12 DJ |
152 | AR="$(AR_FOR_BUILD)"; export AR; \ |
153 | AS="$(AS_FOR_BUILD)"; export AS; \ | |
154 | CC="$(CC_FOR_BUILD)"; export CC; \ | |
155 | CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ | |
156 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | |
157 | CXX="$(CXX_FOR_BUILD)"; export CXX; \ | |
158 | CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ | |
4fc4dd12 | 159 | GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \ |
632e2a07 ILT |
160 | GOC="$(GOC_FOR_BUILD)"; export GOC; \ |
161 | GOCFLAGS="$(GOCFLAGS_FOR_BUILD)"; export GOCFLAGS; \ | |
b4c522fa IB |
162 | GDC="$(GDC_FOR_BUILD)"; export GDC; \ |
163 | GDCFLAGS="$(GDCFLAGS_FOR_BUILD)"; export GDCFLAGS; \ | |
4fc4dd12 DJ |
164 | DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \ |
165 | LD="$(LD_FOR_BUILD)"; export LD; \ | |
166 | LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \ | |
167 | NM="$(NM_FOR_BUILD)"; export NM; \ | |
168 | RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \ | |
0136f2f7 | 169 | WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \ |
901119ae | 170 | WINDMC="$(WINDMC_FOR_BUILD)"; export WINDMC; |
df0f0674 | 171 | |
f8c33439 | 172 | # These variables must be set on the make command line for directories |
32e6ed92 | 173 | # built for the build system to override those in BASE_FLAGS_TO_PASS. |
f8c33439 JM |
174 | EXTRA_BUILD_FLAGS = \ |
175 | CFLAGS="$(CFLAGS_FOR_BUILD)" \ | |
176 | LDFLAGS="$(LDFLAGS_FOR_BUILD)" | |
177 | ||
df0f0674 NN |
178 | # This is the list of directories to built for the host system. |
179 | SUBDIRS = @configdirs@ | |
aae29963 | 180 | TARGET_CONFIGDIRS = @target_configdirs@ |
df0f0674 NN |
181 | # This is set by the configure script to the arguments to use when configuring |
182 | # directories built for the host system. | |
183 | HOST_CONFIGARGS = @host_configargs@ | |
215c351a PB |
184 | # Host programs are put under this directory, which is . except if building |
185 | # with srcdir=.. | |
186 | HOST_SUBDIR = @host_subdir@ | |
4fc4dd12 | 187 | # This is the list of variables to export in the environment when |
2abefe3d PB |
188 | # configuring subdirectories for the host system. We need to pass |
189 | # some to the GCC configure because of its hybrid host/target nature. | |
4fc4dd12 | 190 | HOST_EXPORTS = \ |
23f6b2f9 | 191 | $(BASE_EXPORTS) \ |
4fc4dd12 | 192 | CC="$(CC)"; export CC; \ |
00afcaa0 | 193 | ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \ |
4fc4dd12 DJ |
194 | CFLAGS="$(CFLAGS)"; export CFLAGS; \ |
195 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | |
196 | CXX="$(CXX)"; export CXX; \ | |
197 | CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ | |
4a4a4e99 | 198 | GFORTRAN="$(GFORTRAN)"; export GFORTRAN; \ |
632e2a07 | 199 | GOC="$(GOC)"; export GOC; \ |
b4c522fa | 200 | GDC="$(GDC)"; export GDC; \ |
4fc4dd12 DJ |
201 | AR="$(AR)"; export AR; \ |
202 | AS="$(AS)"; export AS; \ | |
203 | CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ | |
d0fc6e9f | 204 | CXX_FOR_BUILD="$(CXX_FOR_BUILD)"; export CXX_FOR_BUILD; \ |
4fc4dd12 DJ |
205 | DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ |
206 | LD="$(LD)"; export LD; \ | |
00020c16 | 207 | LDFLAGS="$(STAGE1_LDFLAGS) $(LDFLAGS)"; export LDFLAGS; \ |
4fc4dd12 DJ |
208 | NM="$(NM)"; export NM; \ |
209 | RANLIB="$(RANLIB)"; export RANLIB; \ | |
210 | WINDRES="$(WINDRES)"; export WINDRES; \ | |
901119ae | 211 | WINDMC="$(WINDMC)"; export WINDMC; \ |
4fc4dd12 | 212 | OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ |
1c020272 | 213 | OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ |
e4a9a572 | 214 | OTOOL="$(OTOOL)"; export OTOOL; \ |
e7a82751 | 215 | READELF="$(READELF)"; export READELF; \ |
2abefe3d PB |
216 | AR_FOR_TARGET="$(AR_FOR_TARGET)"; export AR_FOR_TARGET; \ |
217 | AS_FOR_TARGET="$(AS_FOR_TARGET)"; export AS_FOR_TARGET; \ | |
218 | GCC_FOR_TARGET="$(GCC_FOR_TARGET)"; export GCC_FOR_TARGET; \ | |
219 | LD_FOR_TARGET="$(LD_FOR_TARGET)"; export LD_FOR_TARGET; \ | |
220 | NM_FOR_TARGET="$(NM_FOR_TARGET)"; export NM_FOR_TARGET; \ | |
221 | OBJDUMP_FOR_TARGET="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP_FOR_TARGET; \ | |
9bccfdf5 | 222 | OBJCOPY_FOR_TARGET="$(OBJCOPY_FOR_TARGET)"; export OBJCOPY_FOR_TARGET; \ |
e4a9a572 | 223 | OTOOL_FOR_TARGET="$(OTOOL_FOR_TARGET)"; export OTOOL_FOR_TARGET; \ |
2abefe3d | 224 | RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \ |
e7a82751 | 225 | READELF_FOR_TARGET="$(READELF_FOR_TARGET)"; export READELF_FOR_TARGET; \ |
4fc4dd12 | 226 | TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \ |
00020c16 | 227 | HOST_LIBS="$(STAGE1_LIBS)"; export HOST_LIBS; \ |
4fc4dd12 | 228 | GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \ |
4c4a5bbc | 229 | GMPINC="$(HOST_GMPINC)"; export GMPINC; \ |
eae1a5d4 | 230 | ISLLIBS="$(HOST_ISLLIBS)"; export ISLLIBS; \ |
33ad93b9 | 231 | ISLINC="$(HOST_ISLINC)"; export ISLINC; \ |
fafb95a6 BRF |
232 | LIBELFLIBS="$(HOST_LIBELFLIBS)"; export LIBELFLIBS; \ |
233 | LIBELFINC="$(HOST_LIBELFINC)"; export LIBELFINC; \ | |
105b682e | 234 | XGCC_FLAGS_FOR_TARGET="$(XGCC_FLAGS_FOR_TARGET)"; export XGCC_FLAGS_FOR_TARGET; \ |
1061f99e PB |
235 | @if gcc-bootstrap |
236 | $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ | |
237 | @endif gcc-bootstrap | |
0bff65e7 | 238 | $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); |
4fc4dd12 | 239 | |
f61428ed AO |
240 | POSTSTAGE1_CXX_EXPORT = \ |
241 | CXX='$(CXX)'; export CXX; \ | |
242 | CXX_FOR_BUILD='$(CXX_FOR_BUILD)'; export CXX_FOR_BUILD; | |
243 | @if target-libstdc++-v3-bootstrap | |
244 | # Override the above if we're bootstrapping C++. | |
245 | POSTSTAGE1_CXX_EXPORT = \ | |
5d99894e | 246 | CXX="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/xg++$(exeext) \ |
f61428ed | 247 | -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ -nostdinc++ \ |
77198d71 | 248 | -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \ |
242f5421 | 249 | -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs \ |
3b9edeac JJ |
250 | `if $(LEAN); then echo ' -isystem '; else echo ' -I'; fi`$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include/$(TARGET_SUBDIR) \ |
251 | `if $(LEAN); then echo ' -isystem '; else echo ' -I'; fi`$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include \ | |
252 | `if $(LEAN); then echo ' -isystem '; else echo ' -I'; fi`$$s/libstdc++-v3/libsupc++ \ | |
242f5421 DE |
253 | -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \ |
254 | -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs"; \ | |
255 | export CXX; \ | |
f61428ed AO |
256 | CXX_FOR_BUILD="$$CXX"; export CXX_FOR_BUILD; |
257 | @endif target-libstdc++-v3-bootstrap | |
258 | ||
4fc4dd12 | 259 | # Similar, for later GCC stages. |
ce406537 | 260 | POSTSTAGE1_HOST_EXPORTS = \ |
a52a0a7f | 261 | $(HOST_EXPORTS) \ |
215c351a | 262 | CC="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \ |
4a4a4e99 AO |
263 | -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ \ |
264 | $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \ | |
265 | CC_FOR_BUILD="$$CC"; export CC_FOR_BUILD; \ | |
f61428ed | 266 | $(POSTSTAGE1_CXX_EXPORT) \ |
e04733ee | 267 | $(LTO_EXPORTS) \ |
b4c522fa IB |
268 | GDC="$$r/$(HOST_SUBDIR)/prev-gcc/gdc$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/ \ |
269 | -B$(build_tooldir)/bin/ $(GDC_FLAGS_FOR_TARGET) \ | |
270 | -B$$r/prev-$(TARGET_SUBDIR)/libphobos/src \ | |
271 | -I$$r/prev-$(TARGET_SUBDIR)/libphobos/libdruntime -I$$s/libphobos/libdruntime \ | |
272 | -L$$r/prev-$(TARGET_SUBDIR)/libphobos/src/.libs \ | |
273 | -L$$r/prev-$(TARGET_SUBDIR)/libphobos/libdruntime/.libs"; \ | |
274 | export GDC; \ | |
275 | GDC_FOR_BUILD="$$GDC"; export GDC_FOR_BUILD; \ | |
00020c16 ILT |
276 | GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind"; export GNATBIND; \ |
277 | LDFLAGS="$(POSTSTAGE1_LDFLAGS) $(BOOT_LDFLAGS)"; export LDFLAGS; \ | |
278 | HOST_LIBS="$(POSTSTAGE1_LIBS)"; export HOST_LIBS; | |
df0f0674 | 279 | |
df0f0674 NN |
280 | # Target libraries are put under this directory: |
281 | TARGET_SUBDIR = @target_subdir@ | |
282 | # This is set by the configure script to the arguments to use when configuring | |
283 | # directories built for the target. | |
25b42232 | 284 | TARGET_CONFIGARGS = @target_configargs@ --with-target-subdir="$(TARGET_SUBDIR)" |
4fc4dd12 | 285 | # This is the list of variables to export in the environment when |
60a2e213 | 286 | # configuring subdirectories for the target system. |
4fc4dd12 | 287 | BASE_TARGET_EXPORTS = \ |
23f6b2f9 | 288 | $(BASE_EXPORTS) \ |
4fc4dd12 | 289 | AR="$(AR_FOR_TARGET)"; export AR; \ |
2abefe3d | 290 | AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \ |
4a4a4e99 AO |
291 | CC="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \ |
292 | CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ | |
4fc4dd12 | 293 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ |
e7daab31 | 294 | CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \ |
4a4a4e99 | 295 | CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ |
4a4a4e99 | 296 | GFORTRAN="$(GFORTRAN_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GFORTRAN; \ |
632e2a07 | 297 | GOC="$(GOC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GOC; \ |
b4c522fa | 298 | GDC="$(GDC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GDC; \ |
4fc4dd12 | 299 | DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ |
2abefe3d | 300 | LD="$(COMPILER_LD_FOR_TARGET)"; export LD; \ |
4fc4dd12 | 301 | LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ |
040b1c5a | 302 | LIPO="$(LIPO_FOR_TARGET)"; export LIPO; \ |
2abefe3d | 303 | NM="$(COMPILER_NM_FOR_TARGET)"; export NM; \ |
d739199a | 304 | OBJDUMP="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP; \ |
9bccfdf5 | 305 | OBJCOPY="$(OBJCOPY_FOR_TARGET)"; export OBJCOPY; \ |
e4a9a572 | 306 | OTOOL="$(OTOOL_FOR_TARGET)"; export OTOOL; \ |
4fc4dd12 | 307 | RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ |
e7a82751 | 308 | READELF="$(READELF_FOR_TARGET)"; export READELF; \ |
040b1c5a | 309 | STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \ |
4c4a5bbc | 310 | WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ |
901119ae | 311 | WINDMC="$(WINDMC_FOR_TARGET)"; export WINDMC; \ |
60a2e213 RW |
312 | @if gcc-bootstrap |
313 | $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ | |
314 | @endif gcc-bootstrap | |
aae29963 JR |
315 | $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ |
316 | TARGET_CONFIGDIRS="$(TARGET_CONFIGDIRS)"; export TARGET_CONFIGDIRS; | |
4fc4dd12 DJ |
317 | |
318 | RAW_CXX_TARGET_EXPORTS = \ | |
319 | $(BASE_TARGET_EXPORTS) \ | |
320 | CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \ | |
4a4a4e99 | 321 | CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; |
4fc4dd12 DJ |
322 | |
323 | NORMAL_TARGET_EXPORTS = \ | |
324 | $(BASE_TARGET_EXPORTS) \ | |
4a4a4e99 | 325 | CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; |
df0f0674 | 326 | |
6de9cd9a DN |
327 | # Where to find GMP |
328 | HOST_GMPLIBS = @gmplibs@ | |
329 | HOST_GMPINC = @gmpinc@ | |
330 | ||
e357a5e0 | 331 | # Where to find isl |
eae1a5d4 | 332 | HOST_ISLLIBS = @isllibs@ |
33ad93b9 | 333 | HOST_ISLINC = @islinc@ |
f8bf9252 | 334 | |
d7f09764 DN |
335 | # Where to find libelf |
336 | HOST_LIBELFLIBS = @libelflibs@ | |
337 | HOST_LIBELFINC = @libelfinc@ | |
338 | ||
df0f0674 NN |
339 | # ---------------------------------------------- |
340 | # Programs producing files for the BUILD machine | |
341 | # ---------------------------------------------- | |
342 | ||
72691ba6 | 343 | SHELL = @SHELL@ |
df0f0674 NN |
344 | |
345 | # pwd command to use. Allow user to override default by setting PWDCMD in | |
346 | # the environment to account for automounters. The make variable must not | |
347 | # be called PWDCMD, otherwise the value set here is passed to make | |
348 | # subprocesses and overrides the setting from the user's environment. | |
8c90b13a L |
349 | # Don't use PWD since it is a common shell environment variable and we |
350 | # don't want to corrupt it. | |
351 | PWD_COMMAND = $${PWDCMD-pwd} | |
df0f0674 NN |
352 | |
353 | # compilers to use to create programs which must be run in the build | |
354 | # environment. | |
0999159b PB |
355 | AR_FOR_BUILD = @AR_FOR_BUILD@ |
356 | AS_FOR_BUILD = @AS_FOR_BUILD@ | |
df0f0674 | 357 | CC_FOR_BUILD = @CC_FOR_BUILD@ |
6691a79e | 358 | CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ |
0999159b PB |
359 | CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@ |
360 | CXX_FOR_BUILD = @CXX_FOR_BUILD@ | |
361 | DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@ | |
0999159b | 362 | GFORTRAN_FOR_BUILD = @GFORTRAN_FOR_BUILD@ |
632e2a07 | 363 | GOC_FOR_BUILD = @GOC_FOR_BUILD@ |
b4c522fa | 364 | GDC_FOR_BUILD = @GDC_FOR_BUILD@ |
0999159b PB |
365 | LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ |
366 | LD_FOR_BUILD = @LD_FOR_BUILD@ | |
367 | NM_FOR_BUILD = @NM_FOR_BUILD@ | |
368 | RANLIB_FOR_BUILD = @RANLIB_FOR_BUILD@ | |
369 | WINDMC_FOR_BUILD = @WINDMC_FOR_BUILD@ | |
370 | WINDRES_FOR_BUILD = @WINDRES_FOR_BUILD@ | |
df0f0674 NN |
371 | |
372 | # Special variables passed down in EXTRA_GCC_FLAGS. They are defined | |
373 | # here so that they can be overridden by Makefile fragments. | |
df0f0674 NN |
374 | BUILD_PREFIX = @BUILD_PREFIX@ |
375 | BUILD_PREFIX_1 = @BUILD_PREFIX_1@ | |
95ddd785 | 376 | |
45f366ab PB |
377 | # Flags to pass to stage2 and later makes. They are defined |
378 | # here so that they can be overridden by Makefile fragments. | |
379 | BOOT_CFLAGS= -g -O2 | |
d19bca38 | 380 | BOOT_LDFLAGS= |
7cb9fd07 | 381 | BOOT_ADAFLAGS= -gnatpg |
45f366ab | 382 | |
87264276 PB |
383 | AWK = @AWK@ |
384 | SED = @SED@ | |
2abefe3d PB |
385 | BISON = @BISON@ |
386 | YACC = @YACC@ | |
387 | FLEX = @FLEX@ | |
388 | LEX = @LEX@ | |
389 | M4 = @M4@ | |
390 | MAKEINFO = @MAKEINFO@ | |
391 | EXPECT = @EXPECT@ | |
392 | RUNTEST = @RUNTEST@ | |
95ddd785 | 393 | |
6facd01f | 394 | AUTO_PROFILE = gcc-auto-profile -c 10000000 |
277d7ee0 | 395 | |
95ddd785 NN |
396 | # This just becomes part of the MAKEINFO definition passed down to |
397 | # sub-makes. It lets flags be given on the command line while still | |
398 | # using the makeinfo from the object tree. | |
2f50999f GP |
399 | # (Default to avoid splitting info files by setting the threshold high.) |
400 | MAKEINFOFLAGS = --split-size=5000000 | |
95ddd785 | 401 | |
df0f0674 NN |
402 | # --------------------------------------------- |
403 | # Programs producing files for the HOST machine | |
404 | # --------------------------------------------- | |
95ddd785 | 405 | |
df0f0674 | 406 | AS = @AS@ |
df0f0674 NN |
407 | AR = @AR@ |
408 | AR_FLAGS = rc | |
df0f0674 | 409 | CC = @CC@ |
df0f0674 | 410 | CXX = @CXX@ |
df0f0674 | 411 | DLLTOOL = @DLLTOOL@ |
df0f0674 | 412 | LD = @LD@ |
2abefe3d PB |
413 | LIPO = @LIPO@ |
414 | NM = @NM@ | |
2d309510 | 415 | OBJDUMP = @OBJDUMP@ |
e4a9a572 | 416 | OTOOL = @OTOOL@ |
df0f0674 | 417 | RANLIB = @RANLIB@ |
e7a82751 | 418 | READELF = @READELF@ |
2abefe3d | 419 | STRIP = @STRIP@ |
df0f0674 | 420 | WINDRES = @WINDRES@ |
901119ae | 421 | WINDMC = @WINDMC@ |
95ddd785 | 422 | |
b4c522fa | 423 | GDC = @GDC@ |
5305be7e RG |
424 | GNATBIND = @GNATBIND@ |
425 | GNATMAKE = @GNATMAKE@ | |
426 | ||
2abefe3d | 427 | CFLAGS = @CFLAGS@ |
f6671c93 | 428 | LDFLAGS = @LDFLAGS@ |
2abefe3d PB |
429 | LIBCFLAGS = $(CFLAGS) |
430 | CXXFLAGS = @CXXFLAGS@ | |
431 | LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates | |
632e2a07 | 432 | GOCFLAGS = $(CFLAGS) |
b4c522fa | 433 | GDCFLAGS = $(CFLAGS) |
df0f0674 | 434 | |
277d7ee0 AK |
435 | CREATE_GCOV = create_gcov |
436 | ||
4a4a4e99 AO |
437 | TFLAGS = |
438 | ||
439 | # Defaults for all stages; some are overridden below. | |
440 | ||
441 | STAGE_CFLAGS = $(BOOT_CFLAGS) | |
442 | STAGE_TFLAGS = $(TFLAGS) | |
443 | STAGE_CONFIGURE_FLAGS=@stage2_werror_flag@ | |
444 | ||
445 | [+ FOR bootstrap-stage +] | |
446 | # Defaults for stage [+id+]; some are overridden below. | |
447 | STAGE[+id+]_CFLAGS = $(STAGE_CFLAGS) | |
f61428ed AO |
448 | STAGE[+id+]_CXXFLAGS = $(CXXFLAGS) |
449 | @if target-libstdc++-v3-bootstrap | |
450 | # Override the above if we're bootstrapping C++. | |
451 | STAGE[+id+]_CXXFLAGS = $(STAGE[+id+]_CFLAGS) | |
452 | @endif target-libstdc++-v3-bootstrap | |
4a4a4e99 | 453 | STAGE[+id+]_TFLAGS = $(STAGE_TFLAGS) |
0823efed | 454 | STAGE[+id+]_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS) |
4a4a4e99 AO |
455 | [+ ENDFOR bootstrap-stage +] |
456 | ||
da0bfb86 JM |
457 | # By default, C and C++ are the only stage1 languages, because they are the |
458 | # only ones we require to build with the bootstrap compiler, and also the | |
459 | # only ones useful for building stage2. | |
8efea775 | 460 | |
4a4a4e99 | 461 | STAGE1_CFLAGS = @stage1_cflags@ |
f61428ed AO |
462 | STAGE1_CHECKING = @stage1_checking@ |
463 | STAGE1_LANGUAGES = @stage1_languages@ | |
4a4a4e99 AO |
464 | # * We force-disable intermodule optimizations, even if |
465 | # --enable-intermodule was passed, since the installed compiler | |
466 | # probably can't handle them. Luckily, autoconf always respects | |
467 | # the last argument when conflicting --enable arguments are passed. | |
468 | # * Likewise, we force-disable coverage flags, since the installed | |
469 | # compiler probably has never heard of them. | |
1652c6da | 470 | # * We also disable -Wformat, since older GCCs don't understand newer %s. |
4a4a4e99 | 471 | STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \ |
1652c6da JM |
472 | --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \ |
473 | --disable-build-format-warnings | |
8efea775 | 474 | |
ae05281f RB |
475 | # When using the slow stage1 compiler disable IL verification and forcefully |
476 | # enable it when using the stage2 compiler instead. As we later compare | |
477 | # stage2 and stage3 we are merely avoid doing redundant work, plus we apply | |
478 | # checking when building all target libraries for release builds. | |
479 | STAGE1_TFLAGS += -fno-checking | |
480 | STAGE2_CFLAGS += -fno-checking | |
481 | STAGE2_TFLAGS += -fno-checking | |
bece35ca RB |
482 | STAGE3_CFLAGS += -fchecking=1 |
483 | STAGE3_TFLAGS += -fchecking=1 | |
ae05281f | 484 | |
4a4a4e99 AO |
485 | STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate |
486 | STAGEprofile_TFLAGS = $(STAGE2_TFLAGS) | |
bb286d71 | 487 | |
bece35ca RB |
488 | STAGEtrain_CFLAGS = $(filter-out -fchecking=1,$(STAGE3_CFLAGS)) |
489 | STAGEtrain_TFLAGS = $(filter-out -fchecking=1,$(STAGE3_TFLAGS)) | |
0d053a49 ML |
490 | |
491 | STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use | |
492 | STAGEfeedback_TFLAGS = $(STAGE4_TFLAGS) | |
1c8bd6a3 | 493 | |
277d7ee0 AK |
494 | STAGEautoprofile_CFLAGS = $(STAGE2_CFLAGS) -g |
495 | STAGEautoprofile_TFLAGS = $(STAGE2_TFLAGS) | |
496 | ||
497 | STAGEautofeedback_CFLAGS = $(STAGE3_CFLAGS) | |
498 | STAGEautofeedback_TFLAGS = $(STAGE3_TFLAGS) | |
499 | ||
bb286d71 AO |
500 | do-compare = @do_compare@ |
501 | do-compare3 = $(do-compare) | |
bb286d71 | 502 | |
df0f0674 NN |
503 | # ----------------------------------------------- |
504 | # Programs producing files for the TARGET machine | |
505 | # ----------------------------------------------- | |
95ddd785 | 506 | |
df0f0674 | 507 | AR_FOR_TARGET=@AR_FOR_TARGET@ |
4977bab6 | 508 | AS_FOR_TARGET=@AS_FOR_TARGET@ |
4a4a4e99 | 509 | CC_FOR_TARGET=$(STAGE_CC_WRAPPER) @CC_FOR_TARGET@ |
4de997d1 | 510 | |
df0f0674 NN |
511 | # If GCC_FOR_TARGET is not overriden on the command line, then this |
512 | # variable is passed down to the gcc Makefile, where it is used to | |
513 | # build libgcc2.a. We define it here so that it can itself be | |
514 | # overridden on the command line. | |
4a4a4e99 AO |
515 | GCC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCC_FOR_TARGET@ |
516 | CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @CXX_FOR_TARGET@ | |
517 | RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @RAW_CXX_FOR_TARGET@ | |
4a4a4e99 | 518 | GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@ |
632e2a07 | 519 | GOC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GOC_FOR_TARGET@ |
b4c522fa | 520 | GDC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GDC_FOR_TARGET@ |
4977bab6 | 521 | DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@ |
df0f0674 | 522 | LD_FOR_TARGET=@LD_FOR_TARGET@ |
df0f0674 | 523 | |
040b1c5a | 524 | LIPO_FOR_TARGET=@LIPO_FOR_TARGET@ |
df0f0674 | 525 | NM_FOR_TARGET=@NM_FOR_TARGET@ |
d739199a | 526 | OBJDUMP_FOR_TARGET=@OBJDUMP_FOR_TARGET@ |
9bccfdf5 | 527 | OBJCOPY_FOR_TARGET=@OBJCOPY_FOR_TARGET@ |
e4a9a572 | 528 | OTOOL_FOR_TARGET=@OTOOL_FOR_TARGET@ |
4977bab6 | 529 | RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@ |
e7a82751 | 530 | READELF_FOR_TARGET=@READELF_FOR_TARGET@ |
040b1c5a | 531 | STRIP_FOR_TARGET=@STRIP_FOR_TARGET@ |
df0f0674 | 532 | WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@ |
901119ae | 533 | WINDMC_FOR_TARGET=@WINDMC_FOR_TARGET@ |
95ddd785 | 534 | |
2abefe3d PB |
535 | COMPILER_AS_FOR_TARGET=@COMPILER_AS_FOR_TARGET@ |
536 | COMPILER_LD_FOR_TARGET=@COMPILER_LD_FOR_TARGET@ | |
537 | COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_TARGET@ | |
538 | ||
1c8bd6a3 PB |
539 | CFLAGS_FOR_TARGET = @CFLAGS_FOR_TARGET@ |
540 | CXXFLAGS_FOR_TARGET = @CXXFLAGS_FOR_TARGET@ | |
1c8bd6a3 | 541 | |
2abefe3d PB |
542 | LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET) |
543 | LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates | |
6f57bdf6 | 544 | LDFLAGS_FOR_TARGET = @LDFLAGS_FOR_TARGET@ |
632e2a07 | 545 | GOCFLAGS_FOR_TARGET = -O2 -g |
b4c522fa | 546 | GDCFLAGS_FOR_TARGET = -O2 -g |
df0f0674 | 547 | |
4a4a4e99 AO |
548 | FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@ |
549 | SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@ | |
550 | DEBUG_PREFIX_CFLAGS_FOR_TARGET = @DEBUG_PREFIX_CFLAGS_FOR_TARGET@ | |
551 | ||
552 | XGCC_FLAGS_FOR_TARGET = $(FLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET) | |
553 | ||
df0f0674 NN |
554 | # ------------------------------------ |
555 | # Miscellaneous targets and flag lists | |
556 | # ------------------------------------ | |
557 | ||
95ddd785 NN |
558 | # The first rule in the file had better be this one. Don't put any above it. |
559 | # This lives here to allow makefile fragments to contain dependencies. | |
1061f99e | 560 | all: |
95ddd785 | 561 | |
95ddd785 | 562 | #### host and target specific makefile fragments come in here. |
671aa708 NN |
563 | @target_makefile_frag@ |
564 | @alphaieee_frag@ | |
565 | @ospace_frag@ | |
566 | @host_makefile_frag@ | |
95ddd785 NN |
567 | ### |
568 | ||
0bff65e7 | 569 | # This is the list of directories that may be needed in RPATH_ENVVAR |
66c92425 | 570 | # so that programs built for the target machine work. |
0bff65e7 PB |
571 | TARGET_LIB_PATH = [+ FOR target_modules +][+ |
572 | IF lib_path +]$(TARGET_LIB_PATH_[+module+])[+ ENDIF lib_path +][+ | |
573 | ENDFOR target_modules +]$(HOST_LIB_PATH_gcc) | |
574 | [+ FOR target_modules +][+ IF lib_path +] | |
575 | @if target-[+module+] | |
576 | TARGET_LIB_PATH_[+module+] = $$r/$(TARGET_SUBDIR)/[+module+]/[+lib_path+]: | |
577 | @endif target-[+module+] | |
578 | [+ ENDIF lib_path +][+ ENDFOR target_modules +] | |
579 | ||
580 | ||
581 | # This is the list of directories that may be needed in RPATH_ENVVAR | |
582 | # so that programs built for the host machine work. | |
583 | HOST_LIB_PATH = [+ FOR host_modules +][+ | |
584 | IF lib_path +]$(HOST_LIB_PATH_[+module+])[+ ENDIF lib_path +][+ | |
585 | ENDFOR host_modules +] | |
586 | ||
587 | # Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch | |
588 | @if gcc | |
d89f0ad6 | 589 | HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc$(GCC_SHLIB_SUBDIR):$$r/$(HOST_SUBDIR)/prev-gcc$(GCC_SHLIB_SUBDIR): |
0bff65e7 PB |
590 | @endif gcc |
591 | ||
592 | [+ FOR host_modules +][+ IF lib_path +] | |
593 | @if [+module+] | |
594 | HOST_LIB_PATH_[+module+] = \ | |
595 | $$r/$(HOST_SUBDIR)/[+module+]/[+lib_path+]:[+ IF bootstrap | |
596 | +]$$r/$(HOST_SUBDIR)/prev-[+module+]/[+lib_path+]:[+ ENDIF bootstrap +] | |
597 | @endif [+module+] | |
598 | [+ ENDIF lib_path +][+ ENDFOR host_modules +] | |
599 | ||
9aff220f AO |
600 | CXX_FOR_TARGET_FLAG_TO_PASS = \ |
601 | "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" | |
602 | @if target-libstdc++-v3 | |
603 | # CXX_FOR_TARGET is tricky to get right for target libs that require a | |
604 | # functional C++ compiler. When we recurse, if we expand | |
605 | # CXX_FOR_TARGET before configuring libstdc++-v3, we won't get | |
606 | # libstdc++ include flags from the script. Instead, we get an | |
607 | # -funconfigured-* word, so that we'll get errors if this invalid C++ | |
608 | # command line is used for anything, but also so that we can use the | |
609 | # word to decide whether or not to pass on this CXX_FOR_TARGET. If we | |
610 | # don't pass it on, sub-make will use the default definition, that | |
611 | # re-expands it at the time of use, so we'll get it right when we need | |
612 | # it. One potential exception is the expansion of CXX_FOR_TARGET | |
613 | # passed down as part of CXX within TARGET_FLAGS, but this wouldn't | |
614 | # really work, for C++ host programs can't depend on the current-stage | |
615 | # C++ target library. | |
616 | CXX_FOR_TARGET_FLAG_TO_PASS = \ | |
617 | $(shell if echo "$(CXX_FOR_TARGET)" | grep " -funconfigured-" > /dev/null; then :; else echo '"CXX_FOR_TARGET=$(CXX_FOR_TARGET)"'; fi) | |
618 | @endif target-libstdc++-v3 | |
619 | ||
da0bfb86 JM |
620 | # Flags to pass down to all sub-makes. STAGE*FLAGS, |
621 | # MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them | |
622 | # overrideable (for a bootstrap build stage1 also builds gcc.info). | |
cc11cc9b PB |
623 | BASE_FLAGS_TO_PASS =[+ FOR flags_to_pass +][+ IF optional +] \ |
624 | "`echo '[+flag+]=$([+flag+])' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"[+ ELSE optional +] \ | |
4a4a4e99 AO |
625 | "[+flag+]=$([+flag+])"[+ ENDIF optional+][+ ENDFOR flags_to_pass +][+ FOR bootstrap-stage +] \ |
626 | "STAGE[+id+]_CFLAGS=$(STAGE[+id+]_CFLAGS)" \ | |
f61428ed | 627 | "STAGE[+id+]_CXXFLAGS=$(STAGE[+id+]_CXXFLAGS)" \ |
1c67e69c | 628 | "STAGE[+id+]_GENERATOR_CFLAGS=$(STAGE[+id+]_GENERATOR_CFLAGS)" \ |
4a4a4e99 | 629 | "STAGE[+id+]_TFLAGS=$(STAGE[+id+]_TFLAGS)"[+ ENDFOR bootstrap-stage +] \ |
9aff220f | 630 | $(CXX_FOR_TARGET_FLAG_TO_PASS) \ |
4a4a4e99 | 631 | "TFLAGS=$(TFLAGS)" \ |
e75f9147 | 632 | "CONFIG_SHELL=$(SHELL)" \ |
cefadad1 MM |
633 | "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \ |
634 | $(if $(LSAN_OPTIONS),"LSAN_OPTIONS=$(LSAN_OPTIONS)") | |
95ddd785 | 635 | |
4de997d1 PB |
636 | # We leave this in just in case, but it is not needed anymore. |
637 | RECURSE_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) | |
ad6717df | 638 | |
95ddd785 NN |
639 | # Flags to pass down to most sub-makes, in which we're building with |
640 | # the host environment. | |
95ddd785 NN |
641 | EXTRA_HOST_FLAGS = \ |
642 | 'AR=$(AR)' \ | |
643 | 'AS=$(AS)' \ | |
644 | 'CC=$(CC)' \ | |
645 | 'CXX=$(CXX)' \ | |
646 | 'DLLTOOL=$(DLLTOOL)' \ | |
4a4a4e99 | 647 | 'GFORTRAN=$(GFORTRAN)' \ |
632e2a07 | 648 | 'GOC=$(GOC)' \ |
b4c522fa | 649 | 'GDC=$(GDC)' \ |
95ddd785 | 650 | 'LD=$(LD)' \ |
2abefe3d | 651 | 'LIPO=$(LIPO)' \ |
95ddd785 | 652 | 'NM=$(NM)' \ |
2d309510 | 653 | 'OBJDUMP=$(OBJDUMP)' \ |
e4a9a572 | 654 | 'OTOOL=$(OTOOL)' \ |
c858bf1e | 655 | 'RANLIB=$(RANLIB)' \ |
e7a82751 | 656 | 'READELF=$(READELF)' \ |
2abefe3d | 657 | 'STRIP=$(STRIP)' \ |
901119ae | 658 | 'WINDRES=$(WINDRES)' \ |
277d7ee0 AK |
659 | 'WINDMC=$(WINDMC)' \ |
660 | 'CREATE_GCOV=$(CREATE_GCOV)' | |
95ddd785 NN |
661 | |
662 | FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) | |
663 | ||
0b21f5d3 EB |
664 | # Flags to pass to stage1 or when not bootstrapping. |
665 | ||
666 | STAGE1_FLAGS_TO_PASS = \ | |
667 | LDFLAGS="$${LDFLAGS}" \ | |
668 | HOST_LIBS="$${HOST_LIBS}" | |
669 | ||
8efea775 PB |
670 | # Flags to pass to stage2 and later makes. |
671 | ||
672 | POSTSTAGE1_FLAGS_TO_PASS = \ | |
00020c16 ILT |
673 | CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \ |
674 | CXX="$${CXX}" CXX_FOR_BUILD="$${CXX_FOR_BUILD}" \ | |
b4c522fa | 675 | GDC="$${GDC}" GDC_FOR_BUILD="$${GDC_FOR_BUILD}" \ |
00020c16 | 676 | GNATBIND="$${GNATBIND}" \ |
f61428ed AO |
677 | LDFLAGS="$${LDFLAGS}" \ |
678 | HOST_LIBS="$${HOST_LIBS}" \ | |
e04733ee | 679 | $(LTO_FLAGS_TO_PASS) \ |
8efea775 PB |
680 | "`echo 'ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" |
681 | ||
77019397 MO |
682 | @if gcc-bootstrap |
683 | EXTRA_HOST_EXPORTS = if [ $(current_stage) != stage1 ]; then \ | |
684 | $(POSTSTAGE1_HOST_EXPORTS) \ | |
fafb95a6 | 685 | fi; |
77019397 MO |
686 | |
687 | EXTRA_BOOTSTRAP_FLAGS = CC="$$CC" CXX="$$CXX" LDFLAGS="$$LDFLAGS" | |
688 | @endif gcc-bootstrap | |
689 | ||
95ddd785 | 690 | # Flags to pass down to makes which are built with the target environment. |
f41d6665 DJ |
691 | # The double $ decreases the length of the command line; those variables |
692 | # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. The | |
1c8bd6a3 PB |
693 | # *_CFLAGS_FOR_TARGET variables are not passed down and most often empty, |
694 | # so we expand them here. | |
95ddd785 NN |
695 | EXTRA_TARGET_FLAGS = \ |
696 | 'AR=$$(AR_FOR_TARGET)' \ | |
f41d6665 | 697 | 'AS=$(COMPILER_AS_FOR_TARGET)' \ |
4a4a4e99 AO |
698 | 'CC=$$(CC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \ |
699 | 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \ | |
b6a65eb6 JJ |
700 | 'CXX=$$(CXX_FOR_TARGET) -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \ |
701 | -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs \ | |
702 | $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \ | |
4a4a4e99 | 703 | 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \ |
95ddd785 | 704 | 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \ |
4a4a4e99 | 705 | 'GFORTRAN=$$(GFORTRAN_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \ |
632e2a07 ILT |
706 | 'GOC=$$(GOC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \ |
707 | 'GOCFLAGS=$$(GOCFLAGS_FOR_TARGET)' \ | |
b4c522fa IB |
708 | 'GDC=$$(GDC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \ |
709 | 'GDCFLAGS=$$(GDCFLAGS_FOR_TARGET)' \ | |
f41d6665 | 710 | 'LD=$(COMPILER_LD_FOR_TARGET)' \ |
e3791243 | 711 | 'LDFLAGS=$$(LDFLAGS_FOR_TARGET)' \ |
4a4a4e99 AO |
712 | 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \ |
713 | 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \ | |
f41d6665 | 714 | 'NM=$(COMPILER_NM_FOR_TARGET)' \ |
d739199a | 715 | 'OBJDUMP=$$(OBJDUMP_FOR_TARGET)' \ |
9bccfdf5 | 716 | 'OBJCOPY=$$(OBJCOPY_FOR_TARGET)' \ |
95ddd785 | 717 | 'RANLIB=$$(RANLIB_FOR_TARGET)' \ |
e7a82751 | 718 | 'READELF=$$(READELF_FOR_TARGET)' \ |
901119ae | 719 | 'WINDRES=$$(WINDRES_FOR_TARGET)' \ |
4a4a4e99 AO |
720 | 'WINDMC=$$(WINDMC_FOR_TARGET)' \ |
721 | 'XGCC_FLAGS_FOR_TARGET=$(XGCC_FLAGS_FOR_TARGET)' \ | |
b6a65eb6 JJ |
722 | 'STAGE1_LDFLAGS=$$(POSTSTAGE1_LDFLAGS)' \ |
723 | 'STAGE1_LIBS=$$(POSTSTAGE1_LIBS)' \ | |
4a4a4e99 | 724 | "TFLAGS=$$TFLAGS" |
95ddd785 NN |
725 | |
726 | TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) | |
727 | ||
728 | # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it | |
729 | # unfortunately needs the native compiler and the target ar and | |
730 | # ranlib. | |
731 | # If any variables are added here, they must be added to do-*, below. | |
1358ccea | 732 | # The BUILD_* variables are a special case, which are used for the gcc |
95ddd785 NN |
733 | # cross-building scheme. |
734 | EXTRA_GCC_FLAGS = \ | |
95ddd785 | 735 | "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \ |
d4cd9d81 | 736 | "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \ |
f9989b51 | 737 | "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" |
95ddd785 | 738 | |
d29b8ad8 | 739 | GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS) |
95ddd785 | 740 | |
4a4a4e99 | 741 | @if gcc |
e12c4094 | 742 | BUILD_CONFIG = @BUILD_CONFIG@ |
4a4a4e99 AO |
743 | ifneq ($(BUILD_CONFIG),) |
744 | include $(foreach CONFIG, $(BUILD_CONFIG), $(srcdir)/config/$(CONFIG).mk) | |
745 | endif | |
746 | @endif gcc | |
747 | ||
8b87bb96 | 748 | .PHONY: configure-host |
d32ab992 | 749 | configure-host: [+ |
8b87bb96 NN |
750 | FOR host_modules +] \ |
751 | maybe-configure-[+module+][+ | |
752 | ENDFOR host_modules +] | |
753 | .PHONY: configure-target | |
754 | configure-target: [+ | |
755 | FOR target_modules +] \ | |
756 | maybe-configure-target-[+module+][+ | |
757 | ENDFOR target_modules +] | |
95ddd785 | 758 | |
f516a7da PB |
759 | # The target built for a native non-bootstrap build. |
760 | .PHONY: all | |
1061f99e PB |
761 | all: |
762 | @if gcc-bootstrap | |
2abefe3d | 763 | [ -f stage_final ] || echo stage3 > stage_final |
1061f99e PB |
764 | @r=`${PWD_COMMAND}`; export r; \ |
765 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
f41d6665 | 766 | $(MAKE) $(RECURSE_FLAGS_TO_PASS) `cat stage_final`-bubble |
1061f99e | 767 | @endif gcc-bootstrap |
f41d6665 | 768 | @: $(MAKE); $(unstage) |
1061f99e PB |
769 | @r=`${PWD_COMMAND}`; export r; \ |
770 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
4a4a4e99 | 771 | @if gcc-bootstrap |
0f501837 | 772 | if [ -f stage_last ]; then \ |
a1fc946a | 773 | TFLAGS="$(STAGE$(shell test ! -f stage_last || sed s,^stage,, stage_last)_TFLAGS)"; \ |
2abefe3d | 774 | $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target; \ |
1061f99e | 775 | else \ |
4a4a4e99 | 776 | @endif gcc-bootstrap |
31c98f49 AO |
777 | $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-host all-target \ |
778 | @if gcc-bootstrap | |
779 | ; \ | |
394e9195 | 780 | fi \ |
31c98f49 | 781 | @endif gcc-bootstrap |
394e9195 | 782 | && : |
8b87bb96 | 783 | |
23f6b2f9 | 784 | .PHONY: all-build |
cc11cc9b PB |
785 | [+ FOR build_modules +] |
786 | all-build: maybe-all-build-[+module+][+ ENDFOR build_modules +] | |
787 | ||
8b87bb96 | 788 | .PHONY: all-host |
cc11cc9b PB |
789 | [+ FOR host_modules +][+ IF bootstrap +] |
790 | @if [+module+]-no-bootstrap[+ ENDIF bootstrap +] | |
791 | all-host: maybe-all-[+module+][+ IF bootstrap +] | |
792 | @endif [+module+]-no-bootstrap[+ ENDIF bootstrap +][+ ENDFOR host_modules +] | |
793 | ||
8b87bb96 | 794 | .PHONY: all-target |
cc11cc9b | 795 | [+ FOR target_modules +][+ IF bootstrap +] |
54fdc474 | 796 | @if target-[+module+]-no-bootstrap[+ ENDIF bootstrap +] |
cc11cc9b | 797 | all-target: maybe-all-target-[+module+][+ IF bootstrap +] |
54fdc474 DJ |
798 | @endif target-[+module+]-no-bootstrap[+ |
799 | ENDIF bootstrap +][+ ENDFOR target_modules +] | |
95ddd785 NN |
800 | |
801 | # Do a target for all the subdirectories. A ``make do-X'' will do a | |
802 | # ``make X'' in all subdirectories (because, in general, there is a | |
803 | # dependency (below) of X upon do-X, a ``make X'' will also do this, | |
804 | # but it may do additional work as well). | |
4977bab6 | 805 | [+ FOR recursive_targets +] |
1a1e6b96 | 806 | .PHONY: do-[+make_target+] |
1061f99e | 807 | do-[+make_target+]: |
f41d6665 | 808 | @: $(MAKE); $(unstage) |
e7c84bf8 PB |
809 | @r=`${PWD_COMMAND}`; export r; \ |
810 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
811 | $(MAKE) $(RECURSE_FLAGS_TO_PASS) [+make_target+]-host \ | |
1061f99e | 812 | [+make_target+]-target |
1061f99e | 813 | |
1358ccea NN |
814 | |
815 | .PHONY: [+make_target+]-host | |
cc11cc9b PB |
816 | [+ FOR host_modules +] |
817 | [+make_target+]-host: maybe-[+make_target+]-[+module+][+ ENDFOR host_modules +] | |
1358ccea NN |
818 | |
819 | .PHONY: [+make_target+]-target | |
cc11cc9b PB |
820 | [+ FOR target_modules +] |
821 | [+make_target+]-target: maybe-[+make_target+]-target-[+module+][+ ENDFOR target_modules +] | |
4977bab6 ZW |
822 | [+ ENDFOR recursive_targets +] |
823 | ||
95ddd785 NN |
824 | # Here are the targets which correspond to the do-X targets. |
825 | ||
9c4d2493 BM |
826 | .PHONY: info installcheck dvi pdf html |
827 | .PHONY: install-info install-pdf install-html | |
95ddd785 NN |
828 | .PHONY: clean distclean mostlyclean maintainer-clean realclean |
829 | .PHONY: local-clean local-distclean local-maintainer-clean | |
830 | info: do-info | |
831 | installcheck: do-installcheck | |
832 | dvi: do-dvi | |
b5422ad7 | 833 | pdf: do-pdf |
f87a2b2e | 834 | html: do-html |
95ddd785 | 835 | |
212f6dd0 NN |
836 | # Make sure makeinfo is built before we do a `make info', if we're |
837 | # in fact building texinfo. | |
838 | do-info: maybe-all-texinfo | |
95ddd785 NN |
839 | |
840 | install-info: do-install-info dir.info | |
8c90b13a | 841 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ |
fafb95a6 BRF |
842 | if [ -f dir.info ]; then \ |
843 | $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info; \ | |
844 | else true; fi | |
95ddd785 | 845 | |
9c4d2493 BM |
846 | install-pdf: do-install-pdf |
847 | ||
65d6e994 CD |
848 | install-html: do-install-html |
849 | ||
95ddd785 NN |
850 | local-clean: |
851 | -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log | |
852 | ||
853 | local-distclean: | |
854 | -rm -f Makefile config.status config.cache mh-frag mt-frag | |
f3653cf5 | 855 | -rm -f maybedep.tmp serdep.tmp stage_final |
95ddd785 NN |
856 | -if [ "$(TARGET_SUBDIR)" != "." ]; then \ |
857 | rm -rf $(TARGET_SUBDIR); \ | |
858 | else true; fi | |
0c227849 | 859 | -rm -rf $(BUILD_SUBDIR) |
215c351a PB |
860 | -if [ "$(HOST_SUBDIR)" != "." ]; then \ |
861 | rm -rf $(HOST_SUBDIR); \ | |
862 | else true; fi | |
95ddd785 NN |
863 | -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile |
864 | -rm -f texinfo/doc/Makefile texinfo/po/POTFILES | |
865 | -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null | |
866 | -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null | |
f3653cf5 SB |
867 | -rmdir fastjar gcc gnattools gotools libcc1 libiberty 2>/dev/null |
868 | -rmdir texinfo zlib 2>/dev/null | |
e50390fc | 869 | -find . -name config.cache -exec rm -f {} \; \; 2>/dev/null |
95ddd785 NN |
870 | |
871 | local-maintainer-clean: | |
872 | @echo "This command is intended for maintainers to use;" | |
873 | @echo "it deletes files that may require special tools to rebuild." | |
874 | ||
875 | clean: do-clean local-clean | |
876 | mostlyclean: do-mostlyclean local-clean | |
877 | distclean: do-distclean local-clean local-distclean | |
878 | maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean | |
879 | maintainer-clean: local-distclean | |
880 | realclean: maintainer-clean | |
881 | ||
95ddd785 NN |
882 | # Check target. |
883 | ||
884 | .PHONY: check do-check | |
333a28b4 | 885 | check: do-check |
95ddd785 | 886 | |
4977bab6 | 887 | # Only include modules actually being configured and built. |
1061f99e PB |
888 | .PHONY: check-host |
889 | check-host: [+ | |
7e2dbcef NN |
890 | FOR host_modules +] \ |
891 | maybe-check-[+module+][+ | |
1061f99e PB |
892 | ENDFOR host_modules +] |
893 | ||
894 | .PHONY: check-target | |
895 | check-target: [+ | |
7e2dbcef NN |
896 | FOR target_modules +] \ |
897 | maybe-check-target-[+module+][+ | |
1061f99e PB |
898 | ENDFOR target_modules +] |
899 | ||
900 | do-check: | |
f41d6665 | 901 | @: $(MAKE); $(unstage) |
e7c84bf8 PB |
902 | @r=`${PWD_COMMAND}`; export r; \ |
903 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
904 | $(MAKE) $(RECURSE_FLAGS_TO_PASS) check-host check-target | |
95ddd785 NN |
905 | |
906 | # Automated reporting of test results. | |
907 | ||
908 | warning.log: build.log | |
909 | $(srcdir)/contrib/warn_summary build.log > $@ | |
910 | ||
911 | mail-report.log: | |
912 | if test x'$(BOOT_CFLAGS)' != x''; then \ | |
913 | BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \ | |
914 | fi; \ | |
915 | $(srcdir)/contrib/test_summary -t >$@ | |
916 | chmod +x $@ | |
917 | echo If you really want to send e-mail, run ./$@ now | |
918 | ||
919 | mail-report-with-warnings.log: warning.log | |
920 | if test x'$(BOOT_CFLAGS)' != x''; then \ | |
921 | BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \ | |
922 | fi; \ | |
923 | $(srcdir)/contrib/test_summary -t -i warning.log >$@ | |
924 | chmod +x $@ | |
925 | echo If you really want to send e-mail, run ./$@ now | |
926 | ||
c3e1e693 YG |
927 | # Local Vim config |
928 | ||
929 | $(srcdir)/.local.vimrc: | |
ec523909 | 930 | $(LN_S) contrib/vimrc $@ |
c3e1e693 YG |
931 | |
932 | $(srcdir)/.lvimrc: | |
ec523909 | 933 | $(LN_S) contrib/vimrc $@ |
c3e1e693 YG |
934 | |
935 | vimrc: $(srcdir)/.local.vimrc $(srcdir)/.lvimrc | |
936 | ||
937 | .PHONY: vimrc | |
938 | ||
daa53f38 ML |
939 | # clang-format config |
940 | ||
941 | $(srcdir)/.clang-format: | |
942 | $(LN_S) contrib/clang-format $@ | |
943 | ||
944 | clang-format: $(srcdir)/.clang-format | |
945 | ||
946 | .PHONY: clang-format | |
947 | ||
95ddd785 NN |
948 | # Installation targets. |
949 | ||
4977bab6 | 950 | .PHONY: install uninstall |
1061f99e | 951 | install: |
f41d6665 | 952 | @: $(MAKE); $(unstage) |
e7c84bf8 PB |
953 | @r=`${PWD_COMMAND}`; export r; \ |
954 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
955 | $(MAKE) $(RECURSE_FLAGS_TO_PASS) installdirs install-host install-target | |
8b87bb96 | 956 | |
7e2dbcef NN |
957 | .PHONY: install-host-nogcc |
958 | install-host-nogcc: [+ | |
3589b69e PB |
959 | FOR host_modules +][+ IF (not (= (get "module") "gcc")) +] \ |
960 | maybe-install-[+module+][+ ENDIF +][+ | |
7e2dbcef NN |
961 | ENDFOR host_modules +] |
962 | ||
8b87bb96 | 963 | .PHONY: install-host |
d32ab992 | 964 | install-host: [+ |
8b87bb96 NN |
965 | FOR host_modules +] \ |
966 | maybe-install-[+module+][+ | |
967 | ENDFOR host_modules +] | |
7e2dbcef | 968 | |
8b87bb96 NN |
969 | .PHONY: install-target |
970 | install-target: [+ | |
971 | FOR target_modules +] \ | |
972 | maybe-install-target-[+module+][+ | |
973 | ENDFOR target_modules +] | |
95ddd785 NN |
974 | |
975 | uninstall: | |
976 | @echo "the uninstall target is not supported in this tree" | |
977 | ||
95ddd785 NN |
978 | .PHONY: install.all |
979 | install.all: install-no-fixedincludes | |
fafb95a6 BRF |
980 | @if [ -f ./gcc/Makefile ]; then \ |
981 | r=`${PWD_COMMAND}`; export r; \ | |
f41d6665 | 982 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ |
a52a0a7f | 983 | $(HOST_EXPORTS) \ |
88b5521b | 984 | (cd ./gcc && \ |
fafb95a6 | 985 | $(MAKE) $(FLAGS_TO_PASS) install-headers); \ |
95ddd785 | 986 | else \ |
fafb95a6 | 987 | true; \ |
95ddd785 NN |
988 | fi |
989 | ||
8294b6fe OH |
990 | # install-no-fixedincludes is used to allow the elaboration of binary packages |
991 | # suitable for distribution, where we cannot include the fixed system header | |
992 | # files. | |
95ddd785 | 993 | .PHONY: install-no-fixedincludes |
7e2dbcef | 994 | install-no-fixedincludes: installdirs install-host-nogcc \ |
8294b6fe | 995 | install-target gcc-install-no-fixedincludes |
95ddd785 | 996 | |
455c8f48 RW |
997 | .PHONY: install-strip |
998 | install-strip: | |
999 | @: $(MAKE); $(unstage) | |
1000 | @r=`${PWD_COMMAND}`; export r; \ | |
1001 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
1002 | $(MAKE) $(RECURSE_FLAGS_TO_PASS) installdirs install-strip-host install-strip-target | |
1003 | ||
1004 | .PHONY: install-strip-host | |
1005 | install-strip-host: [+ | |
1006 | FOR host_modules +] \ | |
1007 | maybe-install-strip-[+module+][+ | |
1008 | ENDFOR host_modules +] | |
1009 | ||
1010 | .PHONY: install-strip-target | |
1011 | install-strip-target: [+ | |
1012 | FOR target_modules +] \ | |
1013 | maybe-install-strip-target-[+module+][+ | |
1014 | ENDFOR target_modules +] | |
1015 | ||
1016 | ||
4977bab6 | 1017 | ### other supporting targets |
95ddd785 | 1018 | |
4977bab6 ZW |
1019 | MAKEDIRS= \ |
1020 | $(DESTDIR)$(prefix) \ | |
1021 | $(DESTDIR)$(exec_prefix) | |
1022 | .PHONY: installdirs | |
1023 | installdirs: mkinstalldirs | |
1024 | $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS) | |
1025 | ||
1026 | dir.info: do-install-info | |
fafb95a6 BRF |
1027 | if [ -f $(srcdir)/texinfo/gen-info-dir ]; then \ |
1028 | $(srcdir)/texinfo/gen-info-dir $(DESTDIR)$(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new; \ | |
1029 | mv -f dir.info.new dir.info; \ | |
1030 | else true; \ | |
95ddd785 NN |
1031 | fi |
1032 | ||
4977bab6 ZW |
1033 | dist: |
1034 | @echo "Building a full distribution of this tree isn't done" | |
1035 | @echo "via 'make dist'. Check out the etc/ subdirectory" | |
1036 | ||
1037 | etags tags: TAGS | |
1038 | ||
1039 | # Right now this just builds TAGS in each subdirectory. emacs19 has the | |
1040 | # ability to use several tags files at once, so there is probably no need | |
1041 | # to combine them into one big TAGS file (like CVS 1.3 does). We could | |
1042 | # (if we felt like it) have this Makefile write a piece of elisp which | |
1043 | # the user could load to tell emacs19 where all the TAGS files we just | |
1044 | # built are. | |
1045 | TAGS: do-TAGS | |
1046 | ||
25b42232 PB |
1047 | # ------------------------------------ |
1048 | # Macros for configure and all targets | |
1049 | # ------------------------------------ | |
1050 | ||
1051 | [+ DEFINE configure +] | |
1052 | .PHONY: configure-[+prefix+][+module+] maybe-configure-[+prefix+][+module+] | |
1053 | maybe-configure-[+prefix+][+module+]: | |
3ff3adad PB |
1054 | @if gcc-bootstrap |
1055 | configure-[+prefix+][+module+]: stage_current | |
1056 | @endif gcc-bootstrap | |
25b42232 PB |
1057 | @if [+prefix+][+module+] |
1058 | maybe-configure-[+prefix+][+module+]: configure-[+prefix+][+module+] | |
3ff3adad | 1059 | configure-[+prefix+][+module+]: [+ IF bootstrap +][+ ELSE +] |
cc11cc9b PB |
1060 | @: $(MAKE); $(unstage)[+ ENDIF bootstrap +] |
1061 | @r=`${PWD_COMMAND}`; export r; \ | |
f41d6665 | 1062 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ |
cc11cc9b PB |
1063 | [+ IF check_multilibs |
1064 | +]echo "Checking multilib configuration for [+module+]..."; \ | |
fafb95a6 BRF |
1065 | $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+]; \ |
1066 | $(CC_FOR_TARGET) --print-multi-lib > [+subdir+]/[+module+]/multilib.tmp 2> /dev/null; \ | |
f41d6665 DJ |
1067 | if test -r [+subdir+]/[+module+]/multilib.out; then \ |
1068 | if cmp -s [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; then \ | |
1069 | rm -f [+subdir+]/[+module+]/multilib.tmp; \ | |
1070 | else \ | |
1071 | rm -f [+subdir+]/[+module+]/Makefile; \ | |
1072 | mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \ | |
1073 | fi; \ | |
1074 | else \ | |
1075 | mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \ | |
cc11cc9b PB |
1076 | fi; \ |
1077 | [+ ENDIF check_multilibs +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \ | |
fafb95a6 | 1078 | $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+]; \ |
f61428ed | 1079 | [+exports+] [+extra_exports+] \ |
25b42232 PB |
1080 | echo Configuring in [+subdir+]/[+module+]; \ |
1081 | cd "[+subdir+]/[+module+]" || exit 1; \ | |
3aa83176 | 1082 | case $(srcdir) in \ |
215c351a | 1083 | /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ |
25b42232 | 1084 | *) topdir=`echo [+subdir+]/[+module+]/ | \ |
215c351a | 1085 | sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ |
3aa83176 | 1086 | esac; \ |
b6383ab8 | 1087 | module_srcdir=[+? module_srcdir (get "module_srcdir") (get "module")+]; \ |
25b42232 | 1088 | [+ IF no-config-site +]rm -f no-such-file || : ; \ |
b6383ab8 TS |
1089 | CONFIG_SITE=no-such-file [+ ENDIF +]$(SHELL) \ |
1090 | $$s/$$module_srcdir/configure \ | |
1091 | --srcdir=$${topdir}/$$module_srcdir \ | |
e69bf64b | 1092 | [+args+] --build=${build_alias} --host=[+host_alias+] \ |
b6383ab8 | 1093 | --target=[+target_alias+] [+extra_configure_flags+] \ |
3aa83176 | 1094 | || exit 1 |
25b42232 | 1095 | @endif [+prefix+][+module+] |
ce406537 PB |
1096 | |
1097 | [+ IF bootstrap +] | |
1098 | [+ FOR bootstrap_stage +] | |
1099 | .PHONY: configure-stage[+id+]-[+prefix+][+module+] maybe-configure-stage[+id+]-[+prefix+][+module+] | |
1100 | maybe-configure-stage[+id+]-[+prefix+][+module+]: | |
f41d6665 | 1101 | @if [+prefix+][+module+]-bootstrap |
ce406537 | 1102 | maybe-configure-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+] |
f41d6665 | 1103 | configure-stage[+id+]-[+prefix+][+module+]: |
cc11cc9b | 1104 | @[ $(current_stage) = stage[+id+] ] || $(MAKE) stage[+id+]-start |
f41d6665 | 1105 | @$(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+] |
cc11cc9b | 1106 | @r=`${PWD_COMMAND}`; export r; \ |
ce406537 | 1107 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ |
4a4a4e99 | 1108 | TFLAGS="$(STAGE[+id+]_TFLAGS)"; \ |
cc11cc9b PB |
1109 | [+ IF check_multilibs |
1110 | +]echo "Checking multilib configuration for [+module+]..."; \ | |
fafb95a6 | 1111 | $(CC_FOR_TARGET) --print-multi-lib > [+subdir+]/[+module+]/multilib.tmp 2> /dev/null; \ |
f41d6665 DJ |
1112 | if test -r [+subdir+]/[+module+]/multilib.out; then \ |
1113 | if cmp -s [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; then \ | |
1114 | rm -f [+subdir+]/[+module+]/multilib.tmp; \ | |
1115 | else \ | |
1116 | rm -f [+subdir+]/[+module+]/Makefile; \ | |
1117 | mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \ | |
1118 | fi; \ | |
1119 | else \ | |
1120 | mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \ | |
cc11cc9b PB |
1121 | fi; \ |
1122 | [+ ENDIF check_multilibs +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \ | |
ce406537 | 1123 | [+exports+][+ IF prev +] \ |
4a4a4e99 AO |
1124 | [+poststage1_exports+][+ ENDIF prev +][+ IF prefix +] \ |
1125 | CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ | |
1126 | CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ | |
1127 | LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS;[+ ELSE prefix +] \ | |
1128 | CFLAGS="$(STAGE[+id+]_CFLAGS)"; export CFLAGS; \ | |
f61428ed | 1129 | CXXFLAGS="$(STAGE[+id+]_CXXFLAGS)"; export CXXFLAGS;[+ IF prev +] \ |
4a4a4e99 | 1130 | LIBCFLAGS="$(STAGE[+id+]_CFLAGS)"[+ ELSE prev +] \ |
f61428ed AO |
1131 | LIBCFLAGS="$(LIBCFLAGS)"[+ ENDIF prev +]; export LIBCFLAGS;[+ |
1132 | ENDIF prefix +] [+extra_exports+] \ | |
fafb95a6 BRF |
1133 | echo Configuring stage [+id+] in [+subdir+]/[+module+]; \ |
1134 | $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+]; \ | |
ce406537 PB |
1135 | cd [+subdir+]/[+module+] || exit 1; \ |
1136 | case $(srcdir) in \ | |
1137 | /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ | |
1138 | *) topdir=`echo [+subdir+]/[+module+]/ | \ | |
1139 | sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ | |
1140 | esac; \ | |
b6383ab8 TS |
1141 | module_srcdir=[+? module_srcdir (get "module_srcdir") (get "module")+]; \ |
1142 | $(SHELL) $$s/$$module_srcdir/configure \ | |
1143 | --srcdir=$${topdir}/$$module_srcdir \ | |
e69bf64b | 1144 | [+args+] --build=${build_alias} --host=[+host_alias+] \ |
b6383ab8 | 1145 | --target=[+target_alias+] \ |
fafb95a6 | 1146 | [+ IF prev +]--with-build-libsubdir=$(HOST_SUBDIR)[+ ENDIF prev +] \ |
4a4a4e99 AO |
1147 | $(STAGE[+id+]_CONFIGURE_FLAGS)[+ IF extra_configure_flags +] \ |
1148 | [+extra_configure_flags+][+ ENDIF extra_configure_flags +] | |
f41d6665 | 1149 | @endif [+prefix+][+module+]-bootstrap |
ce406537 PB |
1150 | [+ ENDFOR bootstrap_stage +] |
1151 | [+ ENDIF bootstrap +] | |
25b42232 PB |
1152 | [+ ENDDEF +] |
1153 | ||
1154 | [+ DEFINE all +] | |
1155 | .PHONY: all-[+prefix+][+module+] maybe-all-[+prefix+][+module+] | |
1156 | maybe-all-[+prefix+][+module+]: | |
3ff3adad PB |
1157 | @if gcc-bootstrap |
1158 | all-[+prefix+][+module+]: stage_current | |
1159 | @endif gcc-bootstrap | |
25b42232 PB |
1160 | @if [+prefix+][+module+] |
1161 | TARGET-[+prefix+][+module+]=[+ | |
e69bf64b | 1162 | IF all_target +][+all_target+][+ ELSE +]all[+ ENDIF all_target +] |
25b42232 | 1163 | maybe-all-[+prefix+][+module+]: all-[+prefix+][+module+] |
3ff3adad | 1164 | all-[+prefix+][+module+]: configure-[+prefix+][+module+][+ IF bootstrap +][+ ELSE +] |
cc11cc9b PB |
1165 | @: $(MAKE); $(unstage)[+ ENDIF bootstrap +] |
1166 | @r=`${PWD_COMMAND}`; export r; \ | |
8c90b13a | 1167 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ |
f61428ed | 1168 | [+exports+] [+extra_exports+] \ |
25b42232 | 1169 | (cd [+subdir+]/[+module+] && \ |
0b21f5d3 | 1170 | $(MAKE) $(BASE_FLAGS_TO_PASS) [+args+] [+stage1_args+] [+extra_make_flags+] \ |
1c8bd6a3 | 1171 | $(TARGET-[+prefix+][+module+])) |
25b42232 | 1172 | @endif [+prefix+][+module+] |
ce406537 PB |
1173 | |
1174 | [+ IF bootstrap +] | |
1175 | [+ FOR bootstrap_stage +] | |
1176 | .PHONY: all-stage[+id+]-[+prefix+][+module+] maybe-all-stage[+id+]-[+prefix+][+module+] | |
1177 | .PHONY: clean-stage[+id+]-[+prefix+][+module+] maybe-clean-stage[+id+]-[+prefix+][+module+] | |
1178 | maybe-all-stage[+id+]-[+prefix+][+module+]: | |
1179 | maybe-clean-stage[+id+]-[+prefix+][+module+]: | |
f41d6665 | 1180 | @if [+prefix+][+module+]-bootstrap |
ce406537 PB |
1181 | maybe-all-stage[+id+]-[+prefix+][+module+]: all-stage[+id+]-[+prefix+][+module+] |
1182 | all-stage[+id+]: all-stage[+id+]-[+prefix+][+module+] | |
1061f99e | 1183 | TARGET-stage[+id+]-[+prefix+][+module+] = $(TARGET-[+prefix+][+module+]) |
ce406537 | 1184 | all-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+] |
cc11cc9b | 1185 | @[ $(current_stage) = stage[+id+] ] || $(MAKE) stage[+id+]-start |
ce406537 PB |
1186 | @r=`${PWD_COMMAND}`; export r; \ |
1187 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
4a4a4e99 | 1188 | TFLAGS="$(STAGE[+id+]_TFLAGS)"; \ |
ce406537 | 1189 | [+exports+][+ IF prev +] \ |
f61428ed | 1190 | [+poststage1_exports+][+ ENDIF prev +] [+extra_exports+] \ |
ce406537 | 1191 | cd [+subdir+]/[+module+] && \ |
277d7ee0 | 1192 | [+autoprofile+] \ |
4a4a4e99 AO |
1193 | $(MAKE) $(BASE_FLAGS_TO_PASS)[+ IF prefix +] \ |
1194 | CFLAGS="$(CFLAGS_FOR_TARGET)" \ | |
1195 | CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \ | |
1196 | LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"[+ ELSE prefix +] \ | |
1197 | CFLAGS="$(STAGE[+id+]_CFLAGS)" \ | |
1c67e69c | 1198 | GENERATOR_CFLAGS="$(STAGE[+id+]_GENERATOR_CFLAGS)" \ |
f61428ed | 1199 | CXXFLAGS="$(STAGE[+id+]_CXXFLAGS)"[+ IF prev +] \ |
4a4a4e99 AO |
1200 | LIBCFLAGS="$(STAGE[+id+]_CFLAGS)"[+ ELSE prev +] \ |
1201 | LIBCFLAGS="$(LIBCFLAGS)"[+ ENDIF prev +][+ ENDIF prefix +] \ | |
1202 | CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ | |
1203 | CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ | |
1204 | LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ | |
0b21f5d3 EB |
1205 | [+args+] [+IF prev +][+poststage1_args+][+ ELSE prev +] \ |
1206 | [+stage1_args+][+ ENDIF prev +] [+extra_make_flags+] \ | |
277d7ee0 | 1207 | TFLAGS="$(STAGE[+id+]_TFLAGS)" [+profile_data+] \ |
1061f99e | 1208 | $(TARGET-stage[+id+]-[+prefix+][+module+]) |
ce406537 PB |
1209 | |
1210 | maybe-clean-stage[+id+]-[+prefix+][+module+]: clean-stage[+id+]-[+prefix+][+module+] | |
1211 | clean-stage[+id+]: clean-stage[+id+]-[+prefix+][+module+] | |
1212 | clean-stage[+id+]-[+prefix+][+module+]: | |
995a5697 PB |
1213 | @if [ $(current_stage) = stage[+id+] ]; then \ |
1214 | [ -f [+subdir+]/[+module+]/Makefile ] || exit 0; \ | |
1215 | else \ | |
1216 | [ -f [+subdir+]/stage[+id+]-[+module+]/Makefile ] || exit 0; \ | |
1217 | $(MAKE) stage[+id+]-start; \ | |
1218 | fi; \ | |
ce406537 | 1219 | cd [+subdir+]/[+module+] && \ |
0b21f5d3 EB |
1220 | $(MAKE) [+args+] [+ IF prev +][+poststage1_args+][+ ELSE prev +] \ |
1221 | [+stage1_args+][+ ENDIF prev +] [+extra_make_flags+] clean | |
f41d6665 | 1222 | @endif [+prefix+][+module+]-bootstrap |
ce406537 PB |
1223 | |
1224 | [+ ENDFOR bootstrap_stage +] | |
1225 | [+ ENDIF bootstrap +] | |
25b42232 PB |
1226 | [+ ENDDEF +] |
1227 | ||
1228 | # -------------------------------------- | |
1229 | # Modules which run on the build machine | |
1230 | # -------------------------------------- | |
1231 | [+ FOR build_modules +] | |
1232 | [+ configure prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)" | |
e69bf64b PB |
1233 | host_alias=(get "host" "${build_alias}") |
1234 | target_alias=(get "target" "${target_alias}") | |
25b42232 PB |
1235 | args="$(BUILD_CONFIGARGS)" no-config-site=true +] |
1236 | ||
f8c33439 JM |
1237 | [+ all prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)" |
1238 | args="$(EXTRA_BUILD_FLAGS)" +] | |
25b42232 | 1239 | [+ ENDFOR build_module +] |
4977bab6 ZW |
1240 | |
1241 | # -------------------------------------- | |
1242 | # Modules which run on the host machine | |
1243 | # -------------------------------------- | |
1244 | [+ FOR host_modules +] | |
ce406537 PB |
1245 | [+ configure prefix="" subdir="$(HOST_SUBDIR)" |
1246 | exports="$(HOST_EXPORTS)" | |
1247 | poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)" | |
e69bf64b PB |
1248 | host_alias=(get "host" "${host_alias}") |
1249 | target_alias=(get "target" "${target_alias}") | |
25b42232 | 1250 | args="$(HOST_CONFIGARGS)" +] |
95ddd785 | 1251 | |
ce406537 PB |
1252 | [+ all prefix="" subdir="$(HOST_SUBDIR)" |
1253 | exports="$(HOST_EXPORTS)" | |
1254 | poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)" | |
1c8bd6a3 | 1255 | args="$(EXTRA_HOST_FLAGS)" |
0b21f5d3 | 1256 | stage1_args="$(STAGE1_FLAGS_TO_PASS)" |
ce406537 | 1257 | poststage1_args="$(POSTSTAGE1_FLAGS_TO_PASS)" +] |
4977bab6 | 1258 | |
7e2dbcef NN |
1259 | .PHONY: check-[+module+] maybe-check-[+module+] |
1260 | maybe-check-[+module+]: | |
60975492 PB |
1261 | @if [+module+] |
1262 | maybe-check-[+module+]: check-[+module+] | |
4977bab6 | 1263 | [+ IF no_check +] |
4977bab6 ZW |
1264 | check-[+module+]: |
1265 | [+ ELIF no_check_cross +] | |
4977bab6 ZW |
1266 | # This module is only tested in a native toolchain. |
1267 | check-[+module+]: | |
f41d6665 | 1268 | @: $(MAKE); $(unstage) |
fafb95a6 | 1269 | @if [ '$(host)' = '$(target)' ]; then \ |
8c90b13a L |
1270 | r=`${PWD_COMMAND}`; export r; \ |
1271 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
77019397 MO |
1272 | $(HOST_EXPORTS) [+ IF bootstrap +]$(EXTRA_HOST_EXPORTS)[+ |
1273 | ENDIF bootstrap +] \ | |
215c351a | 1274 | (cd $(HOST_SUBDIR)/[+module+] && \ |
77019397 MO |
1275 | $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+][+ |
1276 | IF bootstrap +] $(EXTRA_BOOTSTRAP_FLAGS)[+ ENDIF bootstrap +] check) | |
3aa83176 NN |
1277 | fi |
1278 | [+ ELSE check +] | |
3aa83176 | 1279 | check-[+module+]: |
f41d6665 | 1280 | @: $(MAKE); $(unstage) |
8c90b13a L |
1281 | @r=`${PWD_COMMAND}`; export r; \ |
1282 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
77019397 MO |
1283 | $(HOST_EXPORTS) [+ IF bootstrap +]$(EXTRA_HOST_EXPORTS)[+ |
1284 | ENDIF bootstrap +] \ | |
215c351a | 1285 | (cd $(HOST_SUBDIR)/[+module+] && \ |
77019397 MO |
1286 | $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+][+ |
1287 | IF bootstrap +] $(EXTRA_BOOTSTRAP_FLAGS)[+ ENDIF bootstrap +] check) | |
4977bab6 | 1288 | [+ ENDIF no_check +] |
60975492 | 1289 | @endif [+module+] |
4977bab6 | 1290 | |
4977bab6 ZW |
1291 | .PHONY: install-[+module+] maybe-install-[+module+] |
1292 | maybe-install-[+module+]: | |
60975492 PB |
1293 | @if [+module+] |
1294 | maybe-install-[+module+]: install-[+module+] | |
7e2dbcef | 1295 | [+ IF no_install +] |
4977bab6 ZW |
1296 | install-[+module+]: |
1297 | [+ ELSE install +] | |
4977bab6 | 1298 | install-[+module+]: installdirs |
f41d6665 | 1299 | @: $(MAKE); $(unstage) |
8c90b13a L |
1300 | @r=`${PWD_COMMAND}`; export r; \ |
1301 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
4fc4dd12 | 1302 | $(HOST_EXPORTS) \ |
215c351a | 1303 | (cd $(HOST_SUBDIR)/[+module+] && \ |
ace9ac7b | 1304 | $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] install) |
4977bab6 | 1305 | [+ ENDIF no_install +] |
60975492 | 1306 | @endif [+module+] |
295f4e42 | 1307 | |
455c8f48 RW |
1308 | .PHONY: install-strip-[+module+] maybe-install-strip-[+module+] |
1309 | maybe-install-strip-[+module+]: | |
1310 | @if [+module+] | |
1311 | maybe-install-strip-[+module+]: install-strip-[+module+] | |
1312 | [+ IF no_install +] | |
1313 | install-strip-[+module+]: | |
1314 | [+ ELSE install +] | |
1315 | install-strip-[+module+]: installdirs | |
1316 | @: $(MAKE); $(unstage) | |
1317 | @r=`${PWD_COMMAND}`; export r; \ | |
1318 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
1319 | $(HOST_EXPORTS) \ | |
1320 | (cd $(HOST_SUBDIR)/[+module+] && \ | |
1321 | $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] install-strip) | |
1322 | [+ ENDIF no_install +] | |
1323 | @endif [+module+] | |
1324 | ||
b5422ad7 | 1325 | # Other targets (info, dvi, pdf, etc.) |
295f4e42 NN |
1326 | [+ FOR recursive_targets +] |
1327 | .PHONY: maybe-[+make_target+]-[+module+] [+make_target+]-[+module+] | |
1328 | maybe-[+make_target+]-[+module+]: | |
60975492 PB |
1329 | @if [+module+] |
1330 | maybe-[+make_target+]-[+module+]: [+make_target+]-[+module+] | |
295f4e42 NN |
1331 | [+ IF (match-value? = "missing" (get "make_target") ) +] |
1332 | # [+module+] doesn't support [+make_target+]. | |
1333 | [+make_target+]-[+module+]: | |
1334 | [+ ELSE +] | |
1335 | [+make_target+]-[+module+]: [+ | |
1336 | FOR depend +]\ | |
1337 | [+depend+]-[+module+] [+ | |
1338 | ENDFOR depend +] | |
f41d6665 | 1339 | @[+ IF bootstrap +][+ ELSE +]: $(MAKE); $(unstage) |
1061f99e | 1340 | @[+ ENDIF bootstrap +][ -f ./[+module+]/Makefile ] || exit 0; \ |
295f4e42 NN |
1341 | r=`${PWD_COMMAND}`; export r; \ |
1342 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
4fc4dd12 | 1343 | $(HOST_EXPORTS) \ |
d32ab992 | 1344 | for flag in $(EXTRA_HOST_FLAGS) [+extra_make_flags+]; do \ |
295f4e42 NN |
1345 | eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ |
1346 | done; \ | |
fafb95a6 | 1347 | echo "Doing [+make_target+] in [+module+]"; \ |
215c351a | 1348 | (cd $(HOST_SUBDIR)/[+module+] && \ |
295f4e42 NN |
1349 | $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ |
1350 | "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ | |
1351 | "RANLIB=$${RANLIB}" \ | |
901119ae | 1352 | "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ |
d32ab992 | 1353 | [+make_target+]) \ |
295f4e42 NN |
1354 | || exit 1 |
1355 | [+ ENDIF +] | |
60975492 | 1356 | @endif [+module+] |
295f4e42 | 1357 | [+ ENDFOR recursive_targets +] |
4977bab6 ZW |
1358 | [+ ENDFOR host_modules +] |
1359 | ||
1360 | # --------------------------------------- | |
1361 | # Modules which run on the target machine | |
1362 | # --------------------------------------- | |
1363 | [+ FOR target_modules +] | |
4977bab6 | 1364 | |
25b42232 PB |
1365 | [+ IF raw_cxx +] |
1366 | [+ configure prefix="target-" subdir="$(TARGET_SUBDIR)" | |
f41d6665 | 1367 | check_multilibs=true |
25b42232 | 1368 | exports="$(RAW_CXX_TARGET_EXPORTS)" |
e69bf64b PB |
1369 | host_alias=(get "host" "${target_alias}") |
1370 | target_alias=(get "target" "${target_alias}") | |
25b42232 PB |
1371 | args="$(TARGET_CONFIGARGS)" no-config-site=true +] |
1372 | ||
1373 | [+ all prefix="target-" subdir="$(TARGET_SUBDIR)" | |
1374 | exports="$(RAW_CXX_TARGET_EXPORTS)" | |
1c8bd6a3 | 1375 | args="$(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'" +] |
25b42232 PB |
1376 | [+ ELSE +] |
1377 | [+ configure prefix="target-" subdir="$(TARGET_SUBDIR)" | |
f41d6665 | 1378 | check_multilibs=true |
25b42232 | 1379 | exports="$(NORMAL_TARGET_EXPORTS)" |
e69bf64b PB |
1380 | host_alias=(get "host" "${target_alias}") |
1381 | target_alias=(get "target" "${target_alias}") | |
25b42232 PB |
1382 | args="$(TARGET_CONFIGARGS)" no-config-site=true +] |
1383 | ||
1384 | [+ all prefix="target-" subdir="$(TARGET_SUBDIR)" | |
1385 | exports="$(NORMAL_TARGET_EXPORTS)" | |
1c8bd6a3 | 1386 | args="$(EXTRA_TARGET_FLAGS)" +] |
25b42232 | 1387 | [+ ENDIF +] |
7e2dbcef NN |
1388 | |
1389 | .PHONY: check-target-[+module+] maybe-check-target-[+module+] | |
1390 | maybe-check-target-[+module+]: | |
60975492 PB |
1391 | @if target-[+module+] |
1392 | maybe-check-target-[+module+]: check-target-[+module+] | |
4977bab6 ZW |
1393 | [+ IF no_check +] |
1394 | # Dummy target for uncheckable module. | |
4977bab6 ZW |
1395 | check-target-[+module+]: |
1396 | [+ ELSE check +] | |
4977bab6 | 1397 | check-target-[+module+]: |
f41d6665 | 1398 | @: $(MAKE); $(unstage) |
8c90b13a | 1399 | @r=`${PWD_COMMAND}`; export r; \ |
0bff65e7 | 1400 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+ |
4fc4dd12 DJ |
1401 | IF raw_cxx +] |
1402 | $(RAW_CXX_TARGET_EXPORTS) \[+ | |
1403 | ELSE normal_cxx +] | |
1404 | $(NORMAL_TARGET_EXPORTS) \[+ | |
1405 | ENDIF raw_cxx +] | |
3aa83176 NN |
1406 | (cd $(TARGET_SUBDIR)/[+module+] && \ |
1407 | $(MAKE) $(TARGET_FLAGS_TO_PASS) [+ | |
1408 | IF raw_cxx | |
1409 | +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ | |
1410 | ENDIF raw_cxx | |
a52a0a7f | 1411 | +] [+extra_make_flags+] check) |
4977bab6 | 1412 | [+ ENDIF no_check +] |
60975492 | 1413 | @endif target-[+module+] |
7e2dbcef | 1414 | |
4977bab6 ZW |
1415 | .PHONY: install-target-[+module+] maybe-install-target-[+module+] |
1416 | maybe-install-target-[+module+]: | |
60975492 PB |
1417 | @if target-[+module+] |
1418 | maybe-install-target-[+module+]: install-target-[+module+] | |
7e2dbcef | 1419 | [+ IF no_install +] |
4977bab6 ZW |
1420 | # Dummy target for uninstallable. |
1421 | install-target-[+module+]: | |
1422 | [+ ELSE install +] | |
4977bab6 | 1423 | install-target-[+module+]: installdirs |
f41d6665 | 1424 | @: $(MAKE); $(unstage) |
8c90b13a | 1425 | @r=`${PWD_COMMAND}`; export r; \ |
0bff65e7 | 1426 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+ |
4fc4dd12 DJ |
1427 | IF raw_cxx +] |
1428 | $(RAW_CXX_TARGET_EXPORTS) \[+ | |
1429 | ELSE normal_cxx +] | |
1430 | $(NORMAL_TARGET_EXPORTS) \[+ | |
1431 | ENDIF raw_cxx +] | |
3aa83176 | 1432 | (cd $(TARGET_SUBDIR)/[+module+] && \ |
a52a0a7f | 1433 | $(MAKE) $(TARGET_FLAGS_TO_PASS) [+extra_make_flags+] install) |
4977bab6 | 1434 | [+ ENDIF no_install +] |
60975492 | 1435 | @endif target-[+module+] |
295f4e42 | 1436 | |
455c8f48 RW |
1437 | .PHONY: install-strip-target-[+module+] maybe-install-strip-target-[+module+] |
1438 | maybe-install-strip-target-[+module+]: | |
1439 | @if target-[+module+] | |
1440 | maybe-install-strip-target-[+module+]: install-strip-target-[+module+] | |
1441 | [+ IF no_install +] | |
1442 | # Dummy target for uninstallable. | |
1443 | install-strip-target-[+module+]: | |
1444 | [+ ELSE install +] | |
1445 | install-strip-target-[+module+]: installdirs | |
1446 | @: $(MAKE); $(unstage) | |
1447 | @r=`${PWD_COMMAND}`; export r; \ | |
1448 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+ | |
1449 | IF raw_cxx +] | |
1450 | $(RAW_CXX_TARGET_EXPORTS) \[+ | |
1451 | ELSE normal_cxx +] | |
1452 | $(NORMAL_TARGET_EXPORTS) \[+ | |
1453 | ENDIF raw_cxx +] | |
1454 | (cd $(TARGET_SUBDIR)/[+module+] && \ | |
1455 | $(MAKE) $(TARGET_FLAGS_TO_PASS) [+extra_make_flags+] install-strip) | |
1456 | [+ ENDIF no_install +] | |
1457 | @endif target-[+module+] | |
1458 | ||
b5422ad7 | 1459 | # Other targets (info, dvi, pdf, etc.) |
295f4e42 NN |
1460 | [+ FOR recursive_targets +] |
1461 | .PHONY: maybe-[+make_target+]-target-[+module+] [+make_target+]-target-[+module+] | |
1462 | maybe-[+make_target+]-target-[+module+]: | |
60975492 PB |
1463 | @if target-[+module+] |
1464 | maybe-[+make_target+]-target-[+module+]: [+make_target+]-target-[+module+] | |
295f4e42 NN |
1465 | [+ IF (match-value? = "missing" (get "make_target") ) +] |
1466 | # [+module+] doesn't support [+make_target+]. | |
1467 | [+make_target+]-target-[+module+]: | |
1468 | [+ ELSE +] | |
1469 | [+make_target+]-target-[+module+]: [+ | |
1470 | FOR depend +]\ | |
1471 | [+depend+]-target-[+module+] [+ | |
1472 | ENDFOR depend +] | |
f41d6665 | 1473 | @: $(MAKE); $(unstage) |
fafb95a6 | 1474 | @[ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] || exit 0; \ |
295f4e42 | 1475 | r=`${PWD_COMMAND}`; export r; \ |
0bff65e7 | 1476 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+ |
4fc4dd12 DJ |
1477 | IF raw_cxx +] |
1478 | $(RAW_CXX_TARGET_EXPORTS) \[+ | |
1479 | ELSE normal_cxx +] | |
1480 | $(NORMAL_TARGET_EXPORTS) \[+ | |
1481 | ENDIF raw_cxx +] | |
fafb95a6 | 1482 | echo "Doing [+make_target+] in $(TARGET_SUBDIR)/[+module+]"; \ |
295f4e42 NN |
1483 | for flag in $(EXTRA_TARGET_FLAGS); do \ |
1484 | eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ | |
1485 | done; \ | |
1486 | (cd $(TARGET_SUBDIR)/[+module+] && \ | |
1487 | $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ | |
1488 | "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ | |
1489 | "RANLIB=$${RANLIB}" \ | |
901119ae | 1490 | "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ |
a52a0a7f | 1491 | [+extra_make_flags+] [+make_target+]) \ |
295f4e42 NN |
1492 | || exit 1 |
1493 | [+ ENDIF +] | |
60975492 | 1494 | @endif target-[+module+] |
295f4e42 | 1495 | [+ ENDFOR recursive_targets +] |
4977bab6 | 1496 | [+ ENDFOR target_modules +] |
95ddd785 | 1497 | |
056d8580 JM |
1498 | @if target-libgomp |
1499 | .PHONY: check-target-libgomp-c++ | |
1500 | check-target-libgomp-c++: | |
1501 | $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) c++.exp" check-target-libgomp | |
1502 | ||
9e03592e EB |
1503 | .PHONY: check-target-libgomp-fortran |
1504 | check-target-libgomp-fortran: | |
1505 | $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) fortran.exp" check-target-libgomp | |
1506 | ||
056d8580 JM |
1507 | @endif target-libgomp |
1508 | ||
1509 | @if target-libitm | |
1510 | .PHONY: check-target-libitm-c++ | |
1511 | check-target-libitm-c++: | |
1512 | $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) c++.exp" check-target-libitm | |
1513 | ||
1514 | @endif target-libitm | |
1515 | ||
4977bab6 ZW |
1516 | # ---------- |
1517 | # GCC module | |
1518 | # ---------- | |
95ddd785 | 1519 | |
f516a7da | 1520 | @if gcc-no-bootstrap |
95ddd785 | 1521 | .PHONY: cross |
7c27e184 | 1522 | cross: all-build all-gas all-ld |
8c90b13a L |
1523 | @r=`${PWD_COMMAND}`; export r; \ |
1524 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
a52a0a7f | 1525 | $(HOST_EXPORTS) \ |
95ddd785 NN |
1526 | echo "Building the C and C++ compiler"; \ |
1527 | cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" | |
8c90b13a | 1528 | @r=`${PWD_COMMAND}`; export r; \ |
fafb95a6 | 1529 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ |
95ddd785 | 1530 | echo "Building runtime libraries"; \ |
ad6717df | 1531 | $(MAKE) $(RECURSE_FLAGS_TO_PASS) LANGUAGES="c c++" all |
f516a7da | 1532 | @endif gcc-no-bootstrap |
95ddd785 | 1533 | |
60975492 | 1534 | @if gcc |
60911f14 SE |
1535 | [+ FOR languages +] |
1536 | .PHONY: check-gcc-[+language+] check-[+language+] | |
1537 | check-gcc-[+language+]: | |
1538 | r=`${PWD_COMMAND}`; export r; \ | |
1539 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
1540 | $(HOST_EXPORTS) \ | |
1541 | (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) [+gcc-check-target+]); | |
1ec601bf | 1542 | check-[+language+]: check-gcc-[+language+][+ FOR lib-check-target +] [+ lib-check-target +][+ ENDFOR lib-check-target +] |
60911f14 | 1543 | [+ ENDFOR languages +] |
95ddd785 | 1544 | |
8294b6fe OH |
1545 | # The gcc part of install-no-fixedincludes, which relies on an intimate |
1546 | # knowledge of how a number of gcc internal targets (inter)operate. Delegate. | |
1547 | .PHONY: gcc-install-no-fixedincludes | |
1548 | gcc-install-no-fixedincludes: | |
4977bab6 | 1549 | @if [ -f ./gcc/Makefile ]; then \ |
8c90b13a | 1550 | r=`${PWD_COMMAND}`; export r; \ |
8294b6fe | 1551 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ |
a52a0a7f | 1552 | $(HOST_EXPORTS) \ |
8294b6fe OH |
1553 | (cd ./gcc \ |
1554 | && $(MAKE) $(GCC_FLAGS_TO_PASS) install-no-fixedincludes); \ | |
4977bab6 | 1555 | else true; fi |
60975492 | 1556 | @endif gcc |
295f4e42 | 1557 | |
2805b53a NN |
1558 | # --------------------- |
1559 | # GCC bootstrap support | |
1560 | # --------------------- | |
1561 | ||
d32ab992 PB |
1562 | # We track the current stage (the one in 'gcc') in the stage_current file. |
1563 | # stage_last instead tracks the stage that was built last. These targets | |
1564 | # are dummy when toplevel bootstrap is not active. | |
1565 | ||
1061f99e | 1566 | # While making host and target tools, symlinks to the final stage must be |
f41d6665 DJ |
1567 | # there, so $(unstage) should be run at various points. To avoid excessive |
1568 | # recursive invocations of make, we "inline" them using a variable. These | |
1569 | # must be referenced as ": $(MAKE) ; $(unstage)" rather than "$(unstage)" | |
1570 | # to avoid warnings from the GNU Make job server. | |
1061f99e PB |
1571 | |
1572 | unstage = : | |
1573 | stage = : | |
cc11cc9b | 1574 | current_stage = "" |
1061f99e | 1575 | |
d32ab992 | 1576 | @if gcc-bootstrap |
9bd6112c | 1577 | unstage = if [ -f stage_last ]; then [ -f stage_current ] || $(MAKE) `cat stage_last`-start || exit 1; else :; fi |
d19bca38 | 1578 | stage = if [ -f stage_current ]; then $(MAKE) `cat stage_current`-end || exit 1; else :; fi |
cc11cc9b | 1579 | current_stage = "`cat stage_current 2> /dev/null`" |
d32ab992 PB |
1580 | @endif gcc-bootstrap |
1581 | ||
1061f99e PB |
1582 | .PHONY: unstage stage |
1583 | unstage: | |
f41d6665 | 1584 | @: $(MAKE); $(unstage) |
d32ab992 | 1585 | stage: |
f41d6665 | 1586 | @: $(MAKE); $(stage) |
d32ab992 | 1587 | |
2d309510 PB |
1588 | # Disable commands for lean bootstrap. |
1589 | LEAN = false | |
1590 | ||
148907ea PB |
1591 | # We name the build directories for the various stages "stage1-gcc", |
1592 | # "stage2-gcc","stage3-gcc", etc. | |
1593 | ||
1594 | # Since the 'compare' process will fail (on debugging information) if any | |
1595 | # directory names are different, we need to link the gcc directory for | |
f41d6665 | 1596 | # the previous stage to a constant name ('prev-gcc'), and to make the name of |
148907ea PB |
1597 | # the build directories constant as well. For the latter, we use naked names |
1598 | # like 'gcc', because the scripts in that directory assume it. We use | |
1599 | # mv on platforms where symlinks to directories do not work or are not | |
1600 | # reliable. | |
1601 | ||
2805b53a NN |
1602 | # 'touch' doesn't work right on some platforms. |
1603 | STAMP = echo timestamp > | |
1604 | ||
148907ea PB |
1605 | # We only want to compare .o files, so set this! |
1606 | objext = .o | |
2805b53a | 1607 | |
148907ea | 1608 | [+ FOR bootstrap-stage +] |
f516a7da | 1609 | .PHONY: stage[+id+]-start stage[+id+]-end |
148907ea | 1610 | |
ad6717df | 1611 | stage[+id+]-start:: |
f41d6665 | 1612 | @: $(MAKE); $(stage); \ |
fafb95a6 | 1613 | echo stage[+id+] > stage_current; \ |
215c351a | 1614 | echo stage[+id+] > stage_last; \ |
f41d6665 | 1615 | $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)[+ |
215c351a | 1616 | FOR host_modules +][+ IF bootstrap +] |
7c27e184 | 1617 | @if [+ module +] |
215c351a PB |
1618 | @cd $(HOST_SUBDIR); [ -d stage[+id+]-[+module+] ] || \ |
1619 | mkdir stage[+id+]-[+module+]; \ | |
fafb95a6 | 1620 | mv stage[+id+]-[+module+] [+module+][+ IF prev +]; \ |
2d309510 | 1621 | mv stage[+prev+]-[+module+] prev-[+module+] || test -f stage[+prev+]-lean [+ ENDIF prev +] |
f41d6665 DJ |
1622 | @endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +] |
1623 | @[ -d stage[+id+]-$(TARGET_SUBDIR) ] || \ | |
1624 | mkdir stage[+id+]-$(TARGET_SUBDIR); \ | |
fafb95a6 | 1625 | mv stage[+id+]-$(TARGET_SUBDIR) $(TARGET_SUBDIR)[+ IF prev +]; \ |
2d309510 | 1626 | mv stage[+prev+]-$(TARGET_SUBDIR) prev-$(TARGET_SUBDIR) || test -f stage[+prev+]-lean [+ ENDIF prev +] |
148907ea | 1627 | |
2d309510 | 1628 | stage[+id+]-end:: [+ FOR host_modules +][+ IF bootstrap +] |
7c27e184 | 1629 | @if [+ module +] |
fafb95a6 BRF |
1630 | @if test -d $(HOST_SUBDIR)/[+module+]; then \ |
1631 | cd $(HOST_SUBDIR); mv [+module+] stage[+id+]-[+module+][+ IF prev +]; \ | |
1632 | mv prev-[+module+] stage[+prev+]-[+module+]; : [+ ENDIF prev +]; \ | |
f41d6665 DJ |
1633 | fi |
1634 | @endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +] | |
fafb95a6 BRF |
1635 | @if test -d $(TARGET_SUBDIR); then \ |
1636 | mv $(TARGET_SUBDIR) stage[+id+]-$(TARGET_SUBDIR)[+ IF prev +]; \ | |
1637 | mv prev-$(TARGET_SUBDIR) stage[+prev+]-$(TARGET_SUBDIR); : [+ ENDIF prev +]; \ | |
f41d6665 | 1638 | fi |
2d309510 | 1639 | rm -f stage_current |
148907ea | 1640 | |
8024d75e | 1641 | # Bubble a bug fix through all the stages up to stage [+id+]. They are |
f41d6665 | 1642 | # remade, but not reconfigured. The next stage (if any) will not be |
cdce5c41 | 1643 | # reconfigured either. |
f516a7da | 1644 | .PHONY: stage[+id+]-bubble |
2d309510 | 1645 | stage[+id+]-bubble:: [+ IF prev +]stage[+prev+]-bubble[+ ENDIF +] |
e7c84bf8 PB |
1646 | @r=`${PWD_COMMAND}`; export r; \ |
1647 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
1648 | if test -f stage[+id+]-lean [+ | |
fafb95a6 BRF |
1649 | IF prev +]|| test -f stage[+prev+]-lean [+ ENDIF prev +]; then \ |
1650 | echo Skipping rebuild of stage[+id+]; \ | |
ce521a9c | 1651 | else \ |
2d309510 PB |
1652 | $(MAKE) stage[+id+]-start; \[+IF lean +] |
1653 | if $(LEAN); then \ | |
fafb95a6 BRF |
1654 | rm -rf stage[+lean+]-*; \ |
1655 | $(STAMP) stage[+lean+]-lean; \ | |
2d309510 | 1656 | fi; \[+ ENDIF lean +] |
1061f99e | 1657 | $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage[+id+]; \ |
2abefe3d | 1658 | fi[+ IF compare-target +] |
d19bca38 | 1659 | $(MAKE) $(RECURSE_FLAGS_TO_PASS) [+compare-target+][+ ENDIF compare-target +] |
7c27e184 | 1660 | |
45f366ab | 1661 | .PHONY: all-stage[+id+] clean-stage[+id+] |
45f366ab | 1662 | do-clean: clean-stage[+id+] |
2805b53a | 1663 | |
7c27e184 PB |
1664 | # FIXME: Will not need to be conditional when toplevel bootstrap is the |
1665 | # only possibility, but now it conflicts with no-bootstrap rules | |
1666 | @if gcc-bootstrap | |
148907ea | 1667 | [+ IF compare-target +] |
ce521a9c | 1668 | [+compare-target+]: |
e7c84bf8 PB |
1669 | @r=`${PWD_COMMAND}`; export r; \ |
1670 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
1671 | if test -f stage[+prev+]-lean; then \ | |
fafb95a6 BRF |
1672 | echo Cannot compare object files as stage [+prev+] was deleted.; \ |
1673 | exit 0; \ | |
ce521a9c | 1674 | fi; \ |
f41d6665 | 1675 | : $(MAKE); $(stage); \ |
fafb95a6 BRF |
1676 | rm -f .bad_compare; \ |
1677 | echo Comparing stages [+prev+] and [+id+]; \ | |
70cb2d9f AO |
1678 | sed=`echo stage[+id+] | sed 's,^stage,,;s,.,.,g'`; \ |
1679 | files=`find stage[+id+]-* -name "*$(objext)" -print | \ | |
fafb95a6 | 1680 | sed -n s,^stage$$sed-,,p`; \ |
5fe6af6d | 1681 | for file in $${files} ${extra-compare}; do \ |
70cb2d9f AO |
1682 | f1=$$r/stage[+prev+]-$$file; f2=$$r/stage[+id+]-$$file; \ |
1683 | if test ! -f $$f1; then continue; fi; \ | |
bb286d71 | 1684 | $(do-[+compare-target+]) > /dev/null 2>&1; \ |
1061f99e PB |
1685 | if test $$? -eq 1; then \ |
1686 | case $$file in \ | |
f2689b09 | 1687 | @compare_exclusions@) \ |
1061f99e PB |
1688 | echo warning: $$file differs ;; \ |
1689 | *) \ | |
1690 | echo $$file differs >> .bad_compare ;; \ | |
fafb95a6 BRF |
1691 | esac; \ |
1692 | fi; \ | |
1693 | done; \ | |
2805b53a NN |
1694 | if [ -f .bad_compare ]; then \ |
1695 | echo "Bootstrap comparison failure!"; \ | |
1696 | cat .bad_compare; \ | |
1697 | exit 1; \ | |
1698 | else \ | |
cc11cc9b | 1699 | echo Comparison successful.; \ |
fafb95a6 | 1700 | fi; \ |
ce521a9c | 1701 | $(STAMP) [+compare-target+][+ IF prev +] |
2d309510 PB |
1702 | if $(LEAN); then \ |
1703 | rm -rf stage[+prev+]-*; \ | |
1704 | $(STAMP) stage[+prev+]-lean; \ | |
1705 | fi[+ ENDIF prev +] | |
148907ea PB |
1706 | [+ ENDIF compare-target +] |
1707 | ||
1708 | [+ IF bootstrap-target +] | |
2d309510 | 1709 | .PHONY: [+bootstrap-target+] [+bootstrap-target+]-lean |
2abefe3d PB |
1710 | [+bootstrap-target+]: |
1711 | echo stage[+id+] > stage_final | |
1712 | @r=`${PWD_COMMAND}`; export r; \ | |
1713 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
1714 | $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage[+id+]-bubble | |
f41d6665 | 1715 | @: $(MAKE); $(unstage) |
2abefe3d PB |
1716 | @r=`${PWD_COMMAND}`; export r; \ |
1717 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
4a4a4e99 | 1718 | TFLAGS="$(STAGE[+id+]_TFLAGS)"; \ |
2abefe3d | 1719 | $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target |
2d309510 PB |
1720 | |
1721 | [+bootstrap-target+]-lean: | |
1722 | echo stage[+id+] > stage_final | |
1723 | @r=`${PWD_COMMAND}`; export r; \ | |
1724 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
1725 | $(MAKE) $(RECURSE_FLAGS_TO_PASS) LEAN=: stage[+id+]-bubble | |
1726 | @: $(MAKE); $(unstage) | |
1727 | @r=`${PWD_COMMAND}`; export r; \ | |
1728 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
4a4a4e99 | 1729 | TFLAGS="$(STAGE[+id+]_TFLAGS)"; \ |
2d309510 | 1730 | $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target |
148907ea PB |
1731 | [+ ENDIF bootstrap-target +] |
1732 | ||
45f366ab | 1733 | # Rules to wipe a stage and all the following ones, also used for cleanstrap |
ad6717df | 1734 | [+ IF prev +]distclean-stage[+prev+]:: distclean-stage[+id+] [+ ENDIF prev +] |
45f366ab | 1735 | .PHONY: distclean-stage[+id+] |
ad6717df | 1736 | distclean-stage[+id+]:: |
f41d6665 | 1737 | @: $(MAKE); $(stage) |
a19e8f64 | 1738 | @test "`cat stage_last`" != stage[+id+] || rm -f stage_last |
ce521a9c | 1739 | rm -rf stage[+id+]-* [+ |
148907ea | 1740 | IF compare-target +][+compare-target+] [+ ENDIF compare-target +] |
148907ea PB |
1741 | |
1742 | [+ IF cleanstrap-target +] | |
1743 | .PHONY: [+cleanstrap-target+] | |
a19e8f64 PB |
1744 | [+cleanstrap-target+]: do-distclean local-clean |
1745 | echo stage[+id+] > stage_final | |
1746 | @r=`${PWD_COMMAND}`; export r; \ | |
1747 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
1748 | $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage[+id+]-bubble | |
1749 | @: $(MAKE); $(unstage) | |
1750 | @r=`${PWD_COMMAND}`; export r; \ | |
1751 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
4a4a4e99 | 1752 | TFLAGS="$(STAGE[+id+]_TFLAGS)"; \ |
a19e8f64 | 1753 | $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target |
148907ea | 1754 | [+ ENDIF cleanstrap-target +] |
7c27e184 | 1755 | @endif gcc-bootstrap |
148907ea PB |
1756 | |
1757 | [+ ENDFOR bootstrap-stage +] | |
ad6717df | 1758 | |
c7870f5d PB |
1759 | stageprofile-end:: |
1760 | $(MAKE) distclean-stagefeedback | |
ad6717df | 1761 | |
c7870f5d | 1762 | stagefeedback-start:: |
ad6717df PB |
1763 | @r=`${PWD_COMMAND}`; export r; \ |
1764 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
684f6008 ML |
1765 | for i in prev-*; do \ |
1766 | j=`echo $$i | sed s/^prev-//`; \ | |
c7870f5d | 1767 | cd $$r/$$i && \ |
fafb95a6 BRF |
1768 | { find . -type d | sort | sed 's,.*,$(SHELL) '"$$s"'/mkinstalldirs "../'$$j'/&",' | $(SHELL); } && \ |
1769 | { find . -name '*.*da' | sed 's,.*,$(LN) -f "&" "../'$$j'/&",' | $(SHELL); }; \ | |
c7870f5d | 1770 | done |
03a91701 | 1771 | |
45f366ab | 1772 | @if gcc-bootstrap |
45f366ab | 1773 | do-distclean: distclean-stage1 |
cc11cc9b PB |
1774 | |
1775 | # Provide a GCC build when we're building target libraries. This does | |
1776 | # not work as a dependency, just as the minimum necessary to avoid errors. | |
1777 | stage_last: | |
ee04b574 AS |
1778 | @r=`${PWD_COMMAND}`; export r; \ |
1779 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
cc11cc9b | 1780 | $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage1-bubble |
45f366ab | 1781 | |
3ff3adad PB |
1782 | # Same as unstage, but not phony and defaulting to stage1-start. We place |
1783 | # it in the dependency so that for example `make -j3 all-gcc' works. | |
1784 | stage_current: | |
1785 | @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi | |
1786 | ||
cc11cc9b | 1787 | .PHONY: restrap |
c6b196de | 1788 | restrap:: |
cc11cc9b | 1789 | @: $(MAKE); $(stage) |
4a4a4e99 AO |
1790 | rm -rf stage1-$(TARGET_SUBDIR)[+ FOR bootstrap-stage +][+ IF prev |
1791 | +] stage[+id+]-*[+ ENDIF prev +][+ ENDFOR bootstrap-stage +] | |
c6b196de | 1792 | restrap:: all |
e9a54b07 | 1793 | @endif gcc-bootstrap |
cc11cc9b | 1794 | |
4977bab6 ZW |
1795 | # -------------------------------------- |
1796 | # Dependencies between different modules | |
1797 | # -------------------------------------- | |
1798 | ||
3589b69e | 1799 | # Generic dependencies for target modules on host stuff, especially gcc |
cc11cc9b PB |
1800 | @if gcc-bootstrap[+ FOR target_modules +][+ IF bootstrap |
1801 | +][+ FOR bootstrap_stage +] | |
1802 | configure-stage[+id+]-target-[+module+]: maybe-all-stage[+id+]-gcc[+ | |
1803 | ENDFOR +][+ ELSE bootstrap +] | |
1804 | configure-target-[+module+]: stage_last[+ | |
1805 | ENDIF bootstrap +][+ ENDFOR target_modules +] | |
1806 | @endif gcc-bootstrap | |
1807 | ||
fa958513 | 1808 | @if gcc-no-bootstrap[+ FOR target_modules +] |
cc11cc9b | 1809 | configure-target-[+module+]: maybe-all-gcc[+ |
fa958513 | 1810 | ENDFOR target_modules +] |
cc11cc9b PB |
1811 | @endif gcc-no-bootstrap |
1812 | ||
3589b69e | 1813 | |
4977bab6 ZW |
1814 | # There are two types of dependencies here: 'hard' dependencies, where one |
1815 | # module simply won't build without the other; and 'soft' dependencies, where | |
1816 | # if the depended-on module is missing, the depending module will do without | |
1817 | # or find a substitute somewhere (perhaps installed). Soft dependencies | |
3589b69e | 1818 | # are made here to depend on a 'maybe-' target. If you're not sure, |
4977bab6 ZW |
1819 | # it's safer to use a soft dependency. |
1820 | ||
3589b69e PB |
1821 | [+ ;; These Scheme functions build the bulk of the dependencies. |
1822 | ;; dep-target builds a string like "maybe-all-MODULE_KIND-gcc", | |
cdce5c41 | 1823 | ;; where "maybe-" is only included if HARD is not true, and all-gcc |
3589b69e PB |
1824 | ;; is taken from VAR-NAME. |
1825 | (define dep-target (lambda (module-kind var-name hard) | |
1826 | (string-append | |
1827 | (if hard "" "maybe-") | |
1828 | (dep-subtarget var-name) | |
1829 | module-kind | |
1830 | (dep-module var-name) | |
1831 | ))) | |
1832 | ||
1833 | ;; make-dep builds a dependency from the MODULE and ON AutoGen vars. | |
7c27e184 | 1834 | (define make-dep (lambda (module-kind on-kind) |
3589b69e PB |
1835 | (string-append |
1836 | (dep-target module-kind "module" #t) ": " | |
7c27e184 | 1837 | (dep-target on-kind "on" (exist? "hard"))))) |
3589b69e PB |
1838 | |
1839 | ;; dep-subtarget extracts everything up to the first dash in the given | |
1840 | ;; AutoGen variable, for example it extracts "all-" out of "all-gcc". | |
1841 | (define dep-subtarget (lambda (var-name) | |
1842 | (substring (get var-name) 0 (+ 1 (string-index (get var-name) #\-))))) | |
1843 | ||
1844 | ;; dep-module extracts everything up to the first dash in the given | |
1845 | ;; AutoGen variable, for example it extracts "gcc" out of "all-gcc". | |
1846 | (define dep-module (lambda (var-name) | |
1847 | (substring (get var-name) (+ 1 (string-index (get var-name) #\-))))) | |
1848 | ||
1849 | ;; dep-stage builds a string for the prefix of a bootstrap stage. | |
1850 | (define dep-stage (lambda () | |
1851 | (string-append | |
1852 | "stage" | |
1853 | (get "id") | |
1854 | "-"))) | |
1855 | ||
1856 | ;; dep-maybe is the same as the AutoGen expression "- hard 'maybe-'" | |
1857 | ;; but is written in Scheme. | |
1858 | (define dep-maybe (lambda () | |
1859 | (if (exist? "hard") "" "maybe-"))) | |
1860 | ||
da34ca3f AO |
1861 | ;; dep-kind returns returns "prebootstrap" for configure or build |
1862 | ;; dependencies of bootstrapped modules on a build module | |
1863 | ;; (e.g. all-gcc on all-build-bison); "normal" if the dependency is | |
1864 | ;; on an "install" target, or if the dependence module is not | |
1865 | ;; bootstrapped; otherwise, it returns "bootstrap" or | |
1866 | ;; "postbootstrap" depending on whether the dependent module is | |
1867 | ;; bootstrapped. All this is only necessary for host and target | |
1868 | ;; modules. It might seem like, in order to avoid build races, we | |
1869 | ;; might need more elaborate detection between prebootstrap and | |
1870 | ;; postbootstrap modules, but there are no host prebootstrap | |
1871 | ;; modules. If there were any non-bootstrap host modules that | |
1872 | ;; bootstrap modules depended on, we'd get unsatisfied per-stage | |
1873 | ;; dependencies on them, which would be immediately noticed. | |
3589b69e | 1874 | (define dep-kind (lambda () |
da34ca3f AO |
1875 | (cond |
1876 | ((and (hash-ref boot-modules (dep-module "module")) | |
1877 | (=* (dep-module "on") "build-")) | |
1878 | "prebootstrap") | |
3589b69e | 1879 | |
da34ca3f AO |
1880 | ((or (= (dep-subtarget "on") "install-") |
1881 | (not (hash-ref boot-modules (dep-module "on")))) | |
1882 | "normal") | |
1883 | ||
1884 | ((hash-ref boot-modules (dep-module "module")) | |
1885 | "bootstrap") | |
1886 | ||
1887 | (1 "postbootstrap")))) | |
1888 | ||
1889 | (define make-postboot-dep (lambda () | |
1890 | (let ((target (dep-module "module")) (dep "stage_last")) | |
1891 | (unless (= (hash-ref postboot-targets target) dep) | |
1892 | (hash-create-handle! postboot-targets target dep) | |
1893 | ;; All non-bootstrap modules' configure target already | |
1894 | ;; depend on dep. | |
1895 | (unless (=* target "target-") | |
1896 | (string-append "configure-" target ": " dep "\n")))))) | |
3589b69e PB |
1897 | |
1898 | ;; We now build the hash table that is used by dep-kind. | |
1899 | (define boot-modules (make-hash-table 113)) | |
da34ca3f | 1900 | (define postboot-targets (make-hash-table 113)) |
3589b69e PB |
1901 | +] |
1902 | ||
1903 | [+ FOR host_modules +][+ | |
1904 | (if (exist? "bootstrap") | |
1905 | (hash-create-handle! boot-modules (get "module") #t)) | |
1906 | "" +][+ ENDFOR host_modules +] | |
2dfbef6d PB |
1907 | [+ FOR target_modules +][+ |
1908 | (if (exist? "bootstrap") | |
1909 | (hash-create-handle! boot-modules (string-append "target-" (get "module")) #t)) | |
1910 | "" +][+ ENDFOR target_modules +] | |
3589b69e PB |
1911 | |
1912 | # With all the machinery above in place, it is pretty easy to generate | |
1913 | # dependencies. Host dependencies are a bit more complex because we have | |
1914 | # to check for bootstrap/prebootstrap dependencies. To resolve | |
1915 | # prebootstrap dependencies, prebootstrap modules are gathered in | |
1916 | # a hash table. | |
da34ca3f AO |
1917 | [+ FOR dependencies +][+ CASE (dep-kind) +] |
1918 | [+ == "prebootstrap" +][+ (make-dep "" "") +][+ FOR bootstrap_stage +] | |
1919 | [+ (make-dep (dep-stage) "") +][+ ENDFOR bootstrap_stage +] | |
1920 | [+ == "bootstrap" +][+ (make-dep "" "") +][+ FOR bootstrap_stage +] | |
1921 | [+ (make-dep (dep-stage) (dep-stage)) +][+ ENDFOR bootstrap_stage +] | |
1922 | [+ == "normal" +][+ (make-dep "" "") +] | |
1923 | [+ ESAC +][+ ENDFOR dependencies +] | |
1924 | ||
1925 | @if gcc-bootstrap | |
1926 | [+ FOR dependencies +][+ CASE (dep-kind) +] | |
1927 | [+ == "postbootstrap" +][+ (make-postboot-dep) +][+ ESAC +][+ | |
1928 | ENDFOR dependencies +]@endif gcc-bootstrap | |
1929 | ||
1930 | @unless gcc-bootstrap | |
1931 | [+ FOR dependencies +][+ CASE (dep-kind) +] | |
1932 | [+ == "postbootstrap" +][+ (make-dep "" "") +] | |
1933 | [+ ESAC +][+ ENDFOR dependencies +]@endunless gcc-bootstrap | |
3589b69e | 1934 | |
fa958513 DJ |
1935 | # Dependencies for target modules on other target modules are |
1936 | # described by lang_env_dependencies; the defaults apply to anything | |
1937 | # not mentioned there. | |
1938 | [+ | |
1939 | ;; Predicate for whether LANG was specified in lang_env_dependencies. | |
1940 | (define lang-dep (lambda (lang) | |
1941 | (hash-ref lang-env-deps (string-append (get "module") "-" lang)))) | |
1942 | ||
1943 | ;; Build the hash table we will need. | |
1944 | (define lang-env-deps (make-hash-table 7)) | |
1945 | +][+ FOR lang_env_dependencies +][+ | |
1946 | (if (exist? "cxx") | |
1947 | (hash-create-handle! lang-env-deps | |
1948 | (string-append (get "module") "-" "cxx") #t)) | |
1949 | ||
1950 | (if (exist? "no_c") | |
1951 | (hash-create-handle! lang-env-deps | |
1952 | (string-append (get "module") "-" "no_c") #t)) | |
1953 | ||
1954 | (if (exist? "no_gcc") | |
1955 | (hash-create-handle! lang-env-deps | |
1956 | (string-append (get "module") "-" "no_gcc") #t)) | |
1957 | "" +][+ ENDFOR lang_env_dependencies +] | |
1958 | ||
1959 | @if gcc-bootstrap[+ FOR target_modules +][+ IF (not (lang-dep "no_gcc")) | |
1960 | +][+ IF bootstrap +][+ FOR bootstrap_stage +] | |
1961 | configure-stage[+id+]-target-[+module+]: maybe-all-stage[+id+]-target-libgcc[+ | |
1962 | ENDFOR +][+ ENDIF bootstrap +][+ ENDIF +][+ ENDFOR target_modules +] | |
1963 | @endif gcc-bootstrap | |
1964 | ||
1965 | @if gcc-no-bootstrap[+ FOR target_modules +][+ IF (not (lang-dep "no_gcc")) +] | |
1966 | configure-target-[+module+]: maybe-all-target-libgcc[+ | |
1967 | ENDIF +][+ ENDFOR target_modules +] | |
1968 | @endif gcc-no-bootstrap | |
1969 | ||
1970 | [+ FOR target_modules +][+ IF (not (lang-dep "no_c")) +] | |
1971 | configure-target-[+module+]: maybe-all-target-newlib maybe-all-target-libgloss[+ | |
1972 | ENDIF +][+ IF (lang-dep "cxx") +] | |
1973 | configure-target-[+module+]: maybe-all-target-libstdc++-v3[+ | |
1974 | ENDIF +] | |
1975 | [+ ENDFOR target_modules +] | |
1976 | ||
ef9db8d5 | 1977 | CONFIGURE_GDB_TK = @CONFIGURE_GDB_TK@ |
0dffceed | 1978 | GDB_TK = @GDB_TK@ |
ef9db8d5 DJ |
1979 | INSTALL_GDB_TK = @INSTALL_GDB_TK@ |
1980 | configure-gdb: $(CONFIGURE_GDB_TK) | |
3589b69e | 1981 | all-gdb: $(gdbnlmrequirements) $(GDB_TK) |
ef9db8d5 | 1982 | install-gdb: $(INSTALL_GDB_TK) |
95ddd785 | 1983 | |
4977bab6 ZW |
1984 | # Serialization dependencies. Host configures don't work well in parallel to |
1985 | # each other, due to contention over config.cache. Target configures and | |
1986 | # build configures are similar. | |
1987 | @serialization_dependencies@ | |
95ddd785 | 1988 | |
4977bab6 ZW |
1989 | # -------------------------------- |
1990 | # Regenerating top level configury | |
1991 | # -------------------------------- | |
95ddd785 NN |
1992 | |
1993 | # Rebuilding Makefile.in, using autogen. | |
e245b0ea | 1994 | AUTOGEN = autogen |
ee03dc5e | 1995 | $(srcdir)/Makefile.in: @MAINT@ $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def |
e245b0ea | 1996 | cd $(srcdir) && $(AUTOGEN) Makefile.def |
95ddd785 | 1997 | |
671aa708 | 1998 | # Rebuilding Makefile. |
e245b0ea AO |
1999 | Makefile: $(srcdir)/Makefile.in config.status |
2000 | CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status | |
2001 | ||
191dd2c9 | 2002 | config.status: configure |
e75f9147 | 2003 | CONFIG_SHELL="$(SHELL)" $(SHELL) ./config.status --recheck |
95ddd785 | 2004 | |
671aa708 | 2005 | # Rebuilding configure. |
e245b0ea | 2006 | AUTOCONF = autoconf |
18c04407 | 2007 | $(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4 \ |
350216e3 AM |
2008 | $(srcdir)/config/override.m4 $(srcdir)/config/proginstall.m4 \ |
2009 | $(srcdir)/config/elf.m4 $(srcdir)/config/isl.m4 \ | |
2010 | $(srcdir)/libtool.m4 $(srcdir)/ltoptions.m4 $(srcdir)/ltsugar.m4 \ | |
2011 | $(srcdir)/ltversion.m4 $(srcdir)/lt~obsolete.m4 | |
e245b0ea | 2012 | cd $(srcdir) && $(AUTOCONF) |
95ddd785 | 2013 | |
93c834b7 NN |
2014 | # ------------------------------ |
2015 | # Special directives to GNU Make | |
2016 | # ------------------------------ | |
2017 | ||
93c834b7 NN |
2018 | # Don't pass command-line variables to submakes. |
2019 | .NOEXPORT: | |
2020 | MAKEOVERRIDES= | |
2021 | ||
95ddd785 | 2022 | # end of Makefile.in |