* Makefile.in (do_maintainer_clean): Remove $(srcdir)/bfd-in2.h,
[deliverable/binutils-gdb.git] / Makefile.in
CommitLineData
eb02fd64 1#
131a3881 2# Makefile for directory with subdirs to build.
79337c85 3# Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation
eb02fd64 4#
4dfe09da
RP
5# This file is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
8c222f6e 17# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
4dfe09da 18#
f149eb99 19
eb02fd64 20srcdir = .
28f3b094 21
4d714963 22prefix = /usr/local
eb02fd64 23
7fcfdcf7
SC
24exec_prefix = $(prefix)
25bindir = $(exec_prefix)/bin
26libdir = $(exec_prefix)/lib
a54e05f6 27tooldir = $(exec_prefix)/$(target)
7fcfdcf7 28
51489233
ILT
29program_transform_name =
30
4d714963 31datadir = $(prefix)/lib
7fcfdcf7 32mandir = $(prefix)/man
4d714963
RP
33man1dir = $(mandir)/man1
34man2dir = $(mandir)/man2
35man3dir = $(mandir)/man3
36man4dir = $(mandir)/man4
37man5dir = $(mandir)/man5
38man6dir = $(mandir)/man6
39man7dir = $(mandir)/man7
40man8dir = $(mandir)/man8
41man9dir = $(mandir)/man9
7fcfdcf7 42infodir = $(prefix)/info
4d714963
RP
43includedir = $(prefix)/include
44docdir = $(datadir)/doc
04103845 45GDB_NLM_DEPS =
4d714963
RP
46
47SHELL = /bin/sh
48
f35c6160 49INSTALL = $${srcroot}/install.sh -c
4d714963 50INSTALL_PROGRAM = $(INSTALL)
5cc73086 51INSTALL_DATA = $(INSTALL) -m 644
fe560b9f 52INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
3c8735af 53
09985c96 54INSTALL_DOSREL = install-dosrel-fake
a987271c 55
440868a0 56AS = as
ec342d7d 57AR = ar
b5329d84 58AR_FLAGS = rc
e85e07cb 59CC = cc
7b636683 60
66957ce4
ILT
61# Special variables passed down in EXTRA_GCC_FLAGS. They are defined
62# here so that they can be overridden by Makefile fragments.
753d5049
SC
63HOST_CC = $(CC_FOR_BUILD)
64HOST_PREFIX =
65HOST_PREFIX_1 = loser-
66
7b636683
JK
67# We don't specify -g -O because many compilers don't support -g -O,
68# and/or -O is broken in and of itself.
f8a6ad66 69CFLAGS = -g
3585593d
BK
70LIBCFLAGS = $(CFLAGS)
71CFLAGS_FOR_TARGET = $(CFLAGS)
72LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
04103845
DE
73PICFLAG =
74PICFLAG_FOR_TARGET =
7b636683 75
a4e879a1 76# start-sanitize-chill
7d9f0c54
MW
77CHILLFLAGS = $(CFLAGS)
78CHILL_LIB = -lchill
a4e879a1 79# end-sanitize-chill
e85e07cb 80CXX = gcc
7b636683 81
1d5fcc66 82# Use -O2 to stress test the compiler.
864a5888
PB
83CXXFLAGS = -g -O2
84LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
3585593d 85CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
2f64ef77 86LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
7b636683 87
4d714963 88RANLIB = ranlib
51489233 89NM = nm
5cc73086
KR
90# Not plain GZIP, since gzip looks there for extra command-line options.
91GZIPPROG = gzip
eb02fd64 92
40e16078 93# BISON: This line sed'ed to BISON = bison -y for FSF releases, don't remove.
5cc73086
KR
94BISON = `if [ -f $$r/byacc/byacc ] ; \
95 then echo $$r/byacc/byacc ; \
378fd382 96 else echo byacc ; \
06a07944 97 fi`
2645fb0c 98
5cc73086
KR
99LEX = `if [ -f $$r/flex/flex ] ; \
100 then echo $$r/flex/flex ; \
2198e4ba
MT
101 else echo flex ; fi`
102
5cc73086
KR
103M4 = `if [ -f $$r/m4/m4 ] ; \
104 then echo $$r/m4/m4 ; \
65e21701
KR
105 else echo m4 ; fi`
106
5cc73086
KR
107MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
108 then echo $$r/texinfo/makeinfo/makeinfo ; \
77806c3e 109 else echo makeinfo ; fi`
484fa12d 110
9823504d
ILT
111# This just becomes part of the MAKEINFO definition passed down to
112# sub-makes. It lets flags be given on the command line while still
113# using the makeinfo from the object tree.
114MAKEINFOFLAGS =
b772d75e 115
5cc73086
KR
116EXPECT = `if [ -f $$r/expect/expect ] ; \
117 then echo $$r/expect/expect ; \
a54e05f6
KR
118 else echo expect ; fi`
119
120RUNTEST = `if [ -f $${srcroot}/dejagnu/runtest ] ; \
121 then echo $${srcroot}/dejagnu/runtest ; \
6a42d184
DZ
122 else echo runtest ; fi`
123
f980fcfb 124
e85e07cb 125# compilers to use to create programs which must be run in the build
440868a0
ILT
126# environment.
127CC_FOR_BUILD = $(CC)
e85e07cb 128CXX_FOR_BUILD = $(CXX)
440868a0 129
9f73dd6a 130SUBDIRS = "this is set via configure, don't edit this"
6a3958b2
RP
131OTHERS =
132
ca2ce3b3
ILT
133# This is set by the configure script to the list of directories which
134# should be built using the target tools.
ab1cbc67 135TARGET_CONFIGDIRS = libiberty libgloss newlib libio librx libstdc++ libg++ winsup
ca2ce3b3 136
e66eb658
PB
137# Target libraries are put under this directory:
138TARGET_SUBDIR = . # Changed by configure to $(target_alias) if cross.
139
ca2ce3b3
ILT
140# This is set by the configure script to the arguments passed to configure.
141CONFIG_ARGUMENTS =
142
a0f47eb7 143ALL = all.normal
f35c6160
DZ
144INSTALL_TARGET = install-dirs \
145 $(INSTALL_MODULES) \
146 $(INSTALL_TARGET_MODULES) \
147 $(INSTALL_X11_MODULES) \
753d5049 148 install-gcc \
09985c96 149 $(INSTALL_DOSREL)
753d5049 150
fb660409 151
51489233 152CC_FOR_TARGET = ` \
5cc73086 153 if [ -f $$r/gcc/Makefile ] ; then \
e66eb658
PB
154 if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
155 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
753d5049
SC
156 else \
157 echo $$r/gcc/xgcc -B$$r/gcc/; \
158 fi; \
51489233 159 else \
378fd382 160 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
51489233
ILT
161 echo $(CC); \
162 else \
ea6d5817 163 t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
51489233
ILT
164 fi; \
165 fi`
166
a4e879a1 167# start-sanitize-chill
7d9f0c54 168CHILL_FOR_TARGET = ` \
5cc73086 169 if [ -f $$r/gcc/Makefile ] ; then \
04103845 170 echo $$r/gcc/xgcc -B$$r/gcc/ -L$$r/gcc/ch/runtime/; \
7d9f0c54
MW
171 else \
172 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
173 echo $(CC); \
174 else \
ea6d5817 175 t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
7d9f0c54
MW
176 fi; \
177 fi`
34b3298b 178
a4e879a1 179# end-sanitize-chill
7d9f0c54 180
d1bea4c7 181CXX_FOR_TARGET = ` \
5cc73086 182 if [ -f $$r/gcc/Makefile ] ; then \
e66eb658
PB
183 if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
184 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
753d5049
SC
185 else \
186 echo $$r/gcc/xgcc -B$$r/gcc/; \
187 fi; \
fca4f908 188 else \
e85e07cb
ILT
189 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
190 echo $(CXX); \
fca4f908 191 else \
ea6d5817 192 t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
fca4f908
MW
193 fi; \
194 fi`
195
440868a0 196AS_FOR_TARGET = ` \
ea6d5817 197 if [ -f $$r/gas/as.new ] ; then \
5cc73086 198 echo $$r/gas/as.new ; \
440868a0 199 else \
e85e07cb 200 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
440868a0
ILT
201 echo $(AS); \
202 else \
ea6d5817 203 t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \
81246025 204 fi; \
440868a0
ILT
205 fi`
206
054f9ada
JM
207LD_FOR_TARGET = ` \
208 if [ -f $$r/ld/ld.new ] ; then \
209 echo $$r/ld/ld.new ; \
210 else \
211 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
212 echo $(LD); \
213 else \
214 t='$(program_transform_name)'; echo ld | sed -e 's/x/x/' $$t ; \
215 fi; \
216 fi`
217
a220ba0f
SC
218DLLTOOL_FOR_TARGET = ` \
219 if [ -f $$r/binutils/dlltool ] ; then \
220 echo $$r/binutils/dlltool ; \
221 else \
222 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
223 echo $(DLLTOOL); \
224 else \
225 t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \
226 fi; \
227 fi`
228
51489233 229AR_FOR_TARGET = ` \
5cc73086
KR
230 if [ -f $$r/binutils/ar ] ; then \
231 echo $$r/binutils/ar ; \
51489233 232 else \
378fd382 233 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
51489233
ILT
234 echo $(AR); \
235 else \
ea6d5817 236 t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \
81246025 237 fi; \
51489233
ILT
238 fi`
239
240RANLIB_FOR_TARGET = ` \
5cc73086
KR
241 if [ -f $$r/binutils/ranlib ] ; then \
242 echo $$r/binutils/ranlib ; \
51489233 243 else \
378fd382 244 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
51489233
ILT
245 echo $(RANLIB); \
246 else \
ea6d5817 247 t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \
81246025 248 fi; \
51489233
ILT
249 fi`
250
251NM_FOR_TARGET = ` \
ea6d5817 252 if [ -f $$r/binutils/nm.new ] ; then \
753d5049 253 echo $$r/binutils/nm.new ; \
51489233 254 else \
378fd382 255 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
51489233
ILT
256 echo $(NM); \
257 else \
ea6d5817 258 t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \
81246025 259 fi; \
51489233
ILT
260 fi`
261
eb02fd64 262#### host and target specific makefile fragments come in here.
ec342d7d 263###
eb02fd64 264
0ef4728f
ILT
265# Flags to pass down to all sub-makes.
266# Please keep these in alphabetical order.
267BASE_FLAGS_TO_PASS = \
2198e4ba 268 "AR_FLAGS=$(AR_FLAGS)" \
d09de70e 269 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
0ef4728f 270 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
378fd382 271 "BISON=$(BISON)" \
378fd382 272 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
0ef4728f 273 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
2198e4ba 274 "CFLAGS=$(CFLAGS)" \
3585593d 275 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
a4e879a1 276 $(start-sanitize-chill)\
7d9f0c54
MW
277 "CHILLFLAGS=$(CHILLFLAGS)" \
278 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
279 "CHILL_LIB=$(CHILL_LIB)" \
a4e879a1 280 $(end-sanitize-chill)\
0ef4728f
ILT
281 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
282 "CXXFLAGS=$(CXXFLAGS)" \
3585593d 283 "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
0ef4728f 284 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
a220ba0f 285 "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
a9a2f22f 286 "GCC_FOR_TARGET=$(CC_FOR_TARGET)" \
2198e4ba
MT
287 "INSTALL=$(INSTALL)" \
288 "INSTALL_DATA=$(INSTALL_DATA)" \
440868a0 289 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
f35c6160 290 "INSTALL_XFORM=$(INSTALL_XFORM)" \
378fd382
DZ
291 "LDFLAGS=$(LDFLAGS)" \
292 "LEX=$(LEX)" \
054f9ada 293 "LD_FOR_TARGET=$(LD_FOR_TARGET)" \
3585593d
BK
294 "LIBCFLAGS=$(LIBCFLAGS)" \
295 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
04103845
DE
296 "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
297 "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
65e21701 298 "M4=$(M4)" \
9823504d 299 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
0ef4728f 300 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
04103845
DE
301 "PICFLAG=$(PICFLAG)" \
302 "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
d09de70e 303 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
49dfa984 304 "SHELL=$(SHELL)" \
a54e05f6 305 "EXPECT=$(EXPECT)" \
6a42d184 306 "RUNTEST=$(RUNTEST)" \
86365152 307 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
5cc73086 308 "YACC=$(BISON)" \
378fd382
DZ
309 "exec_prefix=$(exec_prefix)" \
310 "prefix=$(prefix)" \
311 "tooldir=$(tooldir)"
2198e4ba 312
0ef4728f
ILT
313# Flags to pass down to most sub-makes, in which we're building with
314# the host environment.
6d681784 315# If any variables are added here, they must be added to do-*, below.
0ef4728f 316EXTRA_HOST_FLAGS = \
6d681784
JG
317 'AR=$(AR)' \
318 'AS=$(AS)' \
319 'CC=$(CC)' \
320 'CXX=$(CXX)' \
321 'NM=$(NM)' \
753d5049 322 'RANLIB=$(RANLIB)'
0ef4728f
ILT
323
324FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
325
d1bea4c7
DZ
326# Flags that are concerned with the location of the X11 include files
327# and library files
054f9ada
JM
328#
329# NOTE: until the top-level is getting the values via autoconf, it only
330# causes problems to have this top-level Makefile overriding the autoconf-set
331# values in child directories. Only variables that don't conflict with
332# autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now.
333#
d1bea4c7 334X11_FLAGS_TO_PASS = \
054f9ada
JM
335 'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
336 'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
d1bea4c7 337
0ef4728f
ILT
338# Flags to pass down to makes which are built with the target environment.
339# The double $ decreases the length of the command line; the variables
340# are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
6d681784 341# If any variables are added here, they must be added to do-*, below.
0ef4728f
ILT
342EXTRA_TARGET_FLAGS = \
343 'AR=$$(AR_FOR_TARGET)' \
344 'AS=$$(AS_FOR_TARGET)' \
345 'CC=$$(CC_FOR_TARGET)' \
3585593d 346 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
0ef4728f 347 'CXX=$$(CXX_FOR_TARGET)' \
3585593d 348 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
a220ba0f 349 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
054f9ada 350 'LD=$$(LD_FOR_TARGET)' \
3585593d
BK
351 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
352 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
0ef4728f 353 'NM=$$(NM_FOR_TARGET)' \
04103845 354 'PICFLAG=$$(PICFLAG_FOR_TARGET)' \
753d5049 355 'RANLIB=$$(RANLIB_FOR_TARGET)'
0ef4728f
ILT
356
357TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
51489233 358
f4e414f1
ILT
359# Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
360# unfortunately needs the native compiler and the target ar and
0ef4728f 361# ranlib.
66957ce4
ILT
362# If any variables are added here, they must be added to do-*, below.
363# The HOST_* variables are a special case, which are used for the gcc
364# cross-building scheme.
0ef4728f
ILT
365EXTRA_GCC_FLAGS = \
366 'AR=$$(AR_FOR_TARGET)' \
6d681784
JG
367 'AS=$(AS)' \
368 'CC=$(CC)' \
369 'CXX=$(CXX)' \
a54e05f6
KR
370 'HOST_CC=$(CC_FOR_BUILD)' \
371 'HOST_PREFIX=$(HOST_PREFIX)' \
372 'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
6d681784 373 'NM=$(NM)' \
4c0b7ebc
DE
374 'RANLIB=$$(RANLIB_FOR_TARGET)' \
375 `if test x"$(LANGUAGES)" != x; then echo "LANGUAGES=$(LANGUAGES)"; fi` \
376 `if test x"$(STMP_FIXPROTO)" != x; then echo "STMP_FIXPROTO=$(STMP_FIXPROTO)"; fi` \
377 `if test x"$(LIMITS_H_TEST)" != x; then echo "LIMITS_H_TEST=$(LIMITS_H_TEST)"; fi` \
378 `if test x"$(LIBGCC1_TEST)" != x; then echo "LIBGCC1_TEST=$(LIBGCC1_TEST)"; fi` \
379 `if test x"$(LIBGCC2_CFLAGS)" != x; then echo "LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)"; fi` \
380 `if test x"$(LIBGCC2_INCLUDES)" != x; then echo "LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)"; fi` \
381 `if test x"$(ENQUIRE)" != x; then echo "ENQUIRE=$(ENQUIRE)"; fi` \
382 `if test x"$(BOOT_CFLAGS)" != x; then echo "BOOT_CFLAGS=$(BOOT_CFLAGS)"; fi`
0ef4728f 383
34b3298b 384GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
f4e414f1 385
6a42d184 386# This is a list of the targets for all of the modules which are compiled
79337c85
ILT
387# using $(FLAGS_TO_PASS).
388ALL_MODULES = \
389 all-autoconf \
390 all-bfd \
391 all-binutils \
392 all-byacc \
393 all-cvs \
394 all-dejagnu \
395 all-diff \
ac259c28 396 all-dosutils \
79337c85
ILT
397 all-etc \
398 all-fileutils \
399 all-find \
400 all-flex \
401 all-gas \
402 all-gawk \
79337c85
ILT
403 all-gprof \
404 all-grep \
19b1d034 405 all-grez \
79337c85
ILT
406 all-gzip \
407 all-hello \
408 all-indent \
409 all-ispell \
410 all-ld \
411 all-libiberty \
412 all-m4 \
413 all-make \
414 all-mmalloc \
415 all-opcodes \
416 all-patch \
417 all-prms \
418 all-rcs \
419 all-readline \
275049c0 420 all-release \
79337c85
ILT
421 all-recode \
422 all-sed \
423 all-send-pr \
424 all-shellutils \
425 all-sim \
426 all-tar \
427 all-tcl \
428 all-texinfo \
429 all-textutils \
430 all-tgas \
431 all-time \
432 all-uudecode \
753d5049
SC
433 all-wdiff
434
6a42d184
DZ
435# This is a list of the check targets for all of the modules which are
436# compiled using $(FLAGS_TO_PASS).
4f0b8f27
TL
437# This is a list of the check targets for all of the modules which are
438# compiled using $(FLAGS_TO_PASS).
439#
d237841c
BC
440# The list is in two parts. The first lists those tools which
441# are tested as part of the host's native tool-chain, and not
442# tested in a cross configuration.
443NATIVE_CHECK_MODULES = \
444 check-byacc \
4f0b8f27
TL
445 check-flex
446
d237841c 447CROSS_CHECK_MODULES = \
6a42d184
DZ
448 check-autoconf \
449 check-bfd \
450 check-binutils \
6a42d184
DZ
451 check-cvs \
452 check-dejagnu \
453 check-diff \
454 check-etc \
455 check-fileutils \
456 check-find \
6a42d184
DZ
457 check-gas \
458 check-gawk \
6a42d184
DZ
459 check-gprof \
460 check-grep \
461 check-gzip \
462 check-hello \
463 check-indent \
464 check-ispell \
465 check-ld \
466 check-libiberty \
467 check-m4 \
468 check-make \
469 check-mmcheckoc \
470 check-opcodes \
471 check-patch \
472 check-prms \
473 check-rcs \
474 check-readline \
475 check-recode \
476 check-sed \
477 check-send-pr \
478 check-shellutils \
479 check-sim \
480 check-tar \
481 check-tcl \
482 check-texinfo \
483 check-textutils \
484 check-tgas \
485 check-time \
486 check-uudecode \
487 check-wdiff
d237841c
BC
488
489CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
6a42d184
DZ
490
491# This is a list of the install targets for all of the modules which are
79337c85
ILT
492# compiled using $(FLAGS_TO_PASS).
493INSTALL_MODULES = \
494 install-autoconf \
495 install-bfd \
496 install-binutils \
497 install-byacc \
498 install-cvs \
499 install-dejagnu \
500 install-diff \
753d5049 501 install-dosutils \
79337c85
ILT
502 install-etc \
503 install-fileutils \
504 install-find \
505 install-flex \
506 install-gas \
507 install-gawk \
79337c85
ILT
508 install-gprof \
509 install-grep \
19b1d034 510 install-grez \
79337c85
ILT
511 install-gzip \
512 install-hello \
513 install-indent \
514 install-ispell \
515 install-ld \
516 install-libiberty \
517 install-m4 \
518 install-make \
519 install-mmalloc \
520 install-opcodes \
521 install-patch \
522 install-prms \
523 install-rcs \
524 install-readline \
525 install-recode \
526 install-sed \
527 install-send-pr \
528 install-shellutils \
529 install-sim \
530 install-tar \
531 install-tcl \
532 install-texinfo \
533 install-textutils \
534 install-tgas \
535 install-time \
536 install-uudecode \
537 install-wdiff
538
6a42d184 539# This is a list of the targets for all of the modules which are compiled
79337c85
ILT
540# using $(X11_FLAGS_TO_PASS).
541ALL_X11_MODULES = \
542 all-emacs \
4d802af9 543 all-emacs19 \
04103845 544 all-gdb \
79337c85 545 all-expect \
65e21701 546 all-gash \
79337c85
ILT
547 all-tclX \
548 all-tk
549
6a42d184
DZ
550# This is a list of the check targets for all of the modules which are
551# compiled using $(X11_FLAGS_TO_PASS).
552CHECK_X11_MODULES = \
553 check-emacs \
04103845 554 check-gdb \
6a42d184 555 check-expect \
65e21701 556 check-gash \
6a42d184
DZ
557 check-tclX \
558 check-tk
559
79337c85
ILT
560# This is a list of the install targets for all the modules which are
561# compiled using $(X11_FLAGS_TO_PASS).
562INSTALL_X11_MODULES = \
563 install-emacs \
4d802af9 564 install-emacs19 \
04103845 565 install-gdb \
79337c85 566 install-expect \
65e21701 567 install-gash \
79337c85
ILT
568 install-tclX \
569 install-tk
fca4f908 570
6a42d184 571# This is a list of the targets for all of the modules which are compiled
79337c85
ILT
572# using $(TARGET_FLAGS_TO_PASS).
573ALL_TARGET_MODULES = \
ab1cbc67
PB
574 all-target-libio \
575 all-target-libstdc++ \
576 all-target-librx \
577 all-target-libg++ \
578 all-target-newlib \
579 all-target-winsup \
580 all-target-libgloss \
4c0b7ebc
DE
581 all-target-libiberty \
582 all-target-examples
79337c85 583
ca2ce3b3
ILT
584# This is a list of the configure targets for all of the modules which
585# are compiled using the target tools.
586CONFIGURE_TARGET_MODULES = \
ab1cbc67
PB
587 configure-target-libio \
588 configure-target-libstdc++ \
589 configure-target-librx \
590 configure-target-libg++ \
591 configure-target-newlib \
592 configure-target-winsup \
593 configure-target-libgloss \
4c0b7ebc
DE
594 configure-target-libiberty \
595 configure-target-examples
ca2ce3b3 596
6a42d184
DZ
597# This is a list of the check targets for all of the modules which are
598# compiled using $(TARGET_FLAGS_TO_PASS).
599CHECK_TARGET_MODULES = \
ab1cbc67
PB
600 check-target-libio \
601 check-target-libstdc++ \
602 check-target-libg++ \
603 check-target-newlib \
604 check-target-winsup \
605 check-target-libiberty
6a42d184
DZ
606
607# This is a list of the install targets for all of the modules which are
79337c85
ILT
608# compiled using $(TARGET_FLAGS_TO_PASS).
609INSTALL_TARGET_MODULES = \
ab1cbc67
PB
610 install-target-libio \
611 install-target-libstdc++ \
612 install-target-libg++ \
613 install-target-newlib \
614 install-target-winsup \
615 install-target-libgloss \
616 install-target-libiberty
7481617f 617
79337c85 618# The first rule in the file had better be this one. Don't put any above it.
a59b94d2 619all: all.normal
79337c85
ILT
620.PHONY: all
621
622# The target built for a native build.
623.PHONY: all.normal
624all.normal: \
625 $(ALL_MODULES) \
626 $(ALL_TARGET_MODULES) \
46d0ca81 627 $(ALL_X11_MODULES) \
79337c85
ILT
628 all-gcc
629
0ef4728f 630# Do a target for all the subdirectories. A ``make do-X'' will do a
53222cbd
RP
631# ``make X'' in all subdirectories (because, in general, there is a
632# dependency (below) of X upon do-X, a ``make X'' will also do this,
633# but it may do additional work as well).
0ef4728f
ILT
634# This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
635# because it is so large that it can easily overflow the command line
636# length limit on some systems.
79337c85 637DO_X = \
79337c85
ILT
638 do-clean \
639 do-distclean \
640 do-dvi \
641 do-info \
642 do-install-info \
643 do-installcheck \
644 do-mostlyclean \
ca2ce3b3 645 do-maintainer-clean \
753d5049 646 do-TAGS
79337c85
ILT
647.PHONY: $(DO_X)
648$(DO_X):
0ef4728f 649 @target=`echo $@ | sed -e 's/^do-//'`; \
5cc73086 650 r=`pwd`; export r; \
0ef4728f 651 srcroot=`cd $(srcdir); pwd`; export srcroot; \
ab1cbc67 652 for i in $(SUBDIRS) -dummy-; do \
36286a3e 653 if [ -f ./$$i/Makefile ]; then \
0ef4728f 654 case $$i in \
0ef4728f 655 gcc) \
6d681784
JG
656 for flag in $(EXTRA_GCC_FLAGS); do \
657 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
658 done; \
0ef4728f
ILT
659 ;; \
660 *) \
6d681784
JG
661 for flag in $(EXTRA_HOST_FLAGS); do \
662 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
663 done; \
0ef4728f
ILT
664 ;; \
665 esac ; \
753d5049 666 export AR AS CC CXX NM RANLIB; \
0ef4728f 667 if (cd ./$$i; \
6d681784
JG
668 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
669 "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
753d5049 670 "RANLIB=$${RANLIB}" \
6d681784 671 $${target}); \
0ef4728f
ILT
672 then true; else exit 1; fi; \
673 else true; fi; \
ec7a8792
ILT
674 done
675 @target=`echo $@ | sed -e 's/^do-//'`; \
676 r=`pwd`; export r; \
677 srcroot=`cd $(srcdir); pwd`; export srcroot; \
ab1cbc67
PB
678 for i in $(TARGET_CONFIGDIRS) -dummy-; do \
679 if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \
680 for flag in $(EXTRA_TARGET_FLAGS); do \
681 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
682 done; \
683 export AR AS CC CXX NM RANLIB; \
684 if (cd $(TARGET_SUBDIR)/$$i; \
685 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
686 "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
687 "RANLIB=$${RANLIB}" \
688 $${target}); \
689 then true; else exit 1; fi; \
690 else true; fi; \
0ef4728f 691 done
fb90daeb 692
79337c85
ILT
693# Here are the targets which correspond to the do-X targets.
694
65088029 695.PHONY: info installcheck dvi install-info
ca2ce3b3
ILT
696.PHONY: clean distclean mostlyclean maintainer-clean realclean
697.PHONY: local-clean local-distclean local-maintainer-clean
0ef4728f 698info: do-info
1a14993c 699installcheck: do-installcheck
0ef4728f 700dvi: do-dvi
9a9e8e7f 701
f35c6160
DZ
702install-info: do-install-info dir.info
703 srcroot=`cd $(srcdir); pwd`; export srcroot; \
72c09fbc
SC
704 if [ -f dir.info ] ; then \
705 $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
50fbe976 706 else true ; fi
4d714963 707
0ef4728f 708local-clean:
7fed4078 709 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
3b30df82 710
0ef4728f 711local-distclean:
7fed4078 712 -rm -f Makefile config.status
8c5bc3e3
ILT
713 -if [ "$(TARGET_SUBDIR)" != "." ]; then \
714 rm -rf $(TARGET_SUBDIR); \
715 else true; fi
7fcfdcf7 716
ca2ce3b3
ILT
717local-maintainer-clean:
718 @echo "This command is intended for maintainers to use;"
719 @echo "it deletes files that may require special tools to rebuild."
720
0ef4728f
ILT
721clean: do-clean local-clean
722mostlyclean: do-mostlyclean local-clean
723distclean: do-distclean local-clean local-distclean
ca2ce3b3
ILT
724maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
725maintainer-clean: local-distclean
726realclean: maintainer-clean
0ef4728f 727
65088029
ILT
728# Check target.
729
730.PHONY: check
731check: $(CHECK_MODULES) \
732 $(CHECK_TARGET_MODULES) \
733 $(CHECK_X11_MODULES) \
734 check-gcc
735
79337c85 736# Installation targets.
4d714963 737
04103845 738.PHONY: install uninstall source-vault binary-vault vault-install
98a33b6d 739install: $(INSTALL_TARGET)
b26ff9d8 740
79337c85
ILT
741uninstall:
742 @echo "the uninstall target is not supported in this tree"
743
04103845
DE
744source-vault:
745 $(MAKE) -f ./release/Build-A-Release \
746 host=$(host_alias) source-vault
747
748binary-vault:
749 $(MAKE) -f ./release/Build-A-Release \
750 host=$(host_alias) target=$(target_alias)
751
275049c0
JK
752vault-install:
753 @if [ -f ./release/vault-install ] ; then \
754 ./release/vault-install $(host_alias) $(target_alias) ; \
96bfa612
KR
755 else \
756 true ; \
275049c0
JK
757 fi
758
79337c85 759.PHONY: install.all
06a07944
RP
760install.all: install-no-fixedincludes
761 @if [ -f ./gcc/Makefile ] ; then \
5cc73086 762 r=`pwd` ; export r ; \
06a07944
RP
763 (cd ./gcc; \
764 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
765 else \
766 true ; \
767 fi
5a63b336 768
96bfa612 769# install-no-fixedincludes is used because Cygnus can not distribute
79337c85
ILT
770# the fixed header files.
771.PHONY: install-no-fixedincludes
772install-no-fixedincludes: \
773 install-dirs \
79337c85
ILT
774 $(INSTALL_MODULES) \
775 $(INSTALL_TARGET_MODULES) \
96bfa612 776 $(INSTALL_X11_MODULES) \
f35c6160 777 gcc-no-fixedincludes
d1bea4c7 778
5cc24596 779# Install the gcc headers files, but not the fixed include files,
79337c85
ILT
780# which Cygnus is not allowed to distribute. This rule is very
781# dependent on the workings of the gcc Makefile.in.
782.PHONY: gcc-no-fixedincludes
06a07944 783gcc-no-fixedincludes:
5cc24596
PB
784 @if [ -f ./gcc/Makefile ]; then \
785 rm -rf gcc/tmp-include; \
786 mv gcc/include gcc/tmp-include 2>/dev/null; \
787 mkdir gcc/include; \
7f9cb3b2 788 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
753d5049 789 touch gcc/stmp-fixinc gcc/include/fixed; \
a54e05f6 790 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
5cc73086 791 r=`pwd`; export r; \
5cc24596
PB
792 srcroot=`cd $(srcdir); pwd` ; export srcroot; \
793 (cd ./gcc; \
794 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
795 rm -rf gcc/include; \
796 mv gcc/tmp-include gcc/include 2>/dev/null; \
797 else true; fi
dcbfc14d 798
79337c85
ILT
799# This rule is used to build the modules which use FLAGS_TO_PASS. To
800# build a target all-X means to cd to X and make all.
3de70f1d 801#
055cca84 802# all-gui, and all-libproc are handled specially because
4d802af9
MT
803# they are still experimental, and if they fail to build, that
804# shouldn't stop "make all".
04103845
DE
805.PHONY: $(ALL_MODULES) all-gui all-libproc
806$(ALL_MODULES) all-gui all-libproc:
79337c85 807 @dir=`echo $@ | sed -e 's/all-//'`; \
472af17f
ILT
808 if [ -f ./$${dir}/Makefile ] ; then \
809 r=`pwd`; export r; \
810 srcroot=`cd $(srcdir); pwd`; export srcroot; \
811 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
07362bd9 812 else \
79337c85 813 true; \
07362bd9
DZ
814 fi
815
80cbf870
ILT
816# These rules are used to check the modules which use FLAGS_TO_PASS.
817# To build a target check-X means to cd to X and make check. Some
818# modules are only tested in a native toolchain.
4f0b8f27 819
d237841c
BC
820.PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
821$(NATIVE_CHECK_MODULES):
39cc6dae
RS
822 @if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
823 dir=`echo $@ | sed -e 's/check-//'`; \
472af17f
ILT
824 if [ -f ./$${dir}/Makefile ] ; then \
825 r=`pwd`; export r; \
826 srcroot=`cd $(srcdir); pwd`; export srcroot; \
827 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
828 else \
829 true; \
4f0b8f27
TL
830 fi; \
831 fi
832
833$(CROSS_CHECK_MODULES):
6a42d184
DZ
834 @dir=`echo $@ | sed -e 's/check-//'`; \
835 if [ -f ./$${dir}/Makefile ] ; then \
5cc73086 836 r=`pwd`; export r; \
6a42d184
DZ
837 srcroot=`cd $(srcdir); pwd`; export srcroot; \
838 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
839 else \
840 true; \
841 fi
842
79337c85
ILT
843# This rule is used to install the modules which use FLAGS_TO_PASS.
844# To build a target install-X means to cd to X and make install.
845.PHONY: $(INSTALL_MODULES)
846$(INSTALL_MODULES): install-dirs
847 @dir=`echo $@ | sed -e 's/install-//'`; \
848 if [ -f ./$${dir}/Makefile ] ; then \
5cc73086 849 r=`pwd`; export r; \
79337c85 850 srcroot=`cd $(srcdir); pwd`; export srcroot; \
f35c6160 851 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
07362bd9 852 else \
79337c85 853 true; \
07362bd9
DZ
854 fi
855
ca2ce3b3
ILT
856# This rule is used to configure the modules which are built with the
857# target tools.
858.PHONY: $(CONFIGURE_TARGET_MODULES)
859$(CONFIGURE_TARGET_MODULES):
ab1cbc67
PB
860 @dir=`echo $@ | sed -e 's/configure-target-//'`; \
861 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
ca2ce3b3
ILT
862 true; \
863 elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
efd7b806 864 if [ -d $(srcdir)/$${dir} ]; then \
ab1cbc67 865 [ -d $(TARGET_SUBDIR)/$${dir} ] || mkdir $(TARGET_SUBDIR)/$${dir};\
efd7b806
SC
866 r=`pwd`; export r; \
867 srcroot=`cd $(srcdir); pwd`; export srcroot; \
868 AR="$(AR_FOR_TARGET)"; export AR; \
869 AS="$(AS_FOR_TARGET)"; export AS; \
870 CC="$(CC_FOR_TARGET)"; export CC; \
871 CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
872 CXX="$(CXX_FOR_TARGET)"; export CXX; \
873 CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
054f9ada 874 LD="$(LD_FOR_TARGET)"; export LD; \
efd7b806
SC
875 NM="$(NM_FOR_TARGET)"; export NM; \
876 RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
19b1d034 877 echo Configuring in $(TARGET_SUBDIR)/$${dir}; \
ab1cbc67 878 cd $(TARGET_SUBDIR)/$${dir}; \
283a2b3d
DE
879 case $(srcdir) in \
880 /*) \
881 topdir=$(srcdir) ;; \
882 *) \
883 case "$(TARGET_SUBDIR)" in \
884 .) topdir="../$(srcdir)" ;; \
885 *) topdir="../../$(srcdir)" ;; \
886 esac ;; \
887 esac; \
888 if [ "$(srcdir)" = "." ] ; then \
889 if [ "$(TARGET_SUBDIR)" != "." ] ; then \
890 if $(SHELL) $${srcroot}/symlink-tree $${topdir}/$${dir} "Makefile" ; then \
891 true; \
892 else \
893 exit 1; \
894 fi; \
895 else \
896 true; \
897 fi; \
898 srcdiroption="--srcdir=."; \
899 libsrcdir="."; \
900 else \
901 srcdiroption="--srcdir=$${topdir}/$${dir}"; \
902 libsrcdir="$${srcroot}/$${dir}"; \
903 fi; \
904 if [ -f $${libsrcdir}/configure ] ; then \
905 $(SHELL) $${libsrcdir}/configure \
906 $(CONFIG_ARGUMENTS) $${srcdiroption} \
907 --with-target-subdir="$(TARGET_SUBDIR)"; \
19b1d034 908 else \
283a2b3d
DE
909 $(SHELL) $${srcroot}/configure \
910 $(CONFIG_ARGUMENTS) $${srcdiroption} \
911 --with-target-subdir="$(TARGET_SUBDIR)"; \
19b1d034 912 fi; \
efd7b806
SC
913 else \
914 true; \
9908eb6a 915 fi; \
ca2ce3b3
ILT
916 else \
917 true; \
918 fi
919
6a42d184
DZ
920# This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
921# To build a target all-X means to cd to X and make all.
79337c85
ILT
922.PHONY: $(ALL_TARGET_MODULES)
923$(ALL_TARGET_MODULES):
ab1cbc67
PB
924 @dir=`echo $@ | sed -e 's/all-target-//'`; \
925 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
5cc73086 926 r=`pwd`; export r; \
79337c85 927 srcroot=`cd $(srcdir); pwd`; export srcroot; \
ab1cbc67 928 (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
07362bd9 929 else \
79337c85 930 true; \
07362bd9
DZ
931 fi
932
6a42d184
DZ
933# This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
934# To build a target install-X means to cd to X and make install.
935.PHONY: $(CHECK_TARGET_MODULES)
936$(CHECK_TARGET_MODULES):
136ca05d 937 @dir=`echo $@ | sed -e 's/check-target-//'`; \
ab1cbc67 938 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
5cc73086 939 r=`pwd`; export r; \
6a42d184 940 srcroot=`cd $(srcdir); pwd`; export srcroot; \
ab1cbc67 941 (cd $(TARGET_SUBDIR)/$${dir};$(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
6a42d184
DZ
942 else \
943 true; \
944 fi
945
79337c85
ILT
946# This rule is used to install the modules which use
947# TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
948# and make install.
949.PHONY: $(INSTALL_TARGET_MODULES)
950$(INSTALL_TARGET_MODULES): install-dirs
ab1cbc67
PB
951 @dir=`echo $@ | sed -e 's/install-target-//'`; \
952 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
5cc73086 953 r=`pwd`; export r; \
79337c85 954 srcroot=`cd $(srcdir); pwd`; export srcroot; \
ab1cbc67
PB
955 (cd $(TARGET_SUBDIR)/$${dir}; \
956 $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
07362bd9 957 else \
79337c85 958 true; \
07362bd9
DZ
959 fi
960
6a42d184 961# This rule is used to build the modules which use X11_FLAGS_TO_PASS.
79337c85
ILT
962# To build a target all-X means to cd to X and make all.
963.PHONY: $(ALL_X11_MODULES)
964$(ALL_X11_MODULES):
965 @dir=`echo $@ | sed -e 's/all-//'`; \
966 if [ -f ./$${dir}/Makefile ] ; then \
5cc73086 967 r=`pwd`; export r; \
79337c85
ILT
968 srcroot=`cd $(srcdir); pwd`; export srcroot; \
969 (cd $${dir}; \
970 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
07362bd9 971 else \
79337c85 972 true; \
07362bd9
DZ
973 fi
974
6a42d184
DZ
975# This rule is used to check the modules which use X11_FLAGS_TO_PASS.
976# To build a target check-X means to cd to X and make all.
977.PHONY: $(CHECK_X11_MODULES)
978$(CHECK_X11_MODULES):
979 @dir=`echo $@ | sed -e 's/check-//'`; \
980 if [ -f ./$${dir}/Makefile ] ; then \
5cc73086 981 r=`pwd`; export r; \
6a42d184
DZ
982 srcroot=`cd $(srcdir); pwd`; export srcroot; \
983 (cd $${dir}; \
984 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
985 else \
986 true; \
987 fi
988
989# This rule is used to install the modules which use X11_FLAGS_TO_PASS.
79337c85
ILT
990# To build a target install-X means to cd to X and make install.
991.PHONY: $(INSTALL_X11_MODULES)
992$(INSTALL_X11_MODULES):
6a42d184 993 @dir=`echo $@ | sed -e 's/install-//'`; \
79337c85 994 if [ -f ./$${dir}/Makefile ] ; then \
5cc73086 995 r=`pwd`; export r; \
79337c85
ILT
996 srcroot=`cd $(srcdir); pwd`; export srcroot; \
997 (cd $${dir}; \
998 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
07362bd9 999 else \
79337c85 1000 true; \
07362bd9
DZ
1001 fi
1002
79337c85
ILT
1003# gcc is the only module which uses GCC_FLAGS_TO_PASS.
1004.PHONY: all-gcc
1005all-gcc:
1006 @if [ -f ./gcc/Makefile ] ; then \
5cc73086 1007 r=`pwd`; export r; \
79337c85
ILT
1008 srcroot=`cd $(srcdir); pwd`; export srcroot; \
1009 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
07362bd9 1010 else \
79337c85 1011 true; \
07362bd9
DZ
1012 fi
1013
4c0b7ebc
DE
1014.PHONY: all-bootstrap
1015all-bootstrap:
1016 @if [ -f ./gcc/Makefile ] ; then \
1017 r=`pwd`; export r; \
1018 srcroot=`cd $(srcdir); pwd`; export srcroot; \
1019 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) bootstrap); \
1020 else \
1021 true; \
1022 fi
1023
65088029
ILT
1024.PHONY: check-gcc
1025check-gcc:
1026 @if [ -f ./gcc/Makefile ] ; then \
5cc73086 1027 r=`pwd`; export r; \
65088029
ILT
1028 srcroot=`cd $(srcdir); pwd`; export srcroot; \
1029 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
1030 else \
1031 true; \
1032 fi
1033
79337c85
ILT
1034.PHONY: install-gcc
1035install-gcc:
1036 @if [ -f ./gcc/Makefile ] ; then \
5cc73086 1037 r=`pwd`; export r; \
79337c85
ILT
1038 srcroot=`cd $(srcdir); pwd`; export srcroot; \
1039 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
07362bd9 1040 else \
79337c85 1041 true; \
07362bd9
DZ
1042 fi
1043
753d5049
SC
1044
1045# EXPERIMENTAL STUFF
1046# This rule is used to install the modules which use FLAGS_TO_PASS.
1047# To build a target install-X means to cd to X and make install.
09985c96
SC
1048.PHONY: install-dosrel
1049install-dosrel: install-dirs info
753d5049
SC
1050 @dir=`echo $@ | sed -e 's/install-//'`; \
1051 if [ -f ./$${dir}/Makefile ] ; then \
1052 r=`pwd`; export r; \
1053 srcroot=`cd $(srcdir); pwd`; export srcroot; \
1054 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1055 else \
1056 true; \
1057 fi
1058
09985c96 1059install-dosrel-fake:
a987271c 1060
753d5049 1061
79337c85 1062# This is a list of inter-dependencies among modules.
65e21701 1063all-autoconf: all-m4
79337c85 1064all-bfd:
dfe44004 1065all-binutils: all-libiberty all-opcodes all-bfd all-flex all-byacc
79337c85 1066all-byacc:
79337c85 1067all-cvs:
4d802af9 1068all-dejagnu: all-tcl all-expect all-tk
79337c85
ILT
1069all-diff: all-libiberty
1070all-emacs:
1d5fcc66 1071all-emacs19: all-byacc
79337c85 1072all-etc:
4c0b7ebc
DE
1073configure-target-examples: $(ALL_GCC)
1074all-target-examples: configure-target-examples
c6ba9ae0 1075all-expect: all-tcl all-tk
275049c0 1076all-fileutils: all-libiberty
79337c85 1077all-find:
7dcc0664 1078all-flex: all-libiberty all-byacc
79337c85 1079all-gas: all-libiberty all-opcodes all-bfd
65e21701 1080all-gash: all-tcl
79337c85 1081all-gawk:
fc3524a9
DE
1082ALL_GCC = all-gcc
1083all-gcc: all-libiberty all-byacc all-binutils all-gas all-ld
4c0b7ebc 1084all-bootstrap: all-libiberty all-byacc all-binutils all-gas all-ld
01082eaf
MM
1085GDB_TK = all-tk all-tcl
1086all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK)
79337c85 1087all-gprof: all-libiberty all-bfd
6214eb23 1088all-grep: all-libiberty
19b1d034 1089all-grez: all-libiberty all-bfd
ab1cbc67 1090all-gui: all-gdb all-libproc all-target-librx
79337c85
ILT
1091all-gzip: all-libiberty
1092all-hello: all-libiberty
1093all-indent:
3585593d 1094all-ispell: all-emacs19
79337c85 1095all-ld: all-libiberty all-bfd all-byacc all-flex
283a2b3d 1096configure-target-libg++: $(ALL_GCC) configure-target-librx
ab1cbc67
PB
1097all-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++
1098configure-target-libgloss: $(ALL_GCC)
283a2b3d 1099all-target-libgloss: configure-target-libgloss configure-target-newlib
ab1cbc67
PB
1100configure-target-libio: $(ALL_GCC)
1101all-target-libio: configure-target-libio all-gas all-ld all-gcc all-target-libiberty all-target-newlib
79337c85 1102all-libiberty:
ab1cbc67
PB
1103configure-target-librx: $(ALL_GCC) configure-target-newlib
1104all-target-librx: configure-target-librx
1105configure-target-libstdc++: $(ALL_GCC)
1106all-target-libstdc++: configure-target-libstdc++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio
79337c85
ILT
1107all-m4: all-libiberty
1108all-make: all-libiberty
1109all-mmalloc:
ab1cbc67
PB
1110configure-target-newlib: $(ALL_GCC)
1111all-target-newlib: configure-target-newlib all-binutils all-gas all-gcc
275049c0 1112all-opcodes: all-bfd
be2c65d3 1113all-patch: all-libiberty
b255ccdb 1114all-prms: all-libiberty
79337c85
ILT
1115all-rcs:
1116all-readline:
1117all-recode: all-libiberty
ac259c28
JM
1118all-sed: all-libiberty
1119all-send-pr: all-prms
79337c85
ILT
1120all-shellutils:
1121all-sim: all-libiberty all-bfd
07362bd9 1122all-tar: all-libiberty
79337c85
ILT
1123all-tcl:
1124all-tclX: all-tcl all-tk
1125all-tk: all-tcl
1126all-texinfo: all-libiberty
1127all-textutils:
1128all-tgas: all-libiberty all-bfd
1129all-time:
1130all-wdiff:
309dca2a 1131all-target-winsup: all-target-newlib configure-target-winsup
ab1cbc67 1132configure-target-winsup: configure-target-newlib
79337c85 1133all-uudecode: all-libiberty
ab1cbc67
PB
1134configure-target-libiberty: $(ALL_GCC)
1135all-target-libiberty: configure-target-libiberty all-gcc all-ld all-target-newlib
07362bd9 1136
79337c85 1137### other supporting targets
07362bd9 1138
79337c85
ILT
1139MAKEDIRS= \
1140 $(prefix) \
1141 $(exec_prefix) \
1142 $(tooldir)
fca4f908 1143
79337c85
ILT
1144.PHONY: install-dirs
1145install-dirs:
1146 @for i in $(MAKEDIRS) ; do \
1147 echo Making $$i... ; \
62cd4a20 1148 parent=`echo $$i | sed -e 's@/[^/]*$$@@' | sed -e 's@^$$@/@'`; \
79337c85
ILT
1149 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
1150 if [ ! -d $$i ] ; then \
1151 if mkdir $$i ; then \
1152 true ; \
1153 else \
1154 exit 1 ; \
1155 fi ; \
1156 else \
1157 true ; \
1158 fi ; \
1159 done
23e3e7f9 1160
618f57a9 1161
79337c85
ILT
1162dir.info: do-install-info
1163 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
1164 $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
1165 mv -f dir.info.new dir.info ; \
1166 else true ; \
72c09fbc 1167 fi
6b7e5998 1168
b1cceba2
DZ
1169dist:
1170 @echo "Building a full distribution of this tree isn't done"
1171 @echo "via 'make dist'. Check out the etc/ subdirectory"
1172
eb02fd64
RP
1173etags tags: TAGS
1174
753d5049
SC
1175# Right now this just builds TAGS in each subdirectory. emacs19 has the
1176# ability to use several tags files at once, so there is probably no need
1177# to combine them into one big TAGS file (like CVS 1.3 does). We could
1178# (if we felt like it) have this Makefile write a piece of elisp which
1179# the user could load to tell emacs19 where all the TAGS files we just
1180# built are.
1181TAGS: do-TAGS
eb02fd64 1182
eb02fd64
RP
1183# with the gnu make, this is done automatically.
1184
01ec9588 1185Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
a26878d1 1186 $(SHELL) ./config.status
eb02fd64 1187
11954bf1 1188#
01ec9588 1189# Support for building net releases
11954bf1 1190
01ec9588
JK
1191# Files in devo used in any net release.
1192# ChangeLog omitted because it may refer to files which are not in this
1193# distribution (perhaps it would be better to include it anyway).
d94d255d 1194DEVO_SUPPORT= README Makefile.in configure configure.in \
9823504d 1195 config.guess config.sub config move-if-change \
81597186 1196 mpw-README mpw-build.in mpw-config.in mpw-configure \
283a2b3d 1197 COPYING COPYING.LIB install.sh config-ml.in symlink-tree
01ec9588
JK
1198
1199# Files in devo/etc used in any net release.
1200# ChangeLog omitted because it may refer to files which are not in this
1201# distribution (perhaps it would be better to include it anyway).
6d681784 1202ETC_SUPPORT= Makefile.in cfg-paper.texi configure.in configure.man \
ab1cbc67
PB
1203 configure.texi standards.texi make-stds.texi \
1204 configure.info* standards.info* cfg-paper.info*
01ec9588 1205
40e16078
KR
1206# When you use `make setup-dirs' or `make taz' you should always redefine
1207# this macro.
1208SUPPORT_FILES = list-of-support-files-for-tool-in-question
65e21701
KR
1209# Files where "byacc" (Cygnus version) should be changed to "bison -y" (FSF).
1210DISTBISONFILES= binutils/Makefile.in gas/Makefile.in gdb/Makefile.in
40e16078 1211
a54e05f6
KR
1212.PHONY: taz
1213
484fa12d
JW
1214taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
1215 texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1216 # Make sure "diststuff" files get built properly.
65e21701
KR
1217 for f in $(DISTBISONFILES) ; do \
1218 if [ -r $$f ]; then \
7b636683 1219 sed '/^BISON *=.*$$/s/.*/BISON = bison -y/' <$$f >tmp ; \
65e21701
KR
1220 mv -f tmp $$f ; \
1221 else true; fi ; \
1222 done
484fa12d
JW
1223 # Take out texinfo from a few places; make simple BISON=bison line.
1224 sed -e '/^all\.normal: /s/\all-texinfo //' \
1225 -e '/^ install-texinfo /d' \
1226 -e '/^BISON = /,/^$$/d' \
1227 -e '/^# BISON:/s/.*/BISON = bison -y/' \
1228 <Makefile.in >tmp
1229 mv -f tmp Makefile.in
65e21701 1230 #
1d5fcc66
PB
1231 $(start-sanitize-Sanitize)
1232 @if [ -f .Sanitize ] ; then echo "RUN Sanitize FIRST!" ; false ; fi ;
1233 $(end-sanitize-Sanitize)
40e16078 1234 ./configure sun4
ab1cbc67
PB
1235 [ -z "$(CONFIGURE_TARGET_MODULES)" ] \
1236 || $(MAKE) $(CONFIGURE_TARGET_MODULES) ALL_GCC="" \
1237 CC_FOR_TARGET="$(CC) CXX_FOR_TARGET="$(CXX)"
6b9e3a78 1238 # Make links, and run "make diststuff" or "make info" when needed.
a54e05f6 1239 rm -rf proto-toplev ; mkdir proto-toplev
7f9cb3b2 1240 set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
a54e05f6
KR
1241 for d in $$dirs ; do \
1242 if [ -d $$d ]; then \
ab1cbc67
PB
1243 if [ ! -f $$d/Makefile ] ; then true ; \
1244 elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \
1245 (cd $$d ; $(MAKE) diststuff ) || exit 1 ; \
6b9e3a78 1246 elif grep '^info:' $$d/Makefile >/dev/null ; then \
ab1cbc67 1247 (cd $$d ; $(MAKE) info ) || exit 1 ; \
6b9e3a78 1248 fi ; \
7f9cb3b2
KR
1249 if [ -d $$d/proto-$$d.dir ]; then \
1250 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1251 else \
1252 ln -s ../$$d proto-toplev/$$d ; \
1253 fi ; \
a54e05f6 1254 else ln -s ../$$d proto-toplev/$$d ; fi ; \
40e16078 1255 done
3dbe0fa2 1256 cd etc ; $(MAKE) info
5600fbd2 1257 $(MAKE) distclean
a54e05f6 1258 #
40e16078 1259 mkdir proto-toplev/etc
15408b3b
KR
1260 (cd proto-toplev/etc; \
1261 for i in $(ETC_SUPPORT); do \
40e16078 1262 ln -s ../../etc/$$i . ; \
15408b3b 1263 done)
a54e05f6 1264 #
04103845 1265 # Take out texinfo from configurable dirs
40e16078
KR
1266 rm proto-toplev/configure.in
1267 sed -e '/^host_tools=/s/texinfo //' \
40e16078 1268 <configure.in >proto-toplev/configure.in
a54e05f6 1269 #
40e16078
KR
1270 mkdir proto-toplev/texinfo
1271 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
7f9cb3b2 1272 ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
484fa12d 1273 ln -s ../../texinfo/lgpl.texinfo proto-toplev/texinfo/
40e16078 1274 ln -s ../../texinfo/tex3patch proto-toplev/texinfo/
a561909f 1275 chmod og=u `find . -print`
7f9cb3b2 1276 (VER=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
1d2bb445 1277 echo "==> Making $(TOOL)-$$VER.tar.gz"; \
a59b94d2 1278 rm -f $(TOOL)-$$VER; ln -s proto-toplev $(TOOL)-$$VER; \
40e16078 1279 tar cfh - $(TOOL)-$$VER \
5cc73086 1280 | $(GZIPPROG) -v -9 >$(TOOL)-$$VER.tar.gz )
40e16078 1281
484fa12d 1282TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
7f9cb3b2 1283DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
40e16078 1284
96bfa612 1285.PHONY: gas.tar.gz
7f9cb3b2 1286GAS_SUPPORT_DIRS= bfd include libiberty opcodes
96bfa612 1287gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
484fa12d
JW
1288 $(MAKE) -f Makefile.in taz TOOL=gas \
1289 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
40e16078 1290
7f9cb3b2 1291# The FSF "binutils" release includes gprof and ld.
96bfa612 1292.PHONY: binutils.tar.gz
4be4b991 1293BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof
96bfa612 1294binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
484fa12d 1295 $(MAKE) -f Makefile.in taz TOOL=binutils \
2492f942 1296 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS) makeall.bat configure.bat"
7f9cb3b2 1297
96bfa612 1298.PHONY: gas+binutils.tar.gz
a54e05f6 1299GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
96bfa612 1300gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
484fa12d 1301 $(MAKE) -f Makefile.in taz TOOL=gas \
2492f942 1302 SUPPORT_FILES="$(GASB_SUPPORT_DIRS) makeall.bat configure.bat"
79337c85 1303
5600fbd2 1304.PHONY: libg++.tar.gz
ab1cbc67 1305LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty
5600fbd2 1306libg++.tar.gz: $(DIST_SUPPORT) libg++
484fa12d
JW
1307 $(MAKE) -f Makefile.in taz TOOL=libg++ \
1308 SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
5600fbd2 1309
49dfa984
JM
1310GNATS_SUPPORT_DIRS=include libiberty send-pr
1311gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
a0bd8e18 1312 $(MAKE) -f Makefile.in taz TOOL=gnats \
49dfa984
JM
1313 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
1314
1d5fcc66 1315.PHONY: gdb.tar.gz
81597186 1316GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils
ca2ce3b3 1317GDBTK_SUPPORT_DIRS= `if [ -d tcl -a -d tk ] ; then echo tcl tk ; fi`
1d5fcc66
PB
1318gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1319 $(MAKE) -f Makefile.in taz TOOL=gdb \
ca2ce3b3 1320 SUPPORT_FILES="$(GDB_SUPPORT_DIRS) $(GDBTK_SUPPORT_DIRS)"
1d5fcc66 1321
7166a308 1322.PHONY: newlib.tar.gz
a220ba0f 1323NEWLIB_SUPPORT_DIRS=libgloss
04103845 1324# taz configures for the sun4 target which won't configure newlib.
a220ba0f
SC
1325# We need newlib configured so that the .info files are made.
1326# Unfortunately, it is not enough to just configure newlib separately:
1327# taz will build the .info files but since SUBDIRS won't contain newlib,
1328# distclean won't be run (leaving Makefile, config.status, and the tmp files
1329# used in building the .info files, eg: *.def, *.ref).
4c0b7ebc
DE
1330# The problem isn't solvable however without a lot of extra work because
1331# target libraries are built in subdir $(target_alias) which gets nuked during
1332# the make distclean. For now punt on the issue of shipping newlib info files
1333# with newlib net releases and wait for a day when some native target (sun4?)
1334# supports newlib (if only minimally).
7166a308
KR
1335newlib.tar.gz: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
1336 $(MAKE) -f Makefile.in taz TOOL=newlib \
1337 SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
6b9e3a78 1338 DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
7166a308 1339
79337c85
ILT
1340.NOEXPORT:
1341MAKEOVERRIDES=
1342
1343# start-sanitize-chill
1344## This is ugly, but I don't want GNU make to put these variables in
1345## the environment. Older makes will see this as a set of targets
1346## with no dependencies and no actions.
1347unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
1348# end-sanitize-chill
1349
eb02fd64 1350# end of Makefile.in
This page took 0.236608 seconds and 4 git commands to generate.