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