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