]>
Commit | Line | Data |
---|---|---|
52b809e4 | 1 | [+ AutoGen5 template -*- Mode: Makefile -*- |
bba02726 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, | |
5a5996f9 | 9 | # 1999, 2000, 2001, 2002, 2003 Free Software Foundation |
bba02726 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 | ||
ff0592df NN |
26 | # ------------------------------- |
27 | # Standard Autoconf-set variables | |
28 | # ------------------------------- | |
c002f9d3 | 29 | VPATH=@srcdir@ |
c002f9d3 NN |
30 | |
31 | build_alias=@build_alias@ | |
7e9ae190 | 32 | build=@build@ |
c002f9d3 | 33 | host_alias=@host_alias@ |
7e9ae190 | 34 | host=@host@ |
c002f9d3 | 35 | target_alias=@target_alias@ |
7e9ae190 | 36 | target=@target@ |
c002f9d3 | 37 | |
ff0592df | 38 | program_transform_name = @program_transform_name@ |
1ae955ba NN |
39 | |
40 | prefix = @prefix@ | |
41 | exec_prefix = @exec_prefix@ | |
42 | ||
ff0592df NN |
43 | srcdir = @srcdir@ |
44 | ||
1ae955ba 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@ | |
bba02726 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 | |
bba02726 | 66 | |
282c0e47 NN |
67 | INSTALL = @INSTALL@ |
68 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
69 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | |
70 | INSTALL_DATA = @INSTALL_DATA@ | |
bba02726 | 71 | |
ff0592df NN |
72 | # ------------------------------------------------- |
73 | # Miscellaneous non-standard autoconf-set variables | |
74 | # ------------------------------------------------- | |
bba02726 | 75 | |
ff0592df | 76 | links=@configlinks@ |
ff0592df NN |
77 | # The file containing GCC's version number. |
78 | gcc_version_trigger = @gcc_version_trigger@ | |
79 | gcc_version = @gcc_version@ | |
bba02726 | 80 | |
ff0592df NN |
81 | # The gcc driver likes to know the arguments it was configured with. |
82 | TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@ | |
bba02726 | 83 | |
ff0592df NN |
84 | gxx_include_dir = @gxx_include_dir@ |
85 | libstdcxx_incdir = @libstdcxx_incdir@ | |
bba02726 | 86 | |
ff0592df NN |
87 | tooldir = @tooldir@ |
88 | build_tooldir = @build_tooldir@ | |
bba02726 | 89 | |
ff0592df NN |
90 | # Directory in which the compiler finds executables, libraries, etc. |
91 | libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version) | |
92 | GDB_NLM_DEPS = | |
bba02726 | 93 | |
ff0592df NN |
94 | # This is the name of the environment variable used for the path to |
95 | # the libraries. | |
96 | RPATH_ENVVAR = @RPATH_ENVVAR@ | |
bba02726 | 97 | |
ff0592df 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@ | |
bba02726 | 101 | |
ff0592df 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); | |
bba02726 | 107 | |
ff0592df 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. | |
5230d454 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} | |
ff0592df 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@ | |
148 | CFLAGS_FOR_BUILD = $(CFLAGS) | |
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. | |
ff0592df NN |
154 | BUILD_PREFIX = @BUILD_PREFIX@ |
155 | BUILD_PREFIX_1 = @BUILD_PREFIX_1@ | |
bba02726 | 156 | |
712e2a32 NN |
157 | BISON=@BISON@ |
158 | USUAL_BISON = `if [ -f $$r/bison/bison ] ; then \ | |
bba02726 NN |
159 | echo $$r/bison/bison -L $$s/bison/ ; \ |
160 | else \ | |
161 | echo bison ; \ | |
162 | fi` | |
163 | ||
ff0592df | 164 | DEFAULT_YACC = @DEFAULT_YACC@ |
712e2a32 NN |
165 | YACC=@YACC@ |
166 | USUAL_YACC = `if [ -f $$r/bison/bison ] ; then \ | |
bba02726 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 | ||
ff0592df | 174 | DEFAULT_LEX = @DEFAULT_LEX@ |
712e2a32 NN |
175 | LEX=@LEX@ |
176 | USUAL_LEX = `if [ -f $$r/flex/flex ] ; \ | |
bba02726 NN |
177 | then echo $$r/flex/flex ; \ |
178 | else echo ${DEFAULT_LEX} ; fi` | |
179 | ||
ff0592df | 180 | DEFAULT_M4 = @DEFAULT_M4@ |
bba02726 NN |
181 | M4 = `if [ -f $$r/m4/m4 ] ; \ |
182 | then echo $$r/m4/m4 ; \ | |
183 | else echo ${DEFAULT_M4} ; fi` | |
184 | ||
37e8e528 | 185 | # For an installed makeinfo, we require it to be from texinfo 4.2 or |
bba02726 | 186 | # higher, else we use the "missing" dummy. |
712e2a32 NN |
187 | MAKEINFO=@MAKEINFO@ |
188 | USUAL_MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \ | |
bba02726 NN |
189 | then echo $$r/texinfo/makeinfo/makeinfo ; \ |
190 | else if (makeinfo --version \ | |
37e8e528 | 191 | | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])') >/dev/null 2>&1; \ |
bba02726 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. | |
8997bae8 DD |
197 | # (Default to avoid splitting info files by setting the threshold high.) |
198 | MAKEINFOFLAGS = --split-size=5000000 | |
bba02726 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 | ||
ff0592df NN |
208 | # --------------------------------------------- |
209 | # Programs producing files for the HOST machine | |
210 | # --------------------------------------------- | |
bba02726 | 211 | |
ff0592df 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 | |
bba02726 | 215 | |
ff0592df | 216 | AS = @AS@ |
bba02726 | 217 | |
ff0592df NN |
218 | AR = @AR@ |
219 | AR_FLAGS = rc | |
bba02726 | 220 | |
ff0592df NN |
221 | CC = @CC@ |
222 | CFLAGS = @CFLAGS@ | |
223 | LIBCFLAGS = $(CFLAGS) | |
bba02726 | 224 | |
ff0592df NN |
225 | CXX = @CXX@ |
226 | CXXFLAGS = @CXXFLAGS@ | |
227 | LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates | |
bba02726 | 228 | |
ff0592df | 229 | DLLTOOL = @DLLTOOL@ |
bba02726 | 230 | |
ff0592df | 231 | NM = @NM@ |
43bdb69a | 232 | |
ff0592df NN |
233 | LD = @LD@ |
234 | LDFLAGS = | |
43bdb69a | 235 | |
ff0592df | 236 | RANLIB = @RANLIB@ |
bba02726 | 237 | |
ff0592df | 238 | WINDRES = @WINDRES@ |
bba02726 | 239 | |
ff0592df NN |
240 | PICFLAG = |
241 | ||
242 | # ----------------------------------------------- | |
243 | # Programs producing files for the TARGET machine | |
244 | # ----------------------------------------------- | |
bba02726 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 | ||
426ce14a | 250 | FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@ |
bba02726 | 251 | |
ff0592df 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 \ | |
7e9ae190 | 257 | if [ '$(host)' = '$(target)' ] ; then \ |
ff0592df NN |
258 | echo $(AR); \ |
259 | else \ | |
260 | echo ar | sed '$(program_transform_name)' ; \ | |
261 | fi; \ | |
262 | fi` | |
bba02726 | 263 | |
712e2a32 NN |
264 | AS_FOR_TARGET=@AS_FOR_TARGET@ |
265 | USUAL_AS_FOR_TARGET = ` \ | |
bba02726 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 \ | |
7e9ae190 | 271 | if [ '$(host)' = '$(target)' ] ; then \ |
bba02726 NN |
272 | echo $(AS); \ |
273 | else \ | |
81011f17 | 274 | echo as | sed '$(program_transform_name)' ; \ |
bba02726 NN |
275 | fi; \ |
276 | fi` | |
277 | ||
ff0592df 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 | |
bba02726 | 298 | |
712e2a32 NN |
299 | DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@ |
300 | USUAL_DLLTOOL_FOR_TARGET = ` \ | |
bba02726 NN |
301 | if [ -f $$r/binutils/dlltool ] ; then \ |
302 | echo $$r/binutils/dlltool ; \ | |
303 | else \ | |
7e9ae190 | 304 | if [ '$(host)' = '$(target)' ] ; then \ |
bba02726 NN |
305 | echo $(DLLTOOL); \ |
306 | else \ | |
81011f17 | 307 | echo dlltool | sed '$(program_transform_name)' ; \ |
bba02726 NN |
308 | fi; \ |
309 | fi` | |
310 | ||
ff0592df 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 ; \ | |
bba02726 | 319 | else \ |
7e9ae190 | 320 | if [ '$(host)' = '$(target)' ] ; then \ |
ff0592df | 321 | echo $(LD); \ |
bba02726 | 322 | else \ |
ff0592df | 323 | echo ld | sed '$(program_transform_name)' ; \ |
bba02726 NN |
324 | fi; \ |
325 | fi` | |
326 | ||
ff0592df 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 ; \ | |
bba02726 | 335 | else \ |
7e9ae190 | 336 | if [ '$(host)' = '$(target)' ] ; then \ |
ff0592df | 337 | echo $(NM); \ |
bba02726 | 338 | else \ |
ff0592df | 339 | echo nm | sed '$(program_transform_name)' ; \ |
bba02726 NN |
340 | fi; \ |
341 | fi` | |
342 | ||
712e2a32 NN |
343 | RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@ |
344 | USUAL_RANLIB_FOR_TARGET = ` \ | |
bba02726 NN |
345 | if [ -f $$r/binutils/ranlib ] ; then \ |
346 | echo $$r/binutils/ranlib ; \ | |
347 | else \ | |
7e9ae190 | 348 | if [ '$(host)' = '$(target)' ] ; then \ |
bba02726 NN |
349 | if [ x'$(RANLIB)' != x ]; then \ |
350 | echo $(RANLIB); \ | |
351 | else \ | |
352 | echo ranlib; \ | |
353 | fi; \ | |
354 | else \ | |
81011f17 | 355 | echo ranlib | sed '$(program_transform_name)' ; \ |
bba02726 NN |
356 | fi; \ |
357 | fi` | |
358 | ||
ff0592df 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 ; \ | |
bba02726 | 363 | else \ |
7e9ae190 | 364 | if [ '$(host)' = '$(target)' ] ; then \ |
ff0592df | 365 | echo $(WINDRES); \ |
bba02726 | 366 | else \ |
ff0592df | 367 | echo windres | sed '$(program_transform_name)' ; \ |
bba02726 NN |
368 | fi; \ |
369 | fi` | |
370 | ||
ff0592df NN |
371 | PICFLAG_FOR_TARGET = |
372 | ||
373 | # ------------------------------------ | |
374 | # Miscellaneous targets and flag lists | |
375 | # ------------------------------------ | |
376 | ||
bba02726 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 | ||
bba02726 | 382 | #### host and target specific makefile fragments come in here. |
bafecfd6 NN |
383 | @target_makefile_frag@ |
384 | @alphaieee_frag@ | |
385 | @ospace_frag@ | |
386 | @host_makefile_frag@ | |
bba02726 NN |
387 | ### |
388 | ||
389 | # Flags to pass down to all sub-makes. | |
47cd8327 NN |
390 | BASE_FLAGS_TO_PASS = [+ FOR flags_to_pass +]\ |
391 | "[+flag+]=$([+flag+])" [+ ENDFOR flags_to_pass +]\ | |
392 | "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" | |
bba02726 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 = \ | |
c5e4bb70 NN |
400 | CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \ |
401 | RAW_CXX_FOR_TARGET='$(RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \ | |
bba02726 NN |
402 | |
403 | # Flags to pass down to most sub-makes, in which we're building with | |
404 | # the host environment. | |
bba02726 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)' \ | |
76ab491a | 413 | 'RANLIB=$(RANLIB)' \ |
bba02726 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. | |
bba02726 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. | |
657b58f4 | 454 | # The BUILD_* variables are a special case, which are used for the gcc |
bba02726 NN |
455 | # cross-building scheme. |
456 | EXTRA_GCC_FLAGS = \ | |
457 | 'AR=$(AR)' \ | |
458 | 'AS=$(AS)' \ | |
459 | 'CC=$(CC)' \ | |
460 | 'CXX=$(CXX)' \ | |
461 | 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \ | |
bba02726 NN |
462 | 'BUILD_PREFIX=$(BUILD_PREFIX)' \ |
463 | 'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \ | |
464 | 'NM=$(NM)' \ | |
76ab491a | 465 | 'RANLIB=$(RANLIB)' \ |
bba02726 NN |
466 | 'WINDRES=$$(WINDRES_FOR_TARGET)' \ |
467 | "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \ | |
468 | "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ | |
469 | "`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s/.*=$$/XFOO=/`" \ | |
470 | "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s/.*=$$/XFOO=/`" \ | |
471 | "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s/.*=$$/XFOO=/`" \ | |
472 | "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \ | |
473 | "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \ | |
474 | "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \ | |
475 | "`echo 'ENQUIRE=$(ENQUIRE)' | sed -e s/.*=$$/XFOO=/`" \ | |
476 | "`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \ | |
477 | "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" | |
478 | ||
479 | GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) | |
480 | ||
9b520963 NN |
481 | .PHONY: configure-host |
482 | configure-host: maybe-configure-gcc [+ | |
483 | FOR host_modules +] \ | |
484 | maybe-configure-[+module+][+ | |
485 | ENDFOR host_modules +] | |
486 | .PHONY: configure-target | |
487 | configure-target: [+ | |
488 | FOR target_modules +] \ | |
489 | maybe-configure-target-[+module+][+ | |
490 | ENDFOR target_modules +] | |
bba02726 | 491 | |
bba02726 NN |
492 | # The target built for a native build. |
493 | .PHONY: all.normal | |
9b520963 NN |
494 | all.normal: @all_build_modules@ all-host all-target |
495 | ||
496 | .PHONY: all-host | |
497 | all-host: maybe-all-gcc [+ | |
498 | FOR host_modules +] \ | |
499 | maybe-all-[+module+][+ | |
500 | ENDFOR host_modules +] | |
501 | .PHONY: all-target | |
502 | all-target: [+ | |
503 | FOR target_modules +] \ | |
504 | maybe-all-target-[+module+][+ | |
505 | ENDFOR target_modules +] | |
bba02726 NN |
506 | |
507 | # Do a target for all the subdirectories. A ``make do-X'' will do a | |
508 | # ``make X'' in all subdirectories (because, in general, there is a | |
509 | # dependency (below) of X upon do-X, a ``make X'' will also do this, | |
510 | # but it may do additional work as well). | |
d6ebd419 | 511 | [+ FOR recursive_targets +] |
878813bd | 512 | .PHONY: do-[+make_target+] |
657b58f4 NN |
513 | do-[+make_target+]: [+make_target+]-host [+make_target+]-target |
514 | ||
515 | .PHONY: [+make_target+]-host | |
516 | [+make_target+]-host: maybe-[+make_target+]-gcc [+ | |
517 | FOR host_modules +] \ | |
518 | maybe-[+make_target+]-[+module+][+ | |
519 | ENDFOR host_modules +] | |
520 | ||
521 | .PHONY: [+make_target+]-target | |
522 | [+make_target+]-target: [+ | |
523 | FOR target_modules +] \ | |
524 | maybe-[+make_target+]-target-[+module+][+ | |
525 | ENDFOR target_modules +] | |
526 | ||
527 | # GCC, the eternal special case | |
528 | .PHONY: maybe-[+make_target+]-gcc [+make_target+]-gcc | |
529 | maybe-[+make_target+]-gcc: | |
530 | [+make_target+]-gcc: [+ | |
531 | FOR depend +]\ | |
532 | [+depend+]-gcc [+ | |
533 | ENDFOR depend +] | |
534 | @[ -f ./gcc/Makefile ] || exit 0; \ | |
5230d454 L |
535 | r=`${PWD_COMMAND}`; export r; \ |
536 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
657b58f4 NN |
537 | $(SET_LIB_PATH) \ |
538 | for flag in $(EXTRA_GCC_FLAGS); do \ | |
539 | eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ | |
540 | done; \ | |
541 | echo "Doing [+make_target+] in gcc" ; \ | |
542 | (cd gcc && \ | |
543 | $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ | |
544 | "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ | |
545 | "RANLIB=$${RANLIB}" \ | |
546 | "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ | |
547 | [+make_target+]) \ | |
548 | || exit 1 | |
549 | ||
550 | # Host modules. | |
551 | [+ FOR host_modules +] | |
552 | .PHONY: maybe-[+make_target+]-[+module+] [+make_target+]-[+module+] | |
553 | maybe-[+make_target+]-[+module+]: | |
554 | [+ IF (match-value? = "missing" (get "make_target") ) +] | |
555 | # [+module+] doesn't support [+make_target+]. | |
556 | [+make_target+]-[+module+]: | |
557 | [+ ELSE +] | |
558 | [+make_target+]-[+module+]: [+ | |
559 | FOR depend +]\ | |
560 | [+depend+]-[+module+] [+ | |
561 | ENDFOR depend +] | |
562 | @[ -f ./[+module+]/Makefile ] || exit 0; \ | |
5230d454 L |
563 | r=`${PWD_COMMAND}`; export r; \ |
564 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
bba02726 | 565 | $(SET_LIB_PATH) \ |
657b58f4 NN |
566 | for flag in $(EXTRA_HOST_FLAGS); do \ |
567 | eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ | |
568 | done; \ | |
569 | echo "Doing [+make_target+] in [+module+]" ; \ | |
570 | (cd [+module+] && \ | |
571 | $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ | |
572 | "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ | |
573 | "RANLIB=$${RANLIB}" \ | |
574 | "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ | |
575 | [+make_target+]) \ | |
576 | || exit 1 | |
577 | [+ ENDIF +] | |
578 | [+ ENDFOR host_modules +] | |
579 | ||
580 | # Target modules. | |
581 | [+ FOR target_modules +] | |
582 | .PHONY: maybe-[+make_target+]-target-[+module+] [+make_target+]-target-[+module+] | |
583 | maybe-[+make_target+]-target-[+module+]: | |
584 | [+ IF (match-value? = "missing" (get "make_target") ) +] | |
585 | # [+module+] doesn't support [+make_target+]. | |
ea170cd1 | 586 | [+make_target+]-target-[+module+]: |
657b58f4 NN |
587 | [+ ELSE +] |
588 | [+make_target+]-target-[+module+]: [+ | |
589 | FOR depend +]\ | |
590 | [+depend+]-target-[+module+] [+ | |
591 | ENDFOR depend +] | |
592 | @[ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] || exit 0 ; \ | |
5230d454 L |
593 | r=`${PWD_COMMAND}`; export r; \ |
594 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
bba02726 | 595 | $(SET_LIB_PATH) \ |
657b58f4 NN |
596 | echo "Doing [+make_target+] in $(TARGET_SUBDIR)/[+module+]" ; \ |
597 | for flag in $(EXTRA_TARGET_FLAGS); do \ | |
598 | eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ | |
599 | done; \ | |
600 | (cd $(TARGET_SUBDIR)/[+module+] && \ | |
601 | $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ | |
602 | "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ | |
603 | "RANLIB=$${RANLIB}" \ | |
604 | "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ | |
605 | [+make_target+]) \ | |
606 | || exit 1 | |
607 | [+ ENDIF +] | |
608 | [+ ENDFOR target_modules +] | |
d6ebd419 NN |
609 | [+ ENDFOR recursive_targets +] |
610 | ||
bba02726 NN |
611 | # Here are the targets which correspond to the do-X targets. |
612 | ||
613 | .PHONY: info installcheck dvi install-info | |
614 | .PHONY: clean distclean mostlyclean maintainer-clean realclean | |
615 | .PHONY: local-clean local-distclean local-maintainer-clean | |
616 | info: do-info | |
617 | installcheck: do-installcheck | |
618 | dvi: do-dvi | |
619 | ||
5b6edf66 NN |
620 | # Make sure makeinfo is built before we do a `make info', if we're |
621 | # in fact building texinfo. | |
622 | do-info: maybe-all-texinfo | |
bba02726 NN |
623 | |
624 | install-info: do-install-info dir.info | |
5230d454 | 625 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ |
bba02726 | 626 | if [ -f dir.info ] ; then \ |
8ccfe116 | 627 | $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info ; \ |
bba02726 NN |
628 | else true ; fi |
629 | ||
630 | local-clean: | |
631 | -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log | |
632 | ||
633 | local-distclean: | |
634 | -rm -f Makefile config.status config.cache mh-frag mt-frag | |
af9955fa | 635 | -rm -f multilib.out multilib.tmp maybedep.tmp serdep.tmp |
bba02726 NN |
636 | -if [ "$(TARGET_SUBDIR)" != "." ]; then \ |
637 | rm -rf $(TARGET_SUBDIR); \ | |
638 | else true; fi | |
f29d8007 | 639 | -rm -rf $(BUILD_SUBDIR) |
bba02726 NN |
640 | -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile |
641 | -rm -f texinfo/doc/Makefile texinfo/po/POTFILES | |
642 | -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null | |
643 | -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null | |
644 | -rmdir fastjar gcc libiberty texinfo zlib 2>/dev/null | |
645 | ||
646 | local-maintainer-clean: | |
647 | @echo "This command is intended for maintainers to use;" | |
648 | @echo "it deletes files that may require special tools to rebuild." | |
649 | ||
650 | clean: do-clean local-clean | |
651 | mostlyclean: do-mostlyclean local-clean | |
652 | distclean: do-distclean local-clean local-distclean | |
653 | maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean | |
654 | maintainer-clean: local-distclean | |
655 | realclean: maintainer-clean | |
656 | ||
657b58f4 NN |
657 | # Extra dependency for clean-target, owing to the mixed nature of gcc |
658 | clean-target: clean-target-libgcc | |
bba02726 NN |
659 | clean-target-libgcc: |
660 | test ! -d gcc/libgcc || \ | |
661 | (cd gcc/libgcc && find . -type d -print) | \ | |
662 | while read d; do rm -f gcc/$$d/libgcc.a || : ; done | |
663 | -rm -rf gcc/libgcc | |
664 | ||
665 | # Check target. | |
666 | ||
667 | .PHONY: check do-check | |
668 | check: | |
7f74e6a3 | 669 | $(MAKE) do-check |
bba02726 | 670 | |
8ecc6504 | 671 | # Only include modules actually being configured and built. |
70ffc148 NN |
672 | do-check: maybe-check-gcc [+ |
673 | FOR host_modules +] \ | |
674 | maybe-check-[+module+][+ | |
675 | ENDFOR host_modules +][+ | |
676 | FOR target_modules +] \ | |
677 | maybe-check-target-[+module+][+ | |
678 | ENDFOR target_modules +] | |
bba02726 NN |
679 | |
680 | # Automated reporting of test results. | |
681 | ||
682 | warning.log: build.log | |
683 | $(srcdir)/contrib/warn_summary build.log > $@ | |
684 | ||
685 | mail-report.log: | |
686 | if test x'$(BOOT_CFLAGS)' != x''; then \ | |
687 | BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \ | |
688 | fi; \ | |
689 | $(srcdir)/contrib/test_summary -t >$@ | |
690 | chmod +x $@ | |
691 | echo If you really want to send e-mail, run ./$@ now | |
692 | ||
693 | mail-report-with-warnings.log: warning.log | |
694 | if test x'$(BOOT_CFLAGS)' != x''; then \ | |
695 | BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \ | |
696 | fi; \ | |
697 | $(srcdir)/contrib/test_summary -t -i warning.log >$@ | |
698 | chmod +x $@ | |
699 | echo If you really want to send e-mail, run ./$@ now | |
700 | ||
701 | # Installation targets. | |
702 | ||
c5ab3a90 | 703 | .PHONY: install uninstall |
9b520963 NN |
704 | install: installdirs install-host install-target |
705 | ||
70ffc148 NN |
706 | .PHONY: install-host-nogcc |
707 | install-host-nogcc: [+ | |
708 | FOR host_modules +] \ | |
709 | maybe-install-[+module+][+ | |
710 | ENDFOR host_modules +] | |
711 | ||
9b520963 NN |
712 | .PHONY: install-host |
713 | install-host: maybe-install-gcc [+ | |
714 | FOR host_modules +] \ | |
715 | maybe-install-[+module+][+ | |
716 | ENDFOR host_modules +] | |
70ffc148 | 717 | |
9b520963 NN |
718 | .PHONY: install-target |
719 | install-target: [+ | |
720 | FOR target_modules +] \ | |
721 | maybe-install-target-[+module+][+ | |
722 | ENDFOR target_modules +] | |
bba02726 NN |
723 | |
724 | uninstall: | |
725 | @echo "the uninstall target is not supported in this tree" | |
726 | ||
bba02726 NN |
727 | .PHONY: install.all |
728 | install.all: install-no-fixedincludes | |
729 | @if [ -f ./gcc/Makefile ] ; then \ | |
5230d454 | 730 | r=`${PWD_COMMAND}` ; export r ; \ |
bba02726 | 731 | $(SET_LIB_PATH) \ |
6dbec167 | 732 | (cd ./gcc && \ |
bba02726 NN |
733 | $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \ |
734 | else \ | |
735 | true ; \ | |
736 | fi | |
737 | ||
738 | # install-no-fixedincludes is used because Cygnus can not distribute | |
739 | # the fixed header files. | |
740 | .PHONY: install-no-fixedincludes | |
70ffc148 | 741 | install-no-fixedincludes: installdirs install-host-nogcc \ |
9b520963 | 742 | install-target gcc-no-fixedincludes |
bba02726 | 743 | |
43bdb69a | 744 | ### other supporting targets |
bba02726 | 745 | |
43bdb69a NN |
746 | MAKEDIRS= \ |
747 | $(DESTDIR)$(prefix) \ | |
748 | $(DESTDIR)$(exec_prefix) | |
749 | .PHONY: installdirs | |
750 | installdirs: mkinstalldirs | |
751 | $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS) | |
752 | ||
753 | dir.info: do-install-info | |
754 | if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \ | |
8ccfe116 | 755 | $(srcdir)/texinfo/gen-info-dir $(DESTDIR)$(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \ |
43bdb69a NN |
756 | mv -f dir.info.new dir.info ; \ |
757 | else true ; \ | |
bba02726 NN |
758 | fi |
759 | ||
43bdb69a NN |
760 | dist: |
761 | @echo "Building a full distribution of this tree isn't done" | |
762 | @echo "via 'make dist'. Check out the etc/ subdirectory" | |
763 | ||
764 | etags tags: TAGS | |
765 | ||
766 | # Right now this just builds TAGS in each subdirectory. emacs19 has the | |
767 | # ability to use several tags files at once, so there is probably no need | |
768 | # to combine them into one big TAGS file (like CVS 1.3 does). We could | |
769 | # (if we felt like it) have this Makefile write a piece of elisp which | |
770 | # the user could load to tell emacs19 where all the TAGS files we just | |
771 | # built are. | |
772 | TAGS: do-TAGS | |
773 | ||
43bdb69a NN |
774 | # -------------------------------------- |
775 | # Modules which run on the build machine | |
776 | # -------------------------------------- | |
777 | [+ FOR build_modules +] | |
c5e4bb70 NN |
778 | .PHONY: configure-build-[+module+] maybe-configure-build-[+module+] |
779 | maybe-configure-build-[+module+]: | |
af9955fa AO |
780 | configure-build-[+module+]: |
781 | @test ! -f $(BUILD_SUBDIR)/[+module+]/Makefile || exit 0; \ | |
df4b5a9c | 782 | $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/[+module+] ; \ |
5230d454 L |
783 | r=`${PWD_COMMAND}`; export r; \ |
784 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
2245eb63 NN |
785 | AR="$(AR_FOR_BUILD)"; export AR; \ |
786 | AS="$(AS_FOR_BUILD)"; export AS; \ | |
787 | CC="$(CC_FOR_BUILD)"; export CC; \ | |
788 | CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ | |
789 | CXX="$(CXX_FOR_BUILD)"; export CXX; \ | |
790 | CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ | |
791 | GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \ | |
792 | DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \ | |
793 | LD="$(LD_FOR_BUILD)"; export LD; \ | |
794 | LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \ | |
795 | NM="$(NM_FOR_BUILD)"; export NM; \ | |
796 | RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \ | |
797 | WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \ | |
798 | echo Configuring in $(BUILD_SUBDIR)/[+module+]; \ | |
799 | cd "$(BUILD_SUBDIR)/[+module+]" || exit 1; \ | |
800 | case $(srcdir) in \ | |
801 | /* | [A-Za-z]:[\\/]*) \ | |
802 | topdir=$(srcdir) ;; \ | |
803 | *) \ | |
804 | case "$(BUILD_SUBDIR)" in \ | |
bba02726 NN |
805 | .) topdir="../$(srcdir)" ;; \ |
806 | *) topdir="../../$(srcdir)" ;; \ | |
2245eb63 NN |
807 | esac ;; \ |
808 | esac; \ | |
809 | if [ "$(srcdir)" = "." ] ; then \ | |
810 | if [ "$(BUILD_SUBDIR)" != "." ] ; then \ | |
811 | if $(SHELL) $$s/symlink-tree $${topdir}/[+module+] "no-such-file" ; then \ | |
812 | if [ -f Makefile ]; then \ | |
813 | if $(MAKE) distclean; then \ | |
814 | true; \ | |
815 | else \ | |
816 | exit 1; \ | |
817 | fi; \ | |
bba02726 | 818 | else \ |
2245eb63 | 819 | true; \ |
bba02726 | 820 | fi; \ |
bba02726 | 821 | else \ |
2245eb63 | 822 | exit 1; \ |
bba02726 | 823 | fi; \ |
2245eb63 NN |
824 | else \ |
825 | true; \ | |
826 | fi; \ | |
827 | srcdiroption="--srcdir=."; \ | |
828 | libsrcdir="."; \ | |
829 | else \ | |
830 | srcdiroption="--srcdir=$${topdir}/[+module+]"; \ | |
831 | libsrcdir="$$s/[+module+]"; \ | |
832 | fi; \ | |
833 | rm -f no-such-file || : ; \ | |
834 | CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ | |
835 | $(BUILD_CONFIGARGS) $${srcdiroption} \ | |
836 | --with-build-subdir="$(BUILD_SUBDIR)" \ | |
837 | || exit 1 | |
43bdb69a NN |
838 | |
839 | .PHONY: all-build-[+module+] maybe-all-build-[+module+] | |
840 | maybe-all-build-[+module+]: | |
841 | all-build-[+module+]: configure-build-[+module+] | |
5230d454 L |
842 | @r=`${PWD_COMMAND}`; export r; \ |
843 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
2245eb63 | 844 | (cd $(BUILD_SUBDIR)/[+module+] && $(MAKE) all) |
d6ebd419 | 845 | [+ ENDFOR build_modules +] |
bba02726 | 846 | |
43bdb69a NN |
847 | # -------------------------------------- |
848 | # Modules which run on the host machine | |
849 | # -------------------------------------- | |
8ecc6504 | 850 | [+ FOR host_modules +] |
94f860c0 NN |
851 | .PHONY: configure-[+module+] maybe-configure-[+module+] |
852 | maybe-configure-[+module+]: | |
af9955fa AO |
853 | configure-[+module+]: |
854 | @test ! -f [+module+]/Makefile || exit 0; \ | |
855 | [ -d [+module+] ] || mkdir [+module+]; \ | |
5230d454 L |
856 | r=`${PWD_COMMAND}`; export r; \ |
857 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
94f860c0 NN |
858 | CC="$(CC)"; export CC; \ |
859 | CFLAGS="$(CFLAGS)"; export CFLAGS; \ | |
860 | CXX="$(CXX)"; export CXX; \ | |
861 | CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ | |
606989ed NN |
862 | AR="$(AR)"; export AR; \ |
863 | AS="$(AS)"; export AS; \ | |
864 | CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ | |
865 | DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ | |
866 | LD="$(LD)"; export LD; \ | |
867 | NM="$(NM)"; export NM; \ | |
868 | RANLIB="$(RANLIB)"; export RANLIB; \ | |
869 | WINDRES="$(WINDRES)"; export WINDRES; \ | |
870 | OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ | |
871 | OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ | |
94f860c0 NN |
872 | echo Configuring in [+module+]; \ |
873 | cd [+module+] || exit 1; \ | |
874 | case $(srcdir) in \ | |
875 | \.) \ | |
876 | srcdiroption="--srcdir=."; \ | |
877 | libsrcdir=".";; \ | |
878 | /* | [A-Za-z]:[\\/]*) \ | |
879 | srcdiroption="--srcdir=$(srcdir)/[+module+]"; \ | |
880 | libsrcdir="$$s/[+module+]";; \ | |
881 | *) \ | |
882 | srcdiroption="--srcdir=../$(srcdir)/[+module+]"; \ | |
883 | libsrcdir="$$s/[+module+]";; \ | |
884 | esac; \ | |
885 | $(SHELL) $${libsrcdir}/configure \ | |
886 | $(HOST_CONFIGARGS) $${srcdiroption} \ | |
887 | || exit 1 | |
888 | ||
c5e4bb70 NN |
889 | .PHONY: all-[+module+] maybe-all-[+module+] |
890 | maybe-all-[+module+]: | |
d6064c79 | 891 | all-[+module+]: configure-[+module+] |
5230d454 L |
892 | @r=`${PWD_COMMAND}`; export r; \ |
893 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
2245eb63 NN |
894 | $(SET_LIB_PATH) \ |
895 | (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ | |
896 | IF with_x | |
897 | +] $(X11_FLAGS_TO_PASS)[+ | |
898 | ENDIF with_x +] all) | |
bba02726 | 899 | |
70ffc148 NN |
900 | .PHONY: check-[+module+] maybe-check-[+module+] |
901 | maybe-check-[+module+]: | |
8ecc6504 | 902 | [+ IF no_check +] |
8ecc6504 NN |
903 | check-[+module+]: |
904 | [+ ELIF no_check_cross +] | |
8ecc6504 NN |
905 | # This module is only tested in a native toolchain. |
906 | check-[+module+]: | |
7e9ae190 | 907 | @if [ '$(host)' = '$(target)' ] ; then \ |
5230d454 L |
908 | r=`${PWD_COMMAND}`; export r; \ |
909 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
bba02726 | 910 | $(SET_LIB_PATH) \ |
6dbec167 | 911 | (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ |
8ecc6504 NN |
912 | IF with_x |
913 | +] $(X11_FLAGS_TO_PASS)[+ | |
2245eb63 NN |
914 | ENDIF with_x +] check); \ |
915 | fi | |
916 | [+ ELSE check +] | |
2245eb63 | 917 | check-[+module+]: |
5230d454 L |
918 | @r=`${PWD_COMMAND}`; export r; \ |
919 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
2245eb63 NN |
920 | $(SET_LIB_PATH) \ |
921 | (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ | |
922 | IF with_x | |
923 | +] $(X11_FLAGS_TO_PASS)[+ | |
924 | ENDIF with_x +] check) | |
8ecc6504 | 925 | [+ ENDIF no_check +] |
bba02726 | 926 | |
c5e4bb70 NN |
927 | .PHONY: install-[+module+] maybe-install-[+module+] |
928 | maybe-install-[+module+]: | |
70ffc148 | 929 | [+ IF no_install +] |
8ecc6504 NN |
930 | install-[+module+]: |
931 | [+ ELSE install +] | |
8ecc6504 | 932 | install-[+module+]: installdirs |
5230d454 L |
933 | @r=`${PWD_COMMAND}`; export r; \ |
934 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
2245eb63 NN |
935 | $(SET_LIB_PATH) \ |
936 | (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ | |
937 | IF with_x | |
938 | +] $(X11_FLAGS_TO_PASS)[+ | |
939 | ENDIF with_x +] install) | |
8ecc6504 NN |
940 | [+ ENDIF no_install +] |
941 | [+ ENDFOR host_modules +] | |
bba02726 | 942 | |
43bdb69a NN |
943 | # --------------------------------------- |
944 | # Modules which run on the target machine | |
945 | # --------------------------------------- | |
d6ebd419 | 946 | [+ FOR target_modules +] |
c5e4bb70 NN |
947 | .PHONY: configure-target-[+module+] maybe-configure-target-[+module+] |
948 | maybe-configure-target-[+module+]: | |
43bdb69a | 949 | |
6dbec167 NN |
950 | # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. |
951 | $(TARGET_SUBDIR)/[+module+]/multilib.out: multilib.out | |
df4b5a9c | 952 | $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/[+module+] ; \ |
af9955fa | 953 | rm -f $(TARGET_SUBDIR)/[+module+]/Makefile || : ; \ |
6dbec167 | 954 | cp multilib.out $(TARGET_SUBDIR)/[+module+]/multilib.out |
43bdb69a | 955 | |
af9955fa AO |
956 | configure-target-[+module+]: $(TARGET_SUBDIR)/[+module+]/multilib.out |
957 | @test ! -f $(TARGET_SUBDIR)/[+module+]/Makefile || exit 0; \ | |
df4b5a9c | 958 | $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/[+module+] ; \ |
5230d454 L |
959 | r=`${PWD_COMMAND}`; export r; \ |
960 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
2245eb63 NN |
961 | $(SET_LIB_PATH) \ |
962 | AR="$(AR_FOR_TARGET)"; export AR; \ | |
963 | AS="$(AS_FOR_TARGET)"; export AS; \ | |
964 | CC="$(CC_FOR_TARGET)"; export CC; \ | |
965 | CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ | |
966 | CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \[+ | |
967 | IF raw_cxx +] | |
968 | CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \ | |
969 | CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \[+ | |
970 | ELSE normal_cxx +] | |
971 | CXX="$(CXX_FOR_TARGET)"; export CXX; \[+ | |
972 | ENDIF raw_cxx +] | |
973 | CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ | |
974 | GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ | |
975 | DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ | |
976 | LD="$(LD_FOR_TARGET)"; export LD; \ | |
977 | LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ | |
978 | NM="$(NM_FOR_TARGET)"; export NM; \ | |
979 | RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ | |
980 | WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ | |
981 | echo Configuring in $(TARGET_SUBDIR)/[+module+]; \ | |
982 | cd "$(TARGET_SUBDIR)/[+module+]" || exit 1; \ | |
983 | case $(srcdir) in \ | |
984 | /* | [A-Za-z]:[\\/]*) \ | |
985 | topdir=$(srcdir) ;; \ | |
986 | *) \ | |
987 | case "$(TARGET_SUBDIR)" in \ | |
bba02726 NN |
988 | .) topdir="../$(srcdir)" ;; \ |
989 | *) topdir="../../$(srcdir)" ;; \ | |
2245eb63 NN |
990 | esac ;; \ |
991 | esac; \ | |
992 | if [ "$(srcdir)" = "." ] ; then \ | |
993 | if [ "$(TARGET_SUBDIR)" != "." ] ; then \ | |
994 | if $(SHELL) $$s/symlink-tree $${topdir}/[+module+] "no-such-file" ; then \ | |
995 | if [ -f Makefile ]; then \ | |
996 | if $(MAKE) distclean; then \ | |
997 | true; \ | |
998 | else \ | |
999 | exit 1; \ | |
1000 | fi; \ | |
bba02726 | 1001 | else \ |
2245eb63 | 1002 | true; \ |
bba02726 | 1003 | fi; \ |
bba02726 | 1004 | else \ |
2245eb63 | 1005 | exit 1; \ |
bba02726 | 1006 | fi; \ |
2245eb63 NN |
1007 | else \ |
1008 | true; \ | |
1009 | fi; \ | |
1010 | srcdiroption="--srcdir=."; \ | |
1011 | libsrcdir="."; \ | |
1012 | else \ | |
1013 | srcdiroption="--srcdir=$${topdir}/[+module+]"; \ | |
1014 | libsrcdir="$$s/[+module+]"; \ | |
1015 | fi; \ | |
1016 | rm -f no-such-file || : ; \ | |
1017 | CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ | |
1018 | $(TARGET_CONFIGARGS) $${srcdiroption} \ | |
1019 | --with-target-subdir="$(TARGET_SUBDIR)" \ | |
1020 | || exit 1 | |
bba02726 | 1021 | |
c5e4bb70 NN |
1022 | .PHONY: all-target-[+module+] maybe-all-target-[+module+] |
1023 | maybe-all-target-[+module+]: | |
43bdb69a | 1024 | all-target-[+module+]: configure-target-[+module+] |
5230d454 L |
1025 | @r=`${PWD_COMMAND}`; export r; \ |
1026 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
2245eb63 NN |
1027 | $(SET_LIB_PATH) \ |
1028 | (cd $(TARGET_SUBDIR)/[+module+] && \ | |
1029 | $(MAKE) $(TARGET_FLAGS_TO_PASS) [+ | |
1030 | IF raw_cxx | |
1031 | +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ | |
1032 | ENDIF raw_cxx | |
1033 | +] all) | |
70ffc148 NN |
1034 | |
1035 | .PHONY: check-target-[+module+] maybe-check-target-[+module+] | |
1036 | maybe-check-target-[+module+]: | |
8ecc6504 NN |
1037 | [+ IF no_check +] |
1038 | # Dummy target for uncheckable module. | |
8ecc6504 NN |
1039 | check-target-[+module+]: |
1040 | [+ ELSE check +] | |
d6ebd419 | 1041 | check-target-[+module+]: |
5230d454 L |
1042 | @r=`${PWD_COMMAND}`; export r; \ |
1043 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
2245eb63 NN |
1044 | $(SET_LIB_PATH) \ |
1045 | (cd $(TARGET_SUBDIR)/[+module+] && \ | |
1046 | $(MAKE) $(TARGET_FLAGS_TO_PASS) [+ | |
1047 | IF raw_cxx | |
1048 | +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ | |
1049 | ENDIF raw_cxx | |
1050 | +] check) | |
d6ebd419 | 1051 | [+ ENDIF no_check +] |
70ffc148 | 1052 | |
c5e4bb70 NN |
1053 | .PHONY: install-target-[+module+] maybe-install-target-[+module+] |
1054 | maybe-install-target-[+module+]: | |
70ffc148 | 1055 | [+ IF no_install +] |
c5e4bb70 NN |
1056 | # Dummy target for uninstallable. |
1057 | install-target-[+module+]: | |
1058 | [+ ELSE install +] | |
d6ebd419 | 1059 | install-target-[+module+]: installdirs |
5230d454 L |
1060 | @r=`${PWD_COMMAND}`; export r; \ |
1061 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
2245eb63 NN |
1062 | $(SET_LIB_PATH) \ |
1063 | (cd $(TARGET_SUBDIR)/[+module+] && \ | |
1064 | $(MAKE) $(TARGET_FLAGS_TO_PASS) install) | |
d6ebd419 NN |
1065 | [+ ENDIF no_install +] |
1066 | [+ ENDFOR target_modules +] | |
bba02726 | 1067 | |
43bdb69a NN |
1068 | # ---------- |
1069 | # GCC module | |
1070 | # ---------- | |
1071 | ||
1072 | # Unfortunately, while gcc _should_ be a host module, | |
1073 | # libgcc is a target module, and gen* programs are | |
1074 | # build modules. So GCC is a sort of hybrid. | |
1075 | ||
bba02726 | 1076 | # gcc is the only module which uses GCC_FLAGS_TO_PASS. |
94f860c0 NN |
1077 | .PHONY: configure-gcc maybe-configure-gcc |
1078 | maybe-configure-gcc: | |
af9955fa AO |
1079 | configure-gcc: |
1080 | @test ! -f gcc/Makefile || exit 0; \ | |
1081 | [ -d gcc ] || mkdir gcc; \ | |
5230d454 L |
1082 | r=`${PWD_COMMAND}`; export r; \ |
1083 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
94f860c0 NN |
1084 | CC="$(CC)"; export CC; \ |
1085 | CFLAGS="$(CFLAGS)"; export CFLAGS; \ | |
1086 | CXX="$(CXX)"; export CXX; \ | |
1087 | CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ | |
6309c931 | 1088 | TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \ |
606989ed NN |
1089 | AR="$(AR)"; export AR; \ |
1090 | AS="$(AS)"; export AS; \ | |
1091 | CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ | |
1092 | DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ | |
1093 | LD="$(LD)"; export LD; \ | |
1094 | NM="$(NM)"; export NM; \ | |
1095 | RANLIB="$(RANLIB)"; export RANLIB; \ | |
1096 | WINDRES="$(WINDRES)"; export WINDRES; \ | |
1097 | OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ | |
1098 | OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ | |
94f860c0 NN |
1099 | echo Configuring in gcc; \ |
1100 | cd gcc || exit 1; \ | |
1101 | case $(srcdir) in \ | |
1102 | \.) \ | |
1103 | srcdiroption="--srcdir=."; \ | |
1104 | libsrcdir=".";; \ | |
1105 | /* | [A-Za-z]:[\\/]*) \ | |
1106 | srcdiroption="--srcdir=$(srcdir)/gcc"; \ | |
1107 | libsrcdir="$$s/gcc";; \ | |
1108 | *) \ | |
1109 | srcdiroption="--srcdir=../$(srcdir)/gcc"; \ | |
1110 | libsrcdir="$$s/gcc";; \ | |
1111 | esac; \ | |
1112 | $(SHELL) $${libsrcdir}/configure \ | |
1113 | $(HOST_CONFIGARGS) $${srcdiroption} \ | |
1114 | || exit 1 | |
1115 | ||
e5e33f0e JM |
1116 | # Don't 'make all' in gcc if it's already been made by 'bootstrap'; that |
1117 | # causes trouble. This wart will be fixed eventually by moving | |
d6064c79 | 1118 | # the bootstrap behavior to this file. |
c5e4bb70 NN |
1119 | .PHONY: all-gcc maybe-all-gcc |
1120 | maybe-all-gcc: | |
d6064c79 | 1121 | all-gcc: configure-gcc |
e5e33f0e | 1122 | @if [ -f gcc/stage_last ] ; then \ |
5230d454 L |
1123 | r=`${PWD_COMMAND}`; export r; \ |
1124 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
e5e33f0e | 1125 | $(SET_LIB_PATH) \ |
6dbec167 | 1126 | (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) quickstrap); \ |
d6064c79 | 1127 | else \ |
5230d454 L |
1128 | r=`${PWD_COMMAND}`; export r; \ |
1129 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
bba02726 | 1130 | $(SET_LIB_PATH) \ |
6dbec167 | 1131 | (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) all); \ |
bba02726 NN |
1132 | fi |
1133 | ||
1134 | # Building GCC uses some tools for rebuilding "source" files | |
1135 | # like texinfo, bison/byacc, etc. So we must depend on those. | |
1136 | # | |
1137 | # While building GCC, it may be necessary to run various target | |
1138 | # programs like the assembler, linker, etc. So we depend on | |
1139 | # those too. | |
1140 | # | |
1141 | # In theory, on an SMP all those dependencies can be resolved | |
1142 | # in parallel. | |
1143 | # | |
09f7abda DD |
1144 | GCC_STRAP_TARGETS = bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap |
1145 | .PHONY: $(GCC_STRAP_TARGETS) | |
1146 | $(GCC_STRAP_TARGETS): all-bootstrap configure-gcc | |
5230d454 L |
1147 | @r=`${PWD_COMMAND}`; export r; \ |
1148 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
bba02726 NN |
1149 | $(SET_LIB_PATH) \ |
1150 | echo "Bootstrapping the compiler"; \ | |
1151 | cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@ | |
5230d454 L |
1152 | @r=`${PWD_COMMAND}`; export r; \ |
1153 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
bba02726 NN |
1154 | case "$@" in \ |
1155 | *bootstrap4-lean ) \ | |
2245eb63 NN |
1156 | msg="Comparing stage3 and stage4 of the compiler"; \ |
1157 | compare=compare3-lean ;; \ | |
1158 | *bootstrap4 ) \ | |
1159 | msg="Comparing stage3 and stage4 of the compiler"; \ | |
1160 | compare=compare3 ;; \ | |
1161 | *-lean ) \ | |
1162 | msg="Comparing stage2 and stage3 of the compiler"; \ | |
1163 | compare=compare-lean ;; \ | |
1164 | * ) \ | |
1165 | msg="Comparing stage2 and stage3 of the compiler"; \ | |
1166 | compare=compare ;; \ | |
bba02726 NN |
1167 | esac; \ |
1168 | $(SET_LIB_PATH) \ | |
1169 | echo "$$msg"; \ | |
1170 | cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare | |
5230d454 L |
1171 | @r=`${PWD_COMMAND}`; export r; \ |
1172 | s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ | |
bba02726 NN |
1173 | $(SET_LIB_PATH) \ |
1174 | echo "Building runtime libraries"; \ | |
1175 | $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all | |
1176 | ||
606989ed | 1177 | profiledbootstrap: all-bootstrap configure-gcc |
5230d454 L |
1178 | @r=`${PWD_COMMAND}`; export r; \ |
1179 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
606989ed NN |
1180 | $(SET_LIB_PATH) \ |
1181 | echo "Bootstrapping the compiler"; \ | |
1182 | cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stageprofile_build | |
5230d454 L |
1183 | @r=`${PWD_COMMAND}`; export r; \ |
1184 | s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ | |
606989ed NN |
1185 | $(SET_LIB_PATH) \ |
1186 | echo "Building runtime libraries and training compiler"; \ | |
1187 | $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all | |
5230d454 L |
1188 | @r=`${PWD_COMMAND}`; export r; \ |
1189 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
606989ed NN |
1190 | $(SET_LIB_PATH) \ |
1191 | echo "Building feedback based compiler"; \ | |
1192 | cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stagefeedback_build | |
1193 | ||
bba02726 NN |
1194 | .PHONY: cross |
1195 | cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld | |
5230d454 L |
1196 | @r=`${PWD_COMMAND}`; export r; \ |
1197 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
bba02726 NN |
1198 | $(SET_LIB_PATH) \ |
1199 | echo "Building the C and C++ compiler"; \ | |
1200 | cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" | |
5230d454 L |
1201 | @r=`${PWD_COMMAND}`; export r; \ |
1202 | s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ | |
bba02726 NN |
1203 | $(SET_LIB_PATH) \ |
1204 | echo "Building runtime libraries"; \ | |
1205 | $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \ | |
1206 | LANGUAGES="c c++" all | |
1207 | ||
4218d888 | 1208 | .PHONY: check-gcc maybe-check-gcc |
6584320e | 1209 | maybe-check-gcc: |
bba02726 NN |
1210 | check-gcc: |
1211 | @if [ -f ./gcc/Makefile ] ; then \ | |
5230d454 L |
1212 | r=`${PWD_COMMAND}`; export r; \ |
1213 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
bba02726 | 1214 | $(SET_LIB_PATH) \ |
6dbec167 | 1215 | (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check); \ |
bba02726 NN |
1216 | else \ |
1217 | true; \ | |
1218 | fi | |
1219 | ||
d97f0f72 JM |
1220 | .PHONY: check-gcc-c++ |
1221 | check-gcc-c++: | |
bba02726 | 1222 | @if [ -f ./gcc/Makefile ] ; then \ |
5230d454 L |
1223 | r=`${PWD_COMMAND}`; export r; \ |
1224 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
bba02726 | 1225 | $(SET_LIB_PATH) \ |
6dbec167 | 1226 | (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \ |
bba02726 NN |
1227 | else \ |
1228 | true; \ | |
d97f0f72 JM |
1229 | fi |
1230 | ||
1231 | .PHONY: check-c++ | |
872173c8 | 1232 | check-c++: |
7f74e6a3 | 1233 | $(MAKE) check-target-libstdc++-v3 check-gcc-c++ |
bba02726 | 1234 | |
c5e4bb70 NN |
1235 | .PHONY: install-gcc maybe-install-gcc |
1236 | maybe-install-gcc: | |
bba02726 NN |
1237 | install-gcc: |
1238 | @if [ -f ./gcc/Makefile ] ; then \ | |
5230d454 L |
1239 | r=`${PWD_COMMAND}`; export r; \ |
1240 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
bba02726 | 1241 | $(SET_LIB_PATH) \ |
6dbec167 | 1242 | (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ |
bba02726 NN |
1243 | else \ |
1244 | true; \ | |
1245 | fi | |
1246 | ||
43bdb69a NN |
1247 | # Install the gcc headers files, but not the fixed include files, |
1248 | # which Cygnus is not allowed to distribute. This rule is very | |
1249 | # dependent on the workings of the gcc Makefile.in. | |
1250 | .PHONY: gcc-no-fixedincludes | |
1251 | gcc-no-fixedincludes: | |
1252 | @if [ -f ./gcc/Makefile ]; then \ | |
1253 | rm -rf gcc/tmp-include; \ | |
1254 | mv gcc/include gcc/tmp-include 2>/dev/null; \ | |
1255 | mkdir gcc/include; \ | |
1256 | cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \ | |
1257 | touch gcc/stmp-fixinc gcc/include/fixed; \ | |
1258 | rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \ | |
5230d454 L |
1259 | r=`${PWD_COMMAND}`; export r; \ |
1260 | s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ | |
43bdb69a | 1261 | $(SET_LIB_PATH) \ |
6dbec167 | 1262 | (cd ./gcc && \ |
43bdb69a NN |
1263 | $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ |
1264 | rm -rf gcc/include; \ | |
1265 | mv gcc/tmp-include gcc/include 2>/dev/null; \ | |
1266 | else true; fi | |
1267 | ||
c5ab3a90 NN |
1268 | # -------------------------------------- |
1269 | # Dependencies between different modules | |
1270 | # -------------------------------------- | |
bba02726 | 1271 | |
c5ab3a90 NN |
1272 | # There are two types of dependencies here: 'hard' dependencies, where one |
1273 | # module simply won't build without the other; and 'soft' dependencies, where | |
1274 | # if the depended-on module is missing, the depending module will do without | |
1275 | # or find a substitute somewhere (perhaps installed). Soft dependencies | |
1276 | # are specified by depending on a 'maybe-' target. If you're not sure, | |
1277 | # it's safer to use a soft dependency. | |
1278 | ||
1279 | # Host modules specific to gcc. | |
94f860c0 | 1280 | # GCC needs to identify certain tools. |
282c0e47 NN |
1281 | # GCC also needs the information exported by the intl configure script. |
1282 | configure-gcc: maybe-configure-intl maybe-configure-binutils maybe-configure-gas maybe-configure-ld maybe-configure-bison maybe-configure-flex | |
1283 | 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 | |
c5ab3a90 NN |
1284 | # This is a slightly kludgy method of getting dependencies on |
1285 | # all-build-libiberty correct; it would be better to build it every time. | |
1286 | all-gcc: maybe-all-build-libiberty | |
282c0e47 | 1287 | 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 |
c5ab3a90 NN |
1288 | |
1289 | # Host modules specific to gdb. | |
94f860c0 | 1290 | # GDB needs to know that the simulator is being built. |
c72bff50 | 1291 | configure-gdb: maybe-configure-itcl maybe-configure-tcl maybe-configure-tk maybe-configure-sim |
c5ab3a90 NN |
1292 | GDB_TK = @GDB_TK@ |
1293 | 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) | |
1294 | install-gdb: maybe-install-tcl maybe-install-tk maybe-install-itcl maybe-install-tix maybe-install-libgui | |
f99629e8 | 1295 | configure-libgui: maybe-configure-tcl maybe-configure-tk |
c5ab3a90 NN |
1296 | all-libgui: maybe-all-tcl maybe-all-tk maybe-all-itcl |
1297 | ||
1298 | # Host modules specific to binutils. | |
5f7308ff | 1299 | configure-bfd: configure-libiberty |
c5e4bb70 NN |
1300 | all-bfd: maybe-all-libiberty maybe-all-intl |
1301 | all-binutils: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-flex maybe-all-bison maybe-all-byacc maybe-all-intl | |
c5ab3a90 NN |
1302 | # We put install-opcodes before install-binutils because the installed |
1303 | # binutils might be on PATH, and they might need the shared opcodes | |
1304 | # library. | |
1305 | install-binutils: maybe-install-opcodes | |
7deb4540 AJ |
1306 | # libopcodes depends on libbfd |
1307 | install-opcodes: maybe-install-bfd | |
c5ab3a90 NN |
1308 | all-gas: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-intl |
1309 | all-gprof: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-intl | |
1310 | all-ld: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-bison maybe-all-byacc maybe-all-flex maybe-all-intl | |
1311 | all-opcodes: maybe-all-bfd maybe-all-libiberty | |
1312 | ||
1313 | # Other host modules in the 'src' repository. | |
c5e4bb70 | 1314 | all-dejagnu: maybe-all-tcl maybe-all-expect maybe-all-tk |
5f7308ff | 1315 | configure-expect: maybe-configure-tcl maybe-configure-tk |
c5e4bb70 | 1316 | all-expect: maybe-all-tcl maybe-all-tk |
5f7308ff | 1317 | configure-itcl: maybe-configure-tcl maybe-configure-tk |
c5ab3a90 NN |
1318 | all-itcl: maybe-all-tcl maybe-all-tk |
1319 | # We put install-tcl before install-itcl because itcl wants to run a | |
1320 | # program on installation which uses the Tcl libraries. | |
1321 | install-itcl: maybe-install-tcl | |
7a94fe2a | 1322 | all-sid: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-tcl maybe-all-tk |
c5ab3a90 | 1323 | install-sid: maybe-install-tcl maybe-install-tk |
6f45749c | 1324 | all-sim: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-readline maybe-configure-gdb |
5f7308ff | 1325 | configure-tk: maybe-configure-tcl |
c5ab3a90 | 1326 | all-tk: maybe-all-tcl |
5f7308ff | 1327 | configure-tix: maybe-configure-tcl maybe-configure-tk |
c5ab3a90 NN |
1328 | all-tix: maybe-all-tcl maybe-all-tk |
1329 | all-texinfo: maybe-all-libiberty | |
1330 | ||
1331 | # Other host modules. Warning, these are not well tested. | |
1332 | all-autoconf: maybe-all-m4 maybe-all-texinfo | |
1333 | all-automake: maybe-all-m4 maybe-all-texinfo | |
1334 | all-bison: maybe-all-texinfo | |
1335 | all-diff: maybe-all-libiberty | |
1336 | all-fastjar: maybe-all-zlib maybe-all-libiberty | |
c5e4bb70 NN |
1337 | all-fileutils: maybe-all-libiberty |
1338 | all-flex: maybe-all-libiberty maybe-all-bison maybe-all-byacc | |
c5e4bb70 NN |
1339 | all-gzip: maybe-all-libiberty |
1340 | all-hello: maybe-all-libiberty | |
c5e4bb70 | 1341 | all-m4: maybe-all-libiberty maybe-all-texinfo |
8d57e668 | 1342 | all-make: maybe-all-libiberty maybe-all-intl |
c5e4bb70 NN |
1343 | all-patch: maybe-all-libiberty |
1344 | all-prms: maybe-all-libiberty | |
c5e4bb70 NN |
1345 | all-recode: maybe-all-libiberty |
1346 | all-sed: maybe-all-libiberty | |
1347 | all-send-pr: maybe-all-prms | |
c5e4bb70 | 1348 | all-tar: maybe-all-libiberty |
c5e4bb70 | 1349 | all-uudecode: maybe-all-libiberty |
c5ab3a90 NN |
1350 | |
1351 | ALL_GCC = maybe-all-gcc | |
1352 | ALL_GCC_C = $(ALL_GCC) maybe-all-target-newlib maybe-all-target-libgloss | |
1353 | ALL_GCC_CXX = $(ALL_GCC_C) maybe-all-target-libstdc++-v3 | |
1354 | ||
1355 | # Target modules specific to gcc. | |
5f7308ff DD |
1356 | configure-target-boehm-gc: $(ALL_GCC_C) maybe-configure-target-qthreads |
1357 | configure-target-fastjar: maybe-configure-target-zlib | |
c5e4bb70 | 1358 | all-target-fastjar: maybe-all-target-zlib maybe-all-target-libiberty |
5f7308ff | 1359 | configure-target-libf2c: $(ALL_GCC_C) |
c5ab3a90 | 1360 | all-target-libf2c: maybe-all-target-libiberty |
5f7308ff DD |
1361 | configure-target-libffi: $(ALL_GCC_C) |
1362 | configure-target-libjava: $(ALL_GCC_C) maybe-configure-target-zlib maybe-configure-target-boehm-gc maybe-configure-target-qthreads maybe-configure-target-libffi | |
c5ab3a90 | 1363 | all-target-libjava: maybe-all-fastjar maybe-all-target-zlib maybe-all-target-boehm-gc maybe-all-target-qthreads maybe-all-target-libffi |
5f7308ff | 1364 | configure-target-libobjc: $(ALL_GCC_C) |
c5ab3a90 | 1365 | all-target-libobjc: maybe-all-target-libiberty |
5f7308ff | 1366 | configure-target-libstdc++-v3: $(ALL_GCC_C) |
c5ab3a90 | 1367 | all-target-libstdc++-v3: maybe-all-target-libiberty |
5f7308ff | 1368 | configure-target-zlib: $(ALL_GCC_C) |
cf605cda | 1369 | |
c5ab3a90 | 1370 | # Target modules in the 'src' repository. |
5f7308ff DD |
1371 | configure-target-examples: $(ALL_GCC_C) |
1372 | configure-target-libgloss: $(ALL_GCC) | |
c5ab3a90 | 1373 | all-target-libgloss: maybe-configure-target-newlib |
a12a8d41 | 1374 | configure-target-libiberty: $(ALL_GCC) |
5f7308ff DD |
1375 | configure-target-libtermcap: $(ALL_GCC_C) |
1376 | configure-target-newlib: $(ALL_GCC) | |
36a8ee59 | 1377 | configure-target-rda: $(ALL_GCC_C) |
5f7308ff | 1378 | configure-target-winsup: $(ALL_GCC_C) |
c5ab3a90 | 1379 | all-target-winsup: maybe-all-target-libiberty maybe-all-target-libtermcap |
cf605cda | 1380 | |
c5ab3a90 | 1381 | # Other target modules. Warning, these are not well tested. |
5f7308ff | 1382 | configure-target-gperf: $(ALL_GCC_CXX) |
c5ab3a90 | 1383 | all-target-gperf: maybe-all-target-libiberty maybe-all-target-libstdc++-v3 |
5f7308ff | 1384 | configure-target-qthreads: $(ALL_GCC_C) |
00f56d7b | 1385 | |
c5e4bb70 NN |
1386 | # Dependencies of maybe-foo on foo. These are used because, for example, |
1387 | # all-gcc only depends on all-gas if gas is present and being configured. | |
1388 | @maybe_dependencies@ | |
1389 | ||
d8e6f006 NN |
1390 | # Serialization dependencies. Host configures don't work well in parallel to |
1391 | # each other, due to contention over config.cache. Target configures and | |
1392 | # build configures are similar. | |
1393 | @serialization_dependencies@ | |
1394 | ||
43bdb69a NN |
1395 | # -------------------------------- |
1396 | # Regenerating top level configury | |
1397 | # -------------------------------- | |
bba02726 | 1398 | |
6dbec167 NN |
1399 | # Multilib.out tells target dirs what multilibs they should build. |
1400 | # There is really only one copy. We use the 'timestamp' method to | |
1401 | # work around various timestamp bugs on some systems. | |
1402 | # We use move-if-change so that it's only considered updated when it | |
1403 | # actually changes, because it has to depend on a phony target. | |
af9955fa | 1404 | multilib.out: maybe-all-gcc |
5230d454 | 1405 | @r=`${PWD_COMMAND}`; export r; \ |
6dbec167 NN |
1406 | echo "Checking multilib configuration..."; \ |
1407 | $(CC_FOR_TARGET) --print-multi-lib > multilib.tmp 2> /dev/null ; \ | |
1408 | $(SHELL) $(srcdir)/move-if-change multilib.tmp multilib.out ; \ | |
6dbec167 | 1409 | |
bba02726 | 1410 | # Rebuilding Makefile.in, using autogen. |
81011f17 | 1411 | AUTOGEN = autogen |
3728f201 | 1412 | $(srcdir)/Makefile.in: @MAINT@ $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def |
81011f17 | 1413 | cd $(srcdir) && $(AUTOGEN) Makefile.def |
bba02726 | 1414 | |
bafecfd6 | 1415 | # Rebuilding Makefile. |
81011f17 AO |
1416 | Makefile: $(srcdir)/Makefile.in config.status |
1417 | CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status | |
1418 | ||
1419 | config.status: configure $(gcc_version_trigger) | |
bafecfd6 | 1420 | $(SHELL) ./config.status --recheck |
bba02726 | 1421 | |
bafecfd6 | 1422 | # Rebuilding configure. |
81011f17 | 1423 | AUTOCONF = autoconf |
3728f201 | 1424 | $(srcdir)/configure: @MAINT@ $(srcdir)/configure.in $(srcdir)/config/acx.m4 |
81011f17 | 1425 | cd $(srcdir) && $(AUTOCONF) |
bba02726 | 1426 | |
1c53cd00 NN |
1427 | # ------------------------------ |
1428 | # Special directives to GNU Make | |
1429 | # ------------------------------ | |
1430 | ||
1c53cd00 NN |
1431 | # Don't pass command-line variables to submakes. |
1432 | .NOEXPORT: | |
1433 | MAKEOVERRIDES= | |
1434 | ||
bba02726 | 1435 | # end of Makefile.in |