First stab at Windows resource compiler:
[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-examples
685
686 # This is a list of the configure targets for all of the modules which
687 # are compiled using the target tools.
688 CONFIGURE_TARGET_MODULES = \
689         configure-target-libio \
690         configure-target-libstdc++ \
691         configure-target-librx \
692         configure-target-libg++ \
693         configure-target-newlib \
694         configure-target-winsup \
695         configure-target-libgloss \
696         configure-target-libiberty \
697         configure-target-examples
698
699 # This is a list of the check targets for all of the modules which are
700 # compiled using $(TARGET_FLAGS_TO_PASS).
701 CHECK_TARGET_MODULES = \
702         check-target-libio \
703         check-target-libstdc++ \
704         check-target-libg++ \
705         check-target-newlib \
706         check-target-winsup \
707         check-target-libiberty
708
709 # This is a list of the install targets for all of the modules which are
710 # compiled using $(TARGET_FLAGS_TO_PASS).
711 INSTALL_TARGET_MODULES = \
712         install-target-libio \
713         install-target-libstdc++ \
714         install-target-libg++ \
715         install-target-newlib \
716         install-target-winsup \
717         install-target-libgloss \
718         install-target-libiberty
719
720 # This is a list of the targets for which we can do a clean-{target}.
721 CLEAN_MODULES = \
722         clean-apache \
723         clean-autoconf \
724         clean-automake \
725         clean-bash \
726         clean-bfd \
727         clean-binutils \
728         clean-byacc \
729         clean-cvs \
730         clean-db \
731         clean-dejagnu \
732         clean-diff \
733         clean-dosutils \
734         clean-etc \
735         clean-fileutils \
736         clean-findutils \
737         clean-find \
738         clean-flex \
739         clean-gas \
740         clean-gawk \
741         clean-gnuserv \
742         clean-gprof \
743         clean-grep \
744         clean-grez \
745         clean-gzip \
746         clean-hello \
747         $(start-sanitize-ide) \
748         clean-ilu \
749         $(end-sanitize-ide) \
750         clean-indent \
751         clean-inet \
752         clean-ispell \
753         clean-itcl \
754         clean-ld \
755         clean-libiberty \
756         $(start-sanitize-ide) \
757         clean-libide \
758         $(end-sanitize-ide) \
759         clean-m4 \
760         clean-make \
761         clean-mmalloc \
762         clean-opcodes \
763         clean-patch \
764         clean-perl \
765         clean-prms \
766         clean-rcs \
767         clean-readline \
768         clean-release \
769         clean-recode \
770         clean-sed \
771         clean-send-pr \
772         clean-shellutils \
773         clean-sim \
774         clean-sn \
775         clean-tar \
776         clean-tcl \
777         clean-texinfo \
778         clean-textutils \
779         clean-tgas \
780         clean-time \
781         clean-uudecode \
782         $(start-sanitize-ide) \
783         clean-vmake \
784         $(end-sanitize-ide) \
785         clean-wdiff
786
787 # All of the target modules that can be cleaned
788 CLEAN_TARGET_MODULES = \
789         clean-target-libio \
790         clean-target-libstdc++ \
791         clean-target-librx \
792         clean-target-libg++ \
793         clean-target-newlib \
794         clean-target-winsup \
795         clean-target-libgloss \
796         clean-target-libiberty \
797         clean-target-examples
798
799 # All of the x11 modules that can be cleaned
800 CLEAN_X11_MODULES = \
801         clean-emacs \
802         clean-emacs19 \
803         clean-gdb \
804         clean-expect \
805         clean-gash \
806         clean-guile \
807         clean-tclX \
808         clean-tk
809
810 # The first rule in the file had better be this one.  Don't put any above it.
811 all: all.normal
812 .PHONY: all
813
814 # The target built for a native build.
815 .PHONY: all.normal
816 all.normal: \
817         $(ALL_MODULES) \
818         $(ALL_X11_MODULES) \
819         $(ALL_TARGET_MODULES) \
820         all-gcc
821
822 # Do a target for all the subdirectories.  A ``make do-X'' will do a
823 # ``make X'' in all subdirectories (because, in general, there is a
824 # dependency (below) of X upon do-X, a ``make X'' will also do this,
825 # but it may do additional work as well).
826 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
827 # because it is so large that it can easily overflow the command line
828 # length limit on some systems.
829 DO_X = \
830         do-clean \
831         do-distclean \
832         do-dvi \
833         do-info \
834         do-install-info \
835         do-installcheck \
836         do-mostlyclean \
837         do-maintainer-clean \
838         do-TAGS
839 .PHONY: $(DO_X)
840 $(DO_X):
841         @target=`echo $@ | sed -e 's/^do-//'`; \
842         r=`pwd`; export r; \
843         s=`cd $(srcdir); pwd`; export s; \
844         $(SET_LIB_PATH) \
845         for i in $(SUBDIRS) -dummy-; do \
846           if [ -f ./$$i/Makefile ]; then \
847             case $$i in \
848             gcc) \
849               for flag in $(EXTRA_GCC_FLAGS); do \
850                 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
851               done; \
852               ;; \
853             *) \
854               for flag in $(EXTRA_HOST_FLAGS); do \
855                 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
856               done; \
857               ;; \
858             esac ; \
859             export AR AS CC CXX LD NM RANLIB DLLTOOL; \
860             if (cd ./$$i; \
861                 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
862                         "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
863                         "RANLIB=$${RANLIB}" \
864                         "DLLTOOL=$${DLLTOOL}" \
865                         $${target}); \
866             then true; else exit 1; fi; \
867           else true; fi; \
868         done
869         @target=`echo $@ | sed -e 's/^do-//'`; \
870         r=`pwd`; export r; \
871         s=`cd $(srcdir); pwd`; export s; \
872         $(SET_LIB_PATH) \
873         for i in $(TARGET_CONFIGDIRS) -dummy-; do \
874           if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \
875             for flag in $(EXTRA_TARGET_FLAGS); do \
876                 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
877             done; \
878             export AR AS CC CXX LD NM RANLIB DLLTOOL; \
879             if (cd $(TARGET_SUBDIR)/$$i; \
880                 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
881                         "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
882                         "RANLIB=$${RANLIB}" \
883                         "DLLTOOL=$${DLLTOOL}" \
884                         $${target}); \
885             then true; else exit 1; fi; \
886           else true; fi; \
887         done
888
889 # Here are the targets which correspond to the do-X targets.
890
891 .PHONY: info installcheck dvi install-info
892 .PHONY: clean distclean mostlyclean maintainer-clean realclean
893 .PHONY: local-clean local-distclean local-maintainer-clean
894 info: do-info
895 installcheck: do-installcheck
896 dvi: do-dvi
897
898 # Make sure makeinfo is built before we do a `make info'.
899 do-info: all-texinfo
900
901 install-info: do-install-info dir.info
902         s=`cd $(srcdir); pwd`; export s; \
903         if [ -f dir.info ] ; then \
904           $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
905         else true ; fi
906
907 local-clean:
908         -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
909
910 local-distclean:
911         -rm -f Makefile config.status config.cache
912         -if [ "$(TARGET_SUBDIR)" != "." ]; then \
913           rm -rf $(TARGET_SUBDIR); \
914         else true; fi
915
916 local-maintainer-clean:
917         @echo "This command is intended for maintainers to use;"
918         @echo "it deletes files that may require special tools to rebuild."
919
920 clean: do-clean local-clean
921 mostlyclean: do-mostlyclean local-clean
922 distclean: do-distclean local-clean local-distclean
923 maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean 
924 maintainer-clean: local-distclean
925 realclean: maintainer-clean
926
927 # This rule is used to clean specific modules.
928 .PHONY: $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc
929 $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc:
930         @dir=`echo $@ | sed -e 's/clean-//'`; \
931         if [ -f ./$${dir}/Makefile ] ; then \
932           r=`pwd`; export r; \
933           s=`cd $(srcdir); pwd`; export s; \
934           $(SET_LIB_PATH) \
935           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) clean); \
936         else \
937           true; \
938         fi
939
940 .PHONY: $(CLEAN_TARGET_MODULES)
941 $(CLEAN_TARGET_MODULES):
942         @dir=`echo $@ | sed -e 's/clean-target-//'`; \
943         rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
944         if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
945           r=`pwd`; export r; \
946           s=`cd $(srcdir); pwd`; export s; \
947           $(SET_LIB_PATH) \
948           (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) clean); \
949         else \
950           true; \
951         fi
952
953 clean-target: $(CLEAN_TARGET_MODULES)
954
955 # Check target.
956
957 .PHONY: check
958 check: $(CHECK_MODULES) \
959         $(CHECK_TARGET_MODULES) \
960         $(CHECK_X11_MODULES) \
961         check-gcc
962
963 # Installation targets.
964
965 .PHONY: install uninstall source-vault binary-vault vault-install
966 install: $(INSTALL_TARGET) 
967
968 uninstall:
969         @echo "the uninstall target is not supported in this tree"
970
971 source-vault:
972         $(MAKE) -f ./release/Build-A-Release \
973                 host=$(host_alias) source-vault
974
975 binary-vault:
976         $(MAKE) -f ./release/Build-A-Release \
977                 host=$(host_alias) target=$(target_alias)
978
979 vault-install:
980         @if [ -f ./release/vault-install ] ; then \
981           ./release/vault-install $(host_alias) $(target_alias) ; \
982         else \
983           true ; \
984         fi
985
986 .PHONY: install.all
987 install.all: install-no-fixedincludes
988         @if [ -f ./gcc/Makefile ] ; then \
989                 r=`pwd` ; export r ; \
990                 $(SET_LIB_PATH) \
991                 (cd ./gcc; \
992                 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
993         else \
994                 true ; \
995         fi
996
997 # inet-install is used because the I*Net wants DejaGNU installed but
998 # not built.  Similarly, gzip is built but not installed.
999 inet-install:
1000         $(MAKE) INSTALL_MODULES="`echo $(INSTALL_MODULES) | sed -e 's/install-dejagnu//' -e 's/install-gzip//'`" install
1001
1002 # install-no-fixedincludes is used because Cygnus can not distribute
1003 # the fixed header files.
1004 .PHONY: install-no-fixedincludes
1005 install-no-fixedincludes: \
1006         installdirs \
1007         $(INSTALL_MODULES) \
1008         $(INSTALL_TARGET_MODULES) \
1009         $(INSTALL_X11_MODULES) \
1010         gcc-no-fixedincludes 
1011
1012 # Install the gcc headers files, but not the fixed include files,
1013 # which Cygnus is not allowed to distribute.  This rule is very
1014 # dependent on the workings of the gcc Makefile.in.
1015 .PHONY: gcc-no-fixedincludes
1016 gcc-no-fixedincludes:
1017         @if [ -f ./gcc/Makefile ]; then \
1018           rm -rf gcc/tmp-include; \
1019           mv gcc/include gcc/tmp-include 2>/dev/null; \
1020           mkdir gcc/include; \
1021           cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
1022           touch gcc/stmp-fixinc gcc/include/fixed; \
1023           rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
1024           r=`pwd`; export r; \
1025           s=`cd $(srcdir); pwd` ; export s; \
1026           $(SET_LIB_PATH) \
1027           (cd ./gcc; \
1028            $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1029           rm -rf gcc/include; \
1030           mv gcc/tmp-include gcc/include 2>/dev/null; \
1031         else true; fi
1032
1033 # This rule is used to build the modules which use FLAGS_TO_PASS.  To
1034 # build a target all-X means to cd to X and make all.
1035 #
1036 # all-gui, and all-libproc are handled specially because
1037 # they are still experimental, and if they fail to build, that
1038 # shouldn't stop "make all".
1039 .PHONY: $(ALL_MODULES) all-gui all-libproc
1040 $(ALL_MODULES) all-gui all-libproc:
1041         @dir=`echo $@ | sed -e 's/all-//'`; \
1042         if [ -f ./$${dir}/Makefile ] ; then \
1043           r=`pwd`; export r; \
1044           s=`cd $(srcdir); pwd`; export s; \
1045           $(SET_LIB_PATH) \
1046           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
1047         else \
1048           true; \
1049         fi
1050
1051 # These rules are used to check the modules which use FLAGS_TO_PASS.
1052 # To build a target check-X means to cd to X and make check.  Some
1053 # modules are only tested in a native toolchain.
1054
1055 .PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
1056 $(NATIVE_CHECK_MODULES):
1057         @if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
1058           dir=`echo $@ | sed -e 's/check-//'`; \
1059           if [ -f ./$${dir}/Makefile ] ; then \
1060             r=`pwd`; export r; \
1061             s=`cd $(srcdir); pwd`; export s; \
1062             $(SET_LIB_PATH) \
1063             (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1064           else \
1065             true; \
1066           fi; \
1067         fi
1068
1069 $(CROSS_CHECK_MODULES):
1070         @dir=`echo $@ | sed -e 's/check-//'`; \
1071         if [ -f ./$${dir}/Makefile ] ; then \
1072           r=`pwd`; export r; \
1073           s=`cd $(srcdir); pwd`; export s; \
1074           $(SET_LIB_PATH) \
1075           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1076         else \
1077           true; \
1078         fi
1079
1080 # This rule is used to install the modules which use FLAGS_TO_PASS.
1081 # To build a target install-X means to cd to X and make install.
1082 .PHONY: $(INSTALL_MODULES)
1083 $(INSTALL_MODULES): installdirs
1084         @dir=`echo $@ | sed -e 's/install-//'`; \
1085         if [ -f ./$${dir}/Makefile ] ; then \
1086           r=`pwd`; export r; \
1087           s=`cd $(srcdir); pwd`; export s; \
1088           $(SET_LIB_PATH) \
1089           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1090         else \
1091           true; \
1092         fi
1093
1094 # This rule is used to configure the modules which are built with the
1095 # target tools.
1096 .PHONY: $(CONFIGURE_TARGET_MODULES)
1097 $(CONFIGURE_TARGET_MODULES):
1098         @dir=`echo $@ | sed -e 's/configure-target-//'`; \
1099         if [ -d $(TARGET_SUBDIR)/$${dir} ]; then \
1100           r=`pwd`; export r; \
1101           $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/$${dir}/tmpmulti.out 2> /dev/null; \
1102           if [ -s $(TARGET_SUBDIR)/$${dir}/tmpmulti.out ]; then \
1103             if [ -f $(TARGET_SUBDIR)/$${dir}/multilib.out ]; then \
1104               if cmp $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out > /dev/null; then \
1105                 rm -f $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
1106               else \
1107                 echo "Multilibs changed for $${dir}, reconfiguring"; \
1108                 rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/Makefile; \
1109                 mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1110               fi; \
1111             else \
1112               mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1113             fi; \
1114           fi; \
1115         fi; exit 0      # break command into two pieces
1116         @dir=`echo $@ | sed -e 's/configure-target-//'`; \
1117         if [ ! -d $(TARGET_SUBDIR) ]; then \
1118           true; \
1119         elif [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1120           true; \
1121         elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
1122           if [ -d $(srcdir)/$${dir} ]; then \
1123             [ -d $(TARGET_SUBDIR)/$${dir} ] || mkdir $(TARGET_SUBDIR)/$${dir};\
1124             r=`pwd`; export r; \
1125             s=`cd $(srcdir); pwd`; export s; \
1126             $(SET_LIB_PATH) \
1127             AR="$(AR_FOR_TARGET)"; export AR; \
1128             AS="$(AS_FOR_TARGET)"; export AS; \
1129             CC="$(CC_FOR_TARGET)"; export CC; \
1130             CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
1131             CXX="$(CXX_FOR_TARGET)"; export CXX; \
1132             CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
1133             DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
1134             LD="$(LD_FOR_TARGET)"; export LD; \
1135             LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
1136             NM="$(NM_FOR_TARGET)"; export NM; \
1137             RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
1138             echo Configuring in $(TARGET_SUBDIR)/$${dir}; \
1139             cd $(TARGET_SUBDIR)/$${dir}; \
1140             case $(srcdir) in \
1141             /*) \
1142               topdir=$(srcdir) ;; \
1143             *) \
1144               case "$(TARGET_SUBDIR)" in \
1145               .) topdir="../$(srcdir)" ;; \
1146               *) topdir="../../$(srcdir)" ;; \
1147               esac ;; \
1148             esac; \
1149             if [ "$(srcdir)" = "." ] ; then \
1150               if [ "$(TARGET_SUBDIR)" != "." ] ; then \
1151                 if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
1152                   if [ -f Makefile ]; then \
1153                     if $(MAKE) distclean; then \
1154                       true; \
1155                     else \
1156                       exit 1; \
1157                     fi; \
1158                   else \
1159                     true; \
1160                   fi; \
1161                 else \
1162                   exit 1; \
1163                 fi; \
1164               else \
1165                 true; \
1166               fi; \
1167               srcdiroption="--srcdir=."; \
1168               libsrcdir="."; \
1169             else \
1170               srcdiroption="--srcdir=$${topdir}/$${dir}"; \
1171               libsrcdir="$$s/$${dir}"; \
1172             fi; \
1173             if [ -f $${libsrcdir}/configure ] ; then \
1174               $(SHELL) $${libsrcdir}/configure \
1175                 $(CONFIG_ARGUMENTS) $${srcdiroption} \
1176                 --with-target-subdir="$(TARGET_SUBDIR)"; \
1177             else \
1178               $(SHELL) $$s/configure \
1179                 $(CONFIG_ARGUMENTS) $${srcdiroption} \
1180                 --with-target-subdir="$(TARGET_SUBDIR)"; \
1181             fi; \
1182           else \
1183             true; \
1184           fi; \
1185         else \
1186           true; \
1187         fi
1188
1189 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
1190 # To build a target all-X means to cd to X and make all.
1191 .PHONY: $(ALL_TARGET_MODULES)
1192 $(ALL_TARGET_MODULES):
1193         @dir=`echo $@ | sed -e 's/all-target-//'`; \
1194         if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1195           r=`pwd`; export r; \
1196           s=`cd $(srcdir); pwd`; export s; \
1197           $(SET_LIB_PATH) \
1198           (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
1199         else \
1200           true; \
1201         fi
1202
1203 # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
1204 # To build a target install-X means to cd to X and make install.
1205 .PHONY: $(CHECK_TARGET_MODULES)
1206 $(CHECK_TARGET_MODULES):
1207         @dir=`echo $@ | sed -e 's/check-target-//'`; \
1208         if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1209           r=`pwd`; export r; \
1210           s=`cd $(srcdir); pwd`; export s; \
1211           $(SET_LIB_PATH) \
1212           (cd $(TARGET_SUBDIR)/$${dir};$(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
1213         else \
1214           true; \
1215         fi
1216
1217 # This rule is used to install the modules which use
1218 # TARGET_FLAGS_TO_PASS.  To build a target install-X means to cd to X
1219 # and make install.
1220 .PHONY: $(INSTALL_TARGET_MODULES)
1221 $(INSTALL_TARGET_MODULES): installdirs
1222         @dir=`echo $@ | sed -e 's/install-target-//'`; \
1223         if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1224           r=`pwd`; export r; \
1225           s=`cd $(srcdir); pwd`; export s; \
1226           $(SET_LIB_PATH) \
1227           (cd $(TARGET_SUBDIR)/$${dir}; \
1228             $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
1229         else \
1230           true; \
1231         fi
1232
1233 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
1234 # To build a target all-X means to cd to X and make all.
1235 .PHONY: $(ALL_X11_MODULES)
1236 $(ALL_X11_MODULES):
1237         @dir=`echo $@ | sed -e 's/all-//'`; \
1238         if [ -f ./$${dir}/Makefile ] ; then \
1239           r=`pwd`; export r; \
1240           s=`cd $(srcdir); pwd`; export s; \
1241           $(SET_LIB_PATH) \
1242           (cd $${dir}; \
1243            $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
1244         else \
1245           true; \
1246         fi
1247
1248 # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
1249 # To build a target check-X means to cd to X and make all.
1250 .PHONY: $(CHECK_X11_MODULES)
1251 $(CHECK_X11_MODULES):
1252         @dir=`echo $@ | sed -e 's/check-//'`; \
1253         if [ -f ./$${dir}/Makefile ] ; then \
1254           r=`pwd`; export r; \
1255           s=`cd $(srcdir); pwd`; export s; \
1256           $(SET_LIB_PATH) \
1257           (cd $${dir}; \
1258            $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
1259         else \
1260           true; \
1261         fi
1262
1263 # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
1264 # To build a target install-X means to cd to X and make install.
1265 .PHONY: $(INSTALL_X11_MODULES)
1266 $(INSTALL_X11_MODULES):
1267         @dir=`echo $@ | sed -e 's/install-//'`; \
1268         if [ -f ./$${dir}/Makefile ] ; then \
1269           r=`pwd`; export r; \
1270           s=`cd $(srcdir); pwd`; export s; \
1271           $(SET_LIB_PATH) \
1272           (cd $${dir}; \
1273            $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
1274         else \
1275           true; \
1276         fi
1277
1278 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
1279 .PHONY: all-gcc
1280 all-gcc:
1281         @if [ -f ./gcc/Makefile ] ; then \
1282           r=`pwd`; export r; \
1283           s=`cd $(srcdir); pwd`; export s; \
1284           $(SET_LIB_PATH) \
1285           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
1286         else \
1287           true; \
1288         fi
1289
1290 .PHONY: all-bootstrap
1291 all-bootstrap:
1292         @if [ -f ./gcc/Makefile ] ; then \
1293           r=`pwd`; export r; \
1294           s=`cd $(srcdir); pwd`; export s; \
1295           $(SET_LIB_PATH) \
1296           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) bootstrap); \
1297         else \
1298           true; \
1299         fi
1300
1301 .PHONY: check-gcc
1302 check-gcc:
1303         @if [ -f ./gcc/Makefile ] ; then \
1304           r=`pwd`; export r; \
1305           s=`cd $(srcdir); pwd`; export s; \
1306           $(SET_LIB_PATH) \
1307           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
1308         else \
1309           true; \
1310         fi
1311
1312 .PHONY: install-gcc
1313 install-gcc:
1314         @if [ -f ./gcc/Makefile ] ; then \
1315           r=`pwd`; export r; \
1316           s=`cd $(srcdir); pwd`; export s; \
1317           $(SET_LIB_PATH) \
1318           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1319         else \
1320           true; \
1321         fi
1322
1323
1324 # EXPERIMENTAL STUFF
1325 # This rule is used to install the modules which use FLAGS_TO_PASS.
1326 # To build a target install-X means to cd to X and make install.
1327 .PHONY: install-dosrel
1328 install-dosrel: installdirs info
1329         @dir=`echo $@ | sed -e 's/install-//'`; \
1330         if [ -f ./$${dir}/Makefile ] ; then \
1331           r=`pwd`; export r; \
1332           s=`cd $(srcdir); pwd`; export s; \
1333           $(SET_LIB_PATH) \
1334           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1335         else \
1336           true; \
1337         fi
1338
1339 install-dosrel-fake:
1340
1341
1342 # This is a list of inter-dependencies among modules.
1343 all-apache:
1344 all-autoconf: all-m4
1345 all-automake:
1346 all-bash:
1347 all-bfd:
1348 all-binutils: all-libiberty all-opcodes all-bfd all-flex all-byacc
1349 all-byacc:
1350 all-cvs:
1351 all-db:
1352 all-dejagnu: all-tcl all-expect all-tk
1353 all-diff: all-libiberty
1354 all-emacs:
1355 all-emacs19: all-byacc
1356 all-etc:
1357 configure-target-examples: $(ALL_GCC)
1358 all-target-examples: configure-target-examples
1359 all-expect: all-tcl all-tk
1360 all-fileutils: all-libiberty
1361 all-findutils:
1362 all-find:
1363 all-flex: all-libiberty all-byacc
1364 all-gas: all-libiberty all-opcodes all-bfd
1365 all-gash: all-tcl
1366 all-gawk:
1367 ALL_GCC = all-gcc
1368 all-gcc: all-byacc all-binutils all-gas all-ld
1369 all-bootstrap: all-libiberty all-byacc all-binutils all-gas all-ld
1370 GDB_TK = all-tk all-tcl
1371 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK)
1372 all-gnuserv:
1373 all-gprof: all-libiberty all-bfd all-opcodes
1374 all-grep: all-libiberty
1375 all-grez: all-libiberty all-bfd all-opcodes
1376 all-gui: all-gdb all-libproc all-target-librx
1377 all-guile:
1378 all-gzip: all-libiberty
1379 all-hello: all-libiberty
1380 # start-sanitize-ide
1381 all-ilu:
1382 # end-sanitize-ide
1383 all-indent:
1384 all-inet: all-tcl all-send-pr all-perl
1385 all-ispell: all-emacs19
1386 all-itcl: all-tcl all-tk
1387 all-ld: all-libiberty all-bfd all-opcodes all-byacc all-flex
1388 configure-target-libg++: $(ALL_GCC) configure-target-librx
1389 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++
1390 configure-target-libgloss: $(ALL_GCC)
1391 all-target-libgloss: configure-target-libgloss configure-target-newlib
1392 configure-target-libio: $(ALL_GCC)
1393 all-target-libio: configure-target-libio all-gas all-ld all-gcc all-target-libiberty all-target-newlib
1394 all-libiberty:
1395 # start-sanitize-ide
1396 all-libide: all-tcl all-tk all-itcl all-ilu
1397 # end-sanitize-ide
1398 configure-target-librx: $(ALL_GCC) configure-target-newlib
1399 all-target-librx: configure-target-librx
1400 configure-target-libstdc++: $(ALL_GCC)
1401 all-target-libstdc++: configure-target-libstdc++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio
1402 all-m4: all-libiberty
1403 all-make: all-libiberty
1404 all-mmalloc:
1405 configure-target-newlib: $(ALL_GCC)
1406 all-target-newlib: configure-target-newlib all-binutils all-gas all-gcc
1407 all-opcodes: all-bfd all-libiberty
1408 all-patch: all-libiberty
1409 all-perl:
1410 all-prms: all-libiberty
1411 all-rcs:
1412 all-readline:
1413 all-recode: all-libiberty
1414 all-sed: all-libiberty
1415 all-send-pr: all-prms
1416 all-shellutils:
1417 all-sim: all-libiberty all-bfd all-opcodes
1418 all-sn: all-tcl all-tk all-itcl all-db all-grep
1419 all-tar: all-libiberty
1420 all-tcl:
1421 all-tclX: all-tcl all-tk
1422 all-tk: all-tcl
1423 all-texinfo: all-libiberty
1424 all-textutils:
1425 all-tgas: all-libiberty all-bfd all-opcodes
1426 all-time:
1427 # start-sanitize-ide
1428 all-vmake: all-tcl all-tk all-itcl all-libide
1429 # end-sanitize-ide
1430 all-wdiff:
1431 all-target-winsup: all-target-newlib all-target-libiberty all-target-librx all-target-libio configure-target-winsup 
1432 configure-target-winsup: configure-target-newlib
1433 all-uudecode: all-libiberty
1434 configure-target-libiberty: $(ALL_GCC)
1435 all-target-libiberty: configure-target-libiberty all-gcc all-ld all-target-newlib
1436 all-target: $(ALL_TARGET_MODULES)
1437 install-target: $(INSTALL_TARGET_MODULES)
1438
1439 ### other supporting targets
1440
1441 MAKEDIRS= \
1442         $(prefix) \
1443         $(exec_prefix)
1444 .PHONY: installdirs
1445 installdirs: mkinstalldirs
1446         $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
1447
1448 dir.info: do-install-info
1449         if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
1450           $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
1451           mv -f dir.info.new dir.info ; \
1452         else true ; \
1453         fi
1454
1455 dist:
1456         @echo "Building a full distribution of this tree isn't done"
1457         @echo "via 'make dist'.  Check out the etc/ subdirectory" 
1458
1459 etags tags: TAGS
1460
1461 # Right now this just builds TAGS in each subdirectory.  emacs19 has the
1462 # ability to use several tags files at once, so there is probably no need
1463 # to combine them into one big TAGS file (like CVS 1.3 does).  We could
1464 # (if we felt like it) have this Makefile write a piece of elisp which
1465 # the user could load to tell emacs19 where all the TAGS files we just
1466 # built are.
1467 TAGS: do-TAGS
1468
1469 # with the gnu make, this is done automatically.
1470
1471 Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
1472         $(SHELL) ./config.status
1473
1474 #
1475 # Support for building net releases
1476
1477 # Files in devo used in any net release.
1478 # ChangeLog omitted because it may refer to files which are not in this
1479 # distribution (perhaps it would be better to include it anyway).
1480 DEVO_SUPPORT= README Makefile.in configure configure.in \
1481         config.guess config.sub config move-if-change \
1482         mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install \
1483         COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
1484         mkinstalldirs
1485
1486 # Files in devo/etc used in any net release.
1487 # ChangeLog omitted because it may refer to files which are not in this
1488 # distribution (perhaps it would be better to include it anyway).
1489 ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
1490         make-stds.texi standards.info*
1491
1492 # When you use `make setup-dirs' or `make taz' you should always redefine
1493 # this macro.
1494 SUPPORT_FILES = list-of-support-files-for-tool-in-question
1495
1496 .PHONY: taz
1497
1498 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
1499   texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1500         # Take out texinfo from a few places; make simple BISON=bison line.
1501         sed -e '/^all\.normal: /s/\all-texinfo //' \
1502             -e '/^      install-texinfo /d' \
1503             -e '/^BISON = `if/,/^$$/d' \
1504             -e '/^# BISON:/s/.*/BISON = $(DEFAULT_YACC)/' \
1505         <Makefile.in >tmp
1506         mv -f tmp Makefile.in
1507         #
1508         $(start-sanitize-Sanitize)
1509         @if [ -f .Sanitize ] ; then echo "RUN Sanitize FIRST!" ; false ; fi ;
1510         $(end-sanitize-Sanitize)
1511         ./configure sun4
1512         [ -z "$(CONFIGURE_TARGET_MODULES)" ] \
1513           || $(MAKE) $(CONFIGURE_TARGET_MODULES) ALL_GCC="" \
1514             CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
1515         # Make links, and run "make diststuff" or "make info" when needed.
1516         rm -rf proto-toplev ; mkdir proto-toplev
1517         set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1518         for d in $$dirs ; do \
1519           if [ -d $$d ]; then \
1520             if [ ! -f $$d/Makefile ] ; then true ; \
1521             elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \
1522                 (cd $$d ; $(MAKE) diststuff ) || exit 1 ; \
1523             elif grep '^info:' $$d/Makefile >/dev/null ; then \
1524                 (cd $$d ; $(MAKE) info ) || exit 1 ; \
1525             fi ; \
1526             if [ -d $$d/proto-$$d.dir ]; then \
1527               ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1528             else \
1529               ln -s ../$$d proto-toplev/$$d ; \
1530             fi ; \
1531           else ln -s ../$$d proto-toplev/$$d ; fi ; \
1532         done
1533         cd etc ; $(MAKE) info
1534         $(MAKE) distclean
1535         #
1536         mkdir proto-toplev/etc
1537         (cd proto-toplev/etc; \
1538          for i in $(ETC_SUPPORT); do \
1539                 ln -s ../../etc/$$i . ; \
1540          done)
1541         #
1542         # Take out texinfo from configurable dirs
1543         rm proto-toplev/configure.in
1544         sed -e '/^host_tools=/s/texinfo //' \
1545             <configure.in >proto-toplev/configure.in
1546         #
1547         mkdir proto-toplev/texinfo
1548         ln -s ../../texinfo/texinfo.tex         proto-toplev/texinfo/
1549         ln -s ../../texinfo/gpl.texinfo         proto-toplev/texinfo/
1550         ln -s ../../texinfo/lgpl.texinfo        proto-toplev/texinfo/
1551         if test -r texinfo/util/tex3patch ; then \
1552           mkdir proto-toplev/texinfo/util && \
1553           ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
1554         else true; fi
1555         chmod og=u `find . -print`
1556         $(MAKE) -f Makefile.in do-tar-gz TOOL=$(TOOL) \
1557                 VER=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`
1558
1559 do-tar-gz:
1560         echo "==> Making $(TOOL)-$(VER).tar.gz"
1561         -rm -f $(TOOL)-$(VER)
1562         ln -s proto-toplev $(TOOL)-$(VER)
1563         tar cfh $(TOOL)-$(VER).tar $(TOOL)-$(VER)
1564         $(GZIPPROG) -v -9 $(TOOL)-$(VER).tar
1565
1566 TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1567 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
1568
1569 .PHONY: gas.tar.gz
1570 GAS_SUPPORT_DIRS= bfd include libiberty opcodes setup.com makefile.vms
1571 gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
1572         $(MAKE) -f Makefile.in taz TOOL=gas \
1573                 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
1574
1575 # The FSF "binutils" release includes gprof and ld.
1576 .PHONY: binutils.tar.gz
1577 BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof setup.com makefile.vms
1578 binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
1579         $(MAKE) -f Makefile.in taz TOOL=binutils \
1580                 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS) makeall.bat configure.bat"
1581
1582 .PHONY: gas+binutils.tar.gz
1583 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
1584 gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
1585         $(MAKE) -f Makefile.in taz TOOL=gas \
1586                 SUPPORT_FILES="$(GASB_SUPPORT_DIRS) makeall.bat configure.bat"
1587
1588 .PHONY: libg++.tar.gz
1589 LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty
1590 libg++.tar.gz: $(DIST_SUPPORT) libg++
1591         $(MAKE) -f Makefile.in taz TOOL=libg++ \
1592                 SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
1593
1594 GNATS_SUPPORT_DIRS=include libiberty send-pr
1595 gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
1596         $(MAKE) -f  Makefile.in taz TOOL=gnats \
1597                 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
1598
1599 .PHONY: gdb.tar.gz
1600 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils
1601 GDBTK_SUPPORT_DIRS= `if [ -d tcl -a -d tk ] ; then echo tcl tk ; fi`
1602 gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1603         $(MAKE) -f Makefile.in taz TOOL=gdb \
1604                 SUPPORT_FILES="$(GDB_SUPPORT_DIRS) $(GDBTK_SUPPORT_DIRS)"
1605
1606 .PHONY: newlib.tar.gz
1607 NEWLIB_SUPPORT_DIRS=libgloss
1608 # taz configures for the sun4 target which won't configure newlib.
1609 # We need newlib configured so that the .info files are made.
1610 # Unfortunately, it is not enough to just configure newlib separately:
1611 # taz will build the .info files but since SUBDIRS won't contain newlib,
1612 # distclean won't be run (leaving Makefile, config.status, and the tmp files
1613 # used in building the .info files, eg: *.def, *.ref).
1614 # The problem isn't solvable however without a lot of extra work because
1615 # target libraries are built in subdir $(target_alias) which gets nuked during
1616 # the make distclean.  For now punt on the issue of shipping newlib info files
1617 # with newlib net releases and wait for a day when some native target (sun4?)
1618 # supports newlib (if only minimally).
1619 newlib.tar.gz: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
1620         $(MAKE) -f Makefile.in taz TOOL=newlib \
1621                 SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
1622                 DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
1623
1624 .NOEXPORT:
1625 MAKEOVERRIDES=
1626
1627 # start-sanitize-chill
1628 ## This is ugly, but I don't want GNU make to put these variables in
1629 ## the environment.  Older makes will see this as a set of targets
1630 ## with no dependencies and no actions.
1631 unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
1632 # end-sanitize-chill
1633
1634 # end of Makefile.in