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