Makefile.in revision 33965
1109313Sobrien#
2109313Sobrien# Makefile for directory with subdirs to build.
3109313Sobrien#   Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation
4109313Sobrien#
5109313Sobrien# This file is free software; you can redistribute it and/or modify
6109313Sobrien# it under the terms of the GNU General Public License as published by
7109313Sobrien# the Free Software Foundation; either version 2 of the License, or
8109313Sobrien# (at your option) any later version.
9109313Sobrien# 
10109313Sobrien# This program is distributed in the hope that it will be useful,
11109313Sobrien# but WITHOUT ANY WARRANTY; without even the implied warranty of
12109313Sobrien# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13109313Sobrien# GNU General Public License for more details.
14109313Sobrien# 
15109313Sobrien# You should have received a copy of the GNU General Public License
16109313Sobrien# along with this program; if not, write to the Free Software
17109313Sobrien# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18109313Sobrien#
19109313Sobrien
20109313Sobriensrcdir = .
21109313Sobrien
22109313Sobrienprefix = /usr/local
23109313Sobrien
24109313Sobrienexec_prefix = $(prefix)
25109313Sobrienbindir = $(exec_prefix)/bin
26109313Sobrienlibdir = $(exec_prefix)/lib
27109313Sobrientooldir = $(exec_prefix)/$(target)
28109313Sobrien
29109313Sobrienprogram_transform_name =
30109313Sobrien
31109313Sobriendatadir = $(prefix)/share
32109313Sobrienmandir = $(prefix)/man
33109313Sobrienman1dir = $(mandir)/man1
34109313Sobrienman2dir = $(mandir)/man2
35109313Sobrienman3dir = $(mandir)/man3
36109313Sobrienman4dir = $(mandir)/man4
37109313Sobrienman5dir = $(mandir)/man5
38109313Sobrienman6dir = $(mandir)/man6
39109313Sobrienman7dir = $(mandir)/man7
40109313Sobrienman8dir = $(mandir)/man8
41109313Sobrienman9dir = $(mandir)/man9
42109313Sobrieninfodir = $(prefix)/info
43109313Sobrienincludedir = $(prefix)/include
44109313SobrienGDB_NLM_DEPS = 
45109313Sobrien
46109313SobrienSHELL = /bin/sh
47109313Sobrien
48109313SobrienINSTALL = $$s/install.sh -c
49109313SobrienINSTALL_PROGRAM = $(INSTALL)
50109313SobrienINSTALL_DATA = $(INSTALL) -m 644
51109313SobrienINSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
52109313Sobrien
53109313SobrienINSTALL_DOSREL = install-dosrel-fake
54109313Sobrien
55109313SobrienAS = as
56109313SobrienAR = ar
57109313SobrienAR_FLAGS = rc
58109313SobrienCC = cc
59109313Sobrien
60109313Sobrien# Special variables passed down in EXTRA_GCC_FLAGS.  They are defined
61109313Sobrien# here so that they can be overridden by Makefile fragments.
62109313SobrienHOST_CC = $(CC_FOR_BUILD)
63109313SobrienHOST_PREFIX = 
64109313SobrienHOST_PREFIX_1 = loser-
65109313Sobrien
66109313Sobrien# We don't specify -g -O because many compilers don't support -g -O,
67109313Sobrien# and/or -O is broken in and of itself.
68109313SobrienCFLAGS = -g
69109313SobrienLIBCFLAGS = $(CFLAGS)
70109313SobrienCFLAGS_FOR_TARGET = $(CFLAGS)
71109313SobrienLDFLAGS_FOR_TARGET = 
72109313SobrienLIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
73109313SobrienPICFLAG = 
74109313SobrienPICFLAG_FOR_TARGET = 
75109313Sobrien
76109313SobrienCXX = gcc
77109313Sobrien
78109313Sobrien# Use -O2 to stress test the compiler.
79109313SobrienCXXFLAGS = -g -O2
80109313SobrienLIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
81109313SobrienCXXFLAGS_FOR_TARGET = $(CXXFLAGS)
82109313SobrienLIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
83109313Sobrien
84109313SobrienRANLIB = ranlib
85109313Sobrien
86109313SobrienDLLTOOL = dlltool
87109313Sobrien
88109313SobrienNM = nm
89109313Sobrien# Not plain GZIP, since gzip looks there for extra command-line options.
90109313SobrienGZIPPROG = gzip
91109313Sobrien
92109313Sobrien# These values are substituted by configure.
93109313SobrienDEFAULT_YACC = yacc
94109313SobrienDEFAULT_LEX = lex
95109313Sobrien
96109313SobrienBISON = bison -y
97109313SobrienLEX = `if [ -f $$r/flex/flex ] ; \
98109313Sobrien	then echo $$r/flex/flex ; \
99109313Sobrien	else echo ${DEFAULT_LEX} ; fi`
100109313Sobrien
101109313SobrienM4 = `if [ -f $$r/m4/m4 ] ; \
102109313Sobrien	then echo $$r/m4/m4 ; \
103109313Sobrien	else echo m4 ; fi`
104109313Sobrien
105109313SobrienMAKEINFO = `if [ -f $$r/texinfo/makeinfo/Makefile ] ; \
106109313Sobrien	then echo $$r/texinfo/makeinfo/makeinfo ; \
107109313Sobrien	else echo makeinfo ; fi`
108109313Sobrien
109109313Sobrien# This just becomes part of the MAKEINFO definition passed down to
110109313Sobrien# sub-makes.  It lets flags be given on the command line while still
111109313Sobrien# using the makeinfo from the object tree.
112109313SobrienMAKEINFOFLAGS =
113109313Sobrien
114109313SobrienEXPECT = `if [ -f $$r/expect/expect ] ; \
115109313Sobrien	then echo $$r/expect/expect ; \
116109313Sobrien	else echo expect ; fi`
117109313Sobrien
118109313SobrienRUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \
119109313Sobrien	then echo $$s/dejagnu/runtest ; \
120109313Sobrien	else echo runtest ; fi`
121109313Sobrien
122109313Sobrien
123109313Sobrien# compilers to use to create programs which must be run in the build
124109313Sobrien# environment.
125109313SobrienCC_FOR_BUILD = $(CC)
126109313SobrienCXX_FOR_BUILD = $(CXX)
127109313Sobrien
128109313SobrienSUBDIRS = "this is set via configure, don't edit this"
129109313SobrienOTHERS = 
130109313Sobrien
131109313Sobrien# This is set by the configure script to the list of directories which
132109313Sobrien# should be built using the target tools.
133109313SobrienTARGET_CONFIGDIRS = libiberty libgloss newlib libio librx libstdc++ libg++ winsup
134109313Sobrien
135109313Sobrien# Target libraries are put under this directory:
136109313Sobrien# Changed by configure to $(target_alias) if cross.
137109313SobrienTARGET_SUBDIR = .
138109313Sobrien
139109313Sobrien# This is set by the configure script to the arguments passed to configure.
140109313SobrienCONFIG_ARGUMENTS = 
141109313Sobrien
142109313Sobrien# This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
143109313Sobrien# was used.
144109313SobrienSET_LIB_PATH =
145109313Sobrien
146109313Sobrien# This is the name of the environment variable used for the path to
147109313Sobrien# the libraries.  This may be changed by configure.in.
148109313SobrienRPATH_ENVVAR = LD_LIBRARY_PATH
149109313Sobrien
150109313Sobrien# configure.in sets SET_LIB_PATH to this if --enable-shared was used.
151109313SobrienREALLY_SET_LIB_PATH = \
152109313Sobrien  $(RPATH_ENVVAR)=$$r/bfd:$$r/opcodes:$$$(RPATH_ENVVAR); \
153109313Sobrien  export $(RPATH_ENVVAR);
154109313Sobrien
155109313SobrienALL = all.normal
156109313SobrienINSTALL_TARGET = install-dirs \
157109313Sobrien	$(INSTALL_MODULES) \
158109313Sobrien	$(INSTALL_TARGET_MODULES) \
159109313Sobrien	$(INSTALL_X11_MODULES) \
160109313Sobrien	install-gcc \
161109313Sobrien	$(INSTALL_DOSREL)
162109313Sobrien
163109313Sobrien
164109313SobrienCC_FOR_TARGET = ` \
165109332Sobrien  if [ -f $$r/gcc/xgcc ] ; then \
166109332Sobrien    if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
167109332Sobrien      if [ -f $$r/$(TARGET_SUBDIR)/winsup/Makefile ] ; then \
168109332Sobrien        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; \
169109332Sobrien      else \
170109332Sobrien        echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
171109332Sobrien      fi; \
172109332Sobrien    else \
173109332Sobrien      echo $$r/gcc/xgcc -B$$r/gcc/; \
174109332Sobrien    fi; \
175109332Sobrien  else \
176109332Sobrien    if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
177109332Sobrien      echo $(CC); \
178109332Sobrien    else \
179109332Sobrien      t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
180109332Sobrien    fi; \
181109332Sobrien  fi`
182109332Sobrien
183109332Sobrien# If CC_FOR_TARGET is not overriden on the command line, then this
184109332Sobrien# variable is passed down to the gcc Makefile, where it is used to
185109332Sobrien# build libgcc2.a.  We define it here so that it can itself be
186109332Sobrien# overridden on the command line.
187109332SobrienGCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/
188109332Sobrien
189109332Sobrien
190109332SobrienCXX_FOR_TARGET = ` \
191109332Sobrien  if [ -f $$r/gcc/xgcc ] ; then \
192109332Sobrien    if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
193109332Sobrien      if [ -f $$r/$(TARGET_SUBDIR)/winsup/Makefile ] ; then \
194109332Sobrien        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; \
195109332Sobrien      else \
196109332Sobrien        echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
197109332Sobrien      fi; \
198109332Sobrien    else \
199109332Sobrien      echo $$r/gcc/xgcc -B$$r/gcc/; \
200109332Sobrien    fi; \
201109332Sobrien  else \
202109332Sobrien    if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
203109332Sobrien      echo $(CXX); \
204109332Sobrien    else \
205109332Sobrien      t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
206109332Sobrien    fi; \
207109332Sobrien  fi`
208109332Sobrien
209109332SobrienAS_FOR_TARGET = ` \
210109332Sobrien  if [ -f $$r/gas/as.new ] ; then \
211109332Sobrien    echo $$r/gas/as.new ; \
212109332Sobrien  else \
213109332Sobrien    if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
214109332Sobrien      echo $(AS); \
215109332Sobrien    else \
216109332Sobrien       t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \
217109332Sobrien    fi; \
218109332Sobrien  fi`
219109332Sobrien
220109332SobrienLD_FOR_TARGET = ` \
221109332Sobrien  if [ -f $$r/ld/ld.new ] ; then \
222109332Sobrien    echo $$r/ld/ld.new ; \
223109332Sobrien  else \
224109332Sobrien    if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
225109332Sobrien      echo $(LD); \
226109332Sobrien    else \
227109332Sobrien       t='$(program_transform_name)'; echo ld | sed -e 's/x/x/' $$t ; \
228109332Sobrien    fi; \
229109332Sobrien  fi`
230109332Sobrien
231109332SobrienDLLTOOL_FOR_TARGET = ` \
232109457Smarcel  if [ -f $$r/binutils/dlltool ] ; then \
233109332Sobrien    echo $$r/binutils/dlltool ; \
234109332Sobrien  else \
235109332Sobrien    if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
236109332Sobrien      echo $(DLLTOOL); \
237109332Sobrien    else \
238109313Sobrien       t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \
239109313Sobrien    fi; \
240109457Smarcel  fi`
241109457Smarcel
242109457SmarcelAR_FOR_TARGET = ` \
243109457Smarcel  if [ -f $$r/binutils/ar ] ; then \
244109457Smarcel    echo $$r/binutils/ar ; \
245109457Smarcel  else \
246109457Smarcel    if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
247109457Smarcel      echo $(AR); \
248109457Smarcel    else \
249109457Smarcel       t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \
250109457Smarcel    fi; \
251109457Smarcel  fi`
252109457Smarcel
253109457SmarcelRANLIB_FOR_TARGET = ` \
254109457Smarcel  if [ -f $$r/binutils/ranlib ] ; then \
255109457Smarcel    echo $$r/binutils/ranlib ; \
256109313Sobrien  else \
257109313Sobrien    if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
258109313Sobrien      echo $(RANLIB); \
259109313Sobrien    else \
260109313Sobrien       t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \
261109313Sobrien    fi; \
262109313Sobrien  fi`
263109313Sobrien
264109313SobrienNM_FOR_TARGET = ` \
265109313Sobrien  if [ -f $$r/binutils/nm.new ] ; then \
266109313Sobrien    echo $$r/binutils/nm.new ; \
267109313Sobrien  else \
268109313Sobrien    if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
269109313Sobrien      echo $(NM); \
270109313Sobrien    else \
271109313Sobrien       t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \
272109313Sobrien    fi; \
273109313Sobrien  fi`
274109313Sobrien
275109313Sobrien#### host and target specific makefile fragments come in here.
276109313Sobrien###
277109313Sobrien
278109313Sobrien# Flags to pass down to all sub-makes.
279109313Sobrien# Please keep these in alphabetical order.
280109313SobrienBASE_FLAGS_TO_PASS = \
281109313Sobrien	"AR_FLAGS=$(AR_FLAGS)" \
282109313Sobrien	"AR_FOR_TARGET=$(AR_FOR_TARGET)" \
283109313Sobrien	"AS_FOR_TARGET=$(AS_FOR_TARGET)" \
284109313Sobrien	"BISON=$(BISON)" \
285109313Sobrien	"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
286109313Sobrien	"CC_FOR_TARGET=$(CC_FOR_TARGET)" \
287109313Sobrien	"CFLAGS=$(CFLAGS)" \
288109313Sobrien	"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
289109313Sobrien	"CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
290109313Sobrien	"CXXFLAGS=$(CXXFLAGS)" \
291109329Sobrien	"CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
292109332Sobrien	"CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
293109332Sobrien	"DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
294109329Sobrien	"INSTALL=$(INSTALL)" \
295109329Sobrien	"INSTALL_DATA=$(INSTALL_DATA)" \
296109329Sobrien	"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
297109329Sobrien	"INSTALL_XFORM=$(INSTALL_XFORM)" \
298109329Sobrien	"LDFLAGS=$(LDFLAGS)" \
299109329Sobrien	"LEX=$(LEX)" \
300109329Sobrien	"LD_FOR_TARGET=$(LD_FOR_TARGET)" \
301109329Sobrien	"LIBCFLAGS=$(LIBCFLAGS)" \
302109329Sobrien	"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
303109329Sobrien	"LIBCXXFLAGS=$(LIBCXXFLAGS)" \
304109329Sobrien	"LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
305109329Sobrien	"M4=$(M4)" \
306109329Sobrien	"MAKE=$(MAKE)" \
307109329Sobrien	"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
308109329Sobrien	"NM_FOR_TARGET=$(NM_FOR_TARGET)" \
309109329Sobrien	"PICFLAG=$(PICFLAG)" \
310109329Sobrien	"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
311109329Sobrien	"RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
312109332Sobrien	"SHELL=$(SHELL)" \
313109329Sobrien	"EXPECT=$(EXPECT)" \
314109329Sobrien	"RUNTEST=$(RUNTEST)" \
315109329Sobrien	"RUNTESTFLAGS=$(RUNTESTFLAGS)" \
316109329Sobrien	"YACC=$(BISON)" \
317109329Sobrien	"exec_prefix=$(exec_prefix)" \
318109329Sobrien	"prefix=$(prefix)" \
319109332Sobrien	"tooldir=$(tooldir)" 
320109457Smarcel
321109457Smarcel# Flags to pass down to most sub-makes, in which we're building with
322109329Sobrien# the host environment.
323109329Sobrien# If any variables are added here, they must be added to do-*, below.
324109332SobrienEXTRA_HOST_FLAGS = \
325109329Sobrien	'AR=$(AR)' \
326109329Sobrien	'AS=$(AS)' \
327109313Sobrien	'CC=$(CC)' \
328109313Sobrien	'CXX=$(CXX)' \
329109313Sobrien	'DLLTOOL=$(DLLTOOL)' \
330109313Sobrien	'NM=$(NM)' \
331109313Sobrien	'RANLIB=$(RANLIB)' 
332109313Sobrien
333109313Sobrien
334109313SobrienFLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
335109313Sobrien
336109313Sobrien# Flags that are concerned with the location of the X11 include files
337109313Sobrien# and library files
338109313Sobrien#
339109313Sobrien# NOTE: until the top-level is getting the values via autoconf, it only
340109313Sobrien# causes problems to have this top-level Makefile overriding the autoconf-set
341109313Sobrien# values in child directories.  Only variables that don't conflict with
342109313Sobrien# autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now.
343109313Sobrien#
344109313SobrienX11_FLAGS_TO_PASS = \
345109313Sobrien	'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
346109313Sobrien	'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
347109313Sobrien
348109313Sobrien# Flags to pass down to makes which are built with the target environment.
349109313Sobrien# The double $ decreases the length of the command line; the variables
350109313Sobrien# are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
351109313Sobrien# If any variables are added here, they must be added to do-*, below.
352109313SobrienEXTRA_TARGET_FLAGS = \
353109313Sobrien	'AR=$$(AR_FOR_TARGET)' \
354109313Sobrien	'AS=$$(AS_FOR_TARGET)' \
355109313Sobrien	'CC=$$(CC_FOR_TARGET)' \
356109313Sobrien	'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
357109313Sobrien	'CXX=$$(CXX_FOR_TARGET)' \
358109313Sobrien	'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
359109313Sobrien	'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
360109313Sobrien	'LD=$$(LD_FOR_TARGET)' \
361109313Sobrien	'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
362109313Sobrien	'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
363109313Sobrien	'NM=$$(NM_FOR_TARGET)' \
364109313Sobrien	'PICFLAG=$$(PICFLAG_FOR_TARGET)' \
365109313Sobrien	'RANLIB=$$(RANLIB_FOR_TARGET)'
366109313Sobrien
367109313SobrienTARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
368109313Sobrien
369109313Sobrien# Flags to pass down to gcc.  gcc builds a library, libgcc.a, so it
370109313Sobrien# unfortunately needs the native compiler and the target ar and
371109313Sobrien# ranlib.
372109313Sobrien# If any variables are added here, they must be added to do-*, below.
373109313Sobrien# The HOST_* variables are a special case, which are used for the gcc
374109313Sobrien# cross-building scheme.
375109313SobrienEXTRA_GCC_FLAGS = \
376109313Sobrien	'AR=$$(AR_FOR_TARGET)' \
377109313Sobrien	'AS=$(AS)' \
378109313Sobrien	'CC=$(CC)' \
379109313Sobrien	'CXX=$(CXX)' \
380109313Sobrien	'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
381109313Sobrien	'HOST_CC=$(CC_FOR_BUILD)' \
382109313Sobrien	'HOST_PREFIX=$(HOST_PREFIX)' \
383109313Sobrien	'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
384109313Sobrien	'NM=$(NM)' \
385109313Sobrien	'RANLIB=$$(RANLIB_FOR_TARGET)' \
386109313Sobrien	"GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
387109313Sobrien	`if test x"$(LANGUAGES)" != x; then echo "LANGUAGES=$(LANGUAGES)"; fi` \
388109313Sobrien	`if test x"$(STMP_FIXPROTO)" != x; then echo "STMP_FIXPROTO=$(STMP_FIXPROTO)"; fi` \
389109313Sobrien	`if test x"$(LIMITS_H_TEST)" != x; then echo "LIMITS_H_TEST=$(LIMITS_H_TEST)"; fi` \
390109313Sobrien	`if test x"$(LIBGCC1_TEST)" != x; then echo "LIBGCC1_TEST=$(LIBGCC1_TEST)"; fi` \
391109313Sobrien	`if test x"$(LIBGCC2_CFLAGS)" != x; then echo "LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)"; fi` \
392109313Sobrien	`if test x"$(LIBGCC2_DEBUG_CFLAGS)" != x; then echo "LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)"; fi` \
393109313Sobrien	`if test x"$(LIBGCC2_INCLUDES)" != x; then echo "LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)"; fi` \
394109313Sobrien	`if test x"$(ENQUIRE)" != x; then echo "ENQUIRE=$(ENQUIRE)"; fi` \
395109313Sobrien	`if test x"$(BOOT_CFLAGS)" != x; then echo "BOOT_CFLAGS=$(BOOT_CFLAGS)"; fi`
396109313Sobrien
397109313SobrienGCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
398109313Sobrien
399109313Sobrien# This is a list of the targets for all of the modules which are compiled
400109313Sobrien# using $(FLAGS_TO_PASS).
401109313SobrienALL_MODULES = \
402109313Sobrien	all-apache \
403109313Sobrien	all-autoconf \
404109313Sobrien	all-bash \
405109313Sobrien	all-bfd \
406109313Sobrien	all-binutils \
407109313Sobrien	all-byacc \
408109313Sobrien	all-cvs \
409109313Sobrien	all-db \
410109313Sobrien	all-dejagnu \
411109313Sobrien	all-diff \
412109313Sobrien	all-dosutils \
413109313Sobrien	all-etc \
414109313Sobrien	all-fileutils \
415109313Sobrien	all-findutils \
416109313Sobrien	all-find \
417109313Sobrien	all-flex \
418109313Sobrien	all-gas \
419109313Sobrien	all-gawk \
420109313Sobrien	all-gprof \
421109313Sobrien	all-grep \
422109313Sobrien	all-grez \
423109313Sobrien	all-gzip \
424109313Sobrien	all-hello \
425109313Sobrien	all-indent \
426109313Sobrien	all-inet \
427109313Sobrien	all-ispell \
428109313Sobrien	all-itcl \
429109313Sobrien	all-ld \
430109313Sobrien	all-libiberty \
431109313Sobrien	all-m4 \
432109313Sobrien	all-make \
433109313Sobrien	all-mmalloc \
434109313Sobrien	all-opcodes \
435109313Sobrien	all-patch \
436109313Sobrien	all-perl \
437109313Sobrien	all-prms \
438109313Sobrien	all-rcs \
439109313Sobrien	all-readline \
440109313Sobrien	all-release \
441109313Sobrien	all-recode \
442109313Sobrien	all-sed \
443109313Sobrien	all-send-pr \
444109313Sobrien	all-shellutils \
445109313Sobrien	all-sim \
446109313Sobrien	all-sn \
447109313Sobrien	all-tar \
448109313Sobrien	all-tcl \
449109313Sobrien	all-texinfo \
450109313Sobrien	all-textutils \
451109313Sobrien	all-tgas \
452109313Sobrien	all-time \
453109313Sobrien	all-uudecode \
454109313Sobrien	all-wdiff 
455109313Sobrien
456109313Sobrien# This is a list of the check targets for all of the modules which are
457109313Sobrien# compiled using $(FLAGS_TO_PASS).
458109313Sobrien#
459109313Sobrien# The list is in two parts.  The first lists those tools which
460109313Sobrien# are tested as part of the host's native tool-chain, and not
461109313Sobrien# tested in a cross configuration.
462109313SobrienNATIVE_CHECK_MODULES = \
463109313Sobrien	check-byacc \
464109313Sobrien	check-flex
465109313Sobrien
466109313SobrienCROSS_CHECK_MODULES = \
467109313Sobrien	check-apache \
468109313Sobrien	check-autoconf \
469109313Sobrien	check-bash \
470109313Sobrien	check-bfd \
471109313Sobrien	check-binutils \
472109313Sobrien	check-cvs \
473109313Sobrien	check-db \
474109313Sobrien	check-dejagnu \
475109313Sobrien	check-diff \
476109313Sobrien	check-etc \
477109313Sobrien	check-fileutils \
478109313Sobrien	check-findutils \
479109313Sobrien	check-find \
480109313Sobrien	check-gas \
481109313Sobrien	check-gawk \
482109313Sobrien	check-gprof \
483109313Sobrien	check-grep \
484109313Sobrien	check-gzip \
485109313Sobrien	check-hello \
486109313Sobrien	check-indent \
487109313Sobrien	check-inet \
488109313Sobrien	check-ispell \
489109313Sobrien	check-itcl \
490109313Sobrien	check-ld \
491109313Sobrien	check-libiberty \
492109313Sobrien	check-m4 \
493109313Sobrien	check-make \
494109313Sobrien	check-mmcheckoc \
495109313Sobrien	check-opcodes \
496109313Sobrien	check-patch \
497109313Sobrien	check-perl \
498109313Sobrien	check-prms \
499109313Sobrien	check-rcs \
500109313Sobrien	check-readline \
501109313Sobrien	check-recode \
502109313Sobrien	check-sed \
503109313Sobrien	check-send-pr \
504109313Sobrien	check-shellutils \
505109313Sobrien	check-sn \
506109313Sobrien	check-sim \
507109313Sobrien	check-tar \
508109313Sobrien	check-tcl \
509109313Sobrien	check-texinfo \
510109313Sobrien	check-textutils \
511109313Sobrien	check-tgas \
512109313Sobrien	check-time \
513109313Sobrien	check-uudecode \
514109313Sobrien	check-wdiff
515109313Sobrien
516109313SobrienCHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
517109313Sobrien
518109313Sobrien# This is a list of the install targets for all of the modules which are
519109313Sobrien# compiled using $(FLAGS_TO_PASS).
520109313Sobrien# We put install-opcodes before install-binutils because the installed
521109313Sobrien# binutils might be on PATH, and they might need the shared opcodes
522109313Sobrien# library.
523109313SobrienINSTALL_MODULES = \
524109313Sobrien	install-apache \
525109313Sobrien	install-autoconf \
526109313Sobrien	install-bash \
527109313Sobrien	install-bfd \
528109313Sobrien	install-opcodes \
529109313Sobrien	install-binutils \
530109313Sobrien	install-byacc \
531109313Sobrien	install-cvs \
532109313Sobrien	install-db \
533109313Sobrien	install-dejagnu \
534109313Sobrien	install-diff \
535109313Sobrien	install-dosutils \
536109313Sobrien	install-etc \
537109313Sobrien	install-fileutils \
538109313Sobrien	install-findutils \
539109313Sobrien	install-find \
540109313Sobrien	install-flex \
541109313Sobrien	install-gas \
542109313Sobrien	install-gawk \
543109313Sobrien	install-gprof \
544109313Sobrien	install-grep \
545109313Sobrien	install-grez \
546109313Sobrien	install-gzip \
547109313Sobrien	install-hello \
548109313Sobrien	install-indent \
549109313Sobrien	install-inet \
550109313Sobrien	install-ispell \
551109313Sobrien	install-itcl \
552109313Sobrien	install-ld \
553109313Sobrien	install-libiberty \
554109313Sobrien	install-m4 \
555109313Sobrien	install-make \
556109313Sobrien	install-mmalloc \
557109313Sobrien	install-patch \
558109313Sobrien	install-perl \
559109313Sobrien	install-prms \
560109313Sobrien	install-rcs \
561109313Sobrien	install-readline \
562109313Sobrien	install-recode \
563109313Sobrien	install-sed \
564109313Sobrien	install-send-pr \
565109313Sobrien	install-shellutils \
566109313Sobrien	install-sim \
567109313Sobrien	install-sn \
568109313Sobrien	install-tar \
569109313Sobrien	install-tcl \
570109313Sobrien	install-textutils \
571109313Sobrien	install-tgas \
572109313Sobrien	install-time \
573109313Sobrien	install-uudecode \
574109313Sobrien	install-wdiff
575109313Sobrien
576109313Sobrien# This is a list of the targets for all of the modules which are compiled
577109313Sobrien# using $(X11_FLAGS_TO_PASS).
578109313SobrienALL_X11_MODULES = \
579109313Sobrien	all-emacs \
580109313Sobrien	all-emacs19 \
581109313Sobrien	all-gdb \
582109457Smarcel	all-expect \
583109313Sobrien	all-gash \
584109313Sobrien	all-guile \
585109313Sobrien	all-tclX \
586109313Sobrien	all-tk
587109313Sobrien
588109313Sobrien# This is a list of the check targets for all of the modules which are
589109313Sobrien# compiled using $(X11_FLAGS_TO_PASS).
590109313SobrienCHECK_X11_MODULES = \
591109313Sobrien	check-emacs \
592109313Sobrien	check-gdb \
593109313Sobrien	check-guile \
594109313Sobrien	check-expect \
595109313Sobrien	check-gash \
596109313Sobrien	check-tclX
597109313Sobrien
598109313Sobrien# This is a list of the install targets for all the modules which are
599109313Sobrien# compiled using $(X11_FLAGS_TO_PASS).
600109313SobrienINSTALL_X11_MODULES = \
601109313Sobrien	install-emacs \
602109313Sobrien	install-emacs19 \
603109313Sobrien	install-gdb \
604109313Sobrien	install-guile \
605109313Sobrien	install-expect \
606109313Sobrien	install-gash \
607109313Sobrien	install-tclX \
608109313Sobrien	install-tk
609109313Sobrien
610109313Sobrien# This is a list of the targets for all of the modules which are compiled
611109313Sobrien# using $(TARGET_FLAGS_TO_PASS).
612109313SobrienALL_TARGET_MODULES = \
613109313Sobrien	all-target-libio \
614109313Sobrien	all-target-libstdc++ \
615109313Sobrien	all-target-librx \
616109313Sobrien	all-target-libg++ \
617109313Sobrien	all-target-newlib \
618109313Sobrien	all-target-winsup \
619109313Sobrien	all-target-libgloss \
620109313Sobrien	all-target-libiberty \
621109313Sobrien	all-target-examples
622109313Sobrien
623109313Sobrien# This is a list of the configure targets for all of the modules which
624109313Sobrien# are compiled using the target tools.
625109313SobrienCONFIGURE_TARGET_MODULES = \
626109313Sobrien	configure-target-libio \
627109313Sobrien	configure-target-libstdc++ \
628109313Sobrien	configure-target-librx \
629109313Sobrien	configure-target-libg++ \
630109313Sobrien	configure-target-newlib \
631109313Sobrien	configure-target-winsup \
632109313Sobrien	configure-target-libgloss \
633109313Sobrien	configure-target-libiberty \
634109313Sobrien	configure-target-examples
635109313Sobrien
636109313Sobrien# This is a list of the check targets for all of the modules which are
637109313Sobrien# compiled using $(TARGET_FLAGS_TO_PASS).
638109313SobrienCHECK_TARGET_MODULES = \
639109313Sobrien	check-target-libio \
640109313Sobrien	check-target-libstdc++ \
641109313Sobrien	check-target-libg++ \
642109313Sobrien	check-target-newlib \
643109313Sobrien	check-target-winsup \
644109313Sobrien	check-target-libiberty
645109313Sobrien
646109313Sobrien# This is a list of the install targets for all of the modules which are
647109313Sobrien# compiled using $(TARGET_FLAGS_TO_PASS).
648109313SobrienINSTALL_TARGET_MODULES = \
649109313Sobrien	install-target-libio \
650109313Sobrien	install-target-libstdc++ \
651109313Sobrien	install-target-libg++ \
652109313Sobrien	install-target-newlib \
653109313Sobrien	install-target-winsup \
654109313Sobrien	install-target-libgloss \
655109313Sobrien	install-target-libiberty
656109313Sobrien
657109313Sobrien# This is a list of the targets for which we can do a clean-{target}.
658109313SobrienCLEAN_MODULES = \
659109313Sobrien	clean-apache \
660109313Sobrien	clean-autoconf \
661109313Sobrien	clean-bash \
662109313Sobrien	clean-bfd \
663109313Sobrien	clean-binutils \
664109313Sobrien	clean-byacc \
665109313Sobrien	clean-cvs \
666109313Sobrien	clean-db \
667109313Sobrien	clean-dejagnu \
668109313Sobrien	clean-diff \
669109313Sobrien	clean-dosutils \
670109313Sobrien	clean-etc \
671109313Sobrien	clean-fileutils \
672109313Sobrien	clean-findutils \
673109313Sobrien	clean-find \
674109329Sobrien	clean-flex \
675109313Sobrien	clean-gas \
676109313Sobrien	clean-gawk \
677109313Sobrien	clean-gprof \
678109313Sobrien	clean-grep \
679109313Sobrien	clean-grez \
680109313Sobrien	clean-gzip \
681109313Sobrien	clean-hello \
682109313Sobrien	clean-indent \
683109313Sobrien	clean-inet \
684109313Sobrien	clean-ispell \
685109313Sobrien	clean-itcl \
686109313Sobrien	clean-ld \
687109313Sobrien	clean-libiberty \
688109313Sobrien	clean-m4 \
689109313Sobrien	clean-make \
690109313Sobrien	clean-mmalloc \
691109313Sobrien	clean-opcodes \
692109313Sobrien	clean-patch \
693109313Sobrien	clean-perl \
694109313Sobrien	clean-prms \
695109313Sobrien	clean-rcs \
696109313Sobrien	clean-readline \
697109313Sobrien	clean-release \
698109313Sobrien	clean-recode \
699109313Sobrien	clean-sed \
700109313Sobrien	clean-send-pr \
701109313Sobrien	clean-shellutils \
702109313Sobrien	clean-sim \
703109313Sobrien	clean-sn \
704109313Sobrien	clean-tar \
705109313Sobrien	clean-tcl \
706109313Sobrien	clean-texinfo \
707109313Sobrien	clean-textutils \
708109313Sobrien	clean-tgas \
709109313Sobrien	clean-time \
710109313Sobrien	clean-uudecode \
711109313Sobrien	clean-wdiff
712109313Sobrien
713109313Sobrien# All of the target modules that can be cleaned
714109313SobrienCLEAN_TARGET_MODULES = \
715109313Sobrien	clean-target-libio \
716109313Sobrien	clean-target-libstdc++ \
717109313Sobrien	clean-target-librx \
718109313Sobrien	clean-target-libg++ \
719109313Sobrien	clean-target-newlib \
720109313Sobrien	clean-target-winsup \
721109313Sobrien	clean-target-libgloss \
722109313Sobrien	clean-target-libiberty \
723109313Sobrien	clean-target-examples
724109313Sobrien
725109313Sobrien# All of the x11 modules that can be cleaned
726109313SobrienCLEAN_X11_MODULES = \
727109313Sobrien	clean-emacs \
728109313Sobrien	clean-emacs19 \
729109313Sobrien	clean-gdb \
730109313Sobrien	clean-expect \
731109313Sobrien	clean-gash \
732109313Sobrien	clean-guile \
733109313Sobrien	clean-tclX \
734109313Sobrien	clean-tk
735109313Sobrien
736109313Sobrien# The first rule in the file had better be this one.  Don't put any above it.
737109313Sobrienall: all.normal
738109313Sobrien.PHONY: all
739109313Sobrien
740109313Sobrien# The target built for a native build.
741109313Sobrien.PHONY: all.normal
742109313Sobrienall.normal: \
743109313Sobrien	$(ALL_MODULES) \
744109313Sobrien	$(ALL_TARGET_MODULES) \
745109313Sobrien	$(ALL_X11_MODULES) \
746109313Sobrien	all-gcc
747109313Sobrien
748109332Sobrien# Do a target for all the subdirectories.  A ``make do-X'' will do a
749109313Sobrien# ``make X'' in all subdirectories (because, in general, there is a
750109313Sobrien# dependency (below) of X upon do-X, a ``make X'' will also do this,
751109313Sobrien# but it may do additional work as well).
752109313Sobrien# This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
753109313Sobrien# because it is so large that it can easily overflow the command line
754109313Sobrien# length limit on some systems.
755109313SobrienDO_X = \
756109313Sobrien	do-clean \
757109313Sobrien	do-distclean \
758109313Sobrien	do-dvi \
759109313Sobrien	do-info \
760109313Sobrien	do-install-info \
761109313Sobrien	do-installcheck \
762109313Sobrien	do-mostlyclean \
763109313Sobrien	do-maintainer-clean \
764109313Sobrien	do-TAGS
765109313Sobrien.PHONY: $(DO_X)
766109313Sobrien$(DO_X):
767109313Sobrien	@target=`echo $@ | sed -e 's/^do-//'`; \
768109313Sobrien	r=`pwd`; export r; \
769109313Sobrien	s=`cd $(srcdir); pwd`; export s; \
770109313Sobrien	$(SET_LIB_PATH) \
771109313Sobrien	for i in $(SUBDIRS) -dummy-; do \
772109313Sobrien	  if [ -f ./$$i/Makefile ]; then \
773109313Sobrien	    case $$i in \
774109313Sobrien	    gcc) \
775109313Sobrien	      for flag in $(EXTRA_GCC_FLAGS); do \
776109313Sobrien		eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
777109313Sobrien	      done; \
778109313Sobrien	      ;; \
779109313Sobrien	    *) \
780109313Sobrien	      for flag in $(EXTRA_HOST_FLAGS); do \
781109313Sobrien		eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
782109313Sobrien	      done; \
783109313Sobrien	      ;; \
784109313Sobrien	    esac ; \
785109313Sobrien	    export AR AS CC CXX NM RANLIB DLLTOOL; \
786109313Sobrien	    if (cd ./$$i; \
787109313Sobrien	        $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
788109313Sobrien			"CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
789109313Sobrien			"RANLIB=$${RANLIB}" \
790109313Sobrien			"DLLTOOL=$${DLLTOOL}" \
791109313Sobrien			$${target}); \
792109313Sobrien	    then true; else exit 1; fi; \
793109313Sobrien	  else true; fi; \
794109313Sobrien	done
795109313Sobrien	@target=`echo $@ | sed -e 's/^do-//'`; \
796109313Sobrien	r=`pwd`; export r; \
797109313Sobrien	s=`cd $(srcdir); pwd`; export s; \
798109313Sobrien	$(SET_LIB_PATH) \
799109313Sobrien	for i in $(TARGET_CONFIGDIRS) -dummy-; do \
800109313Sobrien	  if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \
801109313Sobrien	    for flag in $(EXTRA_TARGET_FLAGS); do \
802109313Sobrien		eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
803109313Sobrien	    done; \
804109313Sobrien	    export AR AS CC CXX NM RANLIB DLLTOOL; \
805109313Sobrien	    if (cd $(TARGET_SUBDIR)/$$i; \
806109313Sobrien	        $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
807109313Sobrien			"CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
808109313Sobrien			"RANLIB=$${RANLIB}" \
809109313Sobrien			"DLLTOOL=$${DLLTOOL}" \
810109313Sobrien			$${target}); \
811109313Sobrien	    then true; else exit 1; fi; \
812109313Sobrien	  else true; fi; \
813109313Sobrien	done
814109313Sobrien
815109313Sobrien# Here are the targets which correspond to the do-X targets.
816109313Sobrien
817109313Sobrien.PHONY: info installcheck dvi install-info
818109313Sobrien.PHONY: clean distclean mostlyclean maintainer-clean realclean
819109313Sobrien.PHONY: local-clean local-distclean local-maintainer-clean
820109313Sobrieninfo: do-info
821109313Sobrieninstallcheck: do-installcheck
822109313Sobriendvi: do-dvi
823109313Sobrien
824109313Sobrien# Make sure makeinfo is built before we do a `make info'.
825109313Sobriendo-info: all-texinfo
826109313Sobrien
827109313Sobrieninstall-info: do-install-info dir.info
828109313Sobrien	s=`cd $(srcdir); pwd`; export s; \
829109313Sobrien	if [ -f dir.info ] ; then \
830109313Sobrien	  $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
831109313Sobrien	else true ; fi
832109313Sobrien
833109313Sobrienlocal-clean:
834109313Sobrien	-rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
835109313Sobrien
836109313Sobrienlocal-distclean:
837109313Sobrien	-rm -f Makefile config.status config.cache
838109313Sobrien	-if [ "$(TARGET_SUBDIR)" != "." ]; then \
839109313Sobrien	  rm -rf $(TARGET_SUBDIR); \
840109313Sobrien	else true; fi
841109313Sobrien
842109313Sobrienlocal-maintainer-clean:
843109313Sobrien	@echo "This command is intended for maintainers to use;"
844109313Sobrien	@echo "it deletes files that may require special tools to rebuild."
845109313Sobrien
846109313Sobrienclean: do-clean local-clean
847109313Sobrienmostlyclean: do-mostlyclean local-clean
848109313Sobriendistclean: do-distclean local-clean local-distclean
849109313Sobrienmaintainer-clean: local-maintainer-clean do-maintainer-clean local-clean 
850109313Sobrienmaintainer-clean: local-distclean
851109313Sobrienrealclean: maintainer-clean
852109313Sobrien
853109313Sobrien# This rule is used to clean specific modules.
854109313Sobrien.PHONY: $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc
855109313Sobrien$(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc:
856109313Sobrien	@dir=`echo $@ | sed -e 's/clean-//'`; \
857109313Sobrien	if [ -f ./$${dir}/Makefile ] ; then \
858109313Sobrien	  r=`pwd`; export r; \
859109313Sobrien	  s=`cd $(srcdir); pwd`; export s; \
860109313Sobrien	  $(SET_LIB_PATH) \
861109313Sobrien	  (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) clean); \
862109313Sobrien	else \
863109313Sobrien	  true; \
864109313Sobrien	fi
865109313Sobrien
866109313Sobrien.PHONY: $(CLEAN_TARGET_MODULES)
867109313Sobrien$(CLEAN_TARGET_MODULES):
868109313Sobrien	@dir=`echo $@ | sed -e 's/clean-target-//'`; \
869109313Sobrien	rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
870109313Sobrien	if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
871109313Sobrien	  r=`pwd`; export r; \
872109313Sobrien	  s=`cd $(srcdir); pwd`; export s; \
873109313Sobrien	  $(SET_LIB_PATH) \
874109313Sobrien	  (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) clean); \
875109313Sobrien	else \
876109313Sobrien	  true; \
877109313Sobrien	fi
878109313Sobrien
879109313Sobrienclean-target: $(CLEAN_TARGET_MODULES)
880109313Sobrien
881109313Sobrien# Check target.
882109313Sobrien
883109313Sobrien.PHONY: check
884109313Sobriencheck: $(CHECK_MODULES) \
885109313Sobrien	$(CHECK_TARGET_MODULES) \
886109313Sobrien	$(CHECK_X11_MODULES) \
887109313Sobrien	check-gcc
888109313Sobrien
889109313Sobrien# Installation targets.
890109313Sobrien
891109313Sobrien.PHONY: install uninstall source-vault binary-vault vault-install
892109313Sobrieninstall: $(INSTALL_TARGET) install-info
893109313Sobrien
894109313Sobrienuninstall:
895109313Sobrien	@echo "the uninstall target is not supported in this tree"
896109313Sobrien
897109313Sobriensource-vault:
898109313Sobrien	$(MAKE) -f ./release/Build-A-Release \
899109313Sobrien		host=$(host_alias) source-vault
900109313Sobrien
901109313Sobrienbinary-vault:
902109313Sobrien	$(MAKE) -f ./release/Build-A-Release \
903109313Sobrien		host=$(host_alias) target=$(target_alias)
904109313Sobrien
905109313Sobrienvault-install:
906109313Sobrien	@if [ -f ./release/vault-install ] ; then \
907109313Sobrien	  ./release/vault-install $(host_alias) $(target_alias) ; \
908109313Sobrien	else \
909109313Sobrien	  true ; \
910109313Sobrien	fi
911109313Sobrien
912109313Sobrien.PHONY: install.all
913109313Sobrieninstall.all: install-no-fixedincludes
914109313Sobrien	@if [ -f ./gcc/Makefile ] ; then \
915109313Sobrien		r=`pwd` ; export r ; \
916109313Sobrien		$(SET_LIB_PATH) \
917109313Sobrien		(cd ./gcc; \
918109313Sobrien		$(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
919109313Sobrien	else \
920109313Sobrien		true ; \
921109313Sobrien	fi
922109313Sobrien
923109313Sobrien# inet-install is used because the I*Net wants DejaGNU installed but
924109313Sobrien# not built.  Similarly, gzip is built but not installed.
925109313Sobrieninet-install:
926109313Sobrien	$(MAKE) INSTALL_MODULES="`echo $(INSTALL_MODULES) | sed -e 's/install-dejagnu//' -e 's/install-gzip//'`" install
927109313Sobrien
928109313Sobrien# install-no-fixedincludes is used because Cygnus can not distribute
929109313Sobrien# the fixed header files.
930109313Sobrien.PHONY: install-no-fixedincludes
931109313Sobrieninstall-no-fixedincludes: \
932109313Sobrien	install-dirs \
933109313Sobrien	$(INSTALL_MODULES) \
934109313Sobrien	$(INSTALL_TARGET_MODULES) \
935109313Sobrien	$(INSTALL_X11_MODULES) \
936109313Sobrien	gcc-no-fixedincludes 
937109313Sobrien
938109313Sobrien# Install the gcc headers files, but not the fixed include files,
939109313Sobrien# which Cygnus is not allowed to distribute.  This rule is very
940109313Sobrien# dependent on the workings of the gcc Makefile.in.
941109313Sobrien.PHONY: gcc-no-fixedincludes
942109313Sobriengcc-no-fixedincludes:
943109313Sobrien	@if [ -f ./gcc/Makefile ]; then \
944109313Sobrien	  rm -rf gcc/tmp-include; \
945109313Sobrien	  mv gcc/include gcc/tmp-include 2>/dev/null; \
946109313Sobrien	  mkdir gcc/include; \
947109313Sobrien	  cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
948109313Sobrien	  touch gcc/stmp-fixinc gcc/include/fixed; \
949109313Sobrien	  rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
950109313Sobrien	  r=`pwd`; export r; \
951109313Sobrien	  s=`cd $(srcdir); pwd` ; export s; \
952109313Sobrien	  $(SET_LIB_PATH) \
953109313Sobrien	  (cd ./gcc; \
954109313Sobrien	   $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
955109313Sobrien	  rm -rf gcc/include; \
956109313Sobrien	  mv gcc/tmp-include gcc/include 2>/dev/null; \
957109313Sobrien	else true; fi
958109313Sobrien
959109313Sobrien# This rule is used to build the modules which use FLAGS_TO_PASS.  To
960109313Sobrien# build a target all-X means to cd to X and make all.
961109313Sobrien#
962109313Sobrien# all-gui, and all-libproc are handled specially because
963109313Sobrien# they are still experimental, and if they fail to build, that
964109313Sobrien# shouldn't stop "make all".
965109313Sobrien.PHONY: $(ALL_MODULES) all-gui all-libproc
966109313Sobrien$(ALL_MODULES) all-gui all-libproc:
967109313Sobrien	@dir=`echo $@ | sed -e 's/all-//'`; \
968109313Sobrien	if [ -f ./$${dir}/Makefile ] ; then \
969109313Sobrien	  r=`pwd`; export r; \
970109313Sobrien	  s=`cd $(srcdir); pwd`; export s; \
971109313Sobrien	  $(SET_LIB_PATH) \
972109313Sobrien	  (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
973109313Sobrien	else \
974109313Sobrien	  true; \
975109313Sobrien	fi
976109313Sobrien
977109313Sobrien# These rules are used to check the modules which use FLAGS_TO_PASS.
978109313Sobrien# To build a target check-X means to cd to X and make check.  Some
979109313Sobrien# modules are only tested in a native toolchain.
980109313Sobrien
981109313Sobrien.PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
982109313Sobrien$(NATIVE_CHECK_MODULES):
983109313Sobrien	@if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
984109313Sobrien	  dir=`echo $@ | sed -e 's/check-//'`; \
985109313Sobrien	  if [ -f ./$${dir}/Makefile ] ; then \
986109313Sobrien	    r=`pwd`; export r; \
987109313Sobrien	    s=`cd $(srcdir); pwd`; export s; \
988109313Sobrien	    $(SET_LIB_PATH) \
989109313Sobrien	    (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
990109313Sobrien	  else \
991109313Sobrien	    true; \
992109313Sobrien	  fi; \
993109313Sobrien	fi
994109313Sobrien
995109313Sobrien$(CROSS_CHECK_MODULES):
996109313Sobrien	@dir=`echo $@ | sed -e 's/check-//'`; \
997109313Sobrien	if [ -f ./$${dir}/Makefile ] ; then \
998109313Sobrien	  r=`pwd`; export r; \
999109313Sobrien	  s=`cd $(srcdir); pwd`; export s; \
1000109313Sobrien	  $(SET_LIB_PATH) \
1001109313Sobrien	  (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1002109313Sobrien	else \
1003109313Sobrien	  true; \
1004109313Sobrien	fi
1005109313Sobrien
1006109313Sobrien# This rule is used to install the modules which use FLAGS_TO_PASS.
1007109313Sobrien# To build a target install-X means to cd to X and make install.
1008109313Sobrien.PHONY: $(INSTALL_MODULES)
1009109313Sobrien$(INSTALL_MODULES): install-dirs
1010109313Sobrien	@dir=`echo $@ | sed -e 's/install-//'`; \
1011109313Sobrien	if [ -f ./$${dir}/Makefile ] ; then \
1012109313Sobrien	  r=`pwd`; export r; \
1013109313Sobrien	  s=`cd $(srcdir); pwd`; export s; \
1014109313Sobrien	  $(SET_LIB_PATH) \
1015109313Sobrien	  (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1016109313Sobrien	else \
1017109313Sobrien	  true; \
1018109313Sobrien	fi
1019109313Sobrien
1020109313Sobrien# This rule is used to configure the modules which are built with the
1021109313Sobrien# target tools.
1022109313Sobrien.PHONY: $(CONFIGURE_TARGET_MODULES)
1023109313Sobrien$(CONFIGURE_TARGET_MODULES):
1024109313Sobrien	@dir=`echo $@ | sed -e 's/configure-target-//'`; \
1025109313Sobrien	if [ -d $(TARGET_SUBDIR)/$${dir} ]; then \
1026109313Sobrien	  r=`pwd`; export r; \
1027109313Sobrien	  $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/$${dir}/tmpmulti.out 2> /dev/null; \
1028109313Sobrien	  if [ -s $(TARGET_SUBDIR)/$${dir}/tmpmulti.out ]; then \
1029109313Sobrien	    if [ -f $(TARGET_SUBDIR)/$${dir}/multilib.out ]; then \
1030109313Sobrien	      if cmp $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out > /dev/null; then \
1031109313Sobrien		rm -f $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
1032109313Sobrien	      else \
1033109313Sobrien		echo "Multilibs changed for $${dir}, reconfiguring"; \
1034109313Sobrien		rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/Makefile; \
1035109313Sobrien		mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1036109313Sobrien	      fi; \
1037109313Sobrien	    else \
1038109313Sobrien	      mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1039109313Sobrien	    fi; \
1040109313Sobrien	  fi; \
1041109313Sobrien	fi; exit 0	# break command into two pieces
1042109313Sobrien	@dir=`echo $@ | sed -e 's/configure-target-//'`; \
1043109313Sobrien	if [ ! -d $(TARGET_SUBDIR) ]; then \
1044109313Sobrien	  true; \
1045109313Sobrien	elif [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1046109313Sobrien	  true; \
1047109313Sobrien	elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
1048109313Sobrien	  if [ -d $(srcdir)/$${dir} ]; then \
1049109313Sobrien	    [ -d $(TARGET_SUBDIR)/$${dir} ] || mkdir $(TARGET_SUBDIR)/$${dir};\
1050109313Sobrien	    r=`pwd`; export r; \
1051109313Sobrien	    s=`cd $(srcdir); pwd`; export s; \
1052109313Sobrien	    $(SET_LIB_PATH) \
1053109313Sobrien	    AR="$(AR_FOR_TARGET)"; export AR; \
1054109313Sobrien	    AS="$(AS_FOR_TARGET)"; export AS; \
1055109313Sobrien	    CC="$(CC_FOR_TARGET)"; export CC; \
1056109313Sobrien	    CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
1057109313Sobrien	    CXX="$(CXX_FOR_TARGET)"; export CXX; \
1058109313Sobrien	    CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
1059109313Sobrien	    DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
1060109313Sobrien	    LD="$(LD_FOR_TARGET)"; export LD; \
1061109313Sobrien            LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
1062109313Sobrien	    NM="$(NM_FOR_TARGET)"; export NM; \
1063109313Sobrien	    RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
1064109313Sobrien	    echo Configuring in $(TARGET_SUBDIR)/$${dir}; \
1065109313Sobrien	    cd $(TARGET_SUBDIR)/$${dir}; \
1066109313Sobrien	    case $(srcdir) in \
1067109313Sobrien	    /*) \
1068109313Sobrien	      topdir=$(srcdir) ;; \
1069109313Sobrien	    *) \
1070109313Sobrien	      case "$(TARGET_SUBDIR)" in \
1071109313Sobrien	      .) topdir="../$(srcdir)" ;; \
1072109313Sobrien	      *) topdir="../../$(srcdir)" ;; \
1073109313Sobrien	      esac ;; \
1074109313Sobrien	    esac; \
1075109313Sobrien	    if [ "$(srcdir)" = "." ] ; then \
1076109313Sobrien	      if [ "$(TARGET_SUBDIR)" != "." ] ; then \
1077109313Sobrien		if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
1078109313Sobrien		  if [ -f Makefile ]; then \
1079109313Sobrien		    if $(MAKE) distclean; then \
1080109313Sobrien		      true; \
1081109313Sobrien		    else \
1082109313Sobrien		      exit 1; \
1083109313Sobrien		    fi; \
1084109313Sobrien		  else \
1085109313Sobrien		    true; \
1086109313Sobrien		  fi; \
1087109313Sobrien		else \
1088109313Sobrien		  exit 1; \
1089109313Sobrien		fi; \
1090109313Sobrien	      else \
1091109313Sobrien		true; \
1092109313Sobrien	      fi; \
1093109313Sobrien	      srcdiroption="--srcdir=."; \
1094109313Sobrien	      libsrcdir="."; \
1095109313Sobrien	    else \
1096109313Sobrien	      srcdiroption="--srcdir=$${topdir}/$${dir}"; \
1097109313Sobrien	      libsrcdir="$$s/$${dir}"; \
1098109313Sobrien	    fi; \
1099109313Sobrien	    if [ -f $${libsrcdir}/configure ] ; then \
1100109313Sobrien	      $(SHELL) $${libsrcdir}/configure \
1101109313Sobrien		$(CONFIG_ARGUMENTS) $${srcdiroption} \
1102109313Sobrien		--with-target-subdir="$(TARGET_SUBDIR)"; \
1103109313Sobrien	    else \
1104109313Sobrien	      $(SHELL) $$s/configure \
1105109313Sobrien		$(CONFIG_ARGUMENTS) $${srcdiroption} \
1106109313Sobrien		--with-target-subdir="$(TARGET_SUBDIR)"; \
1107109313Sobrien	    fi; \
1108109313Sobrien	  else \
1109109313Sobrien	    true; \
1110109313Sobrien	  fi; \
1111109313Sobrien	else \
1112109313Sobrien	  true; \
1113109313Sobrien	fi
1114
1115# This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
1116# To build a target all-X means to cd to X and make all.
1117.PHONY: $(ALL_TARGET_MODULES)
1118$(ALL_TARGET_MODULES):
1119	@dir=`echo $@ | sed -e 's/all-target-//'`; \
1120	if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1121	  r=`pwd`; export r; \
1122	  s=`cd $(srcdir); pwd`; export s; \
1123	  $(SET_LIB_PATH) \
1124	  (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
1125	else \
1126	  true; \
1127	fi
1128
1129# This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
1130# To build a target install-X means to cd to X and make install.
1131.PHONY: $(CHECK_TARGET_MODULES)
1132$(CHECK_TARGET_MODULES):
1133	@dir=`echo $@ | sed -e 's/check-target-//'`; \
1134	if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1135	  r=`pwd`; export r; \
1136	  s=`cd $(srcdir); pwd`; export s; \
1137	  $(SET_LIB_PATH) \
1138	  (cd $(TARGET_SUBDIR)/$${dir};$(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
1139	else \
1140	  true; \
1141	fi
1142
1143# This rule is used to install the modules which use
1144# TARGET_FLAGS_TO_PASS.  To build a target install-X means to cd to X
1145# and make install.
1146.PHONY: $(INSTALL_TARGET_MODULES)
1147$(INSTALL_TARGET_MODULES): install-dirs
1148	@dir=`echo $@ | sed -e 's/install-target-//'`; \
1149	if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1150	  r=`pwd`; export r; \
1151	  s=`cd $(srcdir); pwd`; export s; \
1152	  $(SET_LIB_PATH) \
1153	  (cd $(TARGET_SUBDIR)/$${dir}; \
1154	    $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
1155	else \
1156	  true; \
1157	fi
1158
1159# This rule is used to build the modules which use X11_FLAGS_TO_PASS.
1160# To build a target all-X means to cd to X and make all.
1161.PHONY: $(ALL_X11_MODULES)
1162$(ALL_X11_MODULES):
1163	@dir=`echo $@ | sed -e 's/all-//'`; \
1164	if [ -f ./$${dir}/Makefile ] ; then \
1165	  r=`pwd`; export r; \
1166	  s=`cd $(srcdir); pwd`; export s; \
1167	  $(SET_LIB_PATH) \
1168	  (cd $${dir}; \
1169	   $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
1170	else \
1171	  true; \
1172	fi
1173
1174# This rule is used to check the modules which use X11_FLAGS_TO_PASS.
1175# To build a target check-X means to cd to X and make all.
1176.PHONY: $(CHECK_X11_MODULES)
1177$(CHECK_X11_MODULES):
1178	@dir=`echo $@ | sed -e 's/check-//'`; \
1179	if [ -f ./$${dir}/Makefile ] ; then \
1180	  r=`pwd`; export r; \
1181	  s=`cd $(srcdir); pwd`; export s; \
1182	  $(SET_LIB_PATH) \
1183	  (cd $${dir}; \
1184	   $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
1185	else \
1186	  true; \
1187	fi
1188
1189# This rule is used to install the modules which use X11_FLAGS_TO_PASS.
1190# To build a target install-X means to cd to X and make install.
1191.PHONY: $(INSTALL_X11_MODULES)
1192$(INSTALL_X11_MODULES):
1193	@dir=`echo $@ | sed -e 's/install-//'`; \
1194	if [ -f ./$${dir}/Makefile ] ; then \
1195	  r=`pwd`; export r; \
1196	  s=`cd $(srcdir); pwd`; export s; \
1197	  $(SET_LIB_PATH) \
1198	  (cd $${dir}; \
1199	   $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
1200	else \
1201	  true; \
1202	fi
1203
1204# gcc is the only module which uses GCC_FLAGS_TO_PASS.
1205.PHONY: all-gcc
1206all-gcc:
1207	@if [ -f ./gcc/Makefile ] ; then \
1208	  r=`pwd`; export r; \
1209	  s=`cd $(srcdir); pwd`; export s; \
1210	  $(SET_LIB_PATH) \
1211	  (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
1212	else \
1213	  true; \
1214	fi
1215
1216.PHONY: all-bootstrap
1217all-bootstrap:
1218	@if [ -f ./gcc/Makefile ] ; then \
1219	  r=`pwd`; export r; \
1220	  s=`cd $(srcdir); pwd`; export s; \
1221	  $(SET_LIB_PATH) \
1222	  (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) bootstrap); \
1223	else \
1224	  true; \
1225	fi
1226
1227.PHONY: check-gcc
1228check-gcc:
1229	@if [ -f ./gcc/Makefile ] ; then \
1230	  r=`pwd`; export r; \
1231	  s=`cd $(srcdir); pwd`; export s; \
1232	  $(SET_LIB_PATH) \
1233	  (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
1234	else \
1235	  true; \
1236	fi
1237
1238.PHONY: install-gcc
1239install-gcc:
1240	@if [ -f ./gcc/Makefile ] ; then \
1241	  r=`pwd`; export r; \
1242	  s=`cd $(srcdir); pwd`; export s; \
1243	  $(SET_LIB_PATH) \
1244	  (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1245	else \
1246	  true; \
1247	fi
1248
1249
1250# EXPERIMENTAL STUFF
1251# This rule is used to install the modules which use FLAGS_TO_PASS.
1252# To build a target install-X means to cd to X and make install.
1253.PHONY: install-dosrel
1254install-dosrel: install-dirs info
1255	@dir=`echo $@ | sed -e 's/install-//'`; \
1256	if [ -f ./$${dir}/Makefile ] ; then \
1257	  r=`pwd`; export r; \
1258	  s=`cd $(srcdir); pwd`; export s; \
1259	  $(SET_LIB_PATH) \
1260	  (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1261	else \
1262	  true; \
1263	fi
1264
1265install-dosrel-fake:
1266
1267
1268# This is a list of inter-dependencies among modules.
1269all-apache:
1270all-autoconf: all-m4
1271all-bash:
1272all-bfd:
1273all-binutils: all-libiberty all-opcodes all-bfd all-flex all-byacc
1274all-byacc:
1275all-cvs:
1276all-db:
1277all-dejagnu: all-tcl all-expect all-tk
1278all-diff: all-libiberty
1279all-emacs:
1280all-emacs19: all-byacc
1281all-etc:
1282configure-target-examples: $(ALL_GCC)
1283all-target-examples: configure-target-examples
1284all-expect: all-tcl all-tk
1285all-fileutils: all-libiberty
1286all-findutils:
1287all-find:
1288all-flex: all-libiberty all-byacc
1289all-gas: all-libiberty all-opcodes all-bfd
1290all-gash: all-tcl
1291all-gawk:
1292ALL_GCC = all-gcc
1293all-gcc: all-libiberty all-byacc all-binutils all-gas all-ld
1294all-bootstrap: all-libiberty all-byacc all-binutils all-gas all-ld
1295GDB_TK = all-tk all-tcl
1296all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK)
1297all-gprof: all-libiberty all-bfd all-opcodes
1298all-grep: all-libiberty
1299all-grez: all-libiberty all-bfd all-opcodes
1300all-gui: all-gdb all-libproc all-target-librx
1301all-guile:
1302all-gzip: all-libiberty
1303all-hello: all-libiberty
1304all-indent:
1305all-inet: all-tcl all-send-pr all-perl
1306all-ispell: all-emacs19
1307all-itcl: all-tcl all-tk
1308all-ld: all-libiberty all-bfd all-opcodes all-byacc all-flex
1309configure-target-libg++: $(ALL_GCC) configure-target-librx
1310all-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++
1311configure-target-libgloss: $(ALL_GCC)
1312all-target-libgloss: configure-target-libgloss configure-target-newlib
1313configure-target-libio: $(ALL_GCC)
1314all-target-libio: configure-target-libio all-gas all-ld all-gcc all-target-libiberty all-target-newlib
1315all-libiberty:
1316configure-target-librx: $(ALL_GCC) configure-target-newlib
1317all-target-librx: configure-target-librx
1318configure-target-libstdc++: $(ALL_GCC)
1319all-target-libstdc++: configure-target-libstdc++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio
1320all-m4: all-libiberty
1321all-make: all-libiberty
1322all-mmalloc:
1323configure-target-newlib: $(ALL_GCC)
1324all-target-newlib: configure-target-newlib all-binutils all-gas all-gcc
1325all-opcodes: all-bfd all-libiberty
1326all-patch: all-libiberty
1327all-perl:
1328all-prms: all-libiberty
1329all-rcs:
1330all-readline:
1331all-recode: all-libiberty
1332all-sed: all-libiberty
1333all-send-pr: all-prms
1334all-shellutils:
1335all-sim: all-libiberty all-bfd all-opcodes
1336all-sn: all-tcl all-tk all-itcl all-db
1337all-tar: all-libiberty
1338all-tcl:
1339all-tclX: all-tcl all-tk
1340all-tk: all-tcl
1341all-texinfo: all-libiberty
1342all-textutils:
1343all-tgas: all-libiberty all-bfd all-opcodes
1344all-time:
1345all-wdiff:
1346all-target-winsup: all-target-newlib all-target-libiberty all-target-librx all-target-libio configure-target-winsup 
1347configure-target-winsup: configure-target-newlib
1348all-uudecode: all-libiberty
1349configure-target-libiberty: $(ALL_GCC)
1350all-target-libiberty: configure-target-libiberty all-gcc all-ld all-target-newlib
1351all-target: $(ALL_TARGET_MODULES)
1352install-target: $(INSTALL_TARGET_MODULES)
1353
1354### other supporting targets
1355
1356MAKEDIRS= \
1357	$(prefix) \
1358	$(exec_prefix)
1359.PHONY: install-dirs
1360install-dirs:
1361	@for i in .. $(MAKEDIRS) ; do \
1362	    if [ x$$i != x.. ]; then \
1363		echo Making $$i... ; \
1364		parent=`echo $$i | sed -e 's@/[^/]*$$@@' | sed -e 's@^$$@/@'`; \
1365		if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
1366		if [ ! -d $$i ] ; then \
1367			if mkdir $$i ; then \
1368				true ; \
1369			else \
1370				exit 1 ; \
1371			fi ; \
1372		else \
1373			true ; \
1374		fi ; \
1375	    else true; fi; \
1376	done
1377
1378dir.info: do-install-info
1379	if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
1380	  $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
1381	  mv -f dir.info.new dir.info ; \
1382	else true ; \
1383	fi
1384
1385dist:
1386	@echo "Building a full distribution of this tree isn't done"
1387	@echo "via 'make dist'.  Check out the etc/ subdirectory" 
1388
1389etags tags: TAGS
1390
1391# Right now this just builds TAGS in each subdirectory.  emacs19 has the
1392# ability to use several tags files at once, so there is probably no need
1393# to combine them into one big TAGS file (like CVS 1.3 does).  We could
1394# (if we felt like it) have this Makefile write a piece of elisp which
1395# the user could load to tell emacs19 where all the TAGS files we just
1396# built are.
1397TAGS: do-TAGS
1398
1399# with the gnu make, this is done automatically.
1400
1401Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
1402	$(SHELL) ./config.status
1403
1404#
1405# Support for building net releases
1406
1407# Files in devo used in any net release.
1408# ChangeLog omitted because it may refer to files which are not in this
1409# distribution (perhaps it would be better to include it anyway).
1410DEVO_SUPPORT= README Makefile.in configure configure.in \
1411	config.guess config.sub config move-if-change \
1412	mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install \
1413	COPYING COPYING.LIB install.sh config-ml.in symlink-tree
1414
1415# Files in devo/etc used in any net release.
1416# ChangeLog omitted because it may refer to files which are not in this
1417# distribution (perhaps it would be better to include it anyway).
1418ETC_SUPPORT= Makefile.in cfg-paper.texi configure configure.in configure.man \
1419	configure.texi standards.texi make-stds.texi \
1420	configure.info* standards.info* cfg-paper.info*
1421
1422# When you use `make setup-dirs' or `make taz' you should always redefine
1423# this macro.
1424SUPPORT_FILES = list-of-support-files-for-tool-in-question
1425# Files where "byacc" (Cygnus version) should be changed to "bison -y" (FSF).
1426DISTBISONFILES= binutils/Makefile.in gas/Makefile.in gdb/Makefile.in ld/Makefile.in
1427
1428.PHONY: taz
1429
1430taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
1431  texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1432	# Make sure "diststuff" files get built properly.
1433	for f in $(DISTBISONFILES) ; do \
1434	  if [ -r $$f ]; then \
1435	    sed '/^BISON *=.*$$/s/.*/BISON = bison -y/' <$$f >tmp ; \
1436	    mv -f tmp $$f ; \
1437	  else true; fi ; \
1438	done
1439	# Take out texinfo from a few places; make simple BISON=bison line.
1440	sed -e '/^all\.normal: /s/\all-texinfo //' \
1441	    -e '/^	install-texinfo /d' \
1442	    -e '/^BISON = `if/,/^$$/d' \
1443	    -e '/^# BISON:/s/.*/BISON = bison -y/' \
1444	<Makefile.in >tmp
1445	mv -f tmp Makefile.in
1446	#
1447	./configure sun4
1448	[ -z "$(CONFIGURE_TARGET_MODULES)" ] \
1449	  || $(MAKE) $(CONFIGURE_TARGET_MODULES) ALL_GCC="" \
1450	    CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
1451	# Make links, and run "make diststuff" or "make info" when needed.
1452	rm -rf proto-toplev ; mkdir proto-toplev
1453	set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1454	for d in $$dirs ; do \
1455	  if [ -d $$d ]; then \
1456	    if [ ! -f $$d/Makefile ] ; then true ; \
1457	    elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \
1458		(cd $$d ; $(MAKE) diststuff ) || exit 1 ; \
1459	    elif grep '^info:' $$d/Makefile >/dev/null ; then \
1460	        (cd $$d ; $(MAKE) info ) || exit 1 ; \
1461	    fi ; \
1462	    if [ -d $$d/proto-$$d.dir ]; then \
1463	      ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1464	    else \
1465	      ln -s ../$$d proto-toplev/$$d ; \
1466	    fi ; \
1467	  else ln -s ../$$d proto-toplev/$$d ; fi ; \
1468	done
1469	cd etc ; $(MAKE) info
1470	$(MAKE) distclean
1471	#
1472	mkdir proto-toplev/etc
1473	(cd proto-toplev/etc; \
1474	 for i in $(ETC_SUPPORT); do \
1475		ln -s ../../etc/$$i . ; \
1476	 done)
1477	#
1478	# Take out texinfo from configurable dirs
1479	rm proto-toplev/configure.in
1480	sed -e '/^host_tools=/s/texinfo //' \
1481	    <configure.in >proto-toplev/configure.in
1482	#
1483	mkdir proto-toplev/texinfo
1484	ln -s ../../texinfo/texinfo.tex		proto-toplev/texinfo/
1485	ln -s ../../texinfo/gpl.texinfo		proto-toplev/texinfo/
1486	ln -s ../../texinfo/lgpl.texinfo	proto-toplev/texinfo/
1487	if test -r texinfo/util/tex3patch ; then \
1488	  mkdir proto-toplev/texinfo/util && \
1489	  ln -s ../../../texinfo/util/tex3patch	proto-toplev/texinfo/util ; \
1490	else true; fi
1491	chmod og=u `find . -print`
1492	$(MAKE) -f Makefile.in do-tar-gz TOOL=$(TOOL) \
1493		VER=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`
1494
1495do-tar-gz:
1496	echo "==> Making $(TOOL)-$(VER).tar.gz"
1497	-rm -f $(TOOL)-$(VER)
1498	ln -s proto-toplev $(TOOL)-$(VER)
1499	tar cfh $(TOOL)-$(VER).tar $(TOOL)-$(VER)
1500	$(GZIPPROG) -v -9 $(TOOL)-$(VER).tar
1501
1502TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1503DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
1504
1505.PHONY: gas.tar.gz
1506GAS_SUPPORT_DIRS= bfd include libiberty opcodes setup.com makefile.vms
1507gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
1508	$(MAKE) -f Makefile.in taz TOOL=gas \
1509		SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
1510
1511# The FSF "binutils" release includes gprof and ld.
1512.PHONY: binutils.tar.gz
1513BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof setup.com makefile.vms
1514binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
1515	$(MAKE) -f Makefile.in taz TOOL=binutils \
1516		SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS) makeall.bat configure.bat"
1517
1518.PHONY: gas+binutils.tar.gz
1519GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
1520gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
1521	$(MAKE) -f Makefile.in taz TOOL=gas \
1522		SUPPORT_FILES="$(GASB_SUPPORT_DIRS) makeall.bat configure.bat"
1523
1524.PHONY: libg++.tar.gz
1525LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty
1526libg++.tar.gz: $(DIST_SUPPORT) libg++
1527	$(MAKE) -f Makefile.in taz TOOL=libg++ \
1528		SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
1529
1530GNATS_SUPPORT_DIRS=include libiberty send-pr
1531gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
1532	$(MAKE) -f  Makefile.in taz TOOL=gnats \
1533		SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
1534
1535.PHONY: gdb.tar.gz
1536GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils
1537GDBTK_SUPPORT_DIRS= `if [ -d tcl -a -d tk ] ; then echo tcl tk ; fi`
1538gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1539	$(MAKE) -f Makefile.in taz TOOL=gdb \
1540		SUPPORT_FILES="$(GDB_SUPPORT_DIRS) $(GDBTK_SUPPORT_DIRS)"
1541
1542.PHONY: newlib.tar.gz
1543NEWLIB_SUPPORT_DIRS=libgloss
1544# taz configures for the sun4 target which won't configure newlib.
1545# We need newlib configured so that the .info files are made.
1546# Unfortunately, it is not enough to just configure newlib separately:
1547# taz will build the .info files but since SUBDIRS won't contain newlib,
1548# distclean won't be run (leaving Makefile, config.status, and the tmp files
1549# used in building the .info files, eg: *.def, *.ref).
1550# The problem isn't solvable however without a lot of extra work because
1551# target libraries are built in subdir $(target_alias) which gets nuked during
1552# the make distclean.  For now punt on the issue of shipping newlib info files
1553# with newlib net releases and wait for a day when some native target (sun4?)
1554# supports newlib (if only minimally).
1555newlib.tar.gz: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
1556	$(MAKE) -f Makefile.in taz TOOL=newlib \
1557		SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
1558		DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
1559
1560.NOEXPORT:
1561MAKEOVERRIDES=
1562
1563
1564# end of Makefile.in
1565