2ee086018b5a61efed77212332ac01fabaee1233
[external/binutils.git] / Makefile.in
1 #
2 # Makefile for directory with subdirs to build.
3 #   Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation
4 #
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
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 #
19
20 srcdir = .
21
22 prefix = /usr/local
23
24 exec_prefix = $(prefix)
25 bindir = $(exec_prefix)/bin
26 libdir = $(exec_prefix)/lib
27 tooldir = $(exec_prefix)/$(target)
28
29 program_transform_name =
30
31 datadir = $(prefix)/share
32 mandir = $(prefix)/man
33 man1dir = $(mandir)/man1
34 man2dir = $(mandir)/man2
35 man3dir = $(mandir)/man3
36 man4dir = $(mandir)/man4
37 man5dir = $(mandir)/man5
38 man6dir = $(mandir)/man6
39 man7dir = $(mandir)/man7
40 man8dir = $(mandir)/man8
41 man9dir = $(mandir)/man9
42 infodir = $(prefix)/info
43 includedir = $(prefix)/include
44 GDB_NLM_DEPS = 
45
46 SHELL = /bin/sh
47
48 INSTALL = $(SHELL) $$s/install-sh -c
49 INSTALL_PROGRAM = $(INSTALL)
50 INSTALL_DATA = $(INSTALL) -m 644
51
52 INSTALL_DOSREL = install-dosrel-fake
53
54 AS = as
55 AR = ar
56 AR_FLAGS = rc
57 CC = cc
58
59 # Special variables passed down in EXTRA_GCC_FLAGS.  They are defined
60 # here so that they can be overridden by Makefile fragments.
61 HOST_CC = $(CC_FOR_BUILD)
62 HOST_PREFIX = 
63 HOST_PREFIX_1 = loser-
64
65 # These flag values are normally overridden by the configure script.
66 CFLAGS = -g
67 CXXFLAGS = -g -O2
68
69 LIBCFLAGS = $(CFLAGS)
70 CFLAGS_FOR_TARGET = $(CFLAGS)
71 LDFLAGS_FOR_TARGET = 
72 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
73 PICFLAG = 
74 PICFLAG_FOR_TARGET = 
75
76 # start-sanitize-chill
77 CHILLFLAGS = $(CFLAGS)
78 CHILL_LIB = -lchill
79 # end-sanitize-chill
80 CXX = c++
81
82 # Use -O2 to stress test the compiler.
83 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
84 CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
85 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
86
87 RANLIB = ranlib
88
89 DLLTOOL = dlltool
90
91 NM = nm
92
93 LD = ld
94
95 # Not plain GZIP, since gzip looks there for extra command-line options.
96 GZIPPROG = gzip
97
98 # These values are substituted by configure.
99 DEFAULT_YACC = yacc
100 DEFAULT_LEX = lex
101
102 # BISON: This line sed'ed to BISON = bison -y for FSF releases, don't remove.
103 BISON = `if [ -f $$r/byacc/byacc ] ; \
104             then echo $$r/byacc/byacc ; \
105             else echo ${DEFAULT_YACC} ; \
106         fi`
107
108 LEX = `if [ -f $$r/flex/flex ] ; \
109         then echo $$r/flex/flex ; \
110         else echo ${DEFAULT_LEX} ; fi`
111
112 M4 = `if [ -f $$r/m4/m4 ] ; \
113         then echo $$r/m4/m4 ; \
114         else echo m4 ; fi`
115
116 MAKEINFO = `if [ -f $$r/texinfo/makeinfo/Makefile ] ; \
117         then echo $$r/texinfo/makeinfo/makeinfo ; \
118         else echo makeinfo ; fi`
119
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.
123 MAKEINFOFLAGS =
124
125 EXPECT = `if [ -f $$r/expect/expect ] ; \
126         then echo $$r/expect/expect ; \
127         else echo expect ; fi`
128
129 RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \
130         then echo $$s/dejagnu/runtest ; \
131         else echo runtest ; fi`
132
133
134 # compilers to use to create programs which must be run in the build
135 # environment.
136 CC_FOR_BUILD = $(CC)
137 CXX_FOR_BUILD = $(CXX)
138
139 SUBDIRS = "this is set via configure, don't edit this"
140 OTHERS = 
141
142 # This is set by the configure script to the list of directories which
143 # should be built using the target tools.
144 TARGET_CONFIGDIRS = libiberty libgloss newlib libio librx libstdc++ libg++ winsup
145
146 # Target libraries are put under this directory:
147 # Changed by configure to $(target_alias) if cross.
148 TARGET_SUBDIR = .
149
150 # This is set by the configure script to the arguments passed to configure.
151 CONFIG_ARGUMENTS = 
152
153 # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
154 # was used.
155 SET_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.
159 RPATH_ENVVAR = LD_LIBRARY_PATH
160
161 # configure.in sets SET_LIB_PATH to this if --enable-shared was used.
162 REALLY_SET_LIB_PATH = \
163   $(RPATH_ENVVAR)=$$r/bfd:$$r/opcodes:$$$(RPATH_ENVVAR); \
164   export $(RPATH_ENVVAR);
165
166 ALL = all.normal
167 INSTALL_TARGET = installdirs \
168         $(INSTALL_MODULES) \
169         $(INSTALL_TARGET_MODULES) \
170         $(INSTALL_X11_MODULES) \
171         install-gcc \
172         $(INSTALL_DOSREL)
173
174
175 CC_FOR_TARGET = ` \
176   if [ -f $$r/gcc/xgcc ] ; then \
177     if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
178       if [ -f $$r/$(TARGET_SUBDIR)/winsup/Makefile ] ; then \
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; \
180       else \
181         echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
182       fi; \
183     else \
184       echo $$r/gcc/xgcc -B$$r/gcc/; \
185     fi; \
186   else \
187     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
188       echo $(CC); \
189     else \
190       t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
191     fi; \
192   fi`
193
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.
198 GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/
199
200 # start-sanitize-chill
201 CHILL_FOR_TARGET = ` \
202   if [ -f $$r/gcc/xgcc ] ; then \
203     echo $$r/gcc/xgcc -B$$r/gcc/ -L$$r/gcc/ch/runtime/; \
204   else \
205     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
206       echo $(CC); \
207     else \
208       t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
209     fi; \
210   fi`
211
212 # end-sanitize-chill
213
214 CXX_FOR_TARGET = ` \
215   if [ -f $$r/gcc/xgcc ] ; then \
216     if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
217       if [ -f $$r/$(TARGET_SUBDIR)/winsup/Makefile ] ; then \
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; \
219       else \
220         echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
221       fi; \
222     else \
223       echo $$r/gcc/xgcc -B$$r/gcc/; \
224     fi; \
225   else \
226     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
227       echo $(CXX); \
228     else \
229       t='$(program_transform_name)'; echo c++ | sed -e 's/x/x/' $$t; \
230     fi; \
231   fi`
232
233 AS_FOR_TARGET = ` \
234   if [ -f $$r/gas/as.new ] ; then \
235     echo $$r/gas/as.new ; \
236   else \
237     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
238       echo $(AS); \
239     else \
240        t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \
241     fi; \
242   fi`
243
244 LD_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
255 DLLTOOL_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
266 AR_FOR_TARGET = ` \
267   if [ -f $$r/binutils/ar ] ; then \
268     echo $$r/binutils/ar ; \
269   else \
270     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
271       echo $(AR); \
272     else \
273        t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \
274     fi; \
275   fi`
276
277 RANLIB_FOR_TARGET = ` \
278   if [ -f $$r/binutils/ranlib ] ; then \
279     echo $$r/binutils/ranlib ; \
280   else \
281     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
282       echo $(RANLIB); \
283     else \
284        t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \
285     fi; \
286   fi`
287
288 NM_FOR_TARGET = ` \
289   if [ -f $$r/binutils/nm.new ] ; then \
290     echo $$r/binutils/nm.new ; \
291   else \
292     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
293       echo $(NM); \
294     else \
295        t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \
296     fi; \
297   fi`
298
299 #### host and target specific makefile fragments come in here.
300 ###
301
302 # Flags to pass down to all sub-makes.
303 # Please keep these in alphabetical order.
304 BASE_FLAGS_TO_PASS = \
305         "AR_FLAGS=$(AR_FLAGS)" \
306         "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
307         "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
308         "BISON=$(BISON)" \
309         "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
310         "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
311         "CFLAGS=$(CFLAGS)" \
312         "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
313         $(start-sanitize-chill)\
314         "CHILLFLAGS=$(CHILLFLAGS)" \
315         "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
316         "CHILL_LIB=$(CHILL_LIB)" \
317         $(end-sanitize-chill)\
318         "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
319         "CXXFLAGS=$(CXXFLAGS)" \
320         "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
321         "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
322         "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
323         "INSTALL=$(INSTALL)" \
324         "INSTALL_DATA=$(INSTALL_DATA)" \
325         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
326         "LDFLAGS=$(LDFLAGS)" \
327         "LEX=$(LEX)" \
328         "LD_FOR_TARGET=$(LD_FOR_TARGET)" \
329         "LIBCFLAGS=$(LIBCFLAGS)" \
330         "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
331         "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
332         "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
333         "M4=$(M4)" \
334         "MAKE=$(MAKE)" \
335         "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
336         "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
337         "PICFLAG=$(PICFLAG)" \
338         "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
339         "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
340         "SHELL=$(SHELL)" \
341         "EXPECT=$(EXPECT)" \
342         "RUNTEST=$(RUNTEST)" \
343         "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
344         "YACC=$(BISON)" \
345         "exec_prefix=$(exec_prefix)" \
346         "prefix=$(prefix)" \
347         "tooldir=$(tooldir)" 
348
349 # Flags to pass down to most sub-makes, in which we're building with
350 # the host environment.
351 # If any variables are added here, they must be added to do-*, below.
352 EXTRA_HOST_FLAGS = \
353         'AR=$(AR)' \
354         'AS=$(AS)' \
355         'CC=$(CC)' \
356         'CXX=$(CXX)' \
357         'DLLTOOL=$(DLLTOOL)' \
358         'LD=$(LD)' \
359         'NM=$(NM)' \
360         'RANLIB=$(RANLIB)' 
361
362
363 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
364
365 # Flags that are concerned with the location of the X11 include files
366 # and library files
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 #
373 X11_FLAGS_TO_PASS = \
374         'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
375         'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
376
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.
380 # If any variables are added here, they must be added to do-*, below.
381 EXTRA_TARGET_FLAGS = \
382         'AR=$$(AR_FOR_TARGET)' \
383         'AS=$$(AS_FOR_TARGET)' \
384         'CC=$$(CC_FOR_TARGET)' \
385         'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
386         'CXX=$$(CXX_FOR_TARGET)' \
387         'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
388         'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
389         'LD=$$(LD_FOR_TARGET)' \
390         'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
391         'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
392         'NM=$$(NM_FOR_TARGET)' \
393         'PICFLAG=$$(PICFLAG_FOR_TARGET)' \
394         'RANLIB=$$(RANLIB_FOR_TARGET)'
395
396 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
397
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
400 # ranlib.
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.
404 EXTRA_GCC_FLAGS = \
405         'AR=$$(AR_FOR_TARGET)' \
406         'AS=$(AS)' \
407         'CC=$(CC)' \
408         'CXX=$(CXX)' \
409         'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
410         'HOST_CC=$(CC_FOR_BUILD)' \
411         'HOST_PREFIX=$(HOST_PREFIX)' \
412         'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
413         'NM=$(NM)' \
414         'RANLIB=$$(RANLIB_FOR_TARGET)' \
415         "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
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` \
421         `if test x"$(LIBGCC2_DEBUG_CFLAGS)" != x; then echo "LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)"; fi` \
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`
425
426 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
427
428 # This is a list of the targets for all of the modules which are compiled
429 # using $(FLAGS_TO_PASS).
430 ALL_MODULES = \
431         all-apache \
432         all-autoconf \
433         all-automake \
434         all-bash \
435         all-bfd \
436         all-binutils \
437         all-byacc \
438         all-cvs \
439         all-db \
440         all-dejagnu \
441         all-diff \
442         all-dosutils \
443         all-etc \
444         all-fileutils \
445         all-findutils \
446         all-find \
447         all-flex \
448         all-gas \
449         all-gawk \
450         all-gnuserv \
451         all-gprof \
452         all-grep \
453         all-grez \
454         all-gzip \
455         all-hello \
456         $(start-sanitize-ide) \
457         all-ilu \
458         $(end-sanitize-ide) \
459         all-indent \
460         all-inet \
461         all-ispell \
462         all-itcl \
463         all-ld \
464         all-libiberty \
465         $(start-sanitize-ide) \
466         all-libide \
467         $(end-sanitize-ide) \
468         all-m4 \
469         all-make \
470         all-mmalloc \
471         all-opcodes \
472         all-patch \
473         all-perl \
474         all-prms \
475         all-rcs \
476         all-readline \
477         all-release \
478         all-recode \
479         all-sed \
480         all-send-pr \
481         all-shellutils \
482         all-sim \
483         all-sn \
484         all-tar \
485         all-tcl \
486         all-texinfo \
487         all-textutils \
488         all-tgas \
489         all-time \
490         all-uudecode \
491         $(start-sanitize-ide) \
492         all-vmake \
493         $(end-sanitize-ide) \
494         all-wdiff 
495
496 # This is a list of the check targets for all of the modules which are
497 # compiled using $(FLAGS_TO_PASS).
498 #
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.
502 NATIVE_CHECK_MODULES = \
503         check-byacc \
504         check-flex
505
506 CROSS_CHECK_MODULES = \
507         check-apache \
508         check-autoconf \
509         check-automake \
510         check-bash \
511         check-bfd \
512         check-binutils \
513         check-cvs \
514         check-db \
515         check-dejagnu \
516         check-diff \
517         check-etc \
518         check-fileutils \
519         check-findutils \
520         check-find \
521         check-gas \
522         check-gawk \
523         check-gnuserv \
524         check-gprof \
525         check-grep \
526         check-gzip \
527         check-hello \
528         $(start-sanitize-ide) \
529         check-ilu \
530         $(end-sanitize-ide) \
531         check-indent \
532         check-inet \
533         check-ispell \
534         check-itcl \
535         check-ld \
536         check-libiberty \
537         $(start-sanitize-ide) \
538         check-libide \
539         $(end-sanitize-ide) \
540         check-m4 \
541         check-make \
542         check-mmcheckoc \
543         check-opcodes \
544         check-patch \
545         check-perl \
546         check-prms \
547         check-rcs \
548         check-readline \
549         check-recode \
550         check-sed \
551         check-send-pr \
552         check-shellutils \
553         check-sn \
554         check-sim \
555         check-tar \
556         check-tcl \
557         check-texinfo \
558         check-textutils \
559         check-tgas \
560         check-time \
561         check-uudecode \
562         $(start-sanitize-ide) \
563         check-vmake \
564         $(end-sanitize-ide) \
565         check-wdiff
566
567 CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
568
569 # This is a list of the install targets for all of the modules which are
570 # compiled using $(FLAGS_TO_PASS).
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.
574 INSTALL_MODULES = \
575         install-apache \
576         install-autoconf \
577         install-automake \
578         install-bash \
579         install-bfd \
580         install-opcodes \
581         install-binutils \
582         install-byacc \
583         install-cvs \
584         install-db \
585         install-dejagnu \
586         install-diff \
587         install-dosutils \
588         install-etc \
589         install-fileutils \
590         install-findutils \
591         install-find \
592         install-flex \
593         install-gas \
594         install-gawk \
595         install-gnuserv \
596         install-gprof \
597         install-grep \
598         install-grez \
599         install-gzip \
600         install-hello \
601         $(start-sanitize-ide) \
602         install-ilu \
603         $(end-sanitize-ide) \
604         install-indent \
605         install-inet \
606         install-ispell \
607         install-itcl \
608         install-ld \
609         install-libiberty \
610         $(start-sanitize-ide) \
611         install-libide \
612         $(end-sanitize-ide) \
613         install-m4 \
614         install-make \
615         install-mmalloc \
616         install-patch \
617         install-perl \
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 \
626         install-sn \
627         install-tar \
628         install-tcl \
629         install-texinfo \
630         install-textutils \
631         install-tgas \
632         install-time \
633         install-uudecode \
634         $(start-sanitize-ide) \
635         install-vmake \
636         $(end-sanitize-ide) \
637         install-wdiff
638
639 # This is a list of the targets for all of the modules which are compiled
640 # using $(X11_FLAGS_TO_PASS).
641 ALL_X11_MODULES = \
642         all-emacs \
643         all-emacs19 \
644         all-gdb \
645         all-expect \
646         all-gash \
647         all-guile \
648         all-tclX \
649         all-tk
650
651 # This is a list of the check targets for all of the modules which are
652 # compiled using $(X11_FLAGS_TO_PASS).
653 CHECK_X11_MODULES = \
654         check-emacs \
655         check-gdb \
656         check-guile \
657         check-expect \
658         check-gash \
659         check-tclX
660
661 # This is a list of the install targets for all the modules which are
662 # compiled using $(X11_FLAGS_TO_PASS).
663 INSTALL_X11_MODULES = \
664         install-emacs \
665         install-emacs19 \
666         install-gdb \
667         install-guile \
668         install-expect \
669         install-gash \
670         install-tclX \
671         install-tk
672
673 # This is a list of the targets for all of the modules which are compiled
674 # using $(TARGET_FLAGS_TO_PASS).
675 ALL_TARGET_MODULES = \
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 \
683         all-target-libiberty \
684         all-target-gperf \
685         all-target-examples
686
687 # This is a list of the configure targets for all of the modules which
688 # are compiled using the target tools.
689 CONFIGURE_TARGET_MODULES = \
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 \
697         configure-target-libiberty \
698         configure-target-gperf \
699         configure-target-examples
700
701 # This is a list of the check targets for all of the modules which are
702 # compiled using $(TARGET_FLAGS_TO_PASS).
703 CHECK_TARGET_MODULES = \
704         check-target-libio \
705         check-target-libstdc++ \
706         check-target-libg++ \
707         check-target-newlib \
708         check-target-winsup \
709         check-target-libiberty \
710         check-target-gperf
711
712 # This is a list of the install targets for all of the modules which are
713 # compiled using $(TARGET_FLAGS_TO_PASS).
714 INSTALL_TARGET_MODULES = \
715         install-target-libio \
716         install-target-libstdc++ \
717         install-target-libg++ \
718         install-target-newlib \
719         install-target-winsup \
720         install-target-libgloss \
721         install-target-libiberty \
722         install-target-gperf
723
724 # This is a list of the targets for which we can do a clean-{target}.
725 CLEAN_MODULES = \
726         clean-apache \
727         clean-autoconf \
728         clean-automake \
729         clean-bash \
730         clean-bfd \
731         clean-binutils \
732         clean-byacc \
733         clean-cvs \
734         clean-db \
735         clean-dejagnu \
736         clean-diff \
737         clean-dosutils \
738         clean-etc \
739         clean-fileutils \
740         clean-findutils \
741         clean-find \
742         clean-flex \
743         clean-gas \
744         clean-gawk \
745         clean-gnuserv \
746         clean-gprof \
747         clean-grep \
748         clean-grez \
749         clean-gzip \
750         clean-hello \
751         $(start-sanitize-ide) \
752         clean-ilu \
753         $(end-sanitize-ide) \
754         clean-indent \
755         clean-inet \
756         clean-ispell \
757         clean-itcl \
758         clean-ld \
759         clean-libiberty \
760         $(start-sanitize-ide) \
761         clean-libide \
762         $(end-sanitize-ide) \
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 \
778         clean-sn \
779         clean-tar \
780         clean-tcl \
781         clean-texinfo \
782         clean-textutils \
783         clean-tgas \
784         clean-time \
785         clean-uudecode \
786         $(start-sanitize-ide) \
787         clean-vmake \
788         $(end-sanitize-ide) \
789         clean-wdiff
790
791 # All of the target modules that can be cleaned
792 CLEAN_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 \
801         clean-target-gperf \
802         clean-target-examples
803
804 # All of the x11 modules that can be cleaned
805 CLEAN_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
815 # The first rule in the file had better be this one.  Don't put any above it.
816 all: all.normal
817 .PHONY: all
818
819 # The target built for a native build.
820 .PHONY: all.normal
821 all.normal: \
822         $(ALL_MODULES) \
823         $(ALL_X11_MODULES) \
824         $(ALL_TARGET_MODULES) \
825         all-gcc
826
827 # Do a target for all the subdirectories.  A ``make do-X'' will do a
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).
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.
834 DO_X = \
835         do-clean \
836         do-distclean \
837         do-dvi \
838         do-info \
839         do-install-info \
840         do-installcheck \
841         do-mostlyclean \
842         do-maintainer-clean \
843         do-TAGS
844 .PHONY: $(DO_X)
845 $(DO_X):
846         @target=`echo $@ | sed -e 's/^do-//'`; \
847         r=`pwd`; export r; \
848         s=`cd $(srcdir); pwd`; export s; \
849         $(SET_LIB_PATH) \
850         for i in $(SUBDIRS) -dummy-; do \
851           if [ -f ./$$i/Makefile ]; then \
852             case $$i in \
853             gcc) \
854               for flag in $(EXTRA_GCC_FLAGS); do \
855                 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
856               done; \
857               ;; \
858             *) \
859               for flag in $(EXTRA_HOST_FLAGS); do \
860                 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
861               done; \
862               ;; \
863             esac ; \
864             export AR AS CC CXX LD NM RANLIB DLLTOOL; \
865             if (cd ./$$i; \
866                 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
867                         "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
868                         "RANLIB=$${RANLIB}" \
869                         "DLLTOOL=$${DLLTOOL}" \
870                         $${target}); \
871             then true; else exit 1; fi; \
872           else true; fi; \
873         done
874         @target=`echo $@ | sed -e 's/^do-//'`; \
875         r=`pwd`; export r; \
876         s=`cd $(srcdir); pwd`; export s; \
877         $(SET_LIB_PATH) \
878         for i in $(TARGET_CONFIGDIRS) -dummy-; do \
879           if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \
880             for flag in $(EXTRA_TARGET_FLAGS); do \
881                 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
882             done; \
883             export AR AS CC CXX LD NM RANLIB DLLTOOL; \
884             if (cd $(TARGET_SUBDIR)/$$i; \
885                 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
886                         "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
887                         "RANLIB=$${RANLIB}" \
888                         "DLLTOOL=$${DLLTOOL}" \
889                         $${target}); \
890             then true; else exit 1; fi; \
891           else true; fi; \
892         done
893
894 # Here are the targets which correspond to the do-X targets.
895
896 .PHONY: info installcheck dvi install-info
897 .PHONY: clean distclean mostlyclean maintainer-clean realclean
898 .PHONY: local-clean local-distclean local-maintainer-clean
899 info: do-info
900 installcheck: do-installcheck
901 dvi: do-dvi
902
903 # Make sure makeinfo is built before we do a `make info'.
904 do-info: all-texinfo
905
906 install-info: do-install-info dir.info
907         s=`cd $(srcdir); pwd`; export s; \
908         if [ -f dir.info ] ; then \
909           $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
910         else true ; fi
911
912 local-clean:
913         -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
914
915 local-distclean:
916         -rm -f Makefile config.status config.cache
917         -if [ "$(TARGET_SUBDIR)" != "." ]; then \
918           rm -rf $(TARGET_SUBDIR); \
919         else true; fi
920
921 local-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
925 clean: do-clean local-clean
926 mostlyclean: do-mostlyclean local-clean
927 distclean: do-distclean local-clean local-distclean
928 maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean 
929 maintainer-clean: local-distclean
930 realclean: maintainer-clean
931
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; \
938           s=`cd $(srcdir); pwd`; export s; \
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-//'`; \
948         rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
949         if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
950           r=`pwd`; export r; \
951           s=`cd $(srcdir); pwd`; export s; \
952           $(SET_LIB_PATH) \
953           (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) clean); \
954         else \
955           true; \
956         fi
957
958 clean-target: $(CLEAN_TARGET_MODULES)
959
960 # Check target.
961
962 .PHONY: check
963 check: $(CHECK_MODULES) \
964         $(CHECK_TARGET_MODULES) \
965         $(CHECK_X11_MODULES) \
966         check-gcc
967
968 # Installation targets.
969
970 .PHONY: install uninstall source-vault binary-vault vault-install
971 install: $(INSTALL_TARGET) 
972
973 uninstall:
974         @echo "the uninstall target is not supported in this tree"
975
976 source-vault:
977         $(MAKE) -f ./release/Build-A-Release \
978                 host=$(host_alias) source-vault
979
980 binary-vault:
981         $(MAKE) -f ./release/Build-A-Release \
982                 host=$(host_alias) target=$(target_alias)
983
984 vault-install:
985         @if [ -f ./release/vault-install ] ; then \
986           ./release/vault-install $(host_alias) $(target_alias) ; \
987         else \
988           true ; \
989         fi
990
991 .PHONY: install.all
992 install.all: install-no-fixedincludes
993         @if [ -f ./gcc/Makefile ] ; then \
994                 r=`pwd` ; export r ; \
995                 $(SET_LIB_PATH) \
996                 (cd ./gcc; \
997                 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
998         else \
999                 true ; \
1000         fi
1001
1002 # inet-install is used because the I*Net wants DejaGNU installed but
1003 # not built.  Similarly, gzip is built but not installed.
1004 inet-install:
1005         $(MAKE) INSTALL_MODULES="`echo $(INSTALL_MODULES) | sed -e 's/install-dejagnu//' -e 's/install-gzip//'`" install
1006
1007 # install-no-fixedincludes is used because Cygnus can not distribute
1008 # the fixed header files.
1009 .PHONY: install-no-fixedincludes
1010 install-no-fixedincludes: \
1011         installdirs \
1012         $(INSTALL_MODULES) \
1013         $(INSTALL_TARGET_MODULES) \
1014         $(INSTALL_X11_MODULES) \
1015         gcc-no-fixedincludes 
1016
1017 # Install the gcc headers files, but not the fixed include files,
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
1021 gcc-no-fixedincludes:
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; \
1026           cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
1027           touch gcc/stmp-fixinc gcc/include/fixed; \
1028           rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
1029           r=`pwd`; export r; \
1030           s=`cd $(srcdir); pwd` ; export s; \
1031           $(SET_LIB_PATH) \
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
1037
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.
1040 #
1041 # all-gui, and all-libproc are handled specially because
1042 # they are still experimental, and if they fail to build, that
1043 # shouldn't stop "make all".
1044 .PHONY: $(ALL_MODULES) all-gui all-libproc
1045 $(ALL_MODULES) all-gui all-libproc:
1046         @dir=`echo $@ | sed -e 's/all-//'`; \
1047         if [ -f ./$${dir}/Makefile ] ; then \
1048           r=`pwd`; export r; \
1049           s=`cd $(srcdir); pwd`; export s; \
1050           $(SET_LIB_PATH) \
1051           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
1052         else \
1053           true; \
1054         fi
1055
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.
1059
1060 .PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
1061 $(NATIVE_CHECK_MODULES):
1062         @if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
1063           dir=`echo $@ | sed -e 's/check-//'`; \
1064           if [ -f ./$${dir}/Makefile ] ; then \
1065             r=`pwd`; export r; \
1066             s=`cd $(srcdir); pwd`; export s; \
1067             $(SET_LIB_PATH) \
1068             (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1069           else \
1070             true; \
1071           fi; \
1072         fi
1073
1074 $(CROSS_CHECK_MODULES):
1075         @dir=`echo $@ | sed -e 's/check-//'`; \
1076         if [ -f ./$${dir}/Makefile ] ; then \
1077           r=`pwd`; export r; \
1078           s=`cd $(srcdir); pwd`; export s; \
1079           $(SET_LIB_PATH) \
1080           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1081         else \
1082           true; \
1083         fi
1084
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)
1088 $(INSTALL_MODULES): installdirs
1089         @dir=`echo $@ | sed -e 's/install-//'`; \
1090         if [ -f ./$${dir}/Makefile ] ; then \
1091           r=`pwd`; export r; \
1092           s=`cd $(srcdir); pwd`; export s; \
1093           $(SET_LIB_PATH) \
1094           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1095         else \
1096           true; \
1097         fi
1098
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):
1103         @dir=`echo $@ | sed -e 's/configure-target-//'`; \
1104         if [ -d $(TARGET_SUBDIR)/$${dir} ]; then \
1105           r=`pwd`; export r; \
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; \
1116             else \
1117               mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1118             fi; \
1119           fi; \
1120         fi; exit 0      # break command into two pieces
1121         @dir=`echo $@ | sed -e 's/configure-target-//'`; \
1122         if [ ! -d $(TARGET_SUBDIR) ]; then \
1123           true; \
1124         elif [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1125           true; \
1126         elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
1127           if [ -d $(srcdir)/$${dir} ]; then \
1128             [ -d $(TARGET_SUBDIR)/$${dir} ] || mkdir $(TARGET_SUBDIR)/$${dir};\
1129             r=`pwd`; export r; \
1130             s=`cd $(srcdir); pwd`; export s; \
1131             $(SET_LIB_PATH) \
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; \
1138             DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
1139             LD="$(LD_FOR_TARGET)"; export LD; \
1140             LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
1141             NM="$(NM_FOR_TARGET)"; export NM; \
1142             RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
1143             echo Configuring in $(TARGET_SUBDIR)/$${dir}; \
1144             cd $(TARGET_SUBDIR)/$${dir}; \
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 \
1156                 if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
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; \
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}"; \
1176               libsrcdir="$$s/$${dir}"; \
1177             fi; \
1178             if [ -f $${libsrcdir}/configure ] ; then \
1179               $(SHELL) $${libsrcdir}/configure \
1180                 $(CONFIG_ARGUMENTS) $${srcdiroption} \
1181                 --with-target-subdir="$(TARGET_SUBDIR)"; \
1182             else \
1183               $(SHELL) $$s/configure \
1184                 $(CONFIG_ARGUMENTS) $${srcdiroption} \
1185                 --with-target-subdir="$(TARGET_SUBDIR)"; \
1186             fi; \
1187           else \
1188             true; \
1189           fi; \
1190         else \
1191           true; \
1192         fi
1193
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.
1196 .PHONY: $(ALL_TARGET_MODULES)
1197 $(ALL_TARGET_MODULES):
1198         @dir=`echo $@ | sed -e 's/all-target-//'`; \
1199         if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1200           r=`pwd`; export r; \
1201           s=`cd $(srcdir); pwd`; export s; \
1202           $(SET_LIB_PATH) \
1203           (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
1204         else \
1205           true; \
1206         fi
1207
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):
1212         @dir=`echo $@ | sed -e 's/check-target-//'`; \
1213         if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1214           r=`pwd`; export r; \
1215           s=`cd $(srcdir); pwd`; export s; \
1216           $(SET_LIB_PATH) \
1217           (cd $(TARGET_SUBDIR)/$${dir};$(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
1218         else \
1219           true; \
1220         fi
1221
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)
1226 $(INSTALL_TARGET_MODULES): installdirs
1227         @dir=`echo $@ | sed -e 's/install-target-//'`; \
1228         if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1229           r=`pwd`; export r; \
1230           s=`cd $(srcdir); pwd`; export s; \
1231           $(SET_LIB_PATH) \
1232           (cd $(TARGET_SUBDIR)/$${dir}; \
1233             $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
1234         else \
1235           true; \
1236         fi
1237
1238 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
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 \
1244           r=`pwd`; export r; \
1245           s=`cd $(srcdir); pwd`; export s; \
1246           $(SET_LIB_PATH) \
1247           (cd $${dir}; \
1248            $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
1249         else \
1250           true; \
1251         fi
1252
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 \
1259           r=`pwd`; export r; \
1260           s=`cd $(srcdir); pwd`; export s; \
1261           $(SET_LIB_PATH) \
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.
1269 # To build a target install-X means to cd to X and make install.
1270 .PHONY: $(INSTALL_X11_MODULES)
1271 $(INSTALL_X11_MODULES):
1272         @dir=`echo $@ | sed -e 's/install-//'`; \
1273         if [ -f ./$${dir}/Makefile ] ; then \
1274           r=`pwd`; export r; \
1275           s=`cd $(srcdir); pwd`; export s; \
1276           $(SET_LIB_PATH) \
1277           (cd $${dir}; \
1278            $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
1279         else \
1280           true; \
1281         fi
1282
1283 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
1284 .PHONY: all-gcc
1285 all-gcc:
1286         @if [ -f ./gcc/Makefile ] ; then \
1287           r=`pwd`; export r; \
1288           s=`cd $(srcdir); pwd`; export s; \
1289           $(SET_LIB_PATH) \
1290           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
1291         else \
1292           true; \
1293         fi
1294
1295 .PHONY: all-bootstrap
1296 all-bootstrap:
1297         @if [ -f ./gcc/Makefile ] ; then \
1298           r=`pwd`; export r; \
1299           s=`cd $(srcdir); pwd`; export s; \
1300           $(SET_LIB_PATH) \
1301           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) bootstrap); \
1302         else \
1303           true; \
1304         fi
1305
1306 .PHONY: check-gcc
1307 check-gcc:
1308         @if [ -f ./gcc/Makefile ] ; then \
1309           r=`pwd`; export r; \
1310           s=`cd $(srcdir); pwd`; export s; \
1311           $(SET_LIB_PATH) \
1312           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
1313         else \
1314           true; \
1315         fi
1316
1317 .PHONY: install-gcc
1318 install-gcc:
1319         @if [ -f ./gcc/Makefile ] ; then \
1320           r=`pwd`; export r; \
1321           s=`cd $(srcdir); pwd`; export s; \
1322           $(SET_LIB_PATH) \
1323           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1324         else \
1325           true; \
1326         fi
1327
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.
1332 .PHONY: install-dosrel
1333 install-dosrel: installdirs info
1334         @dir=`echo $@ | sed -e 's/install-//'`; \
1335         if [ -f ./$${dir}/Makefile ] ; then \
1336           r=`pwd`; export r; \
1337           s=`cd $(srcdir); pwd`; export s; \
1338           $(SET_LIB_PATH) \
1339           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1340         else \
1341           true; \
1342         fi
1343
1344 install-dosrel-fake:
1345
1346
1347 # This is a list of inter-dependencies among modules.
1348 all-apache:
1349 all-autoconf: all-m4
1350 all-automake:
1351 all-bash:
1352 all-bfd:
1353 all-binutils: all-libiberty all-opcodes all-bfd all-flex all-byacc
1354 all-byacc:
1355 all-cvs:
1356 all-db:
1357 all-dejagnu: all-tcl all-expect all-tk
1358 all-diff: all-libiberty
1359 all-emacs:
1360 all-emacs19: all-byacc
1361 all-etc:
1362 configure-target-examples: $(ALL_GCC)
1363 all-target-examples: configure-target-examples
1364 all-expect: all-tcl all-tk
1365 all-fileutils: all-libiberty
1366 all-findutils:
1367 all-find:
1368 all-flex: all-libiberty all-byacc
1369 all-gas: all-libiberty all-opcodes all-bfd
1370 all-gash: all-tcl
1371 all-gawk:
1372 ALL_GCC = all-gcc
1373 all-gcc: all-byacc all-binutils all-gas all-ld
1374 all-bootstrap: all-libiberty all-byacc all-binutils all-gas all-ld
1375 GDB_TK = all-tk all-tcl
1376 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK)
1377 all-gnuserv:
1378 configure-target-gperf: $(ALL_GCC)
1379 all-target-gperf: configure-target-gperf all-target-libiberty all-target-libg++
1380 all-gprof: all-libiberty all-bfd all-opcodes
1381 all-grep: all-libiberty
1382 all-grez: all-libiberty all-bfd all-opcodes
1383 all-gui: all-gdb all-libproc all-target-librx
1384 all-guile:
1385 all-gzip: all-libiberty
1386 all-hello: all-libiberty
1387 # start-sanitize-ide
1388 all-ilu:
1389 # end-sanitize-ide
1390 all-indent:
1391 all-inet: all-tcl all-send-pr all-perl
1392 all-ispell: all-emacs19
1393 all-itcl: all-tcl all-tk
1394 all-ld: all-libiberty all-bfd all-opcodes all-byacc all-flex
1395 configure-target-libg++: $(ALL_GCC) configure-target-librx
1396 all-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++
1397 configure-target-libgloss: $(ALL_GCC)
1398 all-target-libgloss: configure-target-libgloss configure-target-newlib
1399 configure-target-libio: $(ALL_GCC)
1400 all-target-libio: configure-target-libio all-gas all-ld all-gcc all-target-libiberty all-target-newlib
1401 all-libiberty:
1402 # start-sanitize-ide
1403 all-libide: all-tcl all-tk all-itcl all-ilu
1404 # end-sanitize-ide
1405 configure-target-librx: $(ALL_GCC) configure-target-newlib
1406 all-target-librx: configure-target-librx
1407 configure-target-libstdc++: $(ALL_GCC)
1408 all-target-libstdc++: configure-target-libstdc++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio
1409 all-m4: all-libiberty
1410 all-make: all-libiberty
1411 all-mmalloc:
1412 configure-target-newlib: $(ALL_GCC)
1413 all-target-newlib: configure-target-newlib all-binutils all-gas all-gcc
1414 all-opcodes: all-bfd all-libiberty
1415 all-patch: all-libiberty
1416 all-perl:
1417 all-prms: all-libiberty
1418 all-rcs:
1419 all-readline:
1420 all-recode: all-libiberty
1421 all-sed: all-libiberty
1422 all-send-pr: all-prms
1423 all-shellutils:
1424 all-sim: all-libiberty all-bfd all-opcodes
1425 all-sn: all-tcl all-tk all-itcl all-db all-grep
1426 all-tar: all-libiberty
1427 all-tcl:
1428 all-tclX: all-tcl all-tk
1429 all-tk: all-tcl
1430 all-texinfo: all-libiberty
1431 all-textutils:
1432 all-tgas: all-libiberty all-bfd all-opcodes
1433 all-time:
1434 # start-sanitize-ide
1435 all-vmake: all-tcl all-tk all-itcl all-libide
1436 # end-sanitize-ide
1437 all-wdiff:
1438 all-target-winsup: all-target-newlib all-target-libiberty all-target-librx all-target-libio configure-target-winsup 
1439 configure-target-winsup: configure-target-newlib
1440 all-uudecode: all-libiberty
1441 configure-target-libiberty: $(ALL_GCC)
1442 all-target-libiberty: configure-target-libiberty all-gcc all-ld all-target-newlib
1443 all-target: $(ALL_TARGET_MODULES)
1444 install-target: $(INSTALL_TARGET_MODULES)
1445
1446 ### other supporting targets
1447
1448 MAKEDIRS= \
1449         $(prefix) \
1450         $(exec_prefix)
1451 .PHONY: installdirs
1452 installdirs: mkinstalldirs
1453         $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
1454
1455 dir.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 ; \
1460         fi
1461
1462 dist:
1463         @echo "Building a full distribution of this tree isn't done"
1464         @echo "via 'make dist'.  Check out the etc/ subdirectory" 
1465
1466 etags tags: TAGS
1467
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.
1474 TAGS: do-TAGS
1475
1476 # with the gnu make, this is done automatically.
1477
1478 Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
1479         $(SHELL) ./config.status
1480
1481 #
1482 # Support for building net releases
1483
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).
1487 DEVO_SUPPORT= README Makefile.in configure configure.in \
1488         config.guess config.sub config move-if-change \
1489         mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install \
1490         COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
1491         mkinstalldirs
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).
1496 ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
1497         make-stds.texi standards.info*
1498
1499 # When you use `make setup-dirs' or `make taz' you should always redefine
1500 # this macro.
1501 SUPPORT_FILES = list-of-support-files-for-tool-in-question
1502
1503 .PHONY: taz
1504
1505 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
1506   texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
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' \
1510             -e '/^BISON = `if/,/^$$/d' \
1511             -e '/^# BISON:/s/.*/BISON = $(DEFAULT_YACC)/' \
1512         <Makefile.in >tmp
1513         mv -f tmp Makefile.in
1514         #
1515         $(start-sanitize-Sanitize)
1516         @if [ -f .Sanitize ] ; then echo "RUN Sanitize FIRST!" ; false ; fi ;
1517         $(end-sanitize-Sanitize)
1518         ./configure sun4
1519         [ -z "$(CONFIGURE_TARGET_MODULES)" ] \
1520           || $(MAKE) $(CONFIGURE_TARGET_MODULES) ALL_GCC="" \
1521             CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
1522         # Make links, and run "make diststuff" or "make info" when needed.
1523         rm -rf proto-toplev ; mkdir proto-toplev
1524         set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1525         for d in $$dirs ; do \
1526           if [ -d $$d ]; then \
1527             if [ ! -f $$d/Makefile ] ; then true ; \
1528             elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \
1529                 (cd $$d ; $(MAKE) diststuff ) || exit 1 ; \
1530             elif grep '^info:' $$d/Makefile >/dev/null ; then \
1531                 (cd $$d ; $(MAKE) info ) || exit 1 ; \
1532             fi ; \
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 ; \
1538           else ln -s ../$$d proto-toplev/$$d ; fi ; \
1539         done
1540         cd etc ; $(MAKE) info
1541         $(MAKE) distclean
1542         #
1543         mkdir proto-toplev/etc
1544         (cd proto-toplev/etc; \
1545          for i in $(ETC_SUPPORT); do \
1546                 ln -s ../../etc/$$i . ; \
1547          done)
1548         #
1549         # Take out texinfo from configurable dirs
1550         rm proto-toplev/configure.in
1551         sed -e '/^host_tools=/s/texinfo //' \
1552             <configure.in >proto-toplev/configure.in
1553         #
1554         mkdir proto-toplev/texinfo
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
1562         chmod og=u `find . -print`
1563         $(MAKE) -f Makefile.in do-tar-gz TOOL=$(TOOL) \
1564                 VER=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`
1565
1566 do-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
1572
1573 TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1574 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
1575
1576 .PHONY: gas.tar.gz
1577 GAS_SUPPORT_DIRS= bfd include libiberty opcodes setup.com makefile.vms
1578 gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
1579         $(MAKE) -f Makefile.in taz TOOL=gas \
1580                 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
1581
1582 # The FSF "binutils" release includes gprof and ld.
1583 .PHONY: binutils.tar.gz
1584 BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof setup.com makefile.vms
1585 binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
1586         $(MAKE) -f Makefile.in taz TOOL=binutils \
1587                 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS) makeall.bat configure.bat"
1588
1589 .PHONY: gas+binutils.tar.gz
1590 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
1591 gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
1592         $(MAKE) -f Makefile.in taz TOOL=gas \
1593                 SUPPORT_FILES="$(GASB_SUPPORT_DIRS) makeall.bat configure.bat"
1594
1595 .PHONY: libg++.tar.gz
1596 LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty
1597 libg++.tar.gz: $(DIST_SUPPORT) libg++
1598         $(MAKE) -f Makefile.in taz TOOL=libg++ \
1599                 SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
1600
1601 GNATS_SUPPORT_DIRS=include libiberty send-pr
1602 gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
1603         $(MAKE) -f  Makefile.in taz TOOL=gnats \
1604                 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
1605
1606 .PHONY: gdb.tar.gz
1607 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils
1608 GDBTK_SUPPORT_DIRS= `if [ -d tcl -a -d tk ] ; then echo tcl tk ; fi`
1609 gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1610         $(MAKE) -f Makefile.in taz TOOL=gdb \
1611                 SUPPORT_FILES="$(GDB_SUPPORT_DIRS) $(GDBTK_SUPPORT_DIRS)"
1612
1613 .PHONY: newlib.tar.gz
1614 NEWLIB_SUPPORT_DIRS=libgloss
1615 # taz configures for the sun4 target which won't configure newlib.
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).
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).
1626 newlib.tar.gz: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
1627         $(MAKE) -f Makefile.in taz TOOL=newlib \
1628                 SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
1629                 DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
1630
1631 .NOEXPORT:
1632 MAKEOVERRIDES=
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.
1638 unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
1639 # end-sanitize-chill
1640
1641 # end of Makefile.in