Fix PR 8255
[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
81597186 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
JG
124
125# libraries that may need to be augmented on a system-by-system basis
126X11_LIB = -lX11
127
e85e07cb 128# compilers to use to create programs which must be run in the build
440868a0
ILT
129# environment.
130CC_FOR_BUILD = $(CC)
e85e07cb 131CXX_FOR_BUILD = $(CXX)
440868a0 132
9f73dd6a 133SUBDIRS = "this is set via configure, don't edit this"
6a3958b2
RP
134OTHERS =
135
ca2ce3b3
ILT
136# This is set by the configure script to the list of directories which
137# should be built using the target tools.
efd7b806 138TARGET_CONFIGDIRS = xiberty libgloss newlib libio librx libstdc++ libg++ winsup
ca2ce3b3
ILT
139
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 \
753d5049
SC
154 if [ -f $$r/newlib/Makefile ] ; then \
155 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
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 \
753d5049
SC
183 if [ -f $$r/newlib/Makefile ] ; then \
184 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
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
a220ba0f
SC
207DLLTOOL_FOR_TARGET = ` \
208 if [ -f $$r/binutils/dlltool ] ; then \
209 echo $$r/binutils/dlltool ; \
210 else \
211 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
212 echo $(DLLTOOL); \
213 else \
214 t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \
215 fi; \
216 fi`
217
51489233 218AR_FOR_TARGET = ` \
5cc73086
KR
219 if [ -f $$r/binutils/ar ] ; then \
220 echo $$r/binutils/ar ; \
51489233 221 else \
378fd382 222 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
51489233
ILT
223 echo $(AR); \
224 else \
ea6d5817 225 t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \
81246025 226 fi; \
51489233
ILT
227 fi`
228
229RANLIB_FOR_TARGET = ` \
5cc73086
KR
230 if [ -f $$r/binutils/ranlib ] ; then \
231 echo $$r/binutils/ranlib ; \
51489233 232 else \
378fd382 233 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
51489233
ILT
234 echo $(RANLIB); \
235 else \
ea6d5817 236 t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \
81246025 237 fi; \
51489233
ILT
238 fi`
239
240NM_FOR_TARGET = ` \
ea6d5817 241 if [ -f $$r/binutils/nm.new ] ; then \
753d5049 242 echo $$r/binutils/nm.new ; \
51489233 243 else \
378fd382 244 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
51489233
ILT
245 echo $(NM); \
246 else \
ea6d5817 247 t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \
81246025 248 fi; \
51489233
ILT
249 fi`
250
eb02fd64 251#### host and target specific makefile fragments come in here.
ec342d7d 252###
eb02fd64 253
0ef4728f
ILT
254# Flags to pass down to all sub-makes.
255# Please keep these in alphabetical order.
256BASE_FLAGS_TO_PASS = \
2198e4ba 257 "AR_FLAGS=$(AR_FLAGS)" \
d09de70e 258 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
0ef4728f 259 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
378fd382 260 "BISON=$(BISON)" \
378fd382 261 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
0ef4728f 262 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
2198e4ba 263 "CFLAGS=$(CFLAGS)" \
3585593d 264 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
a4e879a1 265 $(start-sanitize-chill)\
7d9f0c54
MW
266 "CHILLFLAGS=$(CHILLFLAGS)" \
267 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
268 "CHILL_LIB=$(CHILL_LIB)" \
a4e879a1 269 $(end-sanitize-chill)\
0ef4728f
ILT
270 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
271 "CXXFLAGS=$(CXXFLAGS)" \
3585593d 272 "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
0ef4728f 273 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
a220ba0f 274 "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
a9a2f22f 275 "GCC_FOR_TARGET=$(CC_FOR_TARGET)" \
2198e4ba
MT
276 "INSTALL=$(INSTALL)" \
277 "INSTALL_DATA=$(INSTALL_DATA)" \
440868a0 278 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
f35c6160 279 "INSTALL_XFORM=$(INSTALL_XFORM)" \
378fd382
DZ
280 "LDFLAGS=$(LDFLAGS)" \
281 "LEX=$(LEX)" \
3585593d
BK
282 "LIBCFLAGS=$(LIBCFLAGS)" \
283 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
04103845
DE
284 "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
285 "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
65e21701 286 "M4=$(M4)" \
9823504d 287 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
0ef4728f 288 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
04103845
DE
289 "PICFLAG=$(PICFLAG)" \
290 "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
d09de70e 291 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
49dfa984 292 "SHELL=$(SHELL)" \
a54e05f6 293 "EXPECT=$(EXPECT)" \
6a42d184 294 "RUNTEST=$(RUNTEST)" \
86365152 295 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
5cc73086 296 "YACC=$(BISON)" \
378fd382
DZ
297 "exec_prefix=$(exec_prefix)" \
298 "prefix=$(prefix)" \
299 "tooldir=$(tooldir)"
2198e4ba 300
0ef4728f
ILT
301# Flags to pass down to most sub-makes, in which we're building with
302# the host environment.
6d681784 303# If any variables are added here, they must be added to do-*, below.
0ef4728f 304EXTRA_HOST_FLAGS = \
6d681784
JG
305 'AR=$(AR)' \
306 'AS=$(AS)' \
307 'CC=$(CC)' \
308 'CXX=$(CXX)' \
309 'NM=$(NM)' \
753d5049 310 'RANLIB=$(RANLIB)'
0ef4728f
ILT
311
312FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
313
d1bea4c7
DZ
314# Flags that are concerned with the location of the X11 include files
315# and library files
316X11_FLAGS_TO_PASS = \
317 "X11_INCLUDE_FLAGS=$(X11_INCLUDE_FLAGS)" \
f980fcfb
JG
318 "X11_LIB_FLAGS=$(X11_LIB_FLAGS)" \
319 "X11_LIB=$(X11_LIB)"
d1bea4c7 320
0ef4728f
ILT
321# Flags to pass down to makes which are built with the target environment.
322# The double $ decreases the length of the command line; the variables
323# are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
6d681784 324# If any variables are added here, they must be added to do-*, below.
0ef4728f
ILT
325EXTRA_TARGET_FLAGS = \
326 'AR=$$(AR_FOR_TARGET)' \
327 'AS=$$(AS_FOR_TARGET)' \
328 'CC=$$(CC_FOR_TARGET)' \
3585593d 329 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
0ef4728f 330 'CXX=$$(CXX_FOR_TARGET)' \
3585593d 331 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
a220ba0f 332 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
3585593d
BK
333 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
334 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
0ef4728f 335 'NM=$$(NM_FOR_TARGET)' \
04103845 336 'PICFLAG=$$(PICFLAG_FOR_TARGET)' \
753d5049 337 'RANLIB=$$(RANLIB_FOR_TARGET)'
0ef4728f
ILT
338
339TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
51489233 340
f4e414f1
ILT
341# Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
342# unfortunately needs the native compiler and the target ar and
0ef4728f 343# ranlib.
66957ce4
ILT
344# If any variables are added here, they must be added to do-*, below.
345# The HOST_* variables are a special case, which are used for the gcc
346# cross-building scheme.
0ef4728f
ILT
347EXTRA_GCC_FLAGS = \
348 'AR=$$(AR_FOR_TARGET)' \
6d681784
JG
349 'AS=$(AS)' \
350 'CC=$(CC)' \
351 'CXX=$(CXX)' \
a54e05f6
KR
352 'HOST_CC=$(CC_FOR_BUILD)' \
353 'HOST_PREFIX=$(HOST_PREFIX)' \
354 'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
6d681784 355 'NM=$(NM)' \
753d5049 356 'RANLIB=$$(RANLIB_FOR_TARGET)'
0ef4728f 357
34b3298b 358GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
f4e414f1 359
6a42d184 360# This is a list of the targets for all of the modules which are compiled
79337c85
ILT
361# using $(FLAGS_TO_PASS).
362ALL_MODULES = \
363 all-autoconf \
364 all-bfd \
365 all-binutils \
366 all-byacc \
367 all-cvs \
368 all-dejagnu \
369 all-diff \
ac259c28 370 all-dosutils \
79337c85
ILT
371 all-etc \
372 all-fileutils \
373 all-find \
374 all-flex \
375 all-gas \
376 all-gawk \
79337c85
ILT
377 all-gprof \
378 all-grep \
379 all-gzip \
380 all-hello \
381 all-indent \
382 all-ispell \
383 all-ld \
384 all-libiberty \
385 all-m4 \
386 all-make \
387 all-mmalloc \
388 all-opcodes \
389 all-patch \
390 all-prms \
391 all-rcs \
392 all-readline \
275049c0 393 all-release \
79337c85
ILT
394 all-recode \
395 all-sed \
396 all-send-pr \
397 all-shellutils \
398 all-sim \
399 all-tar \
400 all-tcl \
401 all-texinfo \
402 all-textutils \
403 all-tgas \
404 all-time \
405 all-uudecode \
753d5049
SC
406 all-wdiff
407
6a42d184
DZ
408# This is a list of the check targets for all of the modules which are
409# compiled using $(FLAGS_TO_PASS).
4f0b8f27
TL
410# This is a list of the check targets for all of the modules which are
411# compiled using $(FLAGS_TO_PASS).
412#
d237841c
BC
413# The list is in two parts. The first lists those tools which
414# are tested as part of the host's native tool-chain, and not
415# tested in a cross configuration.
416NATIVE_CHECK_MODULES = \
417 check-byacc \
4f0b8f27
TL
418 check-flex
419
d237841c 420CROSS_CHECK_MODULES = \
6a42d184
DZ
421 check-autoconf \
422 check-bfd \
423 check-binutils \
6a42d184
DZ
424 check-cvs \
425 check-dejagnu \
426 check-diff \
427 check-etc \
428 check-fileutils \
429 check-find \
6a42d184
DZ
430 check-gas \
431 check-gawk \
6a42d184
DZ
432 check-gprof \
433 check-grep \
434 check-gzip \
435 check-hello \
436 check-indent \
437 check-ispell \
438 check-ld \
439 check-libiberty \
440 check-m4 \
441 check-make \
442 check-mmcheckoc \
443 check-opcodes \
444 check-patch \
445 check-prms \
446 check-rcs \
447 check-readline \
448 check-recode \
449 check-sed \
450 check-send-pr \
451 check-shellutils \
452 check-sim \
453 check-tar \
454 check-tcl \
455 check-texinfo \
456 check-textutils \
457 check-tgas \
458 check-time \
459 check-uudecode \
460 check-wdiff
d237841c
BC
461
462CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
6a42d184
DZ
463
464# This is a list of the install targets for all of the modules which are
79337c85
ILT
465# compiled using $(FLAGS_TO_PASS).
466INSTALL_MODULES = \
467 install-autoconf \
468 install-bfd \
469 install-binutils \
470 install-byacc \
471 install-cvs \
472 install-dejagnu \
473 install-diff \
753d5049 474 install-dosutils \
79337c85
ILT
475 install-etc \
476 install-fileutils \
477 install-find \
478 install-flex \
479 install-gas \
480 install-gawk \
79337c85
ILT
481 install-gprof \
482 install-grep \
483 install-gzip \
484 install-hello \
485 install-indent \
486 install-ispell \
487 install-ld \
488 install-libiberty \
489 install-m4 \
490 install-make \
491 install-mmalloc \
492 install-opcodes \
493 install-patch \
494 install-prms \
495 install-rcs \
496 install-readline \
497 install-recode \
498 install-sed \
499 install-send-pr \
500 install-shellutils \
501 install-sim \
502 install-tar \
503 install-tcl \
504 install-texinfo \
505 install-textutils \
506 install-tgas \
507 install-time \
508 install-uudecode \
509 install-wdiff
510
6a42d184 511# This is a list of the targets for all of the modules which are compiled
79337c85
ILT
512# using $(X11_FLAGS_TO_PASS).
513ALL_X11_MODULES = \
514 all-emacs \
4d802af9 515 all-emacs19 \
04103845 516 all-gdb \
79337c85 517 all-expect \
65e21701 518 all-gash \
79337c85
ILT
519 all-tclX \
520 all-tk
521
6a42d184
DZ
522# This is a list of the check targets for all of the modules which are
523# compiled using $(X11_FLAGS_TO_PASS).
524CHECK_X11_MODULES = \
525 check-emacs \
04103845 526 check-gdb \
6a42d184 527 check-expect \
65e21701 528 check-gash \
6a42d184
DZ
529 check-tclX \
530 check-tk
531
79337c85
ILT
532# This is a list of the install targets for all the modules which are
533# compiled using $(X11_FLAGS_TO_PASS).
534INSTALL_X11_MODULES = \
535 install-emacs \
4d802af9 536 install-emacs19 \
04103845 537 install-gdb \
79337c85 538 install-expect \
65e21701 539 install-gash \
79337c85
ILT
540 install-tclX \
541 install-tk
fca4f908 542
6a42d184 543# This is a list of the targets for all of the modules which are compiled
79337c85
ILT
544# using $(TARGET_FLAGS_TO_PASS).
545ALL_TARGET_MODULES = \
6214eb23 546 all-libio \
4be4b991 547 all-libstdc++ \
1d5fcc66 548 all-librx \
79337c85
ILT
549 all-libg++ \
550 all-newlib \
efd7b806 551 all-winsup \
15408b3b 552 all-libgloss \
79337c85
ILT
553 all-xiberty
554
ca2ce3b3
ILT
555# This is a list of the configure targets for all of the modules which
556# are compiled using the target tools.
557CONFIGURE_TARGET_MODULES = \
558 configure-libio \
559 configure-libstdc++ \
560 configure-librx \
561 configure-libg++ \
562 configure-newlib \
efd7b806 563 configure-winsup \
ca2ce3b3
ILT
564 configure-libgloss \
565 configure-xiberty
566
6a42d184
DZ
567# This is a list of the check targets for all of the modules which are
568# compiled using $(TARGET_FLAGS_TO_PASS).
569CHECK_TARGET_MODULES = \
6214eb23 570 check-libio \
4be4b991 571 check-libstdc++ \
6a42d184
DZ
572 check-libg++ \
573 check-newlib \
efd7b806 574 check-winsup \
6a42d184
DZ
575 check-xiberty
576
577# This is a list of the install targets for all of the modules which are
79337c85
ILT
578# compiled using $(TARGET_FLAGS_TO_PASS).
579INSTALL_TARGET_MODULES = \
6214eb23 580 install-libio \
4be4b991 581 install-libstdc++ \
79337c85
ILT
582 install-libg++ \
583 install-newlib \
efd7b806 584 install-winsup \
15408b3b 585 install-libgloss \
79337c85 586 install-xiberty
4d714963 587
79337c85
ILT
588# This is a shell case of all modules which are compiled using
589# $(TARGET_FLAGS_TO_PASS), used in the do-X rule.
efd7b806 590TARGET_LIBS = libio | libstdc++ | librx | libg++ | newlib | xiberty | winsup
7481617f 591
79337c85 592# The first rule in the file had better be this one. Don't put any above it.
a59b94d2 593all: all.normal
79337c85
ILT
594.PHONY: all
595
596# The target built for a native build.
597.PHONY: all.normal
598all.normal: \
599 $(ALL_MODULES) \
600 $(ALL_TARGET_MODULES) \
46d0ca81 601 $(ALL_X11_MODULES) \
79337c85
ILT
602 all-gcc
603
0ef4728f 604# Do a target for all the subdirectories. A ``make do-X'' will do a
53222cbd
RP
605# ``make X'' in all subdirectories (because, in general, there is a
606# dependency (below) of X upon do-X, a ``make X'' will also do this,
607# but it may do additional work as well).
0ef4728f
ILT
608# This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
609# because it is so large that it can easily overflow the command line
610# length limit on some systems.
79337c85 611DO_X = \
79337c85
ILT
612 do-clean \
613 do-distclean \
614 do-dvi \
615 do-info \
616 do-install-info \
617 do-installcheck \
618 do-mostlyclean \
ca2ce3b3 619 do-maintainer-clean \
753d5049 620 do-TAGS
79337c85
ILT
621.PHONY: $(DO_X)
622$(DO_X):
0ef4728f 623 @target=`echo $@ | sed -e 's/^do-//'`; \
5cc73086 624 r=`pwd`; export r; \
0ef4728f 625 srcroot=`cd $(srcdir); pwd`; export srcroot; \
ca2ce3b3 626 for i in $(SUBDIRS) $(TARGET_CONFIGDIRS); do \
36286a3e 627 if [ -f ./$$i/Makefile ]; then \
0ef4728f
ILT
628 case $$i in \
629 $(TARGET_LIBS) ) \
6d681784
JG
630 for flag in $(EXTRA_TARGET_FLAGS); do \
631 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
632 done; \
0ef4728f
ILT
633 ;; \
634 gcc) \
6d681784
JG
635 for flag in $(EXTRA_GCC_FLAGS); do \
636 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
637 done; \
0ef4728f
ILT
638 ;; \
639 *) \
6d681784
JG
640 for flag in $(EXTRA_HOST_FLAGS); do \
641 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
642 done; \
0ef4728f
ILT
643 ;; \
644 esac ; \
753d5049 645 export AR AS CC CXX NM RANLIB; \
0ef4728f 646 if (cd ./$$i; \
6d681784
JG
647 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
648 "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
753d5049 649 "RANLIB=$${RANLIB}" \
6d681784 650 $${target}); \
0ef4728f
ILT
651 then true; else exit 1; fi; \
652 else true; fi; \
653 done
fb90daeb 654
79337c85
ILT
655# Here are the targets which correspond to the do-X targets.
656
65088029 657.PHONY: info installcheck dvi install-info
ca2ce3b3
ILT
658.PHONY: clean distclean mostlyclean maintainer-clean realclean
659.PHONY: local-clean local-distclean local-maintainer-clean
0ef4728f 660info: do-info
1a14993c 661installcheck: do-installcheck
0ef4728f 662dvi: do-dvi
9a9e8e7f 663
f35c6160
DZ
664install-info: do-install-info dir.info
665 srcroot=`cd $(srcdir); pwd`; export srcroot; \
72c09fbc
SC
666 if [ -f dir.info ] ; then \
667 $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
50fbe976 668 else true ; fi
4d714963 669
0ef4728f 670local-clean:
7fed4078 671 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
3b30df82 672
0ef4728f 673local-distclean:
7fed4078 674 -rm -f Makefile config.status
7fcfdcf7 675
ca2ce3b3
ILT
676local-maintainer-clean:
677 @echo "This command is intended for maintainers to use;"
678 @echo "it deletes files that may require special tools to rebuild."
679
0ef4728f
ILT
680clean: do-clean local-clean
681mostlyclean: do-mostlyclean local-clean
682distclean: do-distclean local-clean local-distclean
ca2ce3b3
ILT
683maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
684maintainer-clean: local-distclean
685realclean: maintainer-clean
0ef4728f 686
65088029
ILT
687# Check target.
688
689.PHONY: check
690check: $(CHECK_MODULES) \
691 $(CHECK_TARGET_MODULES) \
692 $(CHECK_X11_MODULES) \
693 check-gcc
694
79337c85 695# Installation targets.
4d714963 696
04103845 697.PHONY: install uninstall source-vault binary-vault vault-install
98a33b6d 698install: $(INSTALL_TARGET)
b26ff9d8 699
79337c85
ILT
700uninstall:
701 @echo "the uninstall target is not supported in this tree"
702
04103845
DE
703source-vault:
704 $(MAKE) -f ./release/Build-A-Release \
705 host=$(host_alias) source-vault
706
707binary-vault:
708 $(MAKE) -f ./release/Build-A-Release \
709 host=$(host_alias) target=$(target_alias)
710
275049c0
JK
711vault-install:
712 @if [ -f ./release/vault-install ] ; then \
713 ./release/vault-install $(host_alias) $(target_alias) ; \
96bfa612
KR
714 else \
715 true ; \
275049c0
JK
716 fi
717
79337c85 718.PHONY: install.all
06a07944
RP
719install.all: install-no-fixedincludes
720 @if [ -f ./gcc/Makefile ] ; then \
5cc73086 721 r=`pwd` ; export r ; \
06a07944
RP
722 (cd ./gcc; \
723 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
724 else \
725 true ; \
726 fi
5a63b336 727
96bfa612 728# install-no-fixedincludes is used because Cygnus can not distribute
79337c85
ILT
729# the fixed header files.
730.PHONY: install-no-fixedincludes
731install-no-fixedincludes: \
732 install-dirs \
79337c85
ILT
733 $(INSTALL_MODULES) \
734 $(INSTALL_TARGET_MODULES) \
96bfa612 735 $(INSTALL_X11_MODULES) \
f35c6160 736 gcc-no-fixedincludes
d1bea4c7 737
5cc24596 738# Install the gcc headers files, but not the fixed include files,
79337c85
ILT
739# which Cygnus is not allowed to distribute. This rule is very
740# dependent on the workings of the gcc Makefile.in.
741.PHONY: gcc-no-fixedincludes
06a07944 742gcc-no-fixedincludes:
5cc24596
PB
743 @if [ -f ./gcc/Makefile ]; then \
744 rm -rf gcc/tmp-include; \
745 mv gcc/include gcc/tmp-include 2>/dev/null; \
746 mkdir gcc/include; \
7f9cb3b2 747 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
753d5049 748 touch gcc/stmp-fixinc gcc/include/fixed; \
a54e05f6 749 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
5cc73086 750 r=`pwd`; export r; \
5cc24596
PB
751 srcroot=`cd $(srcdir); pwd` ; export srcroot; \
752 (cd ./gcc; \
753 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
754 rm -rf gcc/include; \
755 mv gcc/tmp-include gcc/include 2>/dev/null; \
756 else true; fi
dcbfc14d 757
79337c85
ILT
758# This rule is used to build the modules which use FLAGS_TO_PASS. To
759# build a target all-X means to cd to X and make all.
3de70f1d 760#
055cca84 761# all-gui, and all-libproc are handled specially because
4d802af9
MT
762# they are still experimental, and if they fail to build, that
763# shouldn't stop "make all".
04103845
DE
764.PHONY: $(ALL_MODULES) all-gui all-libproc
765$(ALL_MODULES) all-gui all-libproc:
79337c85 766 @dir=`echo $@ | sed -e 's/all-//'`; \
472af17f
ILT
767 if [ -f ./$${dir}/Makefile ] ; then \
768 r=`pwd`; export r; \
769 srcroot=`cd $(srcdir); pwd`; export srcroot; \
770 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
07362bd9 771 else \
79337c85 772 true; \
07362bd9
DZ
773 fi
774
80cbf870
ILT
775# These rules are used to check the modules which use FLAGS_TO_PASS.
776# To build a target check-X means to cd to X and make check. Some
777# modules are only tested in a native toolchain.
4f0b8f27 778
d237841c
BC
779.PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
780$(NATIVE_CHECK_MODULES):
39cc6dae
RS
781 @if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
782 dir=`echo $@ | sed -e 's/check-//'`; \
472af17f
ILT
783 if [ -f ./$${dir}/Makefile ] ; then \
784 r=`pwd`; export r; \
785 srcroot=`cd $(srcdir); pwd`; export srcroot; \
786 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
787 else \
788 true; \
4f0b8f27
TL
789 fi; \
790 fi
791
792$(CROSS_CHECK_MODULES):
6a42d184
DZ
793 @dir=`echo $@ | sed -e 's/check-//'`; \
794 if [ -f ./$${dir}/Makefile ] ; then \
5cc73086 795 r=`pwd`; export r; \
6a42d184
DZ
796 srcroot=`cd $(srcdir); pwd`; export srcroot; \
797 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
798 else \
799 true; \
800 fi
801
79337c85
ILT
802# This rule is used to install the modules which use FLAGS_TO_PASS.
803# To build a target install-X means to cd to X and make install.
804.PHONY: $(INSTALL_MODULES)
805$(INSTALL_MODULES): install-dirs
806 @dir=`echo $@ | sed -e 's/install-//'`; \
807 if [ -f ./$${dir}/Makefile ] ; then \
5cc73086 808 r=`pwd`; export r; \
79337c85 809 srcroot=`cd $(srcdir); pwd`; export srcroot; \
f35c6160 810 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
07362bd9 811 else \
79337c85 812 true; \
07362bd9
DZ
813 fi
814
ca2ce3b3
ILT
815# This rule is used to configure the modules which are built with the
816# target tools.
817.PHONY: $(CONFIGURE_TARGET_MODULES)
818$(CONFIGURE_TARGET_MODULES):
819 @dir=`echo $@ | sed -e 's/configure-//'`; \
820 if [ -f ./$${dir}/Makefile ] ; then \
821 true; \
822 elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
efd7b806
SC
823 if [ -d $(srcdir)/$${dir} ]; then \
824 if [ -d ./$${dir} ]; then true; else mkdir $${dir}; fi; \
825 r=`pwd`; export r; \
826 srcroot=`cd $(srcdir); pwd`; export srcroot; \
827 AR="$(AR_FOR_TARGET)"; export AR; \
828 AS="$(AS_FOR_TARGET)"; export AS; \
829 CC="$(CC_FOR_TARGET)"; export CC; \
830 CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
831 CXX="$(CXX_FOR_TARGET)"; export CXX; \
832 CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
833 NM="$(NM_FOR_TARGET)"; export NM; \
834 RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
835 cd $${dir}; \
836 $${srcroot}/configure $(CONFIG_ARGUMENTS) --srcdir=$${srcroot}/$${dir}; \
837 else \
838 true; \
839 fi \
ca2ce3b3
ILT
840 else \
841 true; \
842 fi
843
6a42d184
DZ
844# This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
845# To build a target all-X means to cd to X and make all.
79337c85
ILT
846.PHONY: $(ALL_TARGET_MODULES)
847$(ALL_TARGET_MODULES):
848 @dir=`echo $@ | sed -e 's/all-//'`; \
849 if [ -f ./$${dir}/Makefile ] ; then \
5cc73086 850 r=`pwd`; export r; \
79337c85
ILT
851 srcroot=`cd $(srcdir); pwd`; export srcroot; \
852 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
07362bd9 853 else \
79337c85 854 true; \
07362bd9
DZ
855 fi
856
6a42d184
DZ
857# This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
858# To build a target install-X means to cd to X and make install.
859.PHONY: $(CHECK_TARGET_MODULES)
860$(CHECK_TARGET_MODULES):
861 @dir=`echo $@ | sed -e 's/check-//'`; \
862 if [ -f ./$${dir}/Makefile ] ; then \
5cc73086 863 r=`pwd`; export r; \
6a42d184
DZ
864 srcroot=`cd $(srcdir); pwd`; export srcroot; \
865 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) check); \
866 else \
867 true; \
868 fi
869
79337c85
ILT
870# This rule is used to install the modules which use
871# TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
872# and make install.
873.PHONY: $(INSTALL_TARGET_MODULES)
874$(INSTALL_TARGET_MODULES): install-dirs
875 @dir=`echo $@ | sed -e 's/install-//'`; \
876 if [ -f ./$${dir}/Makefile ] ; then \
5cc73086 877 r=`pwd`; export r; \
79337c85
ILT
878 srcroot=`cd $(srcdir); pwd`; export srcroot; \
879 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
07362bd9 880 else \
79337c85 881 true; \
07362bd9
DZ
882 fi
883
6a42d184 884# This rule is used to build the modules which use X11_FLAGS_TO_PASS.
79337c85
ILT
885# To build a target all-X means to cd to X and make all.
886.PHONY: $(ALL_X11_MODULES)
887$(ALL_X11_MODULES):
888 @dir=`echo $@ | sed -e 's/all-//'`; \
889 if [ -f ./$${dir}/Makefile ] ; then \
5cc73086 890 r=`pwd`; export r; \
79337c85
ILT
891 srcroot=`cd $(srcdir); pwd`; export srcroot; \
892 (cd $${dir}; \
893 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
07362bd9 894 else \
79337c85 895 true; \
07362bd9
DZ
896 fi
897
6a42d184
DZ
898# This rule is used to check the modules which use X11_FLAGS_TO_PASS.
899# To build a target check-X means to cd to X and make all.
900.PHONY: $(CHECK_X11_MODULES)
901$(CHECK_X11_MODULES):
902 @dir=`echo $@ | sed -e 's/check-//'`; \
903 if [ -f ./$${dir}/Makefile ] ; then \
5cc73086 904 r=`pwd`; export r; \
6a42d184
DZ
905 srcroot=`cd $(srcdir); pwd`; export srcroot; \
906 (cd $${dir}; \
907 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
908 else \
909 true; \
910 fi
911
912# This rule is used to install the modules which use X11_FLAGS_TO_PASS.
79337c85
ILT
913# To build a target install-X means to cd to X and make install.
914.PHONY: $(INSTALL_X11_MODULES)
915$(INSTALL_X11_MODULES):
6a42d184 916 @dir=`echo $@ | sed -e 's/install-//'`; \
79337c85 917 if [ -f ./$${dir}/Makefile ] ; then \
5cc73086 918 r=`pwd`; export r; \
79337c85
ILT
919 srcroot=`cd $(srcdir); pwd`; export srcroot; \
920 (cd $${dir}; \
921 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
07362bd9 922 else \
79337c85 923 true; \
07362bd9
DZ
924 fi
925
79337c85
ILT
926# gcc is the only module which uses GCC_FLAGS_TO_PASS.
927.PHONY: all-gcc
928all-gcc:
929 @if [ -f ./gcc/Makefile ] ; then \
5cc73086 930 r=`pwd`; export r; \
79337c85
ILT
931 srcroot=`cd $(srcdir); pwd`; export srcroot; \
932 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
07362bd9 933 else \
79337c85 934 true; \
07362bd9
DZ
935 fi
936
65088029
ILT
937.PHONY: check-gcc
938check-gcc:
939 @if [ -f ./gcc/Makefile ] ; then \
5cc73086 940 r=`pwd`; export r; \
65088029
ILT
941 srcroot=`cd $(srcdir); pwd`; export srcroot; \
942 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
943 else \
944 true; \
945 fi
946
79337c85
ILT
947.PHONY: install-gcc
948install-gcc:
949 @if [ -f ./gcc/Makefile ] ; then \
5cc73086 950 r=`pwd`; export r; \
79337c85
ILT
951 srcroot=`cd $(srcdir); pwd`; export srcroot; \
952 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
07362bd9 953 else \
79337c85 954 true; \
07362bd9
DZ
955 fi
956
753d5049
SC
957
958# EXPERIMENTAL STUFF
959# This rule is used to install the modules which use FLAGS_TO_PASS.
960# To build a target install-X means to cd to X and make install.
09985c96
SC
961.PHONY: install-dosrel
962install-dosrel: install-dirs info
753d5049
SC
963 @dir=`echo $@ | sed -e 's/install-//'`; \
964 if [ -f ./$${dir}/Makefile ] ; then \
965 r=`pwd`; export r; \
966 srcroot=`cd $(srcdir); pwd`; export srcroot; \
967 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
968 else \
969 true; \
970 fi
971
09985c96 972install-dosrel-fake:
a987271c 973
753d5049 974
79337c85 975# This is a list of inter-dependencies among modules.
65e21701 976all-autoconf: all-m4
79337c85 977all-bfd:
dfe44004 978all-binutils: all-libiberty all-opcodes all-bfd all-flex all-byacc
79337c85 979all-byacc:
79337c85 980all-cvs:
4d802af9 981all-dejagnu: all-tcl all-expect all-tk
79337c85
ILT
982all-diff: all-libiberty
983all-emacs:
1d5fcc66 984all-emacs19: all-byacc
79337c85 985all-etc:
c6ba9ae0 986all-expect: all-tcl all-tk
275049c0 987all-fileutils: all-libiberty
79337c85 988all-find:
7dcc0664 989all-flex: all-libiberty all-byacc
79337c85 990all-gas: all-libiberty all-opcodes all-bfd
65e21701 991all-gash: all-tcl
79337c85 992all-gawk:
04103845
DE
993all-gcc: all-libiberty all-byacc all-binutils all-gas all-ld
994all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-byacc all-sim $(gdbnlmrequirements)
79337c85 995all-gprof: all-libiberty all-bfd
6214eb23 996all-grep: all-libiberty
4d802af9 997all-gui: all-gdb all-libproc all-librx
79337c85
ILT
998all-gzip: all-libiberty
999all-hello: all-libiberty
1000all-indent:
3585593d 1001all-ispell: all-emacs19
79337c85 1002all-ld: all-libiberty all-bfd all-byacc all-flex
ca2ce3b3
ILT
1003configure-libg++: all-gcc
1004all-libg++: configure-libg++ all-gas all-ld all-gcc all-xiberty all-newlib all-libio all-librx all-libstdc++
1005configure-libgloss: all-gcc
1006all-libgloss: configure-libgloss
1007configure-libio: all-gcc
1008all-libio: configure-libio all-gas all-ld all-gcc all-xiberty all-newlib
79337c85 1009all-libiberty:
ca2ce3b3
ILT
1010configure-librx: all-gcc all-newlib
1011all-librx: configure-librx
1012configure-libstdc++: all-gcc
1013all-libstdc++: configure-libstdc++ all-gas all-ld all-gcc all-xiberty all-newlib all-libio
79337c85
ILT
1014all-m4: all-libiberty
1015all-make: all-libiberty
1016all-mmalloc:
ca2ce3b3
ILT
1017configure-newlib: all-gcc
1018all-newlib: configure-newlib all-binutils all-gas all-gcc
275049c0 1019all-opcodes: all-bfd
79337c85 1020all-patch:
b255ccdb 1021all-prms: all-libiberty
79337c85
ILT
1022all-rcs:
1023all-readline:
1024all-recode: all-libiberty
ac259c28
JM
1025all-sed: all-libiberty
1026all-send-pr: all-prms
79337c85
ILT
1027all-shellutils:
1028all-sim: all-libiberty all-bfd
07362bd9 1029all-tar: all-libiberty
79337c85
ILT
1030all-tcl:
1031all-tclX: all-tcl all-tk
1032all-tk: all-tcl
1033all-texinfo: all-libiberty
1034all-textutils:
1035all-tgas: all-libiberty all-bfd
1036all-time:
1037all-wdiff:
efd7b806
SC
1038all-winsup: all-newlib
1039configure-winsup: configure-newlib
79337c85 1040all-uudecode: all-libiberty
ca2ce3b3
ILT
1041configure-xiberty: all-gcc
1042all-xiberty: configure-xiberty all-gcc all-ld all-newlib
07362bd9 1043
79337c85 1044### other supporting targets
07362bd9 1045
79337c85
ILT
1046MAKEDIRS= \
1047 $(prefix) \
1048 $(exec_prefix) \
1049 $(tooldir)
fca4f908 1050
79337c85
ILT
1051.PHONY: install-dirs
1052install-dirs:
1053 @for i in $(MAKEDIRS) ; do \
1054 echo Making $$i... ; \
62cd4a20 1055 parent=`echo $$i | sed -e 's@/[^/]*$$@@' | sed -e 's@^$$@/@'`; \
79337c85
ILT
1056 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
1057 if [ ! -d $$i ] ; then \
1058 if mkdir $$i ; then \
1059 true ; \
1060 else \
1061 exit 1 ; \
1062 fi ; \
1063 else \
1064 true ; \
1065 fi ; \
1066 done
23e3e7f9 1067
618f57a9 1068
79337c85
ILT
1069dir.info: do-install-info
1070 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
1071 $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
1072 mv -f dir.info.new dir.info ; \
1073 else true ; \
72c09fbc 1074 fi
6b7e5998 1075
b1cceba2
DZ
1076dist:
1077 @echo "Building a full distribution of this tree isn't done"
1078 @echo "via 'make dist'. Check out the etc/ subdirectory"
1079
eb02fd64
RP
1080etags tags: TAGS
1081
753d5049
SC
1082# Right now this just builds TAGS in each subdirectory. emacs19 has the
1083# ability to use several tags files at once, so there is probably no need
1084# to combine them into one big TAGS file (like CVS 1.3 does). We could
1085# (if we felt like it) have this Makefile write a piece of elisp which
1086# the user could load to tell emacs19 where all the TAGS files we just
1087# built are.
1088TAGS: do-TAGS
eb02fd64 1089
eb02fd64
RP
1090# with the gnu make, this is done automatically.
1091
01ec9588 1092Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
a26878d1 1093 $(SHELL) ./config.status
eb02fd64 1094
11954bf1 1095#
01ec9588 1096# Support for building net releases
11954bf1 1097
01ec9588
JK
1098# Files in devo used in any net release.
1099# ChangeLog omitted because it may refer to files which are not in this
1100# distribution (perhaps it would be better to include it anyway).
d94d255d 1101DEVO_SUPPORT= README Makefile.in configure configure.in \
9823504d 1102 config.guess config.sub config move-if-change \
81597186 1103 mpw-README mpw-build.in mpw-config.in mpw-configure \
2492f942 1104 COPYING COPYING.LIB install.sh
01ec9588
JK
1105
1106# Files in devo/etc used in any net release.
1107# ChangeLog omitted because it may refer to files which are not in this
1108# distribution (perhaps it would be better to include it anyway).
6d681784 1109ETC_SUPPORT= Makefile.in cfg-paper.texi configure.in configure.man \
275049c0 1110 configure.texi standards.texi make-stds.texi
15408b3b 1111ETC_SUPPORT_PFX=configure.info standards.info cfg-paper.info
01ec9588 1112
40e16078
KR
1113# When you use `make setup-dirs' or `make taz' you should always redefine
1114# this macro.
1115SUPPORT_FILES = list-of-support-files-for-tool-in-question
7f9cb3b2 1116# Directories that might want `make diststuff' run.
7166a308 1117DISTSTUFFDIRS= ld gprof gdb libg++ binutils gnats gas
65e21701
KR
1118# Files where "byacc" (Cygnus version) should be changed to "bison -y" (FSF).
1119DISTBISONFILES= binutils/Makefile.in gas/Makefile.in gdb/Makefile.in
ea18081d 1120# Directories where "info" should be built.
15408b3b 1121DISTDOCDIRS= ld gprof binutils gas bfd libg++ libio gdb gnats send-pr etc
40e16078 1122
a54e05f6
KR
1123.PHONY: taz
1124
484fa12d
JW
1125taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
1126 texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1127 # Make sure "diststuff" files get built properly.
65e21701
KR
1128 for f in $(DISTBISONFILES) ; do \
1129 if [ -r $$f ]; then \
7b636683 1130 sed '/^BISON *=.*$$/s/.*/BISON = bison -y/' <$$f >tmp ; \
65e21701
KR
1131 mv -f tmp $$f ; \
1132 else true; fi ; \
1133 done
484fa12d
JW
1134 # Take out texinfo from a few places; make simple BISON=bison line.
1135 sed -e '/^all\.normal: /s/\all-texinfo //' \
1136 -e '/^ install-texinfo /d' \
1137 -e '/^BISON = /,/^$$/d' \
1138 -e '/^# BISON:/s/.*/BISON = bison -y/' \
1139 <Makefile.in >tmp
1140 mv -f tmp Makefile.in
65e21701 1141 #
1d5fcc66
PB
1142 $(start-sanitize-Sanitize)
1143 @if [ -f .Sanitize ] ; then echo "RUN Sanitize FIRST!" ; false ; fi ;
1144 $(end-sanitize-Sanitize)
40e16078 1145 ./configure sun4
484fa12d
JW
1146 # Doc files don't change; include them in distribution.
1147 for f in $(DISTDOCDIRS) ; do \
1148 if [ -r $$f/Makefile ]; then \
ea18081d 1149 (cd $$f ; $(MAKE) info) || exit 1 ; \
484fa12d
JW
1150 else true ; fi ; \
1151 done
7f9cb3b2 1152 # Make links, and run "make diststuff" when needed.
a54e05f6
KR
1153 # The `echo' for setting `p' is to convert all whitespace to spaces.
1154 # Then the `case' further below should tell whether $$d is in
7f9cb3b2 1155 # DISTSTUFFDIRS.
a54e05f6 1156 rm -rf proto-toplev ; mkdir proto-toplev
7f9cb3b2
KR
1157 set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1158 p=" `echo $(DISTSTUFFDIRS)` " ; \
a54e05f6
KR
1159 for d in $$dirs ; do \
1160 if [ -d $$d ]; then \
7f9cb3b2
KR
1161 case " $$p " in \
1162 *" $$d "*) \
04103845 1163 (cd $$d ; $(MAKE) diststuff ) || exit 1 ;; \
a54e05f6 1164 esac ; \
7f9cb3b2
KR
1165 if [ -d $$d/proto-$$d.dir ]; then \
1166 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1167 else \
1168 ln -s ../$$d proto-toplev/$$d ; \
1169 fi ; \
a54e05f6 1170 else ln -s ../$$d proto-toplev/$$d ; fi ; \
40e16078 1171 done
5600fbd2 1172 $(MAKE) distclean
a54e05f6 1173 #
40e16078 1174 mkdir proto-toplev/etc
15408b3b
KR
1175 (cd proto-toplev/etc; \
1176 for i in $(ETC_SUPPORT); do \
40e16078 1177 ln -s ../../etc/$$i . ; \
15408b3b
KR
1178 done ; \
1179 for i in $(ETC_SUPPORT_PFX); do \
1180 ln -s ../../etc/$$i* . ; \
1181 done)
a54e05f6 1182 #
04103845 1183 # Take out texinfo from configurable dirs
40e16078
KR
1184 rm proto-toplev/configure.in
1185 sed -e '/^host_tools=/s/texinfo //' \
40e16078 1186 <configure.in >proto-toplev/configure.in
a54e05f6 1187 #
40e16078
KR
1188 mkdir proto-toplev/texinfo
1189 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
7f9cb3b2 1190 ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
484fa12d 1191 ln -s ../../texinfo/lgpl.texinfo proto-toplev/texinfo/
40e16078 1192 ln -s ../../texinfo/tex3patch proto-toplev/texinfo/
a561909f 1193 chmod og=u `find . -print`
7f9cb3b2 1194 (VER=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
1d2bb445 1195 echo "==> Making $(TOOL)-$$VER.tar.gz"; \
a59b94d2 1196 rm -f $(TOOL)-$$VER; ln -s proto-toplev $(TOOL)-$$VER; \
40e16078 1197 tar cfh - $(TOOL)-$$VER \
5cc73086 1198 | $(GZIPPROG) -v -9 >$(TOOL)-$$VER.tar.gz )
40e16078 1199
484fa12d 1200TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
7f9cb3b2 1201DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
40e16078 1202
96bfa612 1203.PHONY: gas.tar.gz
7f9cb3b2 1204GAS_SUPPORT_DIRS= bfd include libiberty opcodes
96bfa612 1205gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
484fa12d
JW
1206 $(MAKE) -f Makefile.in taz TOOL=gas \
1207 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
40e16078 1208
7f9cb3b2 1209# The FSF "binutils" release includes gprof and ld.
96bfa612 1210.PHONY: binutils.tar.gz
4be4b991 1211BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof
96bfa612 1212binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
484fa12d 1213 $(MAKE) -f Makefile.in taz TOOL=binutils \
2492f942 1214 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS) makeall.bat configure.bat"
7f9cb3b2 1215
96bfa612 1216.PHONY: gas+binutils.tar.gz
a54e05f6 1217GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
96bfa612 1218gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
484fa12d 1219 $(MAKE) -f Makefile.in taz TOOL=gas \
2492f942 1220 SUPPORT_FILES="$(GASB_SUPPORT_DIRS) makeall.bat configure.bat"
79337c85 1221
5600fbd2 1222.PHONY: libg++.tar.gz
ea6d5817 1223LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty xiberty
5600fbd2 1224libg++.tar.gz: $(DIST_SUPPORT) libg++
484fa12d
JW
1225 $(MAKE) -f Makefile.in taz TOOL=libg++ \
1226 SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
5600fbd2 1227
49dfa984
JM
1228GNATS_SUPPORT_DIRS=include libiberty send-pr
1229gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
a0bd8e18 1230 $(MAKE) -f Makefile.in taz TOOL=gnats \
49dfa984
JM
1231 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
1232
1d5fcc66 1233.PHONY: gdb.tar.gz
81597186 1234GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils
ca2ce3b3 1235GDBTK_SUPPORT_DIRS= `if [ -d tcl -a -d tk ] ; then echo tcl tk ; fi`
1d5fcc66
PB
1236gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1237 $(MAKE) -f Makefile.in taz TOOL=gdb \
ca2ce3b3 1238 SUPPORT_FILES="$(GDB_SUPPORT_DIRS) $(GDBTK_SUPPORT_DIRS)"
1d5fcc66 1239
7166a308 1240.PHONY: newlib.tar.gz
a220ba0f 1241NEWLIB_SUPPORT_DIRS=libgloss
04103845 1242# taz configures for the sun4 target which won't configure newlib.
a220ba0f
SC
1243# We need newlib configured so that the .info files are made.
1244# Unfortunately, it is not enough to just configure newlib separately:
1245# taz will build the .info files but since SUBDIRS won't contain newlib,
1246# distclean won't be run (leaving Makefile, config.status, and the tmp files
1247# used in building the .info files, eg: *.def, *.ref).
1248# Compensate here by configuring newlib for a simple (no multilib support)
1249# cross target (sparc64), building the info files, and doing make distclean
1250# ourselves.
7166a308 1251newlib.tar.gz: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
04103845
DE
1252 rootme=`pwd` ; \
1253 cd newlib && ../configure --srcdir $$rootme/newlib \
1254 --host sun4 --target sparc64-elf
a220ba0f
SC
1255 cd newlib ; make info
1256 cd newlib ; make distclean
7166a308
KR
1257 $(MAKE) -f Makefile.in taz TOOL=newlib \
1258 SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
1259 DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" \
1260 DISTDOCDIRS="$(DISTDOCDIRS) newlib"
1261
79337c85
ILT
1262.NOEXPORT:
1263MAKEOVERRIDES=
1264
1265# start-sanitize-chill
1266## This is ugly, but I don't want GNU make to put these variables in
1267## the environment. Older makes will see this as a set of targets
1268## with no dependencies and no actions.
1269unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
1270# end-sanitize-chill
1271
eb02fd64 1272# end of Makefile.in
This page took 0.237854 seconds and 4 git commands to generate.