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