Commit | Line | Data |
---|---|---|
52d7cdee | 1 | [+ AutoGen5 template -*- Mode: Makefile -*- |
405ea7a0 NN |
2 | in |
3 | +] | |
4 | ||
5 | # Makefile.in is generated from Makefile.tpl by 'autogen Makefile.def'. | |
6 | # | |
7 | # Makefile for directory with subdirs to build. | |
8 | # Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, | |
91f0e695 | 9 | # 1999, 2000, 2001, 2002, 2003 Free Software Foundation |
405ea7a0 NN |
10 | # |
11 | # This file is free software; you can redistribute it and/or modify | |
12 | # it under the terms of the GNU General Public License as published by | |
13 | # the Free Software Foundation; either version 2 of the License, or | |
14 | # (at your option) any later version. | |
15 | # | |
16 | # This program is distributed in the hope that it will be useful, | |
17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 | # GNU General Public License for more details. | |
20 | # | |
21 | # You should have received a copy of the GNU General Public License | |
22 | # along with this program; if not, write to the Free Software | |
23 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
24 | # | |
25 | ||
50212802 NN |
26 | # ------------------------------- |
27 | # Standard Autoconf-set variables | |
28 | # ------------------------------- | |
583d52d7 | 29 | VPATH=@srcdir@ |
583d52d7 NN |
30 | |
31 | build_alias=@build_alias@ | |
32 | build_cpu=@build_cpu@ | |
33 | build_vendor=@build_vendor@ | |
34 | build_os=@build_os@ | |
35 | build_canonical=@build_cpu@-@build_vendor@-@build_os@ | |
36 | host_alias=@host_alias@ | |
37 | host_cpu=@host_cpu@ | |
38 | host_vendor=@host_vendor@ | |
39 | host_os=@host_os@ | |
40 | host_canonical=@host_cpu@-@host_vendor@-@host_os@ | |
41 | target_alias=@target_alias@ | |
42 | target_cpu=@target_cpu@ | |
43 | target_vendor=@target_vendor@ | |
44 | target_os=@target_os@ | |
45 | target_canonical=@target_cpu@-@target_vendor@-@target_os@ | |
46 | ||
50212802 | 47 | program_transform_name = @program_transform_name@ |
c66d951e NN |
48 | |
49 | prefix = @prefix@ | |
50 | exec_prefix = @exec_prefix@ | |
51 | ||
50212802 NN |
52 | srcdir = @srcdir@ |
53 | ||
c66d951e NN |
54 | bindir = @bindir@ |
55 | sbindir = @sbindir@ | |
56 | libexecdir = @libexecdir@ | |
57 | datadir = @datadir@ | |
58 | sysconfdir = @sysconfdir@ | |
59 | sharedstatedir = @sharedstatedir@ | |
60 | localstatedir = @localstatedir@ | |
61 | libdir = @libdir@ | |
62 | includedir = @includedir@ | |
63 | oldincludedir = @oldincludedir@ | |
64 | infodir = @infodir@ | |
65 | mandir = @mandir@ | |
405ea7a0 NN |
66 | man1dir = $(mandir)/man1 |
67 | man2dir = $(mandir)/man2 | |
68 | man3dir = $(mandir)/man3 | |
69 | man4dir = $(mandir)/man4 | |
70 | man5dir = $(mandir)/man5 | |
71 | man6dir = $(mandir)/man6 | |
72 | man7dir = $(mandir)/man7 | |
73 | man8dir = $(mandir)/man8 | |
74 | man9dir = $(mandir)/man9 | |
405ea7a0 NN |
75 | |
76 | # INSTALL_PROGRAM_ARGS is changed by configure.in to use -x for a | |
77 | # cygwin host. | |
78 | INSTALL_PROGRAM_ARGS = | |
79 | ||
80 | INSTALL = $(SHELL) $$s/install-sh -c | |
81 | INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_ARGS) | |
82 | INSTALL_SCRIPT = $(INSTALL) | |
83 | INSTALL_DATA = $(INSTALL) -m 644 | |
84 | ||
50212802 NN |
85 | # ------------------------------------------------- |
86 | # Miscellaneous non-standard autoconf-set variables | |
87 | # ------------------------------------------------- | |
405ea7a0 | 88 | |
50212802 NN |
89 | links=@configlinks@ |
90 | enable_shared = @enable_shared@ | |
91 | enable_threads = @enable_threads@ | |
92 | enable_version_specific_runtime_libs = @enable_version_specific_runtime_libs@ | |
93 | # The file containing GCC's version number. | |
94 | gcc_version_trigger = @gcc_version_trigger@ | |
95 | gcc_version = @gcc_version@ | |
405ea7a0 | 96 | |
50212802 NN |
97 | # The gcc driver likes to know the arguments it was configured with. |
98 | TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@ | |
405ea7a0 | 99 | |
50212802 NN |
100 | gxx_include_dir = @gxx_include_dir@ |
101 | libstdcxx_incdir = @libstdcxx_incdir@ | |
405ea7a0 | 102 | |
50212802 NN |
103 | tooldir = @tooldir@ |
104 | build_tooldir = @build_tooldir@ | |
405ea7a0 | 105 | |
50212802 NN |
106 | # Directory in which the compiler finds executables, libraries, etc. |
107 | libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version) | |
108 | GDB_NLM_DEPS = | |
405ea7a0 | 109 | |
50212802 NN |
110 | # This is the name of the environment variable used for the path to |
111 | # the libraries. | |
112 | RPATH_ENVVAR = @RPATH_ENVVAR@ | |
405ea7a0 | 113 | |
50212802 NN |
114 | # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared |
115 | # was used. | |
116 | SET_LIB_PATH = @SET_LIB_PATH@ | |
405ea7a0 | 117 | |
50212802 NN |
118 | # configure.in sets SET_LIB_PATH to this if --enable-shared was used. |
119 | # Some platforms don't like blank entries, so we remove duplicate, | |
120 | # leading and trailing colons. | |
121 | REALLY_SET_LIB_PATH = \ | |
122 | $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); | |
405ea7a0 | 123 | |
50212802 NN |
124 | # This is the list of directories to be built for the build system. |
125 | BUILD_CONFIGDIRS = libiberty | |
126 | # Build programs are put under this directory. | |
127 | BUILD_SUBDIR = @build_subdir@ | |
128 | # This is set by the configure script to the arguments to use when configuring | |
129 | # directories built for the build system. | |
130 | BUILD_CONFIGARGS = @build_configargs@ | |
131 | ||
132 | # This is the list of directories to built for the host system. | |
133 | SUBDIRS = @configdirs@ | |
134 | # This is set by the configure script to the arguments to use when configuring | |
135 | # directories built for the host system. | |
136 | HOST_CONFIGARGS = @host_configargs@ | |
137 | ||
138 | # This is set by the configure script to the list of directories which | |
139 | # should be built using the target tools. | |
140 | TARGET_CONFIGDIRS = @target_configdirs@ | |
141 | # Target libraries are put under this directory: | |
142 | TARGET_SUBDIR = @target_subdir@ | |
143 | # This is set by the configure script to the arguments to use when configuring | |
144 | # directories built for the target. | |
145 | TARGET_CONFIGARGS = @target_configargs@ | |
146 | ||
147 | # ---------------------------------------------- | |
148 | # Programs producing files for the BUILD machine | |
149 | # ---------------------------------------------- | |
150 | ||
151 | SHELL = @config_shell@ | |
152 | ||
153 | # pwd command to use. Allow user to override default by setting PWDCMD in | |
154 | # the environment to account for automounters. The make variable must not | |
155 | # be called PWDCMD, otherwise the value set here is passed to make | |
156 | # subprocesses and overrides the setting from the user's environment. | |
157 | PWD = $${PWDCMD-pwd} | |
158 | ||
159 | # compilers to use to create programs which must be run in the build | |
160 | # environment. | |
161 | CC_FOR_BUILD = @CC_FOR_BUILD@ | |
162 | CFLAGS_FOR_BUILD = $(CFLAGS) | |
163 | ||
164 | CXX_FOR_BUILD = $(CXX) | |
165 | ||
166 | # Special variables passed down in EXTRA_GCC_FLAGS. They are defined | |
167 | # here so that they can be overridden by Makefile fragments. | |
168 | BUILD_CC = $(CC_FOR_BUILD) | |
169 | BUILD_PREFIX = @BUILD_PREFIX@ | |
170 | BUILD_PREFIX_1 = @BUILD_PREFIX_1@ | |
405ea7a0 | 171 | |
852e5f18 NN |
172 | BISON=@BISON@ |
173 | USUAL_BISON = `if [ -f $$r/bison/bison ] ; then \ | |
405ea7a0 NN |
174 | echo $$r/bison/bison -L $$s/bison/ ; \ |
175 | else \ | |
176 | echo bison ; \ | |
177 | fi` | |
178 | ||
50212802 | 179 | DEFAULT_YACC = @DEFAULT_YACC@ |
852e5f18 NN |
180 | YACC=@YACC@ |
181 | USUAL_YACC = `if [ -f $$r/bison/bison ] ; then \ | |
405ea7a0 NN |
182 | echo $$r/bison/bison -y -L $$s/bison/ ; \ |
183 | elif [ -f $$r/byacc/byacc ] ; then \ | |
184 | echo $$r/byacc/byacc ; \ | |
185 | else \ | |
186 | echo ${DEFAULT_YACC} ; \ | |
187 | fi` | |
188 | ||
50212802 | 189 | DEFAULT_LEX = @DEFAULT_LEX@ |
852e5f18 NN |
190 | LEX=@LEX@ |
191 | USUAL_LEX = `if [ -f $$r/flex/flex ] ; \ | |
405ea7a0 NN |
192 | then echo $$r/flex/flex ; \ |
193 | else echo ${DEFAULT_LEX} ; fi` | |
194 | ||
50212802 | 195 | DEFAULT_M4 = @DEFAULT_M4@ |
405ea7a0 NN |
196 | M4 = `if [ -f $$r/m4/m4 ] ; \ |
197 | then echo $$r/m4/m4 ; \ | |
198 | else echo ${DEFAULT_M4} ; fi` | |
199 | ||
200 | # For an installed makeinfo, we require it to be from texinfo 4 or | |
201 | # higher, else we use the "missing" dummy. | |
852e5f18 NN |
202 | MAKEINFO=@MAKEINFO@ |
203 | USUAL_MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \ | |
405ea7a0 NN |
204 | then echo $$r/texinfo/makeinfo/makeinfo ; \ |
205 | else if (makeinfo --version \ | |
206 | | egrep 'texinfo[^0-9]*([1-3][0-9]|[4-9])') >/dev/null 2>&1; \ | |
207 | then echo makeinfo; else echo $$s/missing makeinfo; fi; fi` | |
208 | ||
209 | # This just becomes part of the MAKEINFO definition passed down to | |
210 | # sub-makes. It lets flags be given on the command line while still | |
211 | # using the makeinfo from the object tree. | |
212 | MAKEINFOFLAGS = | |
213 | ||
214 | EXPECT = `if [ -f $$r/expect/expect ] ; \ | |
215 | then echo $$r/expect/expect ; \ | |
216 | else echo expect ; fi` | |
217 | ||
218 | RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \ | |
219 | then echo $$s/dejagnu/runtest ; \ | |
220 | else echo runtest ; fi` | |
221 | ||
50212802 NN |
222 | # --------------------------------------------- |
223 | # Programs producing files for the HOST machine | |
224 | # --------------------------------------------- | |
405ea7a0 | 225 | |
50212802 NN |
226 | # This is the list of directories that may be needed in RPATH_ENVVAR |
227 | # so that programs built for the host machine work. | |
228 | HOST_LIB_PATH = $$r/bfd:$$r/opcodes | |
405ea7a0 | 229 | |
50212802 | 230 | AS = @AS@ |
405ea7a0 | 231 | |
50212802 NN |
232 | AR = @AR@ |
233 | AR_FLAGS = rc | |
405ea7a0 | 234 | |
50212802 NN |
235 | CC = @CC@ |
236 | CFLAGS = @CFLAGS@ | |
237 | LIBCFLAGS = $(CFLAGS) | |
405ea7a0 | 238 | |
50212802 NN |
239 | CXX = @CXX@ |
240 | CXXFLAGS = @CXXFLAGS@ | |
241 | LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates | |
405ea7a0 | 242 | |
50212802 | 243 | DLLTOOL = @DLLTOOL@ |
405ea7a0 | 244 | |
50212802 | 245 | NM = @NM@ |
15723a45 | 246 | |
50212802 NN |
247 | LD = @LD@ |
248 | LDFLAGS = | |
15723a45 | 249 | |
50212802 | 250 | RANLIB = @RANLIB@ |
405ea7a0 | 251 | |
50212802 | 252 | WINDRES = @WINDRES@ |
405ea7a0 | 253 | |
50212802 NN |
254 | PICFLAG = |
255 | ||
256 | # ----------------------------------------------- | |
257 | # Programs producing files for the TARGET machine | |
258 | # ----------------------------------------------- | |
405ea7a0 NN |
259 | |
260 | # This is the list of directories that may be needed in RPATH_ENVVAR | |
261 | # so that prorgams built for the target machine work. | |
262 | TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs: | |
263 | ||
58daee98 | 264 | FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@ |
405ea7a0 | 265 | |
50212802 NN |
266 | AR_FOR_TARGET=@AR_FOR_TARGET@ |
267 | USUAL_AR_FOR_TARGET = ` \ | |
268 | if [ -f $$r/binutils/ar ] ; then \ | |
269 | echo $$r/binutils/ar ; \ | |
270 | else \ | |
271 | if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ | |
272 | echo $(AR); \ | |
273 | else \ | |
274 | echo ar | sed '$(program_transform_name)' ; \ | |
275 | fi; \ | |
276 | fi` | |
405ea7a0 | 277 | |
852e5f18 NN |
278 | AS_FOR_TARGET=@AS_FOR_TARGET@ |
279 | USUAL_AS_FOR_TARGET = ` \ | |
405ea7a0 NN |
280 | if [ -f $$r/gas/as-new ] ; then \ |
281 | echo $$r/gas/as-new ; \ | |
282 | elif [ -f $$r/gcc/xgcc ]; then \ | |
283 | $(CC_FOR_TARGET) -print-prog-name=as ; \ | |
284 | else \ | |
285 | if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ | |
286 | echo $(AS); \ | |
287 | else \ | |
43be203f | 288 | echo as | sed '$(program_transform_name)' ; \ |
405ea7a0 NN |
289 | fi; \ |
290 | fi` | |
291 | ||
50212802 NN |
292 | CC_FOR_TARGET = @CC_FOR_TARGET@ |
293 | # During gcc bootstrap, if we use some random cc for stage1 then | |
294 | # CFLAGS will be just -g. We want to ensure that TARGET libraries | |
295 | # (which we know are built with gcc) are built with optimizations so | |
296 | # prepend -O2 when setting CFLAGS_FOR_TARGET. | |
297 | CFLAGS_FOR_TARGET = -O2 $(CFLAGS) | |
298 | # If GCC_FOR_TARGET is not overriden on the command line, then this | |
299 | # variable is passed down to the gcc Makefile, where it is used to | |
300 | # build libgcc2.a. We define it here so that it can itself be | |
301 | # overridden on the command line. | |
302 | GCC_FOR_TARGET=@GCC_FOR_TARGET@ | |
303 | USUAL_GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET) | |
304 | LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET) | |
305 | ||
306 | CXX_FOR_TARGET = @CXX_FOR_TARGET@ | |
307 | RAW_CXX_FOR_TARGET = @RAW_CXX_FOR_TARGET@ | |
308 | CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@ | |
309 | RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@ | |
310 | CXXFLAGS_FOR_TARGET = $(CXXFLAGS) | |
311 | LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates | |
405ea7a0 | 312 | |
852e5f18 NN |
313 | DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@ |
314 | USUAL_DLLTOOL_FOR_TARGET = ` \ | |
405ea7a0 NN |
315 | if [ -f $$r/binutils/dlltool ] ; then \ |
316 | echo $$r/binutils/dlltool ; \ | |
317 | else \ | |
318 | if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ | |
319 | echo $(DLLTOOL); \ | |
320 | else \ | |
43be203f | 321 | echo dlltool | sed '$(program_transform_name)' ; \ |
405ea7a0 NN |
322 | fi; \ |
323 | fi` | |
324 | ||
50212802 NN |
325 | GCJ_FOR_TARGET = @GCJ_FOR_TARGET@ |
326 | ||
327 | LD_FOR_TARGET=@LD_FOR_TARGET@ | |
328 | USUAL_LD_FOR_TARGET = ` \ | |
329 | if [ -f $$r/ld/ld-new ] ; then \ | |
330 | echo $$r/ld/ld-new ; \ | |
331 | elif [ -f $$r/gcc/xgcc ]; then \ | |
332 | $(CC_FOR_TARGET) -print-prog-name=ld ; \ | |
405ea7a0 NN |
333 | else \ |
334 | if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ | |
50212802 | 335 | echo $(LD); \ |
405ea7a0 | 336 | else \ |
50212802 | 337 | echo ld | sed '$(program_transform_name)' ; \ |
405ea7a0 NN |
338 | fi; \ |
339 | fi` | |
340 | ||
50212802 NN |
341 | LDFLAGS_FOR_TARGET = |
342 | ||
343 | NM_FOR_TARGET=@NM_FOR_TARGET@ | |
344 | USUAL_NM_FOR_TARGET = ` \ | |
345 | if [ -f $$r/binutils/nm-new ] ; then \ | |
346 | echo $$r/binutils/nm-new ; \ | |
347 | elif [ -f $$r/gcc/xgcc ]; then \ | |
348 | $(CC_FOR_TARGET) -print-prog-name=nm ; \ | |
405ea7a0 NN |
349 | else \ |
350 | if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ | |
50212802 | 351 | echo $(NM); \ |
405ea7a0 | 352 | else \ |
50212802 | 353 | echo nm | sed '$(program_transform_name)' ; \ |
405ea7a0 NN |
354 | fi; \ |
355 | fi` | |
356 | ||
852e5f18 NN |
357 | RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@ |
358 | USUAL_RANLIB_FOR_TARGET = ` \ | |
405ea7a0 NN |
359 | if [ -f $$r/binutils/ranlib ] ; then \ |
360 | echo $$r/binutils/ranlib ; \ | |
361 | else \ | |
362 | if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ | |
363 | if [ x'$(RANLIB)' != x ]; then \ | |
364 | echo $(RANLIB); \ | |
365 | else \ | |
366 | echo ranlib; \ | |
367 | fi; \ | |
368 | else \ | |
43be203f | 369 | echo ranlib | sed '$(program_transform_name)' ; \ |
405ea7a0 NN |
370 | fi; \ |
371 | fi` | |
372 | ||
50212802 NN |
373 | WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@ |
374 | USUAL_WINDRES_FOR_TARGET = ` \ | |
375 | if [ -f $$r/binutils/windres ] ; then \ | |
376 | echo $$r/binutils/windres ; \ | |
405ea7a0 NN |
377 | else \ |
378 | if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ | |
50212802 | 379 | echo $(WINDRES); \ |
405ea7a0 | 380 | else \ |
50212802 | 381 | echo windres | sed '$(program_transform_name)' ; \ |
405ea7a0 NN |
382 | fi; \ |
383 | fi` | |
384 | ||
50212802 NN |
385 | PICFLAG_FOR_TARGET = |
386 | ||
387 | # ------------------------------------ | |
388 | # Miscellaneous targets and flag lists | |
389 | # ------------------------------------ | |
390 | ||
405ea7a0 NN |
391 | # The first rule in the file had better be this one. Don't put any above it. |
392 | # This lives here to allow makefile fragments to contain dependencies. | |
393 | all: all.normal | |
394 | .PHONY: all | |
395 | ||
405ea7a0 | 396 | #### host and target specific makefile fragments come in here. |
a0da8069 NN |
397 | @target_makefile_frag@ |
398 | @alphaieee_frag@ | |
399 | @ospace_frag@ | |
400 | @host_makefile_frag@ | |
405ea7a0 NN |
401 | ### |
402 | ||
403 | # Flags to pass down to all sub-makes. | |
404 | # Please keep these in alphabetical order. | |
405 | BASE_FLAGS_TO_PASS = \ | |
406 | "AR_FLAGS=$(AR_FLAGS)" \ | |
407 | "AR_FOR_TARGET=$(AR_FOR_TARGET)" \ | |
408 | "AS_FOR_TARGET=$(AS_FOR_TARGET)" \ | |
409 | "BISON=$(BISON)" \ | |
410 | "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ | |
411 | "CC_FOR_TARGET=$(CC_FOR_TARGET)" \ | |
412 | "CFLAGS=$(CFLAGS)" \ | |
413 | "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \ | |
414 | "GCJ_FOR_TARGET=$(GCJ_FOR_TARGET)" \ | |
415 | "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \ | |
416 | "CXXFLAGS=$(CXXFLAGS)" \ | |
417 | "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \ | |
418 | "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \ | |
497f816e | 419 | "DESTDIR=$(DESTDIR)" \ |
405ea7a0 NN |
420 | "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \ |
421 | "INSTALL=$(INSTALL)" \ | |
422 | "INSTALL_DATA=$(INSTALL_DATA)" \ | |
423 | "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ | |
424 | "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ | |
425 | "LDFLAGS=$(LDFLAGS)" \ | |
426 | "LEX=$(LEX)" \ | |
427 | "LD_FOR_TARGET=$(LD_FOR_TARGET)" \ | |
428 | "LIBCFLAGS=$(LIBCFLAGS)" \ | |
429 | "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ | |
430 | "LIBCXXFLAGS=$(LIBCXXFLAGS)" \ | |
431 | "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \ | |
432 | "M4=$(M4)" \ | |
433 | "MAKE=$(MAKE)" \ | |
434 | "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \ | |
435 | "NM_FOR_TARGET=$(NM_FOR_TARGET)" \ | |
436 | "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \ | |
437 | "RPATH_ENVVAR=$(RPATH_ENVVAR)" \ | |
438 | "SHELL=$(SHELL)" \ | |
439 | "EXPECT=$(EXPECT)" \ | |
440 | "RUNTEST=$(RUNTEST)" \ | |
441 | "RUNTESTFLAGS=$(RUNTESTFLAGS)" \ | |
442 | "TARGET_SUBDIR=$(TARGET_SUBDIR)" \ | |
443 | "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \ | |
444 | "YACC=$(YACC)" \ | |
445 | "bindir=$(bindir)" \ | |
446 | "datadir=$(datadir)" \ | |
447 | "exec_prefix=$(exec_prefix)" \ | |
448 | "includedir=$(includedir)" \ | |
449 | "infodir=$(infodir)" \ | |
450 | "libdir=$(libdir)" \ | |
451 | "libexecdir=$(libexecdir)" \ | |
452 | "lispdir=$(lispdir)" \ | |
453 | "libstdcxx_incdir=$(libstdcxx_incdir)" \ | |
454 | "libsubdir=$(libsubdir)" \ | |
455 | "localstatedir=$(localstatedir)" \ | |
456 | "mandir=$(mandir)" \ | |
457 | "oldincludedir=$(oldincludedir)" \ | |
458 | "prefix=$(prefix)" \ | |
459 | "sbindir=$(sbindir)" \ | |
460 | "sharedstatedir=$(sharedstatedir)" \ | |
461 | "sysconfdir=$(sysconfdir)" \ | |
462 | "tooldir=$(tooldir)" \ | |
463 | "build_tooldir=$(build_tooldir)" \ | |
464 | "gxx_include_dir=$(gxx_include_dir)" \ | |
465 | "gcc_version=$(gcc_version)" \ | |
466 | "gcc_version_trigger=$(gcc_version_trigger)" \ | |
467 | "target_alias=$(target_alias)" | |
468 | ||
469 | # For any flags above that may contain shell code that varies from one | |
470 | # target library to another. When doing recursive invocations of the | |
471 | # top-level Makefile, we don't want the outer make to evaluate them, | |
472 | # so we pass these variables down unchanged. They must not contain | |
473 | # single nor double quotes. | |
474 | RECURSE_FLAGS = \ | |
930314a4 NN |
475 | CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \ |
476 | RAW_CXX_FOR_TARGET='$(RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \ | |
405ea7a0 NN |
477 | |
478 | # Flags to pass down to most sub-makes, in which we're building with | |
479 | # the host environment. | |
480 | # If any variables are added here, they must be added to do-*, below. | |
481 | EXTRA_HOST_FLAGS = \ | |
482 | 'AR=$(AR)' \ | |
483 | 'AS=$(AS)' \ | |
484 | 'CC=$(CC)' \ | |
485 | 'CXX=$(CXX)' \ | |
486 | 'DLLTOOL=$(DLLTOOL)' \ | |
487 | 'LD=$(LD)' \ | |
488 | 'NM=$(NM)' \ | |
489 | "`echo 'RANLIB=$(RANLIB)' | sed -e s/.*=$$/XFOO=/`" \ | |
490 | 'WINDRES=$(WINDRES)' | |
491 | ||
492 | FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) | |
493 | ||
494 | # Flags that are concerned with the location of the X11 include files | |
495 | # and library files | |
496 | # | |
497 | # NOTE: until the top-level is getting the values via autoconf, it only | |
498 | # causes problems to have this top-level Makefile overriding the autoconf-set | |
499 | # values in child directories. Only variables that don't conflict with | |
500 | # autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now. | |
501 | # | |
502 | X11_FLAGS_TO_PASS = \ | |
503 | 'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \ | |
504 | 'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)' | |
505 | ||
506 | # Flags to pass down to makes which are built with the target environment. | |
507 | # The double $ decreases the length of the command line; the variables | |
508 | # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. | |
509 | # If any variables are added here, they must be added to do-*, below. | |
510 | EXTRA_TARGET_FLAGS = \ | |
511 | 'AR=$$(AR_FOR_TARGET)' \ | |
512 | 'AS=$$(AS_FOR_TARGET)' \ | |
513 | 'CC=$$(CC_FOR_TARGET)' \ | |
514 | 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \ | |
515 | 'CXX=$$(CXX_FOR_TARGET)' \ | |
516 | 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \ | |
517 | 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \ | |
518 | 'LD=$$(LD_FOR_TARGET)' \ | |
519 | 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \ | |
520 | 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \ | |
521 | 'NM=$$(NM_FOR_TARGET)' \ | |
522 | 'RANLIB=$$(RANLIB_FOR_TARGET)' \ | |
523 | 'WINDRES=$$(WINDRES_FOR_TARGET)' | |
524 | ||
525 | TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) | |
526 | ||
527 | # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it | |
528 | # unfortunately needs the native compiler and the target ar and | |
529 | # ranlib. | |
530 | # If any variables are added here, they must be added to do-*, below. | |
531 | # The HOST_* variables are a special case, which are used for the gcc | |
532 | # cross-building scheme. | |
533 | EXTRA_GCC_FLAGS = \ | |
534 | 'AR=$(AR)' \ | |
535 | 'AS=$(AS)' \ | |
536 | 'CC=$(CC)' \ | |
537 | 'CXX=$(CXX)' \ | |
538 | 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \ | |
3866be5d | 539 | 'BUILD_CC=$(CC_FOR_BUILD)' \ |
405ea7a0 NN |
540 | 'BUILD_PREFIX=$(BUILD_PREFIX)' \ |
541 | 'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \ | |
542 | 'NM=$(NM)' \ | |
543 | "`echo 'RANLIB=$(RANLIB)' | sed -e s/.*=$$/XFOO=/`" \ | |
544 | 'WINDRES=$$(WINDRES_FOR_TARGET)' \ | |
545 | "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \ | |
546 | "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ | |
547 | "`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s/.*=$$/XFOO=/`" \ | |
548 | "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s/.*=$$/XFOO=/`" \ | |
549 | "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s/.*=$$/XFOO=/`" \ | |
550 | "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \ | |
551 | "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \ | |
552 | "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \ | |
553 | "`echo 'ENQUIRE=$(ENQUIRE)' | sed -e s/.*=$$/XFOO=/`" \ | |
554 | "`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \ | |
555 | "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" | |
556 | ||
557 | GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) | |
558 | ||
db1ac78d NN |
559 | configure-host: @configure_host_modules@ |
560 | configure-target: @configure_target_modules@ | |
405ea7a0 NN |
561 | |
562 | # This is a list of the targets for which we can do a clean-{target}. | |
52d7cdee NN |
563 | CLEAN_MODULES =[+ |
564 | FOR host_modules +][+ | |
565 | IF (not (or (exist? "no_clean") (exist? "with_x"))) +] \ | |
566 | clean-[+module+][+ | |
567 | ENDIF no_clean +][+ | |
568 | ENDFOR host_modules +] | |
405ea7a0 NN |
569 | |
570 | # All of the target modules that can be cleaned | |
52d7cdee NN |
571 | CLEAN_TARGET_MODULES =[+ |
572 | FOR target_modules +][+ | |
573 | IF (not (exist? "no_clean")) +] \ | |
574 | clean-target-[+module+][+ | |
575 | ENDIF no_clean +][+ | |
576 | ENDFOR target_modules +] | |
405ea7a0 NN |
577 | |
578 | # All of the x11 modules that can be cleaned | |
852e5f18 NN |
579 | CLEAN_X11_MODULES = [+ FOR host_modules +][+ IF with_x +]\ |
580 | clean-[+module+] [+ ENDIF with_x +][+ ENDFOR host_modules +] | |
405ea7a0 NN |
581 | |
582 | # The target built for a native build. | |
3866be5d | 583 | # This list only includes modules actually being configured and built. |
405ea7a0 | 584 | .PHONY: all.normal |
3866be5d NN |
585 | all.normal: @all_build_modules@ \ |
586 | @all_host_modules@ \ | |
587 | @all_target_modules@ | |
588 | ||
db1ac78d | 589 | all-host: @all_host_modules@ |
3866be5d | 590 | all-target: @all_target_modules@ |
405ea7a0 NN |
591 | |
592 | # Do a target for all the subdirectories. A ``make do-X'' will do a | |
593 | # ``make X'' in all subdirectories (because, in general, there is a | |
594 | # dependency (below) of X upon do-X, a ``make X'' will also do this, | |
595 | # but it may do additional work as well). | |
596 | # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once, | |
597 | # because it is so large that it can easily overflow the command line | |
598 | # length limit on some systems. | |
e393202e NN |
599 | [+ FOR recursive_targets +] |
600 | .PHONY: do-[+target+] | |
601 | do-[+target+]: | |
602 | @r=`${PWD}`; export r; \ | |
405ea7a0 NN |
603 | s=`cd $(srcdir); ${PWD}`; export s; \ |
604 | $(SET_LIB_PATH) \ | |
605 | for i in $(SUBDIRS) -dummy-; do \ | |
606 | if [ -f ./$$i/Makefile ]; then \ | |
607 | case $$i in \ | |
608 | gcc) \ | |
609 | for flag in $(EXTRA_GCC_FLAGS); do \ | |
610 | eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ | |
611 | done; \ | |
612 | ;; \ | |
613 | *) \ | |
614 | for flag in $(EXTRA_HOST_FLAGS); do \ | |
615 | eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ | |
616 | done; \ | |
617 | ;; \ | |
618 | esac ; \ | |
1086bc09 | 619 | (cd ./$$i && \ |
405ea7a0 NN |
620 | $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ |
621 | "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ | |
622 | "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ | |
623 | "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ | |
1086bc09 NN |
624 | [+target+]) \ |
625 | || exit 1; \ | |
405ea7a0 NN |
626 | else true; fi; \ |
627 | done | |
e393202e | 628 | # Break into two pieces |
405ea7a0 NN |
629 | r=`${PWD}`; export r; \ |
630 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
631 | $(SET_LIB_PATH) \ | |
632 | for i in $(TARGET_CONFIGDIRS) -dummy-; do \ | |
633 | if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \ | |
634 | for flag in $(EXTRA_TARGET_FLAGS); do \ | |
635 | eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ | |
636 | done; \ | |
1086bc09 | 637 | (cd $(TARGET_SUBDIR)/$$i && \ |
405ea7a0 NN |
638 | $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ |
639 | "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ | |
640 | "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ | |
641 | "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ | |
1086bc09 NN |
642 | [+target+]) \ |
643 | || exit 1; \ | |
405ea7a0 NN |
644 | else true; fi; \ |
645 | done | |
e393202e NN |
646 | [+ ENDFOR recursive_targets +] |
647 | ||
405ea7a0 NN |
648 | |
649 | # Here are the targets which correspond to the do-X targets. | |
650 | ||
651 | .PHONY: info installcheck dvi install-info | |
652 | .PHONY: clean distclean mostlyclean maintainer-clean realclean | |
653 | .PHONY: local-clean local-distclean local-maintainer-clean | |
654 | info: do-info | |
655 | installcheck: do-installcheck | |
656 | dvi: do-dvi | |
657 | ||
43d92c63 NN |
658 | # Make sure makeinfo is built before we do a `make info', if we're |
659 | # in fact building texinfo. | |
660 | do-info: maybe-all-texinfo | |
405ea7a0 NN |
661 | |
662 | install-info: do-install-info dir.info | |
663 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
664 | if [ -f dir.info ] ; then \ | |
497f816e | 665 | $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info ; \ |
405ea7a0 NN |
666 | else true ; fi |
667 | ||
668 | local-clean: | |
669 | -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log | |
670 | ||
671 | local-distclean: | |
672 | -rm -f Makefile config.status config.cache mh-frag mt-frag | |
e6bfb94a | 673 | -rm -f multilib.out multilib.tmp maybedep.tmp serdep.tmp |
405ea7a0 NN |
674 | -if [ "$(TARGET_SUBDIR)" != "." ]; then \ |
675 | rm -rf $(TARGET_SUBDIR); \ | |
676 | else true; fi | |
677 | -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile | |
678 | -rm -f texinfo/doc/Makefile texinfo/po/POTFILES | |
679 | -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null | |
680 | -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null | |
681 | -rmdir fastjar gcc libiberty texinfo zlib 2>/dev/null | |
682 | ||
683 | local-maintainer-clean: | |
684 | @echo "This command is intended for maintainers to use;" | |
685 | @echo "it deletes files that may require special tools to rebuild." | |
686 | ||
687 | clean: do-clean local-clean | |
688 | mostlyclean: do-mostlyclean local-clean | |
689 | distclean: do-distclean local-clean local-distclean | |
690 | maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean | |
691 | maintainer-clean: local-distclean | |
692 | realclean: maintainer-clean | |
693 | ||
694 | # This rule is used to clean specific modules. | |
695 | .PHONY: $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc | |
696 | $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc: | |
697 | @dir=`echo $@ | sed -e 's/clean-//'`; \ | |
698 | if [ -f ./$${dir}/Makefile ] ; then \ | |
699 | r=`${PWD}`; export r; \ | |
700 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
701 | $(SET_LIB_PATH) \ | |
1086bc09 | 702 | (cd $${dir} && $(MAKE) $(FLAGS_TO_PASS) clean); \ |
405ea7a0 NN |
703 | else \ |
704 | true; \ | |
705 | fi | |
706 | ||
707 | .PHONY: $(CLEAN_TARGET_MODULES) | |
708 | $(CLEAN_TARGET_MODULES): | |
709 | @dir=`echo $@ | sed -e 's/clean-target-//'`; \ | |
710 | rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \ | |
711 | if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \ | |
712 | r=`${PWD}`; export r; \ | |
713 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
714 | $(SET_LIB_PATH) \ | |
1086bc09 | 715 | (cd $(TARGET_SUBDIR)/$${dir} && $(MAKE) $(TARGET_FLAGS_TO_PASS) clean); \ |
405ea7a0 NN |
716 | else \ |
717 | true; \ | |
718 | fi | |
719 | ||
720 | clean-target: $(CLEAN_TARGET_MODULES) clean-target-libgcc | |
721 | clean-target-libgcc: | |
722 | test ! -d gcc/libgcc || \ | |
723 | (cd gcc/libgcc && find . -type d -print) | \ | |
724 | while read d; do rm -f gcc/$$d/libgcc.a || : ; done | |
725 | -rm -rf gcc/libgcc | |
726 | ||
727 | # Check target. | |
728 | ||
729 | .PHONY: check do-check | |
730 | check: | |
731 | $(MAKE) do-check NOTPARALLEL=parallel-ok | |
732 | ||
3866be5d NN |
733 | # Only include modules actually being configured and built. |
734 | do-check: @check_host_modules@ \ | |
735 | @check_target_modules@ | |
405ea7a0 NN |
736 | |
737 | # Automated reporting of test results. | |
738 | ||
739 | warning.log: build.log | |
740 | $(srcdir)/contrib/warn_summary build.log > $@ | |
741 | ||
742 | mail-report.log: | |
743 | if test x'$(BOOT_CFLAGS)' != x''; then \ | |
744 | BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \ | |
745 | fi; \ | |
746 | $(srcdir)/contrib/test_summary -t >$@ | |
747 | chmod +x $@ | |
748 | echo If you really want to send e-mail, run ./$@ now | |
749 | ||
750 | mail-report-with-warnings.log: warning.log | |
751 | if test x'$(BOOT_CFLAGS)' != x''; then \ | |
752 | BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \ | |
753 | fi; \ | |
754 | $(srcdir)/contrib/test_summary -t -i warning.log >$@ | |
755 | chmod +x $@ | |
756 | echo If you really want to send e-mail, run ./$@ now | |
757 | ||
758 | # Installation targets. | |
759 | ||
ae831be5 | 760 | .PHONY: install uninstall |
3866be5d NN |
761 | install: installdirs @install_host_modules@ @install_target_modules@ |
762 | ||
763 | install-target: @install_target_modules@ | |
405ea7a0 NN |
764 | |
765 | uninstall: | |
766 | @echo "the uninstall target is not supported in this tree" | |
767 | ||
405ea7a0 NN |
768 | .PHONY: install.all |
769 | install.all: install-no-fixedincludes | |
770 | @if [ -f ./gcc/Makefile ] ; then \ | |
771 | r=`${PWD}` ; export r ; \ | |
772 | $(SET_LIB_PATH) \ | |
1086bc09 | 773 | (cd ./gcc && \ |
405ea7a0 NN |
774 | $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \ |
775 | else \ | |
776 | true ; \ | |
777 | fi | |
778 | ||
779 | # install-no-fixedincludes is used because Cygnus can not distribute | |
780 | # the fixed header files. | |
781 | .PHONY: install-no-fixedincludes | |
3866be5d NN |
782 | install-no-fixedincludes: installdirs @install_host_modules_nogcc@ \ |
783 | @install_target_modules@ gcc-no-fixedincludes | |
405ea7a0 | 784 | |
15723a45 | 785 | ### other supporting targets |
405ea7a0 | 786 | |
15723a45 NN |
787 | MAKEDIRS= \ |
788 | $(DESTDIR)$(prefix) \ | |
789 | $(DESTDIR)$(exec_prefix) | |
790 | .PHONY: installdirs | |
791 | installdirs: mkinstalldirs | |
792 | $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS) | |
793 | ||
794 | dir.info: do-install-info | |
795 | if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \ | |
497f816e | 796 | $(srcdir)/texinfo/gen-info-dir $(DESTDIR)$(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \ |
15723a45 NN |
797 | mv -f dir.info.new dir.info ; \ |
798 | else true ; \ | |
405ea7a0 NN |
799 | fi |
800 | ||
15723a45 NN |
801 | dist: |
802 | @echo "Building a full distribution of this tree isn't done" | |
803 | @echo "via 'make dist'. Check out the etc/ subdirectory" | |
804 | ||
805 | etags tags: TAGS | |
806 | ||
807 | # Right now this just builds TAGS in each subdirectory. emacs19 has the | |
808 | # ability to use several tags files at once, so there is probably no need | |
809 | # to combine them into one big TAGS file (like CVS 1.3 does). We could | |
810 | # (if we felt like it) have this Makefile write a piece of elisp which | |
811 | # the user could load to tell emacs19 where all the TAGS files we just | |
812 | # built are. | |
813 | TAGS: do-TAGS | |
814 | ||
15723a45 NN |
815 | # -------------------------------------- |
816 | # Modules which run on the build machine | |
817 | # -------------------------------------- | |
818 | [+ FOR build_modules +] | |
930314a4 NN |
819 | .PHONY: configure-build-[+module+] maybe-configure-build-[+module+] |
820 | maybe-configure-build-[+module+]: | |
e6bfb94a AO |
821 | configure-build-[+module+]: |
822 | @test ! -f $(BUILD_SUBDIR)/[+module+]/Makefile || exit 0; \ | |
823 | [ -d $(BUILD_SUBDIR)/[+module+] ] || \ | |
824 | mkdir $(BUILD_SUBDIR)/[+module+];\ | |
405ea7a0 NN |
825 | r=`${PWD}`; export r; \ |
826 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
827 | AR="$(AR_FOR_BUILD)"; export AR; \ | |
828 | AS="$(AS_FOR_BUILD)"; export AS; \ | |
829 | CC="$(CC_FOR_BUILD)"; export CC; \ | |
830 | CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ | |
831 | CXX="$(CXX_FOR_BUILD)"; export CXX; \ | |
832 | CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ | |
833 | GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \ | |
834 | DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \ | |
835 | LD="$(LD_FOR_BUILD)"; export LD; \ | |
836 | LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \ | |
837 | NM="$(NM_FOR_BUILD)"; export NM; \ | |
838 | RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \ | |
839 | WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \ | |
e393202e NN |
840 | echo Configuring in $(BUILD_SUBDIR)/[+module+]; \ |
841 | cd "$(BUILD_SUBDIR)/[+module+]" || exit 1; \ | |
405ea7a0 NN |
842 | case $(srcdir) in \ |
843 | /* | [A-Za-z]:[\\/]*) \ | |
844 | topdir=$(srcdir) ;; \ | |
845 | *) \ | |
846 | case "$(BUILD_SUBDIR)" in \ | |
847 | .) topdir="../$(srcdir)" ;; \ | |
848 | *) topdir="../../$(srcdir)" ;; \ | |
849 | esac ;; \ | |
850 | esac; \ | |
851 | if [ "$(srcdir)" = "." ] ; then \ | |
852 | if [ "$(BUILD_SUBDIR)" != "." ] ; then \ | |
e393202e | 853 | if $(SHELL) $$s/symlink-tree $${topdir}/[+module+] "no-such-file" ; then \ |
405ea7a0 NN |
854 | if [ -f Makefile ]; then \ |
855 | if $(MAKE) distclean; then \ | |
856 | true; \ | |
857 | else \ | |
858 | exit 1; \ | |
859 | fi; \ | |
860 | else \ | |
861 | true; \ | |
862 | fi; \ | |
863 | else \ | |
864 | exit 1; \ | |
865 | fi; \ | |
866 | else \ | |
867 | true; \ | |
868 | fi; \ | |
869 | srcdiroption="--srcdir=."; \ | |
870 | libsrcdir="."; \ | |
871 | else \ | |
e393202e NN |
872 | srcdiroption="--srcdir=$${topdir}/[+module+]"; \ |
873 | libsrcdir="$$s/[+module+]"; \ | |
405ea7a0 | 874 | fi; \ |
930314a4 NN |
875 | rm -f no-such-file || : ; \ |
876 | CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ | |
877 | $(BUILD_CONFIGARGS) $${srcdiroption} \ | |
878 | --with-build-subdir="$(BUILD_SUBDIR)" \ | |
15723a45 NN |
879 | || exit 1 |
880 | ||
881 | .PHONY: all-build-[+module+] maybe-all-build-[+module+] | |
882 | maybe-all-build-[+module+]: | |
883 | all-build-[+module+]: configure-build-[+module+] | |
884 | @r=`${PWD}`; export r; \ | |
885 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
886 | (cd $(BUILD_SUBDIR)/[+module+] && $(MAKE) all) | |
e393202e | 887 | [+ ENDFOR build_modules +] |
405ea7a0 | 888 | |
15723a45 NN |
889 | # -------------------------------------- |
890 | # Modules which run on the host machine | |
891 | # -------------------------------------- | |
3866be5d | 892 | [+ FOR host_modules +] |
e2b9e2dc NN |
893 | .PHONY: configure-[+module+] maybe-configure-[+module+] |
894 | maybe-configure-[+module+]: | |
e6bfb94a AO |
895 | configure-[+module+]: |
896 | @test ! -f [+module+]/Makefile || exit 0; \ | |
897 | [ -d [+module+] ] || mkdir [+module+]; \ | |
e2b9e2dc NN |
898 | r=`${PWD}`; export r; \ |
899 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
900 | CC="$(CC)"; export CC; \ | |
901 | CFLAGS="$(CFLAGS)"; export CFLAGS; \ | |
902 | CXX="$(CXX)"; export CXX; \ | |
903 | CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ | |
904 | if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ | |
905 | AR="$(AR)"; export AR; \ | |
906 | AS="$(AS)"; export AS; \ | |
907 | CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ | |
908 | DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ | |
909 | LD="$(LD)"; export LD; \ | |
910 | NM="$(NM)"; export NM; \ | |
911 | RANLIB="$(RANLIB)"; export RANLIB; \ | |
912 | WINDRES="$(WINDRES)"; export WINDRES; \ | |
913 | OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ | |
914 | OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ | |
915 | fi; \ | |
916 | echo Configuring in [+module+]; \ | |
917 | cd [+module+] || exit 1; \ | |
918 | case $(srcdir) in \ | |
919 | \.) \ | |
920 | srcdiroption="--srcdir=."; \ | |
921 | libsrcdir=".";; \ | |
922 | /* | [A-Za-z]:[\\/]*) \ | |
923 | srcdiroption="--srcdir=$(srcdir)/[+module+]"; \ | |
924 | libsrcdir="$$s/[+module+]";; \ | |
925 | *) \ | |
926 | srcdiroption="--srcdir=../$(srcdir)/[+module+]"; \ | |
927 | libsrcdir="$$s/[+module+]";; \ | |
928 | esac; \ | |
929 | $(SHELL) $${libsrcdir}/configure \ | |
930 | $(HOST_CONFIGARGS) $${srcdiroption} \ | |
931 | || exit 1 | |
932 | ||
930314a4 NN |
933 | .PHONY: all-[+module+] maybe-all-[+module+] |
934 | maybe-all-[+module+]: | |
db1ac78d | 935 | all-[+module+]: configure-[+module+] |
930314a4 | 936 | @r=`${PWD}`; export r; \ |
405ea7a0 NN |
937 | s=`cd $(srcdir); ${PWD}`; export s; \ |
938 | $(SET_LIB_PATH) \ | |
1086bc09 | 939 | (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ |
3866be5d NN |
940 | IF with_x |
941 | +] $(X11_FLAGS_TO_PASS)[+ | |
930314a4 | 942 | ENDIF with_x +] all) |
405ea7a0 | 943 | |
3866be5d NN |
944 | [+ IF no_check +] |
945 | .PHONY: check-[+module+] | |
946 | check-[+module+]: | |
947 | [+ ELIF no_check_cross +] | |
948 | .PHONY: check-[+module+] | |
949 | # This module is only tested in a native toolchain. | |
950 | check-[+module+]: | |
405ea7a0 | 951 | @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ |
405ea7a0 NN |
952 | r=`${PWD}`; export r; \ |
953 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
954 | $(SET_LIB_PATH) \ | |
1086bc09 | 955 | (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ |
3866be5d NN |
956 | IF with_x |
957 | +] $(X11_FLAGS_TO_PASS)[+ | |
958 | ENDIF with_x +] check); \ | |
405ea7a0 | 959 | fi |
3866be5d NN |
960 | [+ ELSE check +] |
961 | .PHONY: check-[+module+] | |
962 | check-[+module+]: | |
930314a4 | 963 | @r=`${PWD}`; export r; \ |
405ea7a0 NN |
964 | s=`cd $(srcdir); ${PWD}`; export s; \ |
965 | $(SET_LIB_PATH) \ | |
1086bc09 | 966 | (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ |
3866be5d NN |
967 | IF with_x |
968 | +] $(X11_FLAGS_TO_PASS)[+ | |
930314a4 | 969 | ENDIF with_x +] check) |
3866be5d | 970 | [+ ENDIF no_check +] |
405ea7a0 | 971 | |
3866be5d | 972 | [+ IF no_install +] |
930314a4 NN |
973 | .PHONY: install-[+module+] maybe-install-[+module+] |
974 | maybe-install-[+module+]: | |
3866be5d NN |
975 | install-[+module+]: |
976 | [+ ELSE install +] | |
930314a4 NN |
977 | .PHONY: install-[+module+] maybe-install-[+module+] |
978 | maybe-install-[+module+]: | |
3866be5d | 979 | install-[+module+]: installdirs |
930314a4 | 980 | @r=`${PWD}`; export r; \ |
405ea7a0 NN |
981 | s=`cd $(srcdir); ${PWD}`; export s; \ |
982 | $(SET_LIB_PATH) \ | |
1086bc09 | 983 | (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ |
3866be5d NN |
984 | IF with_x |
985 | +] $(X11_FLAGS_TO_PASS)[+ | |
930314a4 | 986 | ENDIF with_x +] install) |
3866be5d NN |
987 | [+ ENDIF no_install +] |
988 | [+ ENDFOR host_modules +] | |
405ea7a0 | 989 | |
15723a45 NN |
990 | # --------------------------------------- |
991 | # Modules which run on the target machine | |
992 | # --------------------------------------- | |
e393202e | 993 | [+ FOR target_modules +] |
930314a4 NN |
994 | .PHONY: configure-target-[+module+] maybe-configure-target-[+module+] |
995 | maybe-configure-target-[+module+]: | |
15723a45 | 996 | |
1086bc09 NN |
997 | # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. |
998 | $(TARGET_SUBDIR)/[+module+]/multilib.out: multilib.out | |
e6bfb94a AO |
999 | @[ -d $(TARGET_SUBDIR)/[+module+] ] || \ |
1000 | mkdir $(TARGET_SUBDIR)/[+module+]; \ | |
1001 | rm -f $(TARGET_SUBDIR)/[+module+]/Makefile || : ; \ | |
1086bc09 | 1002 | cp multilib.out $(TARGET_SUBDIR)/[+module+]/multilib.out |
15723a45 | 1003 | |
e6bfb94a AO |
1004 | configure-target-[+module+]: $(TARGET_SUBDIR)/[+module+]/multilib.out |
1005 | @test ! -f $(TARGET_SUBDIR)/[+module+]/Makefile || exit 0; \ | |
1006 | [ -d $(TARGET_SUBDIR)/[+module+] ] || \ | |
1007 | mkdir $(TARGET_SUBDIR)/[+module+];\ | |
405ea7a0 NN |
1008 | r=`${PWD}`; export r; \ |
1009 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
1010 | $(SET_LIB_PATH) \ | |
1011 | AR="$(AR_FOR_TARGET)"; export AR; \ | |
1012 | AS="$(AS_FOR_TARGET)"; export AS; \ | |
1013 | CC="$(CC_FOR_TARGET)"; export CC; \ | |
3decd77d DD |
1014 | CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ |
1015 | CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \[+ | |
930314a4 NN |
1016 | IF raw_cxx +] |
1017 | CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \ | |
1018 | CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \[+ | |
1019 | ELSE normal_cxx +] | |
1020 | CXX="$(CXX_FOR_TARGET)"; export CXX; \[+ | |
1021 | ENDIF raw_cxx +] | |
405ea7a0 NN |
1022 | CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ |
1023 | GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ | |
1024 | DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ | |
1025 | LD="$(LD_FOR_TARGET)"; export LD; \ | |
1026 | LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ | |
1027 | NM="$(NM_FOR_TARGET)"; export NM; \ | |
1028 | RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ | |
1029 | WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ | |
e393202e NN |
1030 | echo Configuring in $(TARGET_SUBDIR)/[+module+]; \ |
1031 | cd "$(TARGET_SUBDIR)/[+module+]" || exit 1; \ | |
405ea7a0 NN |
1032 | case $(srcdir) in \ |
1033 | /* | [A-Za-z]:[\\/]*) \ | |
1034 | topdir=$(srcdir) ;; \ | |
1035 | *) \ | |
1036 | case "$(TARGET_SUBDIR)" in \ | |
1037 | .) topdir="../$(srcdir)" ;; \ | |
1038 | *) topdir="../../$(srcdir)" ;; \ | |
1039 | esac ;; \ | |
1040 | esac; \ | |
1041 | if [ "$(srcdir)" = "." ] ; then \ | |
1042 | if [ "$(TARGET_SUBDIR)" != "." ] ; then \ | |
e393202e | 1043 | if $(SHELL) $$s/symlink-tree $${topdir}/[+module+] "no-such-file" ; then \ |
405ea7a0 NN |
1044 | if [ -f Makefile ]; then \ |
1045 | if $(MAKE) distclean; then \ | |
1046 | true; \ | |
1047 | else \ | |
1048 | exit 1; \ | |
1049 | fi; \ | |
1050 | else \ | |
1051 | true; \ | |
1052 | fi; \ | |
1053 | else \ | |
1054 | exit 1; \ | |
1055 | fi; \ | |
1056 | else \ | |
1057 | true; \ | |
1058 | fi; \ | |
1059 | srcdiroption="--srcdir=."; \ | |
1060 | libsrcdir="."; \ | |
1061 | else \ | |
e393202e NN |
1062 | srcdiroption="--srcdir=$${topdir}/[+module+]"; \ |
1063 | libsrcdir="$$s/[+module+]"; \ | |
405ea7a0 | 1064 | fi; \ |
930314a4 NN |
1065 | rm -f no-such-file || : ; \ |
1066 | CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ | |
1067 | $(TARGET_CONFIGARGS) $${srcdiroption} \ | |
1068 | --with-target-subdir="$(TARGET_SUBDIR)" \ | |
15723a45 | 1069 | || exit 1 |
405ea7a0 | 1070 | |
930314a4 NN |
1071 | .PHONY: all-target-[+module+] maybe-all-target-[+module+] |
1072 | maybe-all-target-[+module+]: | |
15723a45 | 1073 | all-target-[+module+]: configure-target-[+module+] |
930314a4 | 1074 | @r=`${PWD}`; export r; \ |
405ea7a0 NN |
1075 | s=`cd $(srcdir); ${PWD}`; export s; \ |
1076 | $(SET_LIB_PATH) \ | |
1086bc09 | 1077 | (cd $(TARGET_SUBDIR)/[+module+] && \ |
930314a4 NN |
1078 | $(MAKE) $(TARGET_FLAGS_TO_PASS) [+ |
1079 | IF raw_cxx | |
1080 | +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ | |
1081 | ENDIF raw_cxx | |
1082 | +] all) | |
3866be5d NN |
1083 | [+ IF no_check +] |
1084 | # Dummy target for uncheckable module. | |
1085 | .PHONY: check-target-[+module+] | |
1086 | check-target-[+module+]: | |
1087 | [+ ELSE check +] | |
e393202e NN |
1088 | .PHONY: check-target-[+module+] |
1089 | check-target-[+module+]: | |
930314a4 | 1090 | @r=`${PWD}`; export r; \ |
405ea7a0 NN |
1091 | s=`cd $(srcdir); ${PWD}`; export s; \ |
1092 | $(SET_LIB_PATH) \ | |
1086bc09 | 1093 | (cd $(TARGET_SUBDIR)/[+module+] && \ |
930314a4 NN |
1094 | $(MAKE) $(TARGET_FLAGS_TO_PASS) [+ |
1095 | IF raw_cxx | |
1096 | +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ | |
1097 | ENDIF raw_cxx | |
1098 | +] check) | |
e393202e | 1099 | [+ ENDIF no_check +] |
930314a4 NN |
1100 | [+ IF no_install +] |
1101 | .PHONY: install-target-[+module+] maybe-install-target-[+module+] | |
1102 | maybe-install-target-[+module+]: | |
1103 | # Dummy target for uninstallable. | |
1104 | install-target-[+module+]: | |
1105 | [+ ELSE install +] | |
1106 | .PHONY: install-target-[+module+] maybe-install-target-[+module+] | |
1107 | maybe-install-target-[+module+]: | |
e393202e | 1108 | install-target-[+module+]: installdirs |
930314a4 | 1109 | @r=`${PWD}`; export r; \ |
405ea7a0 NN |
1110 | s=`cd $(srcdir); ${PWD}`; export s; \ |
1111 | $(SET_LIB_PATH) \ | |
1086bc09 | 1112 | (cd $(TARGET_SUBDIR)/[+module+] && \ |
930314a4 | 1113 | $(MAKE) $(TARGET_FLAGS_TO_PASS) install) |
e393202e NN |
1114 | [+ ENDIF no_install +] |
1115 | [+ ENDFOR target_modules +] | |
405ea7a0 | 1116 | |
15723a45 NN |
1117 | # ---------- |
1118 | # GCC module | |
1119 | # ---------- | |
1120 | ||
1121 | # Unfortunately, while gcc _should_ be a host module, | |
1122 | # libgcc is a target module, and gen* programs are | |
1123 | # build modules. So GCC is a sort of hybrid. | |
1124 | ||
405ea7a0 | 1125 | # gcc is the only module which uses GCC_FLAGS_TO_PASS. |
e2b9e2dc NN |
1126 | .PHONY: configure-gcc maybe-configure-gcc |
1127 | maybe-configure-gcc: | |
e6bfb94a AO |
1128 | configure-gcc: |
1129 | @test ! -f gcc/Makefile || exit 0; \ | |
1130 | [ -d gcc ] || mkdir gcc; \ | |
e2b9e2dc NN |
1131 | r=`${PWD}`; export r; \ |
1132 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
1133 | CC="$(CC)"; export CC; \ | |
1134 | CFLAGS="$(CFLAGS)"; export CFLAGS; \ | |
1135 | CXX="$(CXX)"; export CXX; \ | |
1136 | CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ | |
586c0873 | 1137 | TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \ |
e2b9e2dc NN |
1138 | if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ |
1139 | AR="$(AR)"; export AR; \ | |
1140 | AS="$(AS)"; export AS; \ | |
1141 | CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ | |
1142 | DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ | |
1143 | LD="$(LD)"; export LD; \ | |
1144 | NM="$(NM)"; export NM; \ | |
1145 | RANLIB="$(RANLIB)"; export RANLIB; \ | |
1146 | WINDRES="$(WINDRES)"; export WINDRES; \ | |
1147 | OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ | |
1148 | OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ | |
1149 | fi; \ | |
1150 | echo Configuring in gcc; \ | |
1151 | cd gcc || exit 1; \ | |
1152 | case $(srcdir) in \ | |
1153 | \.) \ | |
1154 | srcdiroption="--srcdir=."; \ | |
1155 | libsrcdir=".";; \ | |
1156 | /* | [A-Za-z]:[\\/]*) \ | |
1157 | srcdiroption="--srcdir=$(srcdir)/gcc"; \ | |
1158 | libsrcdir="$$s/gcc";; \ | |
1159 | *) \ | |
1160 | srcdiroption="--srcdir=../$(srcdir)/gcc"; \ | |
1161 | libsrcdir="$$s/gcc";; \ | |
1162 | esac; \ | |
1163 | $(SHELL) $${libsrcdir}/configure \ | |
1164 | $(HOST_CONFIGARGS) $${srcdiroption} \ | |
1165 | || exit 1 | |
1166 | ||
b72e6a2d JM |
1167 | # Don't 'make all' in gcc if it's already been made by 'bootstrap'; that |
1168 | # causes trouble. This wart will be fixed eventually by moving | |
db1ac78d | 1169 | # the bootstrap behavior to this file. |
930314a4 NN |
1170 | .PHONY: all-gcc maybe-all-gcc |
1171 | maybe-all-gcc: | |
db1ac78d | 1172 | all-gcc: configure-gcc |
b72e6a2d JM |
1173 | @if [ -f gcc/stage_last ] ; then \ |
1174 | r=`${PWD}`; export r; \ | |
1175 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
1176 | $(SET_LIB_PATH) \ | |
1086bc09 | 1177 | (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) quickstrap); \ |
db1ac78d | 1178 | else \ |
405ea7a0 NN |
1179 | r=`${PWD}`; export r; \ |
1180 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
1181 | $(SET_LIB_PATH) \ | |
1086bc09 | 1182 | (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) all); \ |
405ea7a0 NN |
1183 | fi |
1184 | ||
1185 | # Building GCC uses some tools for rebuilding "source" files | |
1186 | # like texinfo, bison/byacc, etc. So we must depend on those. | |
1187 | # | |
1188 | # While building GCC, it may be necessary to run various target | |
1189 | # programs like the assembler, linker, etc. So we depend on | |
1190 | # those too. | |
1191 | # | |
1192 | # In theory, on an SMP all those dependencies can be resolved | |
1193 | # in parallel. | |
1194 | # | |
1aa8389d | 1195 | .PHONY: bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap |
db1ac78d | 1196 | bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap: all-bootstrap configure-gcc |
405ea7a0 NN |
1197 | @r=`${PWD}`; export r; \ |
1198 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
1199 | $(SET_LIB_PATH) \ | |
1200 | echo "Bootstrapping the compiler"; \ | |
1201 | cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@ | |
1202 | @r=`${PWD}`; export r; \ | |
1203 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
1204 | case "$@" in \ | |
1205 | *bootstrap4-lean ) \ | |
1206 | msg="Comparing stage3 and stage4 of the compiler"; \ | |
1207 | compare=compare3-lean ;; \ | |
1208 | *bootstrap4 ) msg="Comparing stage3 and stage4 of the compiler"; \ | |
1209 | compare=compare3 ;; \ | |
1210 | *-lean ) msg="Comparing stage2 and stage3 of the compiler"; \ | |
1211 | compare=compare-lean ;; \ | |
1212 | * ) msg="Comparing stage2 and stage3 of the compiler"; \ | |
1213 | compare=compare ;; \ | |
1214 | esac; \ | |
1215 | $(SET_LIB_PATH) \ | |
1216 | echo "$$msg"; \ | |
1217 | cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare | |
1218 | @r=`${PWD}`; export r; \ | |
1219 | s=`cd $(srcdir); ${PWD}` ; export s; \ | |
1220 | $(SET_LIB_PATH) \ | |
1221 | echo "Building runtime libraries"; \ | |
1222 | $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all | |
1223 | ||
1224 | .PHONY: cross | |
1225 | cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld | |
1226 | @r=`${PWD}`; export r; \ | |
1227 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
1228 | $(SET_LIB_PATH) \ | |
1229 | echo "Building the C and C++ compiler"; \ | |
1230 | cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" | |
1231 | @r=`${PWD}`; export r; \ | |
1232 | s=`cd $(srcdir); ${PWD}` ; export s; \ | |
1233 | $(SET_LIB_PATH) \ | |
1234 | echo "Building runtime libraries"; \ | |
1235 | $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \ | |
1236 | LANGUAGES="c c++" all | |
1237 | ||
1238 | .PHONY: check-gcc | |
1239 | check-gcc: | |
1240 | @if [ -f ./gcc/Makefile ] ; then \ | |
1241 | r=`${PWD}`; export r; \ | |
1242 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
1243 | $(SET_LIB_PATH) \ | |
1086bc09 | 1244 | (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check); \ |
405ea7a0 NN |
1245 | else \ |
1246 | true; \ | |
1247 | fi | |
1248 | ||
7d695d07 JM |
1249 | .PHONY: check-gcc-c++ |
1250 | check-gcc-c++: | |
405ea7a0 NN |
1251 | @if [ -f ./gcc/Makefile ] ; then \ |
1252 | r=`${PWD}`; export r; \ | |
1253 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
1254 | $(SET_LIB_PATH) \ | |
1086bc09 | 1255 | (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \ |
405ea7a0 NN |
1256 | else \ |
1257 | true; \ | |
7d695d07 JM |
1258 | fi |
1259 | ||
1260 | .PHONY: check-c++ | |
e9e45685 JM |
1261 | check-c++: |
1262 | $(MAKE) check-target-libstdc++-v3 check-gcc-c++ NOTPARALLEL=parallel-ok | |
405ea7a0 | 1263 | |
930314a4 NN |
1264 | .PHONY: install-gcc maybe-install-gcc |
1265 | maybe-install-gcc: | |
405ea7a0 NN |
1266 | install-gcc: |
1267 | @if [ -f ./gcc/Makefile ] ; then \ | |
1268 | r=`${PWD}`; export r; \ | |
1269 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
1270 | $(SET_LIB_PATH) \ | |
1086bc09 | 1271 | (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ |
405ea7a0 NN |
1272 | else \ |
1273 | true; \ | |
1274 | fi | |
1275 | ||
15723a45 NN |
1276 | # Install the gcc headers files, but not the fixed include files, |
1277 | # which Cygnus is not allowed to distribute. This rule is very | |
1278 | # dependent on the workings of the gcc Makefile.in. | |
1279 | .PHONY: gcc-no-fixedincludes | |
1280 | gcc-no-fixedincludes: | |
1281 | @if [ -f ./gcc/Makefile ]; then \ | |
1282 | rm -rf gcc/tmp-include; \ | |
1283 | mv gcc/include gcc/tmp-include 2>/dev/null; \ | |
1284 | mkdir gcc/include; \ | |
1285 | cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \ | |
1286 | touch gcc/stmp-fixinc gcc/include/fixed; \ | |
1287 | rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \ | |
1288 | r=`${PWD}`; export r; \ | |
1289 | s=`cd $(srcdir); ${PWD}` ; export s; \ | |
1290 | $(SET_LIB_PATH) \ | |
1086bc09 | 1291 | (cd ./gcc && \ |
15723a45 NN |
1292 | $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ |
1293 | rm -rf gcc/include; \ | |
1294 | mv gcc/tmp-include gcc/include 2>/dev/null; \ | |
1295 | else true; fi | |
1296 | ||
ae831be5 NN |
1297 | # -------------------------------------- |
1298 | # Dependencies between different modules | |
1299 | # -------------------------------------- | |
405ea7a0 | 1300 | |
ae831be5 NN |
1301 | # There are two types of dependencies here: 'hard' dependencies, where one |
1302 | # module simply won't build without the other; and 'soft' dependencies, where | |
1303 | # if the depended-on module is missing, the depending module will do without | |
1304 | # or find a substitute somewhere (perhaps installed). Soft dependencies | |
1305 | # are specified by depending on a 'maybe-' target. If you're not sure, | |
1306 | # it's safer to use a soft dependency. | |
1307 | ||
1308 | # Host modules specific to gcc. | |
e2b9e2dc | 1309 | # GCC needs to identify certain tools. |
b4a77b47 | 1310 | configure-gcc: maybe-configure-binutils maybe-configure-gas maybe-configure-ld maybe-configure-bison maybe-configure-flex |
ae831be5 NN |
1311 | all-gcc: maybe-all-libiberty maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib |
1312 | # This is a slightly kludgy method of getting dependencies on | |
1313 | # all-build-libiberty correct; it would be better to build it every time. | |
1314 | all-gcc: maybe-all-build-libiberty | |
1315 | all-bootstrap: maybe-all-libiberty maybe-all-texinfo maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib | |
1316 | ||
1317 | # Host modules specific to gdb. | |
e2b9e2dc | 1318 | # GDB needs to know that the simulator is being built. |
b4a77b47 | 1319 | configure-gdb: maybe-configure-tcl maybe-configure-tk maybe-configure-sim |
ae831be5 NN |
1320 | GDB_TK = @GDB_TK@ |
1321 | all-gdb: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-mmalloc maybe-all-readline maybe-all-bison maybe-all-byacc maybe-all-sim $(gdbnlmrequirements) $(GDB_TK) | |
1322 | install-gdb: maybe-install-tcl maybe-install-tk maybe-install-itcl maybe-install-tix maybe-install-libgui | |
59da4fe6 | 1323 | configure-libgui: maybe-configure-tcl maybe-configure-tk |
ae831be5 NN |
1324 | all-libgui: maybe-all-tcl maybe-all-tk maybe-all-itcl |
1325 | ||
1326 | # Host modules specific to binutils. | |
b4a77b47 | 1327 | configure-bfd: configure-libiberty |
930314a4 NN |
1328 | all-bfd: maybe-all-libiberty maybe-all-intl |
1329 | all-binutils: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-flex maybe-all-bison maybe-all-byacc maybe-all-intl | |
ae831be5 NN |
1330 | # We put install-opcodes before install-binutils because the installed |
1331 | # binutils might be on PATH, and they might need the shared opcodes | |
1332 | # library. | |
1333 | install-binutils: maybe-install-opcodes | |
1334 | all-gas: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-intl | |
1335 | all-gprof: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-intl | |
1336 | all-ld: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-bison maybe-all-byacc maybe-all-flex maybe-all-intl | |
1337 | all-opcodes: maybe-all-bfd maybe-all-libiberty | |
1338 | ||
1339 | # Other host modules in the 'src' repository. | |
930314a4 | 1340 | all-dejagnu: maybe-all-tcl maybe-all-expect maybe-all-tk |
b4a77b47 | 1341 | configure-expect: maybe-configure-tcl maybe-configure-tk |
930314a4 | 1342 | all-expect: maybe-all-tcl maybe-all-tk |
b4a77b47 | 1343 | configure-itcl: maybe-configure-tcl maybe-configure-tk |
ae831be5 NN |
1344 | all-itcl: maybe-all-tcl maybe-all-tk |
1345 | # We put install-tcl before install-itcl because itcl wants to run a | |
1346 | # program on installation which uses the Tcl libraries. | |
1347 | install-itcl: maybe-install-tcl | |
122bfa92 | 1348 | all-sid: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-tcl maybe-all-tk |
ae831be5 | 1349 | install-sid: maybe-install-tcl maybe-install-tk |
a36d530e | 1350 | all-sim: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-readline maybe-configure-gdb |
b4a77b47 | 1351 | configure-tk: maybe-configure-tcl |
ae831be5 | 1352 | all-tk: maybe-all-tcl |
b4a77b47 | 1353 | configure-tix: maybe-configure-tcl maybe-configure-tk |
ae831be5 NN |
1354 | all-tix: maybe-all-tcl maybe-all-tk |
1355 | all-texinfo: maybe-all-libiberty | |
1356 | ||
1357 | # Other host modules. Warning, these are not well tested. | |
1358 | all-autoconf: maybe-all-m4 maybe-all-texinfo | |
1359 | all-automake: maybe-all-m4 maybe-all-texinfo | |
1360 | all-bison: maybe-all-texinfo | |
1361 | all-diff: maybe-all-libiberty | |
1362 | all-fastjar: maybe-all-zlib maybe-all-libiberty | |
930314a4 NN |
1363 | all-fileutils: maybe-all-libiberty |
1364 | all-flex: maybe-all-libiberty maybe-all-bison maybe-all-byacc | |
930314a4 NN |
1365 | all-gzip: maybe-all-libiberty |
1366 | all-hello: maybe-all-libiberty | |
930314a4 NN |
1367 | all-m4: maybe-all-libiberty maybe-all-texinfo |
1368 | all-make: maybe-all-libiberty | |
930314a4 NN |
1369 | all-patch: maybe-all-libiberty |
1370 | all-prms: maybe-all-libiberty | |
930314a4 NN |
1371 | all-recode: maybe-all-libiberty |
1372 | all-sed: maybe-all-libiberty | |
1373 | all-send-pr: maybe-all-prms | |
930314a4 | 1374 | all-tar: maybe-all-libiberty |
930314a4 | 1375 | all-uudecode: maybe-all-libiberty |
ae831be5 NN |
1376 | |
1377 | ALL_GCC = maybe-all-gcc | |
1378 | ALL_GCC_C = $(ALL_GCC) maybe-all-target-newlib maybe-all-target-libgloss | |
1379 | ALL_GCC_CXX = $(ALL_GCC_C) maybe-all-target-libstdc++-v3 | |
1380 | ||
1381 | # Target modules specific to gcc. | |
b4a77b47 DD |
1382 | configure-target-boehm-gc: $(ALL_GCC_C) maybe-configure-target-qthreads |
1383 | configure-target-fastjar: maybe-configure-target-zlib | |
930314a4 | 1384 | all-target-fastjar: maybe-all-target-zlib maybe-all-target-libiberty |
b4a77b47 | 1385 | configure-target-libf2c: $(ALL_GCC_C) |
ae831be5 | 1386 | all-target-libf2c: maybe-all-target-libiberty |
b4a77b47 DD |
1387 | configure-target-libffi: $(ALL_GCC_C) |
1388 | configure-target-libjava: $(ALL_GCC_C) maybe-configure-target-zlib maybe-configure-target-boehm-gc maybe-configure-target-qthreads maybe-configure-target-libffi | |
ae831be5 | 1389 | all-target-libjava: maybe-all-fastjar maybe-all-target-zlib maybe-all-target-boehm-gc maybe-all-target-qthreads maybe-all-target-libffi |
b4a77b47 | 1390 | configure-target-libobjc: $(ALL_GCC_C) |
ae831be5 | 1391 | all-target-libobjc: maybe-all-target-libiberty |
b4a77b47 | 1392 | configure-target-libstdc++-v3: $(ALL_GCC_C) |
ae831be5 | 1393 | all-target-libstdc++-v3: maybe-all-target-libiberty |
b4a77b47 | 1394 | configure-target-zlib: $(ALL_GCC_C) |
a9590527 | 1395 | |
ae831be5 | 1396 | # Target modules in the 'src' repository. |
b4a77b47 DD |
1397 | configure-target-examples: $(ALL_GCC_C) |
1398 | configure-target-libgloss: $(ALL_GCC) | |
ae831be5 | 1399 | all-target-libgloss: maybe-configure-target-newlib |
b4a77b47 DD |
1400 | configure-target-libiberty: $(ALL_GCC_C) |
1401 | configure-target-libtermcap: $(ALL_GCC_C) | |
1402 | configure-target-newlib: $(ALL_GCC) | |
7dda0df6 | 1403 | configure-target-rda: $(ALL_GCC_C) |
b4a77b47 | 1404 | configure-target-winsup: $(ALL_GCC_C) |
ae831be5 | 1405 | all-target-winsup: maybe-all-target-libiberty maybe-all-target-libtermcap |
a9590527 | 1406 | |
ae831be5 | 1407 | # Other target modules. Warning, these are not well tested. |
b4a77b47 | 1408 | configure-target-gperf: $(ALL_GCC_CXX) |
ae831be5 | 1409 | all-target-gperf: maybe-all-target-libiberty maybe-all-target-libstdc++-v3 |
b4a77b47 | 1410 | configure-target-qthreads: $(ALL_GCC_C) |
907a7241 | 1411 | |
930314a4 NN |
1412 | # Dependencies of maybe-foo on foo. These are used because, for example, |
1413 | # all-gcc only depends on all-gas if gas is present and being configured. | |
1414 | @maybe_dependencies@ | |
1415 | ||
a2cc058a NN |
1416 | # Serialization dependencies. Host configures don't work well in parallel to |
1417 | # each other, due to contention over config.cache. Target configures and | |
1418 | # build configures are similar. | |
1419 | @serialization_dependencies@ | |
1420 | ||
15723a45 NN |
1421 | # -------------------------------- |
1422 | # Regenerating top level configury | |
1423 | # -------------------------------- | |
405ea7a0 | 1424 | |
1086bc09 NN |
1425 | # Multilib.out tells target dirs what multilibs they should build. |
1426 | # There is really only one copy. We use the 'timestamp' method to | |
1427 | # work around various timestamp bugs on some systems. | |
1428 | # We use move-if-change so that it's only considered updated when it | |
1429 | # actually changes, because it has to depend on a phony target. | |
e6bfb94a | 1430 | multilib.out: maybe-all-gcc |
1086bc09 NN |
1431 | @r=`${PWD}`; export r; \ |
1432 | echo "Checking multilib configuration..."; \ | |
1433 | $(CC_FOR_TARGET) --print-multi-lib > multilib.tmp 2> /dev/null ; \ | |
1434 | $(SHELL) $(srcdir)/move-if-change multilib.tmp multilib.out ; \ | |
1086bc09 | 1435 | |
405ea7a0 | 1436 | # Rebuilding Makefile.in, using autogen. |
43be203f | 1437 | AUTOGEN = autogen |
6b784d9f | 1438 | $(srcdir)/Makefile.in: @MAINT@ $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def |
43be203f | 1439 | cd $(srcdir) && $(AUTOGEN) Makefile.def |
405ea7a0 | 1440 | |
a0da8069 | 1441 | # Rebuilding Makefile. |
43be203f AO |
1442 | Makefile: $(srcdir)/Makefile.in config.status |
1443 | CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status | |
1444 | ||
1445 | config.status: configure $(gcc_version_trigger) | |
a0da8069 | 1446 | $(SHELL) ./config.status --recheck |
405ea7a0 | 1447 | |
a0da8069 | 1448 | # Rebuilding configure. |
43be203f | 1449 | AUTOCONF = autoconf |
6b784d9f | 1450 | $(srcdir)/configure: @MAINT@ $(srcdir)/configure.in $(srcdir)/config/acx.m4 |
43be203f | 1451 | cd $(srcdir) && $(AUTOCONF) |
405ea7a0 | 1452 | # |
405ea7a0 NN |
1453 | |
1454 | .NOEXPORT: | |
1455 | MAKEOVERRIDES= | |
1456 | ||
43be203f AO |
1457 | # Tell GNU make 3.79 not to run the top level in parallel. This |
1458 | # prevents contention for $builddir/$target/config.cache, as well | |
1459 | # as minimizing scatter in file system caches. | |
1460 | NOTPARALLEL = .NOTPARALLEL | |
1461 | $(NOTPARALLEL): | |
1462 | ||
405ea7a0 | 1463 | # end of Makefile.in |