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