* elf-m10300.c (mn10300_elf_relax_section): Fix typo when relaxing
[deliverable/binutils-gdb.git] / Makefile.in
CommitLineData
eb02fd64 1#
131a3881 2# Makefile for directory with subdirs to build.
f46d03c5
ILT
3# Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998
4# Free Software Foundation
eb02fd64 5#
4dfe09da
RP
6# This file is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
8c222f6e 18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
4dfe09da 19#
f149eb99 20
eb02fd64 21srcdir = .
28f3b094 22
4d714963 23prefix = /usr/local
7fcfdcf7 24exec_prefix = $(prefix)
2ec9f3fd
KS
25
26bindir=${exec_prefix}/bin
27sbindir=${exec_prefix}/sbin
28libexecdir=${exec_prefix}/libexec
29datadir=${prefix}/share
30sysconfdir=${prefix}/etc
31sharedstatedir=${prefix}/com
32localstatedir=${prefix}/var
33libdir=${exec_prefix}/lib
34includedir=${prefix}/include
35oldincludedir=/usr/include
36infodir=${prefix}/info
37mandir=${prefix}/man
38
a54e05f6 39tooldir = $(exec_prefix)/$(target)
7fcfdcf7 40
51489233
ILT
41program_transform_name =
42
4d714963
RP
43man1dir = $(mandir)/man1
44man2dir = $(mandir)/man2
45man3dir = $(mandir)/man3
46man4dir = $(mandir)/man4
47man5dir = $(mandir)/man5
48man6dir = $(mandir)/man6
49man7dir = $(mandir)/man7
50man8dir = $(mandir)/man8
51man9dir = $(mandir)/man9
04103845 52GDB_NLM_DEPS =
4d714963
RP
53
54SHELL = /bin/sh
55
8270cd76
ILT
56# INSTALL_PROGRAM_ARGS is changed by configure.in to use -x for a
57# cygwin32 host.
58INSTALL_PROGRAM_ARGS =
59
64434418 60INSTALL = $(SHELL) $$s/install-sh -c
8270cd76
ILT
61INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_ARGS)
62INSTALL_SCRIPT = $(INSTALL)
5cc73086 63INSTALL_DATA = $(INSTALL) -m 644
3c8735af 64
09985c96 65INSTALL_DOSREL = install-dosrel-fake
a987271c 66
440868a0 67AS = as
ec342d7d 68AR = ar
b5329d84 69AR_FLAGS = rc
e85e07cb 70CC = cc
7b636683 71
66957ce4
ILT
72# Special variables passed down in EXTRA_GCC_FLAGS. They are defined
73# here so that they can be overridden by Makefile fragments.
753d5049
SC
74HOST_CC = $(CC_FOR_BUILD)
75HOST_PREFIX =
76HOST_PREFIX_1 = loser-
77
572728c6 78# These flag values are normally overridden by the configure script.
f8a6ad66 79CFLAGS = -g
572728c6
ILT
80CXXFLAGS = -g -O2
81
3585593d
BK
82LIBCFLAGS = $(CFLAGS)
83CFLAGS_FOR_TARGET = $(CFLAGS)
276c2d7d 84LDFLAGS_FOR_TARGET =
3585593d 85LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
04103845
DE
86PICFLAG =
87PICFLAG_FOR_TARGET =
7b636683 88
a4e879a1 89# start-sanitize-chill
7d9f0c54
MW
90CHILLFLAGS = $(CFLAGS)
91CHILL_LIB = -lchill
a4e879a1 92# end-sanitize-chill
2cf00a36 93CXX = c++
7b636683 94
1d5fcc66 95# Use -O2 to stress test the compiler.
864a5888 96LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
3585593d 97CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
2f64ef77 98LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
7b636683 99
4d714963 100RANLIB = ranlib
b6ae0f10
ILT
101
102DLLTOOL = dlltool
d29cd970 103WINDRES = windres
b6ae0f10 104
51489233 105NM = nm
64434418
ILT
106
107LD = ld
108
5cc73086
KR
109# Not plain GZIP, since gzip looks there for extra command-line options.
110GZIPPROG = gzip
eb02fd64 111
aaefc574
JM
112# These values are substituted by configure.
113DEFAULT_YACC = yacc
114DEFAULT_LEX = lex
115
3a671555 116BISON = `if [ -f $$r/bison/bison ] ; then \
97036944 117 echo $$r/bison/bison -L $$s/bison/ ; \
3a671555
JM
118 else \
119 echo bison ; \
120 fi`
121
122YACC = `if [ -f $$r/bison/bison ] ; then \
97036944 123 echo $$r/bison/bison -y -L $$s/bison/ ; \
3a671555
JM
124 elif [ -f $$r/byacc/byacc ] ; then \
125 echo $$r/byacc/byacc ; \
126 else \
127 echo ${DEFAULT_YACC} ; \
06a07944 128 fi`
2645fb0c 129
5cc73086
KR
130LEX = `if [ -f $$r/flex/flex ] ; \
131 then echo $$r/flex/flex ; \
aaefc574 132 else echo ${DEFAULT_LEX} ; fi`
2198e4ba 133
5cc73086
KR
134M4 = `if [ -f $$r/m4/m4 ] ; \
135 then echo $$r/m4/m4 ; \
65e21701
KR
136 else echo m4 ; fi`
137
97840afa 138MAKEINFO = `if [ -f $$r/texinfo/makeinfo/Makefile ] ; \
5cc73086 139 then echo $$r/texinfo/makeinfo/makeinfo ; \
77806c3e 140 else echo makeinfo ; fi`
484fa12d 141
9823504d
ILT
142# This just becomes part of the MAKEINFO definition passed down to
143# sub-makes. It lets flags be given on the command line while still
144# using the makeinfo from the object tree.
145MAKEINFOFLAGS =
b772d75e 146
5cc73086
KR
147EXPECT = `if [ -f $$r/expect/expect ] ; \
148 then echo $$r/expect/expect ; \
a54e05f6
KR
149 else echo expect ; fi`
150
81eb5025
ILT
151RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \
152 then echo $$s/dejagnu/runtest ; \
6a42d184
DZ
153 else echo runtest ; fi`
154
f980fcfb 155
e85e07cb 156# compilers to use to create programs which must be run in the build
440868a0
ILT
157# environment.
158CC_FOR_BUILD = $(CC)
e85e07cb 159CXX_FOR_BUILD = $(CXX)
440868a0 160
9f73dd6a 161SUBDIRS = "this is set via configure, don't edit this"
6a3958b2
RP
162OTHERS =
163
ca2ce3b3
ILT
164# This is set by the configure script to the list of directories which
165# should be built using the target tools.
f4434c50 166TARGET_CONFIGDIRS = libiberty libgloss newlib libio librx libstdc++ libg++ winsup opcodes libstub cygmon
ca2ce3b3 167
e66eb658 168# Target libraries are put under this directory:
d92eef0c
JM
169# Changed by configure to $(target_alias) if cross.
170TARGET_SUBDIR = .
e66eb658 171
ca2ce3b3
ILT
172# This is set by the configure script to the arguments passed to configure.
173CONFIG_ARGUMENTS =
174
b6ae0f10
ILT
175# This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
176# was used.
177SET_LIB_PATH =
178
179# This is the name of the environment variable used for the path to
180# the libraries. This may be changed by configure.in.
181RPATH_ENVVAR = LD_LIBRARY_PATH
182
183# configure.in sets SET_LIB_PATH to this if --enable-shared was used.
184REALLY_SET_LIB_PATH = \
185 $(RPATH_ENVVAR)=$$r/bfd:$$r/opcodes:$$$(RPATH_ENVVAR); \
186 export $(RPATH_ENVVAR);
187
a0f47eb7 188ALL = all.normal
ff290baf 189INSTALL_TARGET = installdirs \
43e1bf25 190 install-gcc \
f35c6160
DZ
191 $(INSTALL_MODULES) \
192 $(INSTALL_TARGET_MODULES) \
193 $(INSTALL_X11_MODULES) \
09985c96 194 $(INSTALL_DOSREL)
753d5049 195
fb660409 196
51489233 197CC_FOR_TARGET = ` \
72ce05e8 198 if [ -f $$r/gcc/xgcc ] ; then \
e66eb658 199 if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
d5a8bfde 200 if [ -f $$r/$(TARGET_SUBDIR)/winsup/Makefile ] ; then \
abc93570 201 echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/$(TARGET_SUBDIR)/newlib/ -L$$r/$(TARGET_SUBDIR)/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
d5a8bfde 202 else \
81eb5025 203 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
d5a8bfde 204 fi; \
753d5049
SC
205 else \
206 echo $$r/gcc/xgcc -B$$r/gcc/; \
207 fi; \
51489233 208 else \
378fd382 209 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
51489233
ILT
210 echo $(CC); \
211 else \
ea6d5817 212 t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
51489233
ILT
213 fi; \
214 fi`
215
72ce05e8
ILT
216# If CC_FOR_TARGET is not overriden on the command line, then this
217# variable is passed down to the gcc Makefile, where it is used to
218# build libgcc2.a. We define it here so that it can itself be
219# overridden on the command line.
220GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/
221
a4e879a1 222# start-sanitize-chill
7d9f0c54 223CHILL_FOR_TARGET = ` \
72ce05e8 224 if [ -f $$r/gcc/xgcc ] ; then \
04103845 225 echo $$r/gcc/xgcc -B$$r/gcc/ -L$$r/gcc/ch/runtime/; \
7d9f0c54
MW
226 else \
227 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
228 echo $(CC); \
229 else \
ea6d5817 230 t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
7d9f0c54
MW
231 fi; \
232 fi`
34b3298b 233
a4e879a1 234# end-sanitize-chill
7d9f0c54 235
d1bea4c7 236CXX_FOR_TARGET = ` \
72ce05e8 237 if [ -f $$r/gcc/xgcc ] ; then \
e66eb658 238 if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
d5a8bfde 239 if [ -f $$r/$(TARGET_SUBDIR)/winsup/Makefile ] ; then \
abc93570 240 echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/$(TARGET_SUBDIR)/newlib/ -L$$r/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
d5a8bfde 241 else \
81eb5025 242 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
d5a8bfde 243 fi; \
753d5049
SC
244 else \
245 echo $$r/gcc/xgcc -B$$r/gcc/; \
246 fi; \
fca4f908 247 else \
e85e07cb
ILT
248 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
249 echo $(CXX); \
fca4f908 250 else \
2cf00a36 251 t='$(program_transform_name)'; echo c++ | sed -e 's/x/x/' $$t; \
fca4f908
MW
252 fi; \
253 fi`
254
440868a0 255AS_FOR_TARGET = ` \
ef9a68f7
ILT
256 if [ -f $$r/gas/as-new ] ; then \
257 echo $$r/gas/as-new ; \
440868a0 258 else \
e85e07cb 259 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
440868a0
ILT
260 echo $(AS); \
261 else \
ea6d5817 262 t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \
81246025 263 fi; \
440868a0
ILT
264 fi`
265
054f9ada 266LD_FOR_TARGET = ` \
19ebe123
ILT
267 if [ -f $$r/ld/ld-new ] ; then \
268 echo $$r/ld/ld-new ; \
054f9ada
JM
269 else \
270 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
271 echo $(LD); \
272 else \
273 t='$(program_transform_name)'; echo ld | sed -e 's/x/x/' $$t ; \
274 fi; \
275 fi`
276
a220ba0f
SC
277DLLTOOL_FOR_TARGET = ` \
278 if [ -f $$r/binutils/dlltool ] ; then \
279 echo $$r/binutils/dlltool ; \
280 else \
281 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
282 echo $(DLLTOOL); \
283 else \
284 t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \
285 fi; \
286 fi`
287
d29cd970
ILT
288WINDRES_FOR_TARGET = ` \
289 if [ -f $$r/binutils/windres ] ; then \
290 echo $$r/binutils/windres ; \
291 else \
292 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
293 echo $(WINDRES); \
294 else \
295 t='$(program_transform_name)'; echo windres | sed -e 's/x/x/' $$t ; \
296 fi; \
297 fi`
298
51489233 299AR_FOR_TARGET = ` \
5cc73086
KR
300 if [ -f $$r/binutils/ar ] ; then \
301 echo $$r/binutils/ar ; \
51489233 302 else \
378fd382 303 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
51489233
ILT
304 echo $(AR); \
305 else \
ea6d5817 306 t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \
81246025 307 fi; \
51489233
ILT
308 fi`
309
310RANLIB_FOR_TARGET = ` \
5cc73086
KR
311 if [ -f $$r/binutils/ranlib ] ; then \
312 echo $$r/binutils/ranlib ; \
51489233 313 else \
378fd382 314 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
51489233
ILT
315 echo $(RANLIB); \
316 else \
ea6d5817 317 t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \
81246025 318 fi; \
51489233
ILT
319 fi`
320
321NM_FOR_TARGET = ` \
0e25edca
ILT
322 if [ -f $$r/binutils/nm-new ] ; then \
323 echo $$r/binutils/nm-new ; \
51489233 324 else \
378fd382 325 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
51489233
ILT
326 echo $(NM); \
327 else \
ea6d5817 328 t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \
81246025 329 fi; \
51489233
ILT
330 fi`
331
456876c8
DE
332# The first rule in the file had better be this one. Don't put any above it.
333# This lives here to allow makefile fragments to contain dependencies.
334all: all.normal
335.PHONY: all
336
337# These can be overridden by config/mt-*.
338# The _TARGET_ is because they're specified in mt-foo.
339# The _HOST_ is because they're programs that run on the host.
340EXTRA_TARGET_HOST_ALL_MODULES =
341EXTRA_TARGET_HOST_INSTALL_MODULES =
342EXTRA_TARGET_HOST_CHECK_MODULES =
343
eb02fd64 344#### host and target specific makefile fragments come in here.
ec342d7d 345###
eb02fd64 346
0ef4728f
ILT
347# Flags to pass down to all sub-makes.
348# Please keep these in alphabetical order.
349BASE_FLAGS_TO_PASS = \
2198e4ba 350 "AR_FLAGS=$(AR_FLAGS)" \
d09de70e 351 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
0ef4728f 352 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
378fd382 353 "BISON=$(BISON)" \
378fd382 354 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
0ef4728f 355 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
2198e4ba 356 "CFLAGS=$(CFLAGS)" \
3585593d 357 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
a4e879a1 358 $(start-sanitize-chill)\
7d9f0c54
MW
359 "CHILLFLAGS=$(CHILLFLAGS)" \
360 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
361 "CHILL_LIB=$(CHILL_LIB)" \
a4e879a1 362 $(end-sanitize-chill)\
0ef4728f
ILT
363 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
364 "CXXFLAGS=$(CXXFLAGS)" \
3585593d 365 "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
0ef4728f 366 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
a220ba0f 367 "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
2198e4ba
MT
368 "INSTALL=$(INSTALL)" \
369 "INSTALL_DATA=$(INSTALL_DATA)" \
440868a0 370 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
8270cd76 371 "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
378fd382
DZ
372 "LDFLAGS=$(LDFLAGS)" \
373 "LEX=$(LEX)" \
054f9ada 374 "LD_FOR_TARGET=$(LD_FOR_TARGET)" \
3585593d
BK
375 "LIBCFLAGS=$(LIBCFLAGS)" \
376 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
04103845
DE
377 "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
378 "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
65e21701 379 "M4=$(M4)" \
eb40ca93 380 "MAKE=$(MAKE)" \
9823504d 381 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
0ef4728f 382 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
04103845
DE
383 "PICFLAG=$(PICFLAG)" \
384 "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
d09de70e 385 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
43e1bf25 386 "RPATH_ENVVAR=$(RPATH_ENVVAR)" \
49dfa984 387 "SHELL=$(SHELL)" \
a54e05f6 388 "EXPECT=$(EXPECT)" \
6a42d184 389 "RUNTEST=$(RUNTEST)" \
86365152 390 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
d29cd970 391 "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \
3a671555 392 "YACC=$(YACC)" \
2ec9f3fd
KS
393 "bindir=$(bindir)" \
394 "datadir=$(datadir)" \
378fd382 395 "exec_prefix=$(exec_prefix)" \
2ec9f3fd
KS
396 "includedir=$(includedir)" \
397 "infodir=$(infodir)" \
398 "libdir=$(libdir)" \
399 "libexecdir=$(libexecdir)" \
3173839b 400 "lispdir=$(lispdir)" \
2ec9f3fd
KS
401 "localstatedir=$(localstatedir)" \
402 "mandir=$(mandir)" \
403 "oldincludedir=$(oldincludedir)" \
378fd382 404 "prefix=$(prefix)" \
2ec9f3fd
KS
405 "sbindir=$(sbindir)" \
406 "sharedstatedir=$(sharedstatedir)" \
407 "sysconfdir=$(sysconfdir)" \
408 "tooldir=$(tooldir)"
2198e4ba 409
0ef4728f
ILT
410# Flags to pass down to most sub-makes, in which we're building with
411# the host environment.
6d681784 412# If any variables are added here, they must be added to do-*, below.
0ef4728f 413EXTRA_HOST_FLAGS = \
6d681784
JG
414 'AR=$(AR)' \
415 'AS=$(AS)' \
416 'CC=$(CC)' \
417 'CXX=$(CXX)' \
b6ae0f10 418 'DLLTOOL=$(DLLTOOL)' \
64434418 419 'LD=$(LD)' \
6d681784 420 'NM=$(NM)' \
d29cd970
ILT
421 'RANLIB=$(RANLIB)' \
422 'WINDRES=$(WINDRES)'
0ef4728f 423
97840afa 424FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
0ef4728f 425
d1bea4c7
DZ
426# Flags that are concerned with the location of the X11 include files
427# and library files
054f9ada
JM
428#
429# NOTE: until the top-level is getting the values via autoconf, it only
430# causes problems to have this top-level Makefile overriding the autoconf-set
431# values in child directories. Only variables that don't conflict with
432# autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now.
433#
d1bea4c7 434X11_FLAGS_TO_PASS = \
054f9ada
JM
435 'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
436 'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
d1bea4c7 437
0ef4728f
ILT
438# Flags to pass down to makes which are built with the target environment.
439# The double $ decreases the length of the command line; the variables
440# are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
6d681784 441# If any variables are added here, they must be added to do-*, below.
0ef4728f
ILT
442EXTRA_TARGET_FLAGS = \
443 'AR=$$(AR_FOR_TARGET)' \
444 'AS=$$(AS_FOR_TARGET)' \
445 'CC=$$(CC_FOR_TARGET)' \
3585593d 446 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
0ef4728f 447 'CXX=$$(CXX_FOR_TARGET)' \
3585593d 448 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
a220ba0f 449 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
054f9ada 450 'LD=$$(LD_FOR_TARGET)' \
3585593d
BK
451 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
452 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
0ef4728f 453 'NM=$$(NM_FOR_TARGET)' \
04103845 454 'PICFLAG=$$(PICFLAG_FOR_TARGET)' \
d29cd970
ILT
455 'RANLIB=$$(RANLIB_FOR_TARGET)' \
456 'WINDRES=$$(WINDRES_FOR_TARGET)'
0ef4728f
ILT
457
458TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
51489233 459
f4e414f1
ILT
460# Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
461# unfortunately needs the native compiler and the target ar and
0ef4728f 462# ranlib.
66957ce4
ILT
463# If any variables are added here, they must be added to do-*, below.
464# The HOST_* variables are a special case, which are used for the gcc
465# cross-building scheme.
0ef4728f
ILT
466EXTRA_GCC_FLAGS = \
467 'AR=$$(AR_FOR_TARGET)' \
6d681784
JG
468 'AS=$(AS)' \
469 'CC=$(CC)' \
470 'CXX=$(CXX)' \
b6ae0f10 471 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
a54e05f6
KR
472 'HOST_CC=$(CC_FOR_BUILD)' \
473 'HOST_PREFIX=$(HOST_PREFIX)' \
474 'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
6d681784 475 'NM=$(NM)' \
4c0b7ebc 476 'RANLIB=$$(RANLIB_FOR_TARGET)' \
d29cd970 477 'WINDRES=$$(WINDRES_FOR_TARGET)' \
97840afa 478 "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
b0ea0c52
ILT
479 "`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s/.*=$$/XFOO=/`" \
480 "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s/.*=$$/XFOO=/`" \
481 "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s/.*=$$/XFOO=/`" \
482 "`echo 'LIBGCC1_TEST=$(LIBGCC1_TEST)' | sed -e s/.*=$$/XFOO=/`" \
483 "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
484 "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
485 "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \
486 "`echo 'ENQUIRE=$(ENQUIRE)' | sed -e s/.*=$$/XFOO=/`" \
700d7935 487 "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`"
0ef4728f 488
34b3298b 489GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
f4e414f1 490
6a42d184 491# This is a list of the targets for all of the modules which are compiled
79337c85
ILT
492# using $(FLAGS_TO_PASS).
493ALL_MODULES = \
53c403df 494 all-apache \
258950c5 495 all-ash \
79337c85 496 all-autoconf \
08168809 497 all-automake \
5db223e4 498 all-bash \
79337c85
ILT
499 all-bfd \
500 all-binutils \
3a671555 501 all-bison \
79337c85 502 all-byacc \
0ab3f086
BK
503 $(start-sanitize-cygnus) \
504 all-cgen \
505 $(end-sanitize-cygnus) \
97b951fb 506 all-cvssrc \
97840afa 507 all-db \
79337c85
ILT
508 all-dejagnu \
509 all-diff \
ac259c28 510 all-dosutils \
79337c85
ILT
511 all-etc \
512 all-fileutils \
97840afa 513 all-findutils \
79337c85
ILT
514 all-find \
515 all-flex \
bcbcf456
BE
516 $(start-sanitize-cygnus) \
517 all-flexlm \
518 $(end-sanitize-cygnus) \
79337c85
ILT
519 all-gas \
520 all-gawk \
f46d03c5 521 all-gettext \
ba26181f 522 all-gnuserv \
79337c85
ILT
523 all-gprof \
524 all-grep \
19b1d034 525 all-grez \
79337c85
ILT
526 all-gzip \
527 all-hello \
3718029f
ILT
528 $(start-sanitize-ide) \
529 all-ilu \
530 $(end-sanitize-ide) \
79337c85 531 all-indent \
13d7cbe2 532 all-inet \
f46d03c5 533 all-intl \
79337c85 534 all-ispell \
97840afa 535 all-itcl \
c070fb34
ILT
536 $(start-sanitize-ide) \
537 all-jstools \
538 $(end-sanitize-ide) \
79337c85 539 all-ld \
67ae6381 540 all-libgui \
79337c85 541 all-libiberty \
43e1bf25 542 $(start-sanitize-ide) \
eebe454c 543 all-libide \
f46d03c5 544 all-libidetcl \
43e1bf25 545 $(end-sanitize-ide) \
c99e91d2 546 all-libtool \
79337c85
ILT
547 all-m4 \
548 all-make \
549 all-mmalloc \
550 all-opcodes \
551 all-patch \
0f8f1d33 552 all-perl \
79337c85
ILT
553 all-prms \
554 all-rcs \
555 all-readline \
275049c0 556 all-release \
79337c85
ILT
557 all-recode \
558 all-sed \
559 all-send-pr \
560 all-shellutils \
561 all-sim \
b0dae4d7 562 $(start-sanitize-cygnus) \
abc93570 563 all-snavigator \
b0dae4d7 564 $(end-sanitize-cygnus) \
79337c85
ILT
565 all-tar \
566 all-tcl \
567 all-texinfo \
568 all-textutils \
569 all-tgas \
570 all-time \
571 all-uudecode \
eebe454c
TT
572 $(start-sanitize-ide) \
573 all-vmake \
574 $(end-sanitize-ide) \
456876c8
DE
575 all-wdiff \
576 $(EXTRA_TARGET_HOST_ALL_MODULES)
753d5049 577
4f0b8f27
TL
578# This is a list of the check targets for all of the modules which are
579# compiled using $(FLAGS_TO_PASS).
580#
d237841c
BC
581# The list is in two parts. The first lists those tools which
582# are tested as part of the host's native tool-chain, and not
583# tested in a cross configuration.
584NATIVE_CHECK_MODULES = \
3a671555 585 check-bison \
d237841c 586 check-byacc \
4f0b8f27
TL
587 check-flex
588
d237841c 589CROSS_CHECK_MODULES = \
53c403df 590 check-apache \
258950c5 591 check-ash \
6a42d184 592 check-autoconf \
08168809 593 check-automake \
5db223e4 594 check-bash \
6a42d184
DZ
595 check-bfd \
596 check-binutils \
97b951fb 597 check-cvssrc \
97840afa 598 check-db \
6a42d184
DZ
599 check-dejagnu \
600 check-diff \
601 check-etc \
602 check-fileutils \
97840afa 603 check-findutils \
6a42d184 604 check-find \
bcbcf456
BE
605 $(start-sanitize-cygnus) \
606 check-flexlm \
607 $(end-sanitize-cygnus) \
6a42d184
DZ
608 check-gas \
609 check-gawk \
f46d03c5 610 check-gettext \
ba26181f 611 check-gnuserv \
6a42d184
DZ
612 check-gprof \
613 check-grep \
614 check-gzip \
615 check-hello \
3718029f
ILT
616 $(start-sanitize-ide) \
617 check-ilu \
618 $(end-sanitize-ide) \
6a42d184 619 check-indent \
13d7cbe2 620 check-inet \
f46d03c5 621 check-intl \
6a42d184 622 check-ispell \
97840afa 623 check-itcl \
c070fb34
ILT
624 $(start-sanitize-ide) \
625 check-jstools \
626 $(end-sanitize-ide) \
6a42d184 627 check-ld \
67ae6381 628 check-libgui \
6a42d184 629 check-libiberty \
43e1bf25 630 $(start-sanitize-ide) \
eebe454c 631 check-libide \
f46d03c5 632 check-libidetcl \
43e1bf25 633 $(end-sanitize-ide) \
c99e91d2 634 check-libtool \
6a42d184
DZ
635 check-m4 \
636 check-make \
637 check-mmcheckoc \
638 check-opcodes \
639 check-patch \
0f8f1d33 640 check-perl \
6a42d184
DZ
641 check-prms \
642 check-rcs \
643 check-readline \
644 check-recode \
645 check-sed \
646 check-send-pr \
647 check-shellutils \
b0dae4d7 648 $(start-sanitize-cygnus) \
abc93570 649 check-snavigator \
b0dae4d7 650 $(end-sanitize-cygnus) \
6a42d184
DZ
651 check-sim \
652 check-tar \
653 check-tcl \
654 check-texinfo \
655 check-textutils \
656 check-tgas \
657 check-time \
658 check-uudecode \
eebe454c
TT
659 $(start-sanitize-ide) \
660 check-vmake \
661 $(end-sanitize-ide) \
456876c8
DE
662 check-wdiff \
663 $(EXTRA_TARGET_HOST_CHECK_MODULES)
d237841c
BC
664
665CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
6a42d184
DZ
666
667# This is a list of the install targets for all of the modules which are
79337c85 668# compiled using $(FLAGS_TO_PASS).
27349293
ILT
669# We put install-opcodes before install-binutils because the installed
670# binutils might be on PATH, and they might need the shared opcodes
671# library.
abc93570
ILT
672# We put install-tcl before install-itcl because itcl wants to run a
673# program on installation which uses the Tcl libraries.
79337c85 674INSTALL_MODULES = \
53c403df 675 install-apache \
258950c5 676 install-ash \
79337c85 677 install-autoconf \
08168809 678 install-automake \
5db223e4 679 install-bash \
79337c85 680 install-bfd \
27349293 681 install-opcodes \
79337c85 682 install-binutils \
3a671555 683 install-bison \
79337c85 684 install-byacc \
97b951fb 685 install-cvssrc \
97840afa 686 install-db \
79337c85
ILT
687 install-dejagnu \
688 install-diff \
753d5049 689 install-dosutils \
79337c85
ILT
690 install-etc \
691 install-fileutils \
97840afa 692 install-findutils \
79337c85
ILT
693 install-find \
694 install-flex \
bcbcf456
BE
695 $(start-sanitize-cygnus) \
696 install-flexlm \
697 $(end-sanitize-cygnus) \
79337c85
ILT
698 install-gas \
699 install-gawk \
f46d03c5 700 install-gettext \
ba26181f 701 install-gnuserv \
79337c85
ILT
702 install-gprof \
703 install-grep \
19b1d034 704 install-grez \
79337c85
ILT
705 install-gzip \
706 install-hello \
3718029f
ILT
707 $(start-sanitize-ide) \
708 install-ilu \
709 $(end-sanitize-ide) \
79337c85 710 install-indent \
13d7cbe2 711 install-inet \
f46d03c5 712 install-intl \
79337c85 713 install-ispell \
abc93570 714 install-tcl \
97840afa 715 install-itcl \
c070fb34
ILT
716 $(start-sanitize-ide) \
717 install-jstools \
718 $(end-sanitize-ide) \
79337c85 719 install-ld \
67ae6381 720 install-libgui \
79337c85 721 install-libiberty \
43e1bf25 722 $(start-sanitize-ide) \
eebe454c 723 install-libide \
f46d03c5 724 install-libidetcl \
43e1bf25 725 $(end-sanitize-ide) \
c99e91d2 726 install-libtool \
79337c85
ILT
727 install-m4 \
728 install-make \
729 install-mmalloc \
79337c85 730 install-patch \
0f8f1d33 731 install-perl \
79337c85
ILT
732 install-prms \
733 install-rcs \
734 install-readline \
735 install-recode \
736 install-sed \
737 install-send-pr \
738 install-shellutils \
739 install-sim \
b0dae4d7 740 $(start-sanitize-cygnus) \
abc93570 741 install-snavigator \
b0dae4d7 742 $(end-sanitize-cygnus) \
79337c85 743 install-tar \
79337c85
ILT
744 install-texinfo \
745 install-textutils \
746 install-tgas \
747 install-time \
748 install-uudecode \
eebe454c
TT
749 $(start-sanitize-ide) \
750 install-vmake \
751 $(end-sanitize-ide) \
456876c8
DE
752 install-wdiff \
753 $(EXTRA_TARGET_HOST_INSTALL_MODULES)
79337c85 754
6a42d184 755# This is a list of the targets for all of the modules which are compiled
79337c85
ILT
756# using $(X11_FLAGS_TO_PASS).
757ALL_X11_MODULES = \
758 all-emacs \
4d802af9 759 all-emacs19 \
04103845 760 all-gdb \
79337c85 761 all-expect \
65e21701 762 all-gash \
0f8f1d33 763 all-guile \
79337c85 764 all-tclX \
9239dc26
ILT
765 all-tk \
766 all-tix
79337c85 767
6a42d184
DZ
768# This is a list of the check targets for all of the modules which are
769# compiled using $(X11_FLAGS_TO_PASS).
770CHECK_X11_MODULES = \
771 check-emacs \
04103845 772 check-gdb \
0f8f1d33 773 check-guile \
6a42d184 774 check-expect \
65e21701 775 check-gash \
9239dc26
ILT
776 check-tclX \
777 check-tk \
778 check-tix
6a42d184 779
79337c85
ILT
780# This is a list of the install targets for all the modules which are
781# compiled using $(X11_FLAGS_TO_PASS).
782INSTALL_X11_MODULES = \
783 install-emacs \
4d802af9 784 install-emacs19 \
04103845 785 install-gdb \
0f8f1d33 786 install-guile \
79337c85 787 install-expect \
65e21701 788 install-gash \
79337c85 789 install-tclX \
9239dc26
ILT
790 install-tk \
791 install-tix
fca4f908 792
6a42d184 793# This is a list of the targets for all of the modules which are compiled
79337c85
ILT
794# using $(TARGET_FLAGS_TO_PASS).
795ALL_TARGET_MODULES = \
ab1cbc67
PB
796 all-target-libio \
797 all-target-libstdc++ \
f46d03c5
ILT
798 all-target-librx \
799 all-target-libg++ \
ab1cbc67
PB
800 all-target-newlib \
801 all-target-winsup \
802 all-target-libgloss \
4c0b7ebc 803 all-target-libiberty \
10be59aa 804 all-target-gperf \
664298e6 805 all-target-examples \
f4434c50 806 all-target-libstub \
06855275 807 $(start-sanitize-java) \
3970ecc7 808 all-target-libjava \
06855275
SG
809 all-target-boehm-gc \
810 $(end-sanitize-java) \
811 all-target-cygmon
79337c85 812
ca2ce3b3
ILT
813# This is a list of the configure targets for all of the modules which
814# are compiled using the target tools.
815CONFIGURE_TARGET_MODULES = \
ab1cbc67
PB
816 configure-target-libio \
817 configure-target-libstdc++ \
f46d03c5
ILT
818 configure-target-librx \
819 configure-target-libg++ \
ab1cbc67
PB
820 configure-target-newlib \
821 configure-target-winsup \
822 configure-target-libgloss \
4c0b7ebc 823 configure-target-libiberty \
10be59aa 824 configure-target-gperf \
664298e6 825 configure-target-examples \
f4434c50 826 configure-target-libstub \
06855275 827 $(start-sanitize-java) \
3970ecc7 828 configure-target-libjava \
06855275
SG
829 configure-target-boehm-gc \
830 $(end-sanitize-java) \
831 configure-target-cygmon
ca2ce3b3 832
6a42d184
DZ
833# This is a list of the check targets for all of the modules which are
834# compiled using $(TARGET_FLAGS_TO_PASS).
835CHECK_TARGET_MODULES = \
ab1cbc67
PB
836 check-target-libio \
837 check-target-libstdc++ \
f46d03c5 838 check-target-libg++ \
ab1cbc67
PB
839 check-target-newlib \
840 check-target-winsup \
10be59aa 841 check-target-libiberty \
06855275 842 $(start-sanitize-java) \
3970ecc7 843 check-target-libjava \
06855275
SG
844 check-target-boehm-gc \
845 $(end-sanitize-java) \
846 check-target-gperf
6a42d184
DZ
847
848# This is a list of the install targets for all of the modules which are
79337c85
ILT
849# compiled using $(TARGET_FLAGS_TO_PASS).
850INSTALL_TARGET_MODULES = \
ab1cbc67
PB
851 install-target-libio \
852 install-target-libstdc++ \
f46d03c5 853 install-target-libg++ \
ab1cbc67
PB
854 install-target-newlib \
855 install-target-winsup \
856 install-target-libgloss \
10be59aa 857 install-target-libiberty \
06855275 858 $(start-sanitize-java) \
3970ecc7 859 install-target-libjava \
06855275
SG
860 install-target-boehm-gc \
861 $(end-sanitize-java) \
862 install-target-gperf
7481617f 863
7508666f
MM
864# This is a list of the targets for which we can do a clean-{target}.
865CLEAN_MODULES = \
13d7cbe2 866 clean-apache \
258950c5 867 clean-ash \
7508666f 868 clean-autoconf \
08168809 869 clean-automake \
5db223e4 870 clean-bash \
7508666f
MM
871 clean-bfd \
872 clean-binutils \
3a671555 873 clean-bison \
7508666f 874 clean-byacc \
0ab3f086
BK
875 $(start-sanitize-cygnus) \
876 clean-cgen \
877 $(end-sanitize-cygnus) \
97b951fb 878 clean-cvssrc \
97840afa 879 clean-db \
7508666f
MM
880 clean-dejagnu \
881 clean-diff \
882 clean-dosutils \
883 clean-etc \
884 clean-fileutils \
97840afa 885 clean-findutils \
7508666f
MM
886 clean-find \
887 clean-flex \
bcbcf456
BE
888 $(start-sanitize-cygnus) \
889 clean-flexlm \
890 $(end-sanitize-cygnus) \
7508666f
MM
891 clean-gas \
892 clean-gawk \
f46d03c5 893 clean-gettext \
ba26181f 894 clean-gnuserv \
7508666f
MM
895 clean-gprof \
896 clean-grep \
897 clean-grez \
898 clean-gzip \
899 clean-hello \
3718029f
ILT
900 $(start-sanitize-ide) \
901 clean-ilu \
902 $(end-sanitize-ide) \
7508666f 903 clean-indent \
13d7cbe2 904 clean-inet \
f46d03c5 905 clean-intl \
7508666f 906 clean-ispell \
97840afa 907 clean-itcl \
c070fb34
ILT
908 $(start-sanitize-ide) \
909 clean-jstools \
910 $(end-sanitize-ide) \
7508666f 911 clean-ld \
67ae6381 912 clean-libgui \
7508666f 913 clean-libiberty \
43e1bf25 914 $(start-sanitize-ide) \
eebe454c 915 clean-libide \
f46d03c5 916 clean-libidetcl \
43e1bf25 917 $(end-sanitize-ide) \
c99e91d2 918 clean-libtool \
7508666f
MM
919 clean-m4 \
920 clean-make \
921 clean-mmalloc \
922 clean-opcodes \
923 clean-patch \
924 clean-perl \
925 clean-prms \
926 clean-rcs \
927 clean-readline \
928 clean-release \
929 clean-recode \
930 clean-sed \
931 clean-send-pr \
932 clean-shellutils \
933 clean-sim \
b0dae4d7 934 $(start-sanitize-cygnus) \
abc93570 935 clean-snavigator \
b0dae4d7 936 $(end-sanitize-cygnus) \
7508666f
MM
937 clean-tar \
938 clean-tcl \
939 clean-texinfo \
940 clean-textutils \
941 clean-tgas \
942 clean-time \
943 clean-uudecode \
eebe454c
TT
944 $(start-sanitize-ide) \
945 clean-vmake \
946 $(end-sanitize-ide) \
7508666f
MM
947 clean-wdiff
948
949# All of the target modules that can be cleaned
950CLEAN_TARGET_MODULES = \
951 clean-target-libio \
952 clean-target-libstdc++ \
f46d03c5
ILT
953 clean-target-librx \
954 clean-target-libg++ \
7508666f
MM
955 clean-target-newlib \
956 clean-target-winsup \
957 clean-target-libgloss \
958 clean-target-libiberty \
10be59aa 959 clean-target-gperf \
664298e6 960 clean-target-examples \
f4434c50 961 clean-target-libstub \
06855275 962 $(start-sanitize-java) \
3970ecc7 963 clean-target-libjava \
06855275
SG
964 clean-target-boehm-gc \
965 $(end-sanitize-java) \
966 clean-target-cygmon
7508666f
MM
967
968# All of the x11 modules that can be cleaned
969CLEAN_X11_MODULES = \
970 clean-emacs \
971 clean-emacs19 \
972 clean-gdb \
973 clean-expect \
974 clean-gash \
975 clean-guile \
976 clean-tclX \
9239dc26
ILT
977 clean-tk \
978 clean-tix
7508666f 979
79337c85
ILT
980# The target built for a native build.
981.PHONY: all.normal
982all.normal: \
983 $(ALL_MODULES) \
46d0ca81 984 $(ALL_X11_MODULES) \
2e482734 985 $(ALL_TARGET_MODULES) \
79337c85
ILT
986 all-gcc
987
0ef4728f 988# Do a target for all the subdirectories. A ``make do-X'' will do a
53222cbd
RP
989# ``make X'' in all subdirectories (because, in general, there is a
990# dependency (below) of X upon do-X, a ``make X'' will also do this,
991# but it may do additional work as well).
0ef4728f
ILT
992# This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
993# because it is so large that it can easily overflow the command line
994# length limit on some systems.
79337c85 995DO_X = \
79337c85
ILT
996 do-clean \
997 do-distclean \
998 do-dvi \
999 do-info \
1000 do-install-info \
1001 do-installcheck \
1002 do-mostlyclean \
ca2ce3b3 1003 do-maintainer-clean \
753d5049 1004 do-TAGS
79337c85
ILT
1005.PHONY: $(DO_X)
1006$(DO_X):
0ef4728f 1007 @target=`echo $@ | sed -e 's/^do-//'`; \
5cc73086 1008 r=`pwd`; export r; \
81eb5025 1009 s=`cd $(srcdir); pwd`; export s; \
b6ae0f10 1010 $(SET_LIB_PATH) \
ab1cbc67 1011 for i in $(SUBDIRS) -dummy-; do \
36286a3e 1012 if [ -f ./$$i/Makefile ]; then \
0ef4728f 1013 case $$i in \
0ef4728f 1014 gcc) \
6d681784 1015 for flag in $(EXTRA_GCC_FLAGS); do \
0f8f1d33 1016 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
6d681784 1017 done; \
0ef4728f
ILT
1018 ;; \
1019 *) \
6d681784 1020 for flag in $(EXTRA_HOST_FLAGS); do \
0f8f1d33 1021 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
6d681784 1022 done; \
0ef4728f
ILT
1023 ;; \
1024 esac ; \
d29cd970 1025 export AR AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
0ef4728f 1026 if (cd ./$$i; \
6d681784 1027 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
64434418 1028 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
753d5049 1029 "RANLIB=$${RANLIB}" \
d29cd970 1030 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
6d681784 1031 $${target}); \
0ef4728f
ILT
1032 then true; else exit 1; fi; \
1033 else true; fi; \
ec7a8792
ILT
1034 done
1035 @target=`echo $@ | sed -e 's/^do-//'`; \
1036 r=`pwd`; export r; \
81eb5025 1037 s=`cd $(srcdir); pwd`; export s; \
b6ae0f10 1038 $(SET_LIB_PATH) \
ab1cbc67
PB
1039 for i in $(TARGET_CONFIGDIRS) -dummy-; do \
1040 if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \
1041 for flag in $(EXTRA_TARGET_FLAGS); do \
0f8f1d33 1042 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
ab1cbc67 1043 done; \
d29cd970 1044 export AR AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
ab1cbc67
PB
1045 if (cd $(TARGET_SUBDIR)/$$i; \
1046 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
64434418 1047 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
ab1cbc67 1048 "RANLIB=$${RANLIB}" \
d29cd970 1049 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
ab1cbc67
PB
1050 $${target}); \
1051 then true; else exit 1; fi; \
1052 else true; fi; \
0ef4728f 1053 done
fb90daeb 1054
79337c85
ILT
1055# Here are the targets which correspond to the do-X targets.
1056
65088029 1057.PHONY: info installcheck dvi install-info
ca2ce3b3
ILT
1058.PHONY: clean distclean mostlyclean maintainer-clean realclean
1059.PHONY: local-clean local-distclean local-maintainer-clean
0ef4728f 1060info: do-info
1a14993c 1061installcheck: do-installcheck
0ef4728f 1062dvi: do-dvi
9a9e8e7f 1063
97840afa
TT
1064# Make sure makeinfo is built before we do a `make info'.
1065do-info: all-texinfo
1066
f35c6160 1067install-info: do-install-info dir.info
81eb5025 1068 s=`cd $(srcdir); pwd`; export s; \
72c09fbc
SC
1069 if [ -f dir.info ] ; then \
1070 $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
50fbe976 1071 else true ; fi
4d714963 1072
0ef4728f 1073local-clean:
7fed4078 1074 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
3b30df82 1075
0ef4728f 1076local-distclean:
2e482734 1077 -rm -f Makefile config.status config.cache
8c5bc3e3
ILT
1078 -if [ "$(TARGET_SUBDIR)" != "." ]; then \
1079 rm -rf $(TARGET_SUBDIR); \
1080 else true; fi
7fcfdcf7 1081
ca2ce3b3
ILT
1082local-maintainer-clean:
1083 @echo "This command is intended for maintainers to use;"
1084 @echo "it deletes files that may require special tools to rebuild."
1085
0ef4728f
ILT
1086clean: do-clean local-clean
1087mostlyclean: do-mostlyclean local-clean
1088distclean: do-distclean local-clean local-distclean
ca2ce3b3
ILT
1089maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
1090maintainer-clean: local-distclean
1091realclean: maintainer-clean
0ef4728f 1092
7508666f
MM
1093# This rule is used to clean specific modules.
1094.PHONY: $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc
1095$(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc:
1096 @dir=`echo $@ | sed -e 's/clean-//'`; \
1097 if [ -f ./$${dir}/Makefile ] ; then \
1098 r=`pwd`; export r; \
81eb5025 1099 s=`cd $(srcdir); pwd`; export s; \
7508666f
MM
1100 $(SET_LIB_PATH) \
1101 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) clean); \
1102 else \
1103 true; \
1104 fi
1105
1106.PHONY: $(CLEAN_TARGET_MODULES)
1107$(CLEAN_TARGET_MODULES):
1108 @dir=`echo $@ | sed -e 's/clean-target-//'`; \
062aded9 1109 rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
7508666f
MM
1110 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1111 r=`pwd`; export r; \
81eb5025 1112 s=`cd $(srcdir); pwd`; export s; \
7508666f
MM
1113 $(SET_LIB_PATH) \
1114 (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) clean); \
1115 else \
1116 true; \
1117 fi
1118
1119clean-target: $(CLEAN_TARGET_MODULES)
1120
65088029
ILT
1121# Check target.
1122
1123.PHONY: check
1124check: $(CHECK_MODULES) \
1125 $(CHECK_TARGET_MODULES) \
1126 $(CHECK_X11_MODULES) \
1127 check-gcc
1128
79337c85 1129# Installation targets.
4d714963 1130
04103845 1131.PHONY: install uninstall source-vault binary-vault vault-install
98a33b6d 1132install: $(INSTALL_TARGET)
b26ff9d8 1133
79337c85
ILT
1134uninstall:
1135 @echo "the uninstall target is not supported in this tree"
1136
04103845
DE
1137source-vault:
1138 $(MAKE) -f ./release/Build-A-Release \
1139 host=$(host_alias) source-vault
1140
1141binary-vault:
1142 $(MAKE) -f ./release/Build-A-Release \
1143 host=$(host_alias) target=$(target_alias)
1144
275049c0
JK
1145vault-install:
1146 @if [ -f ./release/vault-install ] ; then \
1147 ./release/vault-install $(host_alias) $(target_alias) ; \
96bfa612
KR
1148 else \
1149 true ; \
275049c0
JK
1150 fi
1151
79337c85 1152.PHONY: install.all
06a07944
RP
1153install.all: install-no-fixedincludes
1154 @if [ -f ./gcc/Makefile ] ; then \
5cc73086 1155 r=`pwd` ; export r ; \
b6ae0f10 1156 $(SET_LIB_PATH) \
06a07944
RP
1157 (cd ./gcc; \
1158 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
1159 else \
1160 true ; \
1161 fi
5a63b336 1162
424c7ca7 1163# inet-install is used because the I*Net wants DejaGNU installed but
f2b43566 1164# not built. Similarly, gzip is built but not installed.
424c7ca7 1165inet-install:
f2b43566 1166 $(MAKE) INSTALL_MODULES="`echo $(INSTALL_MODULES) | sed -e 's/install-dejagnu//' -e 's/install-gzip//'`" install
424c7ca7 1167
96bfa612 1168# install-no-fixedincludes is used because Cygnus can not distribute
79337c85
ILT
1169# the fixed header files.
1170.PHONY: install-no-fixedincludes
1171install-no-fixedincludes: \
ff290baf 1172 installdirs \
79337c85
ILT
1173 $(INSTALL_MODULES) \
1174 $(INSTALL_TARGET_MODULES) \
96bfa612 1175 $(INSTALL_X11_MODULES) \
f35c6160 1176 gcc-no-fixedincludes
d1bea4c7 1177
5cc24596 1178# Install the gcc headers files, but not the fixed include files,
79337c85
ILT
1179# which Cygnus is not allowed to distribute. This rule is very
1180# dependent on the workings of the gcc Makefile.in.
1181.PHONY: gcc-no-fixedincludes
06a07944 1182gcc-no-fixedincludes:
5cc24596
PB
1183 @if [ -f ./gcc/Makefile ]; then \
1184 rm -rf gcc/tmp-include; \
1185 mv gcc/include gcc/tmp-include 2>/dev/null; \
1186 mkdir gcc/include; \
7f9cb3b2 1187 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
753d5049 1188 touch gcc/stmp-fixinc gcc/include/fixed; \
a54e05f6 1189 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
5cc73086 1190 r=`pwd`; export r; \
81eb5025 1191 s=`cd $(srcdir); pwd` ; export s; \
b6ae0f10 1192 $(SET_LIB_PATH) \
5cc24596
PB
1193 (cd ./gcc; \
1194 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1195 rm -rf gcc/include; \
1196 mv gcc/tmp-include gcc/include 2>/dev/null; \
1197 else true; fi
dcbfc14d 1198
2ec9f3fd
KS
1199# start-sanitize-ide
1200# Install Foundry. Avoid installing a bunch of stuff we don't need.
1201install-foundry:
1202 mods="$(INSTALL_MODULES)"; \
1203 x11_mods="$(INSTALL_X11_MODULES)"; \
1204 for d in install-tcl install-tk install-itcl install-tix install-ilu; do \
1205 mods="`echo $${mods} | sed -e "s/$$d//"`"; \
1206 x11_mods="`echo $${x11_mods} | sed -e "s/$$d//"`"; \
1207 done; \
1208 $(MAKE) INSTALL_MODULES="$${mods}" INSTALL_X11_MODULES="$${x11_mods}" install
1209 for d in tcl tk itcl tix ilu; do \
1210 if [ -f $$d/Makefile ]; then \
1211 r=`pwd`; export r; \
1212 s=`cd $(srcdir); pwd`; export s; \
1213 $(SET_LIB_PATH) \
1214 (cd $$d; $(MAKE) $(FLAGS_TO_PASS) install-minimal); \
1215 else \
1216 true; \
1217 fi; \
1218 done
1219# end-sanitize-ide
1220
79337c85
ILT
1221# This rule is used to build the modules which use FLAGS_TO_PASS. To
1222# build a target all-X means to cd to X and make all.
3de70f1d 1223#
055cca84 1224# all-gui, and all-libproc are handled specially because
4d802af9
MT
1225# they are still experimental, and if they fail to build, that
1226# shouldn't stop "make all".
04103845
DE
1227.PHONY: $(ALL_MODULES) all-gui all-libproc
1228$(ALL_MODULES) all-gui all-libproc:
79337c85 1229 @dir=`echo $@ | sed -e 's/all-//'`; \
472af17f
ILT
1230 if [ -f ./$${dir}/Makefile ] ; then \
1231 r=`pwd`; export r; \
81eb5025 1232 s=`cd $(srcdir); pwd`; export s; \
b6ae0f10 1233 $(SET_LIB_PATH) \
472af17f 1234 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
07362bd9 1235 else \
79337c85 1236 true; \
07362bd9
DZ
1237 fi
1238
80cbf870
ILT
1239# These rules are used to check the modules which use FLAGS_TO_PASS.
1240# To build a target check-X means to cd to X and make check. Some
1241# modules are only tested in a native toolchain.
4f0b8f27 1242
d237841c
BC
1243.PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
1244$(NATIVE_CHECK_MODULES):
39cc6dae
RS
1245 @if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
1246 dir=`echo $@ | sed -e 's/check-//'`; \
472af17f
ILT
1247 if [ -f ./$${dir}/Makefile ] ; then \
1248 r=`pwd`; export r; \
81eb5025 1249 s=`cd $(srcdir); pwd`; export s; \
b6ae0f10 1250 $(SET_LIB_PATH) \
472af17f
ILT
1251 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1252 else \
1253 true; \
4f0b8f27
TL
1254 fi; \
1255 fi
1256
1257$(CROSS_CHECK_MODULES):
6a42d184
DZ
1258 @dir=`echo $@ | sed -e 's/check-//'`; \
1259 if [ -f ./$${dir}/Makefile ] ; then \
5cc73086 1260 r=`pwd`; export r; \
81eb5025 1261 s=`cd $(srcdir); pwd`; export s; \
b6ae0f10 1262 $(SET_LIB_PATH) \
6a42d184
DZ
1263 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1264 else \
1265 true; \
1266 fi
1267
79337c85
ILT
1268# This rule is used to install the modules which use FLAGS_TO_PASS.
1269# To build a target install-X means to cd to X and make install.
1270.PHONY: $(INSTALL_MODULES)
ff290baf 1271$(INSTALL_MODULES): installdirs
79337c85
ILT
1272 @dir=`echo $@ | sed -e 's/install-//'`; \
1273 if [ -f ./$${dir}/Makefile ] ; then \
5cc73086 1274 r=`pwd`; export r; \
81eb5025 1275 s=`cd $(srcdir); pwd`; export s; \
b6ae0f10 1276 $(SET_LIB_PATH) \
f35c6160 1277 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
07362bd9 1278 else \
79337c85 1279 true; \
07362bd9
DZ
1280 fi
1281
ca2ce3b3
ILT
1282# This rule is used to configure the modules which are built with the
1283# target tools.
1284.PHONY: $(CONFIGURE_TARGET_MODULES)
1285$(CONFIGURE_TARGET_MODULES):
ab1cbc67 1286 @dir=`echo $@ | sed -e 's/configure-target-//'`; \
354a86c7 1287 if [ -d $(TARGET_SUBDIR)/$${dir} ]; then \
59d3634c 1288 r=`pwd`; export r; \
f2b43566
ILT
1289 $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/$${dir}/tmpmulti.out 2> /dev/null; \
1290 if [ -s $(TARGET_SUBDIR)/$${dir}/tmpmulti.out ]; then \
1291 if [ -f $(TARGET_SUBDIR)/$${dir}/multilib.out ]; then \
1292 if cmp $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out > /dev/null; then \
1293 rm -f $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
1294 else \
1295 echo "Multilibs changed for $${dir}, reconfiguring"; \
1296 rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/Makefile; \
1297 mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1298 fi; \
354a86c7 1299 else \
0ab3f086
BK
1300 if echo '.;' | cmp - $(TARGET_SUBDIR)/$${dir}/tmpmulti.out >/dev/null 2>&1; then \
1301 true; \
1302 else \
1303 rm -f $(TARGET_SUBDIR)/$${dir}/Makefile; \
1304 fi; \
354a86c7
MM
1305 mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1306 fi; \
062aded9 1307 fi; \
354a86c7
MM
1308 fi; exit 0 # break command into two pieces
1309 @dir=`echo $@ | sed -e 's/configure-target-//'`; \
3e288e27
SG
1310 if [ ! -d $(TARGET_SUBDIR) ]; then \
1311 true; \
1312 elif [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
ca2ce3b3
ILT
1313 true; \
1314 elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
efd7b806 1315 if [ -d $(srcdir)/$${dir} ]; then \
ab1cbc67 1316 [ -d $(TARGET_SUBDIR)/$${dir} ] || mkdir $(TARGET_SUBDIR)/$${dir};\
efd7b806 1317 r=`pwd`; export r; \
81eb5025 1318 s=`cd $(srcdir); pwd`; export s; \
b6ae0f10 1319 $(SET_LIB_PATH) \
efd7b806
SC
1320 AR="$(AR_FOR_TARGET)"; export AR; \
1321 AS="$(AS_FOR_TARGET)"; export AS; \
1322 CC="$(CC_FOR_TARGET)"; export CC; \
1323 CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
1324 CXX="$(CXX_FOR_TARGET)"; export CXX; \
1325 CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
b6ae0f10 1326 DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
054f9ada 1327 LD="$(LD_FOR_TARGET)"; export LD; \
276c2d7d 1328 LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
efd7b806
SC
1329 NM="$(NM_FOR_TARGET)"; export NM; \
1330 RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
d29cd970 1331 WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
19b1d034 1332 echo Configuring in $(TARGET_SUBDIR)/$${dir}; \
ab1cbc67 1333 cd $(TARGET_SUBDIR)/$${dir}; \
283a2b3d
DE
1334 case $(srcdir) in \
1335 /*) \
1336 topdir=$(srcdir) ;; \
1337 *) \
1338 case "$(TARGET_SUBDIR)" in \
1339 .) topdir="../$(srcdir)" ;; \
1340 *) topdir="../../$(srcdir)" ;; \
1341 esac ;; \
1342 esac; \
1343 if [ "$(srcdir)" = "." ] ; then \
1344 if [ "$(TARGET_SUBDIR)" != "." ] ; then \
81eb5025 1345 if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
0f8f1d33
TT
1346 if [ -f Makefile ]; then \
1347 if $(MAKE) distclean; then \
1348 true; \
1349 else \
1350 exit 1; \
1351 fi; \
1352 else \
1353 true; \
1354 fi; \
283a2b3d
DE
1355 else \
1356 exit 1; \
1357 fi; \
1358 else \
1359 true; \
1360 fi; \
1361 srcdiroption="--srcdir=."; \
1362 libsrcdir="."; \
1363 else \
1364 srcdiroption="--srcdir=$${topdir}/$${dir}"; \
81eb5025 1365 libsrcdir="$$s/$${dir}"; \
283a2b3d
DE
1366 fi; \
1367 if [ -f $${libsrcdir}/configure ] ; then \
1368 $(SHELL) $${libsrcdir}/configure \
1369 $(CONFIG_ARGUMENTS) $${srcdiroption} \
1370 --with-target-subdir="$(TARGET_SUBDIR)"; \
19b1d034 1371 else \
81eb5025 1372 $(SHELL) $$s/configure \
283a2b3d
DE
1373 $(CONFIG_ARGUMENTS) $${srcdiroption} \
1374 --with-target-subdir="$(TARGET_SUBDIR)"; \
19b1d034 1375 fi; \
efd7b806
SC
1376 else \
1377 true; \
9908eb6a 1378 fi; \
ca2ce3b3
ILT
1379 else \
1380 true; \
1381 fi
1382
6a42d184
DZ
1383# This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
1384# To build a target all-X means to cd to X and make all.
79337c85
ILT
1385.PHONY: $(ALL_TARGET_MODULES)
1386$(ALL_TARGET_MODULES):
ab1cbc67
PB
1387 @dir=`echo $@ | sed -e 's/all-target-//'`; \
1388 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
5cc73086 1389 r=`pwd`; export r; \
81eb5025 1390 s=`cd $(srcdir); pwd`; export s; \
b6ae0f10 1391 $(SET_LIB_PATH) \
ab1cbc67 1392 (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
07362bd9 1393 else \
79337c85 1394 true; \
07362bd9
DZ
1395 fi
1396
6a42d184
DZ
1397# This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
1398# To build a target install-X means to cd to X and make install.
1399.PHONY: $(CHECK_TARGET_MODULES)
1400$(CHECK_TARGET_MODULES):
136ca05d 1401 @dir=`echo $@ | sed -e 's/check-target-//'`; \
ab1cbc67 1402 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
5cc73086 1403 r=`pwd`; export r; \
81eb5025 1404 s=`cd $(srcdir); pwd`; export s; \
b6ae0f10 1405 $(SET_LIB_PATH) \
ab1cbc67 1406 (cd $(TARGET_SUBDIR)/$${dir};$(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
6a42d184
DZ
1407 else \
1408 true; \
1409 fi
1410
79337c85
ILT
1411# This rule is used to install the modules which use
1412# TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
1413# and make install.
1414.PHONY: $(INSTALL_TARGET_MODULES)
ff290baf 1415$(INSTALL_TARGET_MODULES): installdirs
ab1cbc67
PB
1416 @dir=`echo $@ | sed -e 's/install-target-//'`; \
1417 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
5cc73086 1418 r=`pwd`; export r; \
81eb5025 1419 s=`cd $(srcdir); pwd`; export s; \
b6ae0f10 1420 $(SET_LIB_PATH) \
ab1cbc67
PB
1421 (cd $(TARGET_SUBDIR)/$${dir}; \
1422 $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
07362bd9 1423 else \
79337c85 1424 true; \
07362bd9
DZ
1425 fi
1426
6a42d184 1427# This rule is used to build the modules which use X11_FLAGS_TO_PASS.
79337c85
ILT
1428# To build a target all-X means to cd to X and make all.
1429.PHONY: $(ALL_X11_MODULES)
1430$(ALL_X11_MODULES):
1431 @dir=`echo $@ | sed -e 's/all-//'`; \
1432 if [ -f ./$${dir}/Makefile ] ; then \
5cc73086 1433 r=`pwd`; export r; \
81eb5025 1434 s=`cd $(srcdir); pwd`; export s; \
b6ae0f10 1435 $(SET_LIB_PATH) \
79337c85
ILT
1436 (cd $${dir}; \
1437 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
07362bd9 1438 else \
79337c85 1439 true; \
07362bd9
DZ
1440 fi
1441
6a42d184
DZ
1442# This rule is used to check the modules which use X11_FLAGS_TO_PASS.
1443# To build a target check-X means to cd to X and make all.
1444.PHONY: $(CHECK_X11_MODULES)
1445$(CHECK_X11_MODULES):
1446 @dir=`echo $@ | sed -e 's/check-//'`; \
1447 if [ -f ./$${dir}/Makefile ] ; then \
5cc73086 1448 r=`pwd`; export r; \
81eb5025 1449 s=`cd $(srcdir); pwd`; export s; \
b6ae0f10 1450 $(SET_LIB_PATH) \
6a42d184
DZ
1451 (cd $${dir}; \
1452 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
1453 else \
1454 true; \
1455 fi
1456
1457# This rule is used to install the modules which use X11_FLAGS_TO_PASS.
79337c85
ILT
1458# To build a target install-X means to cd to X and make install.
1459.PHONY: $(INSTALL_X11_MODULES)
48a3d5e5 1460$(INSTALL_X11_MODULES): installdirs
6a42d184 1461 @dir=`echo $@ | sed -e 's/install-//'`; \
79337c85 1462 if [ -f ./$${dir}/Makefile ] ; then \
5cc73086 1463 r=`pwd`; export r; \
81eb5025 1464 s=`cd $(srcdir); pwd`; export s; \
b6ae0f10 1465 $(SET_LIB_PATH) \
79337c85
ILT
1466 (cd $${dir}; \
1467 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
07362bd9 1468 else \
79337c85 1469 true; \
07362bd9
DZ
1470 fi
1471
79337c85
ILT
1472# gcc is the only module which uses GCC_FLAGS_TO_PASS.
1473.PHONY: all-gcc
1474all-gcc:
1475 @if [ -f ./gcc/Makefile ] ; then \
5cc73086 1476 r=`pwd`; export r; \
81eb5025 1477 s=`cd $(srcdir); pwd`; export s; \
b6ae0f10 1478 $(SET_LIB_PATH) \
79337c85 1479 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
07362bd9 1480 else \
79337c85 1481 true; \
07362bd9
DZ
1482 fi
1483
4c0b7ebc
DE
1484.PHONY: all-bootstrap
1485all-bootstrap:
1486 @if [ -f ./gcc/Makefile ] ; then \
1487 r=`pwd`; export r; \
81eb5025 1488 s=`cd $(srcdir); pwd`; export s; \
b6ae0f10 1489 $(SET_LIB_PATH) \
4c0b7ebc
DE
1490 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) bootstrap); \
1491 else \
1492 true; \
1493 fi
1494
65088029
ILT
1495.PHONY: check-gcc
1496check-gcc:
1497 @if [ -f ./gcc/Makefile ] ; then \
5cc73086 1498 r=`pwd`; export r; \
81eb5025 1499 s=`cd $(srcdir); pwd`; export s; \
b6ae0f10 1500 $(SET_LIB_PATH) \
65088029
ILT
1501 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
1502 else \
1503 true; \
1504 fi
1505
79337c85
ILT
1506.PHONY: install-gcc
1507install-gcc:
1508 @if [ -f ./gcc/Makefile ] ; then \
5cc73086 1509 r=`pwd`; export r; \
81eb5025 1510 s=`cd $(srcdir); pwd`; export s; \
b6ae0f10 1511 $(SET_LIB_PATH) \
79337c85 1512 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
07362bd9 1513 else \
79337c85 1514 true; \
07362bd9
DZ
1515 fi
1516
753d5049
SC
1517
1518# EXPERIMENTAL STUFF
1519# This rule is used to install the modules which use FLAGS_TO_PASS.
1520# To build a target install-X means to cd to X and make install.
09985c96 1521.PHONY: install-dosrel
ff290baf 1522install-dosrel: installdirs info
753d5049
SC
1523 @dir=`echo $@ | sed -e 's/install-//'`; \
1524 if [ -f ./$${dir}/Makefile ] ; then \
1525 r=`pwd`; export r; \
81eb5025 1526 s=`cd $(srcdir); pwd`; export s; \
b6ae0f10 1527 $(SET_LIB_PATH) \
753d5049
SC
1528 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1529 else \
1530 true; \
1531 fi
1532
09985c96 1533install-dosrel-fake:
a987271c 1534
753d5049 1535
79337c85 1536# This is a list of inter-dependencies among modules.
53c403df 1537all-apache:
258950c5 1538all-ash:
3a671555 1539all-autoconf: all-m4 all-texinfo
08168809 1540all-automake:
5db223e4 1541all-bash:
6bf191bf
TT
1542all-bfd: all-libiberty all-intl
1543all-binutils: all-libiberty all-opcodes all-bfd all-flex all-bison all-byacc all-intl
97036944 1544all-bison: all-texinfo
06855275 1545# start-sanitize-java
ba7634ad 1546all-target-boehm-gc: configure-target-boehm-gc
06855275 1547# end-sanitize-java
79337c85 1548all-byacc:
0ab3f086
BK
1549# start-sanitize-cygnus
1550all-cgen:
1551# These two have dependencies on cgen, and while this section is alphabetically
1552# sorted, I wish to keep these together until things settle.
1553all-opcodes: all-cgen
1554all-sim: all-cgen
1555# end-sanitize-cygnus
97b951fb 1556all-cvssrc:
664298e6 1557configure-target-cygmon: $(ALL_GCC)
f4434c50 1558all-target-cygmon: configure-target-cygmon all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio all-target-libstub
2e482734 1559all-db:
4d802af9 1560all-dejagnu: all-tcl all-expect all-tk
79337c85
ILT
1561all-diff: all-libiberty
1562all-emacs:
3a671555 1563all-emacs19: all-bison all-byacc
79337c85 1564all-etc:
4c0b7ebc
DE
1565configure-target-examples: $(ALL_GCC)
1566all-target-examples: configure-target-examples
c6ba9ae0 1567all-expect: all-tcl all-tk
275049c0 1568all-fileutils: all-libiberty
97840afa 1569all-findutils:
79337c85 1570all-find:
3a671555 1571all-flex: all-libiberty all-bison all-byacc
bcbcf456
BE
1572# start-sanitize-cygnus
1573all-flexlm:
1574# end-sanitize-cygnus
6bf191bf 1575all-gas: all-libiberty all-opcodes all-bfd all-intl
65e21701 1576all-gash: all-tcl
79337c85 1577all-gawk:
fc3524a9 1578ALL_GCC = all-gcc
3a671555
JM
1579all-gcc: all-bison all-byacc all-binutils all-gas all-ld
1580all-bootstrap: all-libiberty all-bison all-byacc all-binutils all-gas all-ld
43e1bf25
JL
1581GDB_TK = all-tk all-tcl all-itcl all-tix all-libgui
1582# start-sanitize-ide
f46d03c5 1583GDB_TK = all-tk all-tcl all-itcl all-tix all-libgui all-libide all-libidetcl
43e1bf25 1584# end-sanitize-ide
3a671555 1585all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-bison all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK)
f46d03c5 1586all-gettext:
ba26181f 1587all-gnuserv:
10be59aa 1588configure-target-gperf: $(ALL_GCC)
97b951fb 1589all-target-gperf: configure-target-gperf all-target-libiberty all-target-libstdc++
6bf191bf 1590all-gprof: all-libiberty all-bfd all-opcodes all-intl
b6ae0f10 1591all-grez: all-libiberty all-bfd all-opcodes
ab1cbc67 1592all-gui: all-gdb all-libproc all-target-librx
0f8f1d33 1593all-guile:
79337c85
ILT
1594all-gzip: all-libiberty
1595all-hello: all-libiberty
3718029f
ILT
1596# start-sanitize-ide
1597all-ilu:
1598# end-sanitize-ide
79337c85 1599all-indent:
8d1d94b6 1600all-inet: all-tcl all-send-pr all-perl
f46d03c5 1601all-intl:
3585593d 1602all-ispell: all-emacs19
754a6784 1603all-itcl: all-tcl all-tk
c070fb34 1604# start-sanitize-ide
f46d03c5 1605all-jstools: all-tcl all-tk all-tix all-libgui all-libide all-libidetcl
c070fb34 1606# end-sanitize-ide
6bf191bf 1607all-ld: all-libiberty all-bfd all-opcodes all-bison all-byacc all-flex all-intl
283a2b3d 1608configure-target-libg++: $(ALL_GCC) configure-target-librx
ab1cbc67
PB
1609all-target-libg++: configure-target-libg++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio all-target-librx all-target-libstdc++
1610configure-target-libgloss: $(ALL_GCC)
283a2b3d 1611all-target-libgloss: configure-target-libgloss configure-target-newlib
ab1cbc67
PB
1612configure-target-libio: $(ALL_GCC)
1613all-target-libio: configure-target-libio all-gas all-ld all-gcc all-target-libiberty all-target-newlib
2ec9f3fd 1614check-target-libio: all-target-libstdc++
67ae6381 1615all-libgui: all-tcl all-tk all-itcl
79337c85 1616all-libiberty:
87d36c31 1617# start-sanitize-ide
f46d03c5
ILT
1618all-libide: all-ilu
1619all-libidetcl: all-tcl all-tk all-itcl all-ilu all-libgui all-libide
87d36c31 1620# end-sanitize-ide
06855275 1621# start-sanitize-java
0ab3f086
BK
1622configure-target-libjava: $(ALL_GCC) configure-target-boehm-gc
1623all-target-libjava: configure-target-libjava all-gcc all-target-newlib all-target-boehm-gc
06855275 1624# end-sanitize-java
ab1cbc67
PB
1625configure-target-librx: $(ALL_GCC) configure-target-newlib
1626all-target-librx: configure-target-librx
1627configure-target-libstdc++: $(ALL_GCC)
1628all-target-libstdc++: configure-target-libstdc++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio
f4434c50
BM
1629configure-target-libstub: $(ALL_GCC)
1630all-target-libstub: configure-target-libstub
c99e91d2 1631all-libtool:
79337c85
ILT
1632all-m4: all-libiberty
1633all-make: all-libiberty
1634all-mmalloc:
ab1cbc67
PB
1635configure-target-newlib: $(ALL_GCC)
1636all-target-newlib: configure-target-newlib all-binutils all-gas all-gcc
b6ae0f10 1637all-opcodes: all-bfd all-libiberty
be2c65d3 1638all-patch: all-libiberty
0f8f1d33 1639all-perl:
b255ccdb 1640all-prms: all-libiberty
79337c85
ILT
1641all-rcs:
1642all-readline:
1643all-recode: all-libiberty
ac259c28
JM
1644all-sed: all-libiberty
1645all-send-pr: all-prms
79337c85 1646all-shellutils:
97036944 1647all-sim: all-libiberty all-bfd all-opcodes all-readline
b0dae4d7
SP
1648# start-sanitize-cygnus
1649all-snavigator: all-tcl all-tk all-tix all-itcl all-db all-grep all-flexlm all-libgui
1650# end-sanitize-cygnus
07362bd9 1651all-tar: all-libiberty
79337c85
ILT
1652all-tcl:
1653all-tclX: all-tcl all-tk
1654all-tk: all-tcl
1655all-texinfo: all-libiberty
1656all-textutils:
b6ae0f10 1657all-tgas: all-libiberty all-bfd all-opcodes
79337c85 1658all-time:
c446cc8b 1659all-tix: all-tcl all-tk
eebe454c 1660# start-sanitize-ide
f46d03c5 1661all-vmake: all-tcl all-tk all-itcl all-tix all-libgui all-libide all-libidetcl
eebe454c 1662# end-sanitize-ide
79337c85 1663all-wdiff:
fd249336 1664all-target-winsup: all-target-newlib all-target-libiberty all-target-libio configure-target-winsup
ab1cbc67 1665configure-target-winsup: configure-target-newlib
79337c85 1666all-uudecode: all-libiberty
ab1cbc67
PB
1667configure-target-libiberty: $(ALL_GCC)
1668all-target-libiberty: configure-target-libiberty all-gcc all-ld all-target-newlib
0f8f1d33
TT
1669all-target: $(ALL_TARGET_MODULES)
1670install-target: $(INSTALL_TARGET_MODULES)
abc93570 1671# start-sanitize-gdbtk
bfde75f7 1672install-gdb: install-tcl install-tk install-itcl install-tix install-libgui
abc93570 1673#end-sanitize-gdbtk
79337c85 1674### other supporting targets
07362bd9 1675
79337c85
ILT
1676MAKEDIRS= \
1677 $(prefix) \
9deb9485 1678 $(exec_prefix)
ff290baf
ILT
1679.PHONY: installdirs
1680installdirs: mkinstalldirs
fab3dd2d 1681 $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
23e3e7f9 1682
79337c85
ILT
1683dir.info: do-install-info
1684 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
1685 $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
1686 mv -f dir.info.new dir.info ; \
1687 else true ; \
72c09fbc 1688 fi
6b7e5998 1689
b1cceba2
DZ
1690dist:
1691 @echo "Building a full distribution of this tree isn't done"
1692 @echo "via 'make dist'. Check out the etc/ subdirectory"
1693
eb02fd64
RP
1694etags tags: TAGS
1695
753d5049
SC
1696# Right now this just builds TAGS in each subdirectory. emacs19 has the
1697# ability to use several tags files at once, so there is probably no need
1698# to combine them into one big TAGS file (like CVS 1.3 does). We could
1699# (if we felt like it) have this Makefile write a piece of elisp which
1700# the user could load to tell emacs19 where all the TAGS files we just
1701# built are.
1702TAGS: do-TAGS
eb02fd64 1703
eb02fd64
RP
1704# with the gnu make, this is done automatically.
1705
01ec9588 1706Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
a26878d1 1707 $(SHELL) ./config.status
eb02fd64 1708
11954bf1 1709#
01ec9588 1710# Support for building net releases
11954bf1 1711
01ec9588
JK
1712# Files in devo used in any net release.
1713# ChangeLog omitted because it may refer to files which are not in this
1714# distribution (perhaps it would be better to include it anyway).
d94d255d 1715DEVO_SUPPORT= README Makefile.in configure configure.in \
9823504d 1716 config.guess config.sub config move-if-change \
5f69e8bc 1717 mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install \
08499fc2 1718 COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
6e68a23e 1719 mkinstalldirs ltconfig ltmain.sh missing ylwrap
01ec9588
JK
1720
1721# Files in devo/etc used in any net release.
1722# ChangeLog omitted because it may refer to files which are not in this
1723# distribution (perhaps it would be better to include it anyway).
f046ec67
JM
1724ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
1725 make-stds.texi standards.info*
01ec9588 1726
40e16078
KR
1727# When you use `make setup-dirs' or `make taz' you should always redefine
1728# this macro.
1729SUPPORT_FILES = list-of-support-files-for-tool-in-question
40e16078 1730
a54e05f6
KR
1731.PHONY: taz
1732
484fa12d
JW
1733taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
1734 texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
258950c5 1735 # Take out texinfo from a few places.
484fa12d
JW
1736 sed -e '/^all\.normal: /s/\all-texinfo //' \
1737 -e '/^ install-texinfo /d' \
484fa12d
JW
1738 <Makefile.in >tmp
1739 mv -f tmp Makefile.in
65e21701 1740 #
1d5fcc66
PB
1741 $(start-sanitize-Sanitize)
1742 @if [ -f .Sanitize ] ; then echo "RUN Sanitize FIRST!" ; false ; fi ;
1743 $(end-sanitize-Sanitize)
40e16078 1744 ./configure sun4
ab1cbc67
PB
1745 [ -z "$(CONFIGURE_TARGET_MODULES)" ] \
1746 || $(MAKE) $(CONFIGURE_TARGET_MODULES) ALL_GCC="" \
aaefc574 1747 CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
6b9e3a78 1748 # Make links, and run "make diststuff" or "make info" when needed.
a54e05f6 1749 rm -rf proto-toplev ; mkdir proto-toplev
7f9cb3b2 1750 set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
a54e05f6
KR
1751 for d in $$dirs ; do \
1752 if [ -d $$d ]; then \
ab1cbc67
PB
1753 if [ ! -f $$d/Makefile ] ; then true ; \
1754 elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \
1755 (cd $$d ; $(MAKE) diststuff ) || exit 1 ; \
6b9e3a78 1756 elif grep '^info:' $$d/Makefile >/dev/null ; then \
ab1cbc67 1757 (cd $$d ; $(MAKE) info ) || exit 1 ; \
6b9e3a78 1758 fi ; \
7f9cb3b2
KR
1759 if [ -d $$d/proto-$$d.dir ]; then \
1760 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1761 else \
1762 ln -s ../$$d proto-toplev/$$d ; \
1763 fi ; \
a54e05f6 1764 else ln -s ../$$d proto-toplev/$$d ; fi ; \
40e16078 1765 done
3dbe0fa2 1766 cd etc ; $(MAKE) info
5600fbd2 1767 $(MAKE) distclean
a54e05f6 1768 #
40e16078 1769 mkdir proto-toplev/etc
15408b3b
KR
1770 (cd proto-toplev/etc; \
1771 for i in $(ETC_SUPPORT); do \
40e16078 1772 ln -s ../../etc/$$i . ; \
15408b3b 1773 done)
a54e05f6 1774 #
04103845 1775 # Take out texinfo from configurable dirs
40e16078
KR
1776 rm proto-toplev/configure.in
1777 sed -e '/^host_tools=/s/texinfo //' \
40e16078 1778 <configure.in >proto-toplev/configure.in
a54e05f6 1779 #
40e16078 1780 mkdir proto-toplev/texinfo
8d190aa3
KR
1781 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1782 ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
1783 ln -s ../../texinfo/lgpl.texinfo proto-toplev/texinfo/
1784 if test -r texinfo/util/tex3patch ; then \
1785 mkdir proto-toplev/texinfo/util && \
1786 ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
1787 else true; fi
a561909f 1788 chmod og=u `find . -print`
19ebe123
ILT
1789 if grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
1790 ver=`sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'`; \
1791 else \
1792 ver=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
1793 fi; \
1794 $(MAKE) -f Makefile.in do-tar-gz TOOL=$(TOOL) VER=$$ver
b5dbae28
KR
1795
1796do-tar-gz:
1797 echo "==> Making $(TOOL)-$(VER).tar.gz"
1798 -rm -f $(TOOL)-$(VER)
1799 ln -s proto-toplev $(TOOL)-$(VER)
1800 tar cfh $(TOOL)-$(VER).tar $(TOOL)-$(VER)
1801 $(GZIPPROG) -v -9 $(TOOL)-$(VER).tar
40e16078 1802
484fa12d 1803TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
7f9cb3b2 1804DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
40e16078 1805
96bfa612 1806.PHONY: gas.tar.gz
1e93b49b 1807GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms
96bfa612 1808gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
484fa12d
JW
1809 $(MAKE) -f Makefile.in taz TOOL=gas \
1810 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
40e16078 1811
7f9cb3b2 1812# The FSF "binutils" release includes gprof and ld.
96bfa612 1813.PHONY: binutils.tar.gz
1e93b49b 1814BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms
96bfa612 1815binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
484fa12d 1816 $(MAKE) -f Makefile.in taz TOOL=binutils \
2492f942 1817 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS) makeall.bat configure.bat"
7f9cb3b2 1818
96bfa612 1819.PHONY: gas+binutils.tar.gz
b0dae4d7 1820GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
96bfa612 1821gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
484fa12d 1822 $(MAKE) -f Makefile.in taz TOOL=gas \
2492f942 1823 SUPPORT_FILES="$(GASB_SUPPORT_DIRS) makeall.bat configure.bat"
79337c85 1824
5600fbd2 1825.PHONY: libg++.tar.gz
ab1cbc67 1826LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty
5600fbd2 1827libg++.tar.gz: $(DIST_SUPPORT) libg++
484fa12d
JW
1828 $(MAKE) -f Makefile.in taz TOOL=libg++ \
1829 SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
5600fbd2 1830
49dfa984
JM
1831GNATS_SUPPORT_DIRS=include libiberty send-pr
1832gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
a0bd8e18 1833 $(MAKE) -f Makefile.in taz TOOL=gnats \
49dfa984
JM
1834 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
1835
1d5fcc66 1836.PHONY: gdb.tar.gz
1e93b49b 1837GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils intl
ca2ce3b3 1838GDBTK_SUPPORT_DIRS= `if [ -d tcl -a -d tk ] ; then echo tcl tk ; fi`
1d5fcc66
PB
1839gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1840 $(MAKE) -f Makefile.in taz TOOL=gdb \
ca2ce3b3 1841 SUPPORT_FILES="$(GDB_SUPPORT_DIRS) $(GDBTK_SUPPORT_DIRS)"
1d5fcc66 1842
7166a308 1843.PHONY: newlib.tar.gz
a220ba0f 1844NEWLIB_SUPPORT_DIRS=libgloss
04103845 1845# taz configures for the sun4 target which won't configure newlib.
a220ba0f
SC
1846# We need newlib configured so that the .info files are made.
1847# Unfortunately, it is not enough to just configure newlib separately:
1848# taz will build the .info files but since SUBDIRS won't contain newlib,
1849# distclean won't be run (leaving Makefile, config.status, and the tmp files
1850# used in building the .info files, eg: *.def, *.ref).
4c0b7ebc
DE
1851# The problem isn't solvable however without a lot of extra work because
1852# target libraries are built in subdir $(target_alias) which gets nuked during
1853# the make distclean. For now punt on the issue of shipping newlib info files
1854# with newlib net releases and wait for a day when some native target (sun4?)
1855# supports newlib (if only minimally).
7166a308
KR
1856newlib.tar.gz: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
1857 $(MAKE) -f Makefile.in taz TOOL=newlib \
1858 SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
6b9e3a78 1859 DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
7166a308 1860
79337c85 1861.NOEXPORT:
05992891 1862MAKEOVERRIDES=
79337c85
ILT
1863
1864# start-sanitize-chill
1865## This is ugly, but I don't want GNU make to put these variables in
1866## the environment. Older makes will see this as a set of targets
1867## with no dependencies and no actions.
1868unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
1869# end-sanitize-chill
1870
eb02fd64 1871# end of Makefile.in
This page took 0.350062 seconds and 4 git commands to generate.