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