Blob of Makefile.tpl (raw blob data)

1 [+ AutoGen5 template -*- Mode: Makefile -*-
2 in
3 +]
4
5 # Makefile.in is generated from Makefile.tpl by 'autogen Makefile.def'.
6 #
7 # Makefile for directory with subdirs to build.
8 # Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
9 # 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation
10 #
11 # This file is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 2 of the License, or
14 # (at your option) any later version.
15 #
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
20 #
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #
25
26 # First, test for a proper version of make, but only where one is required.
27
28 @if gcc
29 ifeq (,$(.VARIABLES)) # The variable .VARIABLES, new with 3.80, is never empty.
30 $(error GNU make version 3.80 or newer is required.)
31 endif
32 @endif gcc
33
34 # -------------------------------
35 # Standard Autoconf-set variables
36 # -------------------------------
37 VPATH=@srcdir@
38
39 build_alias=@build_noncanonical@
40 build_vendor=@build_vendor@
41 build_os=@build_os@
42 build=@build@
43 host_alias=@host_noncanonical@
44 host_vendor=@host_vendor@
45 host_os=@host_os@
46 host=@host@
47 target_alias=@target_noncanonical@
48 target_vendor=@target_vendor@
49 target_os=@target_os@
50 target=@target@
51
52 program_transform_name = @program_transform_name@
53
54 prefix = @prefix@
55 exec_prefix = @exec_prefix@
56
57 srcdir = @srcdir@
58
59 bindir = @bindir@
60 sbindir = @sbindir@
61 libexecdir = @libexecdir@
62 datadir = @datadir@
63 sysconfdir = @sysconfdir@
64 sharedstatedir = @sharedstatedir@
65 localstatedir = @localstatedir@
66 libdir = @libdir@
67 includedir = @includedir@
68 oldincludedir = @oldincludedir@
69 infodir = @infodir@
70 datarootdir = @datarootdir@
71 docdir = @docdir@
72 pdfdir = @pdfdir@
73 htmldir = @htmldir@
74 mandir = @mandir@
75 man1dir = $(mandir)/man1
76 man2dir = $(mandir)/man2
77 man3dir = $(mandir)/man3
78 man4dir = $(mandir)/man4
79 man5dir = $(mandir)/man5
80 man6dir = $(mandir)/man6
81 man7dir = $(mandir)/man7
82 man8dir = $(mandir)/man8
83 man9dir = $(mandir)/man9
84
85 INSTALL = @INSTALL@
86 INSTALL_PROGRAM = @INSTALL_PROGRAM@
87 INSTALL_SCRIPT = @INSTALL_SCRIPT@
88 INSTALL_DATA = @INSTALL_DATA@
89 LN = @LN@
90 LN_S = @LN_S@
91 MAINT = @MAINT@
92 MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
93 MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
94
95 # -------------------------------------------------
96 # Miscellaneous non-standard autoconf-set variables
97 # -------------------------------------------------
98
99 # The gcc driver likes to know the arguments it was configured with.
100 TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@
101
102 tooldir = @tooldir@
103 build_tooldir = @build_tooldir@
104
105 GDB_NLM_DEPS =
106
107 # This is the name of the environment variable used for the path to
108 # the libraries.
109 RPATH_ENVVAR = @RPATH_ENVVAR@
110
111 # Build programs are put under this directory.
112 BUILD_SUBDIR = @build_subdir@
113 # This is set by the configure script to the arguments to use when configuring
114 # directories built for the build system.
115 BUILD_CONFIGARGS = @build_configargs@ --with-build-subdir="$(BUILD_SUBDIR)"
116
117 # This is the list of variables to export in the environment when
118 # configuring any subdirectory. It must also be exported whenever
119 # recursing into a build directory in case that directory's Makefile
120 # re-runs configure.
121 BASE_EXPORTS = \
122 FLEX="$(FLEX)"; export FLEX; \
123 LEX="$(LEX)"; export LEX; \
124 BISON="$(BISON)"; export BISON; \
125 YACC="$(YACC)"; export YACC; \
126 M4="$(M4)"; export M4; \
127 MAKEINFO="$(MAKEINFO)"; export MAKEINFO;
128
129 # This is the list of variables to export in the environment when
130 # configuring subdirectories for the build system.
131 BUILD_EXPORTS = \
132 $(BASE_EXPORTS) \
133 AR="$(AR_FOR_BUILD)"; export AR; \
134 AS="$(AS_FOR_BUILD)"; export AS; \
135 CC="$(CC_FOR_BUILD)"; export CC; \
136 CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
137 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
138 CXX="$(CXX_FOR_BUILD)"; export CXX; \
139 CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
140 GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
141 GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
142 DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
143 LD="$(LD_FOR_BUILD)"; export LD; \
144 LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
145 NM="$(NM_FOR_BUILD)"; export NM; \
146 RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
147 WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
148 WINDMC="$(WINDMC_FOR_BUILD)"; export WINDMC;
149
150 # This is the list of directories to built for the host system.
151 SUBDIRS = @configdirs@
152 # This is set by the configure script to the arguments to use when configuring
153 # directories built for the host system.
154 HOST_CONFIGARGS = @host_configargs@
155 # Host programs are put under this directory, which is . except if building
156 # with srcdir=..
157 HOST_SUBDIR = @host_subdir@
158 # This is the list of variables to export in the environment when
159 # configuring subdirectories for the host system. We need to pass
160 # some to the GCC configure because of its hybrid host/target nature.
161 HOST_EXPORTS = \
162 $(BASE_EXPORTS) \
163 CC="$(CC)"; export CC; \
164 CFLAGS="$(CFLAGS)"; export CFLAGS; \
165 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
166 CXX="$(CXX)"; export CXX; \
167 CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
168 AR="$(AR)"; export AR; \
169 AS="$(AS)"; export AS; \
170 CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
171 DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
172 LD="$(LD)"; export LD; \
173 LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \
174 NM="$(NM)"; export NM; \
175 RANLIB="$(RANLIB)"; export RANLIB; \
176 WINDRES="$(WINDRES)"; export WINDRES; \
177 WINDMC="$(WINDMC)"; export WINDMC; \
178 OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
179 OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
180 AR_FOR_TARGET="$(AR_FOR_TARGET)"; export AR_FOR_TARGET; \
181 AS_FOR_TARGET="$(AS_FOR_TARGET)"; export AS_FOR_TARGET; \
182 GCC_FOR_TARGET="$(GCC_FOR_TARGET)"; export GCC_FOR_TARGET; \
183 LD_FOR_TARGET="$(LD_FOR_TARGET)"; export LD_FOR_TARGET; \
184 NM_FOR_TARGET="$(NM_FOR_TARGET)"; export NM_FOR_TARGET; \
185 OBJDUMP_FOR_TARGET="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP_FOR_TARGET; \
186 RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \
187 TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
188 GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
189 GMPINC="$(HOST_GMPINC)"; export GMPINC; \
190 @if gcc-bootstrap
191 $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
192 @endif gcc-bootstrap
193 $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
194
195 # Similar, for later GCC stages.
196 POSTSTAGE1_HOST_EXPORTS = \
197 $(HOST_EXPORTS) \
198 CC="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \
199 -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/"; export CC; \
200 CC_FOR_BUILD="$(STAGE_CC_WRAPPER) \
201 $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \
202 -B$$r/$(HOST_SUBDIR)/prev-gcc/ \
203 -B$(build_tooldir)/bin/"; export CC_FOR_BUILD; \
204 LDFLAGS="$(BOOT_LDFLAGS)"; export LDFLAGS;
205
206 # Target libraries are put under this directory:
207 TARGET_SUBDIR = @target_subdir@
208 # This is set by the configure script to the arguments to use when configuring
209 # directories built for the target.
210 TARGET_CONFIGARGS = @target_configargs@ --with-target-subdir="$(TARGET_SUBDIR)"
211 # This is the list of variables to export in the environment when
212 # configuring subdirectories for the host system.
213 BASE_TARGET_EXPORTS = \
214 $(BASE_EXPORTS) \
215 AR="$(AR_FOR_TARGET)"; export AR; \
216 AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \
217 CC="$(CC_FOR_TARGET)"; export CC; \
218 CFLAGS="$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \
219 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
220 CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
221 CXXFLAGS="$(CXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \
222 GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
223 GFORTRAN="$(GFORTRAN_FOR_TARGET)"; export GFORTRAN; \
224 DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
225 LD="$(COMPILER_LD_FOR_TARGET)"; export LD; \
226 LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
227 LIPO="$(LIPO_FOR_TARGET)"; export LIPO; \
228 NM="$(COMPILER_NM_FOR_TARGET)"; export NM; \
229 OBJDUMP="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP; \
230 RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
231 STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \
232 WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
233 WINDMC="$(WINDMC_FOR_TARGET)"; export WINDMC; \
234 $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
235
236 RAW_CXX_TARGET_EXPORTS = \
237 $(BASE_TARGET_EXPORTS) \
238 CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
239 CXX="$(RAW_CXX_FOR_TARGET)"; export CXX;
240
241 NORMAL_TARGET_EXPORTS = \
242 $(BASE_TARGET_EXPORTS) \
243 CXX="$(CXX_FOR_TARGET)"; export CXX;
244
245 # Where to find GMP
246 HOST_GMPLIBS = @gmplibs@
247 HOST_GMPINC = @gmpinc@
248
249 # ----------------------------------------------
250 # Programs producing files for the BUILD machine
251 # ----------------------------------------------
252
253 SHELL = @config_shell@
254
255 # pwd command to use. Allow user to override default by setting PWDCMD in
256 # the environment to account for automounters. The make variable must not
257 # be called PWDCMD, otherwise the value set here is passed to make
258 # subprocesses and overrides the setting from the user's environment.
259 # Don't use PWD since it is a common shell environment variable and we
260 # don't want to corrupt it.
261 PWD_COMMAND = $${PWDCMD-pwd}
262
263 # compilers to use to create programs which must be run in the build
264 # environment.
265 AR_FOR_BUILD = @AR_FOR_BUILD@
266 AS_FOR_BUILD = @AS_FOR_BUILD@
267 CC_FOR_BUILD = @CC_FOR_BUILD@
268 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
269 CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@
270 CXX_FOR_BUILD = @CXX_FOR_BUILD@
271 DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@
272 GCJ_FOR_BUILD = @GCJ_FOR_BUILD@
273 GFORTRAN_FOR_BUILD = @GFORTRAN_FOR_BUILD@
274 LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
275 LD_FOR_BUILD = @LD_FOR_BUILD@
276 NM_FOR_BUILD = @NM_FOR_BUILD@
277 RANLIB_FOR_BUILD = @RANLIB_FOR_BUILD@
278 WINDMC_FOR_BUILD = @WINDMC_FOR_BUILD@
279 WINDRES_FOR_BUILD = @WINDRES_FOR_BUILD@
280
281 # Special variables passed down in EXTRA_GCC_FLAGS. They are defined
282 # here so that they can be overridden by Makefile fragments.
283 BUILD_PREFIX = @BUILD_PREFIX@
284 BUILD_PREFIX_1 = @BUILD_PREFIX_1@
285
286 # Flags to pass to stage2 and later makes. They are defined
287 # here so that they can be overridden by Makefile fragments.
288 BOOT_CFLAGS= -g -O2
289 BOOT_LDFLAGS=
290
291 BISON = @BISON@
292 YACC = @YACC@
293 FLEX = @FLEX@
294 LEX = @LEX@
295 M4 = @M4@
296 MAKEINFO = @MAKEINFO@
297 EXPECT = @EXPECT@
298 RUNTEST = @RUNTEST@
299
300 # This just becomes part of the MAKEINFO definition passed down to
301 # sub-makes. It lets flags be given on the command line while still
302 # using the makeinfo from the object tree.
303 # (Default to avoid splitting info files by setting the threshold high.)
304 MAKEINFOFLAGS = --split-size=5000000
305
306 # ---------------------------------------------
307 # Programs producing files for the HOST machine
308 # ---------------------------------------------
309
310 AS = @AS@
311 AR = @AR@
312 AR_FLAGS = rc
313 CC = @CC@
314 CXX = @CXX@
315 DLLTOOL = @DLLTOOL@
316 LD = @LD@
317 LIPO = @LIPO@
318 NM = @NM@
319 OBJDUMP = @OBJDUMP@
320 RANLIB = @RANLIB@
321 STRIP = @STRIP@
322 WINDRES = @WINDRES@
323 WINDMC = @WINDMC@
324
325 GNATBIND = @GNATBIND@
326 GNATMAKE = @GNATMAKE@
327
328 CFLAGS = @CFLAGS@
329 LDFLAGS = @LDFLAGS@
330 LIBCFLAGS = $(CFLAGS)
331 CXXFLAGS = @CXXFLAGS@
332 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
333
334 # Only build the C compiler for stage1, because that is the only one that
335 # we can guarantee will build with the native compiler, and also it is the
336 # only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS),
337 # MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them
338 # overrideable (for a bootstrap build stage1 also builds gcc.info).
339
340 STAGE1_CHECKING=@stage1_checking@
341 STAGE1_LANGUAGES=@stage1_languages@
342
343 STAGE1_CFLAGS=@stage1_cflags@
344 STAGE2_CFLAGS=$(BOOT_CFLAGS)
345 STAGE3_CFLAGS=$(BOOT_CFLAGS)
346 STAGE4_CFLAGS=$(BOOT_CFLAGS)
347
348 STAGE1_LIBCFLAGS=$(CFLAGS_FOR_TARGET)
349 STAGE2_LIBCFLAGS=$(CFLAGS_FOR_TARGET)
350 STAGE3_LIBCFLAGS=$(CFLAGS_FOR_TARGET)
351 STAGE4_LIBCFLAGS=$(CFLAGS_FOR_TARGET)
352
353 do-compare = @do_compare@
354 do-compare3 = $(do-compare)
355 do-compare-debug = $(SHELL) $(srcdir)/contrib/compare-debug $$f1 $$f2
356
357 # -----------------------------------------------
358 # Programs producing files for the TARGET machine
359 # -----------------------------------------------
360
361 FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
362
363 AR_FOR_TARGET=@AR_FOR_TARGET@
364 AS_FOR_TARGET=@AS_FOR_TARGET@
365 CC_FOR_TARGET=$(STAGE_CC_WRAPPER) @CC_FOR_TARGET@ $(FLAGS_FOR_TARGET)
366
367 # If GCC_FOR_TARGET is not overriden on the command line, then this
368 # variable is passed down to the gcc Makefile, where it is used to
369 # build libgcc2.a. We define it here so that it can itself be
370 # overridden on the command line.
371 GCC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCC_FOR_TARGET@ $(FLAGS_FOR_TARGET)
372 CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @CXX_FOR_TARGET@ $(FLAGS_FOR_TARGET)
373 RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @RAW_CXX_FOR_TARGET@ $(FLAGS_FOR_TARGET)
374 GCJ_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCJ_FOR_TARGET@ $(FLAGS_FOR_TARGET)
375 GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@ $(FLAGS_FOR_TARGET)
376 DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
377 LD_FOR_TARGET=@LD_FOR_TARGET@
378
379 LIPO_FOR_TARGET=@LIPO_FOR_TARGET@
380 NM_FOR_TARGET=@NM_FOR_TARGET@
381 OBJDUMP_FOR_TARGET=@OBJDUMP_FOR_TARGET@
382 RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@
383 STRIP_FOR_TARGET=@STRIP_FOR_TARGET@
384 WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@
385 WINDMC_FOR_TARGET=@WINDMC_FOR_TARGET@
386
387 COMPILER_AS_FOR_TARGET=@COMPILER_AS_FOR_TARGET@
388 COMPILER_LD_FOR_TARGET=@COMPILER_LD_FOR_TARGET@
389 COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_TARGET@
390
391 CFLAGS_FOR_TARGET = @CFLAGS_FOR_TARGET@
392 CXXFLAGS_FOR_TARGET = @CXXFLAGS_FOR_TARGET@
393 SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
394 DEBUG_PREFIX_CFLAGS_FOR_TARGET = @DEBUG_PREFIX_CFLAGS_FOR_TARGET@
395
396 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
397 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
398 LDFLAGS_FOR_TARGET =
399
400 # ------------------------------------
401 # Miscellaneous targets and flag lists
402 # ------------------------------------
403
404 # The first rule in the file had better be this one. Don't put any above it.
405 # This lives here to allow makefile fragments to contain dependencies.
406 all:
407
408 #### host and target specific makefile fragments come in here.
409 @target_makefile_frag@
410 @alphaieee_frag@
411 @ospace_frag@
412 @host_makefile_frag@
413 ###
414
415 # This is the list of directories that may be needed in RPATH_ENVVAR
416 # so that prorgams built for the target machine work.
417 TARGET_LIB_PATH = [+ FOR target_modules +][+
418 IF lib_path +]$(TARGET_LIB_PATH_[+module+])[+ ENDIF lib_path +][+
419 ENDFOR target_modules +]$(HOST_LIB_PATH_gcc)
420 [+ FOR target_modules +][+ IF lib_path +]
421 @if target-[+module+]
422 TARGET_LIB_PATH_[+module+] = $$r/$(TARGET_SUBDIR)/[+module+]/[+lib_path+]:
423 @endif target-[+module+]
424 [+ ENDIF lib_path +][+ ENDFOR target_modules +]
425
426
427 # This is the list of directories that may be needed in RPATH_ENVVAR
428 # so that programs built for the host machine work.
429 HOST_LIB_PATH = [+ FOR host_modules +][+
430 IF lib_path +]$(HOST_LIB_PATH_[+module+])[+ ENDIF lib_path +][+
431 ENDFOR host_modules +]
432
433 # Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch
434 @if gcc
435 HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc:$$r/$(HOST_SUBDIR)/prev-gcc:
436 @endif gcc
437
438 [+ FOR host_modules +][+ IF lib_path +]
439 @if [+module+]
440 HOST_LIB_PATH_[+module+] = \
441 $$r/$(HOST_SUBDIR)/[+module+]/[+lib_path+]:[+ IF bootstrap
442 +]$$r/$(HOST_SUBDIR)/prev-[+module+]/[+lib_path+]:[+ ENDIF bootstrap +]
443 @endif [+module+]
444 [+ ENDIF lib_path +][+ ENDFOR host_modules +]
445
446 # Flags to pass down to all sub-makes.
447 BASE_FLAGS_TO_PASS =[+ FOR flags_to_pass +][+ IF optional +] \
448 "`echo '[+flag+]=$([+flag+])' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"[+ ELSE optional +] \
449 "[+flag+]=$([+flag+])"[+ ENDIF optional+][+ ENDFOR flags_to_pass +] \
450 "CONFIG_SHELL=$(SHELL)" \
451 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)"
452
453 # We leave this in just in case, but it is not needed anymore.
454 RECURSE_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS)
455
456 # Flags to pass down to most sub-makes, in which we're building with
457 # the host environment.
458 EXTRA_HOST_FLAGS = \
459 'AR=$(AR)' \
460 'AS=$(AS)' \
461 'CC=$(CC)' \
462 'CXX=$(CXX)' \
463 'DLLTOOL=$(DLLTOOL)' \
464 'LD=$(LD)' \
465 'LIPO=$(LIPO)' \
466 'NM=$(NM)' \
467 'OBJDUMP=$(OBJDUMP)' \
468 'RANLIB=$(RANLIB)' \
469 'STRIP=$(STRIP)' \
470 'WINDRES=$(WINDRES)' \
471 'WINDMC=$(WINDMC)'
472
473 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
474
475 # Flags that are concerned with the location of the X11 include files
476 # and library files
477 #
478 # NOTE: until the top-level is getting the values via autoconf, it only
479 # causes problems to have this top-level Makefile overriding the autoconf-set
480 # values in child directories. Only variables that don't conflict with
481 # autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now.
482 #
483 X11_FLAGS_TO_PASS = \
484 'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
485 'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
486
487 # Flags to pass to stage2 and later makes.
488
489 POSTSTAGE1_FLAGS_TO_PASS = \
490 CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
491 GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind" \
492 LDFLAGS="$(BOOT_LDFLAGS)" \
493 "`echo 'ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
494
495 # Flags to pass down to makes which are built with the target environment.
496 # The double $ decreases the length of the command line; those variables
497 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. The
498 # *_CFLAGS_FOR_TARGET variables are not passed down and most often empty,
499 # so we expand them here.
500 EXTRA_TARGET_FLAGS = \
501 'AR=$$(AR_FOR_TARGET)' \
502 'AS=$(COMPILER_AS_FOR_TARGET)' \
503 'CC=$$(CC_FOR_TARGET)' \
504 'CFLAGS=$$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \
505 'CXX=$$(CXX_FOR_TARGET)' \
506 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \
507 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
508 'LD=$(COMPILER_LD_FOR_TARGET)' \
509 'LDFLAGS=$$(LDFLAGS_FOR_TARGET)' \
510 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \
511 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \
512 'NM=$(COMPILER_NM_FOR_TARGET)' \
513 'OBJDUMP=$$(OBJDUMP_FOR_TARGET)' \
514 'RANLIB=$$(RANLIB_FOR_TARGET)' \
515 'WINDRES=$$(WINDRES_FOR_TARGET)' \
516 'WINDMC=$$(WINDMC_FOR_TARGET)'
517
518 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
519
520 # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
521 # unfortunately needs the native compiler and the target ar and
522 # ranlib.
523 # If any variables are added here, they must be added to do-*, below.
524 # The BUILD_* variables are a special case, which are used for the gcc
525 # cross-building scheme.
526 EXTRA_GCC_FLAGS = \
527 "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
528 "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
529 "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
530 "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
531 "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
532 "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
533
534 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS)
535
536 .PHONY: configure-host
537 configure-host: [+
538 FOR host_modules +] \
539 maybe-configure-[+module+][+
540 ENDFOR host_modules +]
541 .PHONY: configure-target
542 configure-target: [+
543 FOR target_modules +] \
544 maybe-configure-target-[+module+][+
545 ENDFOR target_modules +]
546
547 # The target built for a native non-bootstrap build.
548 .PHONY: all
549 all:
550 @if gcc-bootstrap
551 [ -f stage_final ] || echo stage3 > stage_final
552 @r=`${PWD_COMMAND}`; export r; \
553 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
554 $(MAKE) $(RECURSE_FLAGS_TO_PASS) `cat stage_final`-bubble
555 @endif gcc-bootstrap
556 @: $(MAKE); $(unstage)
557 @r=`${PWD_COMMAND}`; export r; \
558 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
559 if [ -f stage_last ]; then \
560 $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target; \
561 else \
562 $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-host all-target; \
563 fi
564
565 .PHONY: all-build
566 [+ FOR build_modules +]
567 all-build: maybe-all-build-[+module+][+ ENDFOR build_modules +]
568
569 .PHONY: all-host
570 [+ FOR host_modules +][+ IF bootstrap +]
571 @if [+module+]-no-bootstrap[+ ENDIF bootstrap +]
572 all-host: maybe-all-[+module+][+ IF bootstrap +]
573 @endif [+module+]-no-bootstrap[+ ENDIF bootstrap +][+ ENDFOR host_modules +]
574
575 .PHONY: all-target
576 [+ FOR target_modules +][+ IF bootstrap +]
577 @if target-[+module+]-no-bootstrap[+ ENDIF bootstrap +]
578 all-target: maybe-all-target-[+module+][+ IF bootstrap +]
579 @endif target-[+module+]-no-bootstrap[+
580 ENDIF bootstrap +][+ ENDFOR target_modules +]
581
582 # Do a target for all the subdirectories. A ``make do-X'' will do a
583 # ``make X'' in all subdirectories (because, in general, there is a
584 # dependency (below) of X upon do-X, a ``make X'' will also do this,
585 # but it may do additional work as well).
586 [+ FOR recursive_targets +]
587 .PHONY: do-[+make_target+]
588 do-[+make_target+]:
589 @: $(MAKE); $(unstage)
590 @r=`${PWD_COMMAND}`; export r; \
591 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
592 $(MAKE) $(RECURSE_FLAGS_TO_PASS) [+make_target+]-host \
593 [+make_target+]-target
594
595
596 .PHONY: [+make_target+]-host
597 [+ FOR host_modules +]
598 [+make_target+]-host: maybe-[+make_target+]-[+module+][+ ENDFOR host_modules +]
599
600 .PHONY: [+make_target+]-target
601 [+ FOR target_modules +]
602 [+make_target+]-target: maybe-[+make_target+]-target-[+module+][+ ENDFOR target_modules +]
603 [+ ENDFOR recursive_targets +]
604
605 # Here are the targets which correspond to the do-X targets.
606
607 .PHONY: info installcheck dvi pdf html
608 .PHONY: install-info install-pdf install-html
609 .PHONY: clean distclean mostlyclean maintainer-clean realclean
610 .PHONY: local-clean local-distclean local-maintainer-clean
611 info: do-info
612 installcheck: do-installcheck
613 dvi: do-dvi
614 pdf: do-pdf
615 html: do-html
616
617 # Make sure makeinfo is built before we do a `make info', if we're
618 # in fact building texinfo.
619 do-info: maybe-all-texinfo
620
621 install-info: do-install-info dir.info
622 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
623 if [ -f dir.info ] ; then \
624 $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info ; \
625 else true ; fi
626
627 install-pdf: do-install-pdf
628
629 install-html: do-install-html
630
631 local-clean:
632 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
633
634 local-distclean:
635 -rm -f Makefile config.status config.cache mh-frag mt-frag
636 -rm -f maybedep.tmp serdep.tmp
637 -if [ "$(TARGET_SUBDIR)" != "." ]; then \
638 rm -rf $(TARGET_SUBDIR); \
639 else true; fi
640 -rm -rf $(BUILD_SUBDIR)
641 -if [ "$(HOST_SUBDIR)" != "." ]; then \
642 rm -rf $(HOST_SUBDIR); \
643 else true; fi
644 -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile
645 -rm -f texinfo/doc/Makefile texinfo/po/POTFILES
646 -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null
647 -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null
648 -rmdir fastjar gcc libiberty texinfo zlib 2>/dev/null
649
650 local-maintainer-clean:
651 @echo "This command is intended for maintainers to use;"
652 @echo "it deletes files that may require special tools to rebuild."
653
654 clean: do-clean local-clean
655 mostlyclean: do-mostlyclean local-clean
656 distclean: do-distclean local-clean local-distclean
657 maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
658 maintainer-clean: local-distclean
659 realclean: maintainer-clean
660
661 # Check target.
662
663 .PHONY: check do-check
664 check: do-check
665
666 # Only include modules actually being configured and built.
667 .PHONY: check-host
668 check-host: [+
669 FOR host_modules +] \
670 maybe-check-[+module+][+
671 ENDFOR host_modules +]
672
673 .PHONY: check-target
674 check-target: [+
675 FOR target_modules +] \
676 maybe-check-target-[+module+][+
677 ENDFOR target_modules +]
678
679 do-check:
680 @: $(MAKE); $(unstage)
681 @r=`${PWD_COMMAND}`; export r; \
682 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
683 $(MAKE) $(RECURSE_FLAGS_TO_PASS) check-host check-target
684
685 # Automated reporting of test results.
686
687 warning.log: build.log
688 $(srcdir)/contrib/warn_summary build.log > $@
689
690 mail-report.log:
691 if test x'$(BOOT_CFLAGS)' != x''; then \
692 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
693 fi; \
694 $(srcdir)/contrib/test_summary -t >$@
695 chmod +x $@
696 echo If you really want to send e-mail, run ./$@ now
697
698 mail-report-with-warnings.log: warning.log
699 if test x'$(BOOT_CFLAGS)' != x''; then \
700 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
701 fi; \
702 $(srcdir)/contrib/test_summary -t -i warning.log >$@
703 chmod +x $@
704 echo If you really want to send e-mail, run ./$@ now
705
706 # Installation targets.
707
708 .PHONY: install uninstall
709 install:
710 @: $(MAKE); $(unstage)
711 @r=`${PWD_COMMAND}`; export r; \
712 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
713 $(MAKE) $(RECURSE_FLAGS_TO_PASS) installdirs install-host install-target
714
715 .PHONY: install-host-nogcc
716 install-host-nogcc: [+
717 FOR host_modules +][+ IF (not (= (get "module") "gcc")) +] \
718 maybe-install-[+module+][+ ENDIF +][+
719 ENDFOR host_modules +]
720
721 .PHONY: install-host
722 install-host: [+
723 FOR host_modules +] \
724 maybe-install-[+module+][+
725 ENDFOR host_modules +]
726
727 .PHONY: install-target
728 install-target: [+
729 FOR target_modules +] \
730 maybe-install-target-[+module+][+
731 ENDFOR target_modules +]
732
733 uninstall:
734 @echo "the uninstall target is not supported in this tree"
735
736 .PHONY: install.all
737 install.all: install-no-fixedincludes
738 @if [ -f ./gcc/Makefile ] ; then \
739 r=`${PWD_COMMAND}` ; export r ; \
740 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
741 $(HOST_EXPORTS) \
742 (cd ./gcc && \
743 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
744 else \
745 true ; \
746 fi
747
748 # install-no-fixedincludes is used because Cygnus can not distribute
749 # the fixed header files.
750 .PHONY: install-no-fixedincludes
751 install-no-fixedincludes: installdirs install-host-nogcc \
752 install-target gcc-no-fixedincludes
753
754 ### other supporting targets
755
756 MAKEDIRS= \
757 $(DESTDIR)$(prefix) \
758 $(DESTDIR)$(exec_prefix)
759 .PHONY: installdirs
760 installdirs: mkinstalldirs
761 $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
762
763 dir.info: do-install-info
764 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
765 $(srcdir)/texinfo/gen-info-dir $(DESTDIR)$(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
766 mv -f dir.info.new dir.info ; \
767 else true ; \
768 fi
769
770 dist:
771 @echo "Building a full distribution of this tree isn't done"
772 @echo "via 'make dist'. Check out the etc/ subdirectory"
773
774 etags tags: TAGS
775
776 # Right now this just builds TAGS in each subdirectory. emacs19 has the
777 # ability to use several tags files at once, so there is probably no need
778 # to combine them into one big TAGS file (like CVS 1.3 does). We could
779 # (if we felt like it) have this Makefile write a piece of elisp which
780 # the user could load to tell emacs19 where all the TAGS files we just
781 # built are.
782 TAGS: do-TAGS
783
784 # ------------------------------------
785 # Macros for configure and all targets
786 # ------------------------------------
787
788 [+ DEFINE configure +]
789 .PHONY: configure-[+prefix+][+module+] maybe-configure-[+prefix+][+module+]
790 maybe-configure-[+prefix+][+module+]:
791 @if gcc-bootstrap
792 configure-[+prefix+][+module+]: stage_current
793 @endif gcc-bootstrap
794 @if [+prefix+][+module+]
795 maybe-configure-[+prefix+][+module+]: configure-[+prefix+][+module+]
796 configure-[+prefix+][+module+]: [+ IF bootstrap +][+ ELSE +]
797 @: $(MAKE); $(unstage)[+ ENDIF bootstrap +]
798 @r=`${PWD_COMMAND}`; export r; \
799 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
800 [+ IF check_multilibs
801 +]echo "Checking multilib configuration for [+module+]..."; \
802 $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+] ; \
803 $(CC_FOR_TARGET) --print-multi-lib > [+subdir+]/[+module+]/multilib.tmp 2> /dev/null ; \
804 if test -r [+subdir+]/[+module+]/multilib.out; then \
805 if cmp -s [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; then \
806 rm -f [+subdir+]/[+module+]/multilib.tmp; \