Build gas tar file, based on gdb code:
[platform/upstream/binutils.git] / Makefile.in
1 #
2 # Makefile for directory with subdirs to build.
3 #   Copyright (C) 1990-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., 675 Mass Ave, Cambridge, MA 02139, 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 = $(libdir)
28
29 program_transform_name =
30
31 datadir = $(prefix)/lib
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
46 SHELL = /bin/sh
47
48 INSTALL = cp
49 INSTALL_PROGRAM = $(INSTALL)
50 INSTALL_DATA = $(INSTALL)
51
52 AS = as
53 AR = ar
54 AR_FLAGS = rc
55 CC = cc
56 CFLAGS = -g
57 # start-sanitize-chill
58 CHILLFLAGS = $(CFLAGS)
59 CHILL_LIB = -lchill
60 # end-sanitize-chill
61 CXX = gcc
62 CXXFLAGS = -g -O
63 RANLIB = ranlib
64 NM = nm
65 GZIP = gzip
66
67 # BISON: This line sed'ed to BISON = bison -y for FSF releases, don't remove.
68 BISON = `if [ -f $${rootme}/byacc/byacc ] ; \
69             then echo $${rootme}/byacc/byacc ; \
70             else echo byacc ; \
71         fi`
72
73 LEX = `if [ -f $${rootme}/flex/flex ] ; \
74         then echo $${rootme}/flex/flex ; \
75         else echo flex ; fi`
76
77 MAKEINFO = `if [ -f $${rootme}/texinfo/makeinfo/makeinfo ] ; \
78         then echo $${rootme}/texinfo/makeinfo/makeinfo ; \
79         else echo makeinfo ; fi`
80
81
82 # libraries that may need to be augmented on a system-by-system basis
83 X11_LIB = -lX11
84
85 # compilers to use to create programs which must be run in the build
86 # environment.
87 CC_FOR_BUILD = $(CC)
88 CXX_FOR_BUILD = $(CXX)
89
90 SUBDIRS = "this is set via configure, don't edit this"
91 OTHERS = 
92
93 ALL = all.normal
94 INSTALL_TARGET = install.all
95
96 ### for debugging
97 #GCCVERBOSE=-v
98
99 CC_FOR_TARGET = ` \
100   if [ -f $${rootme}/gcc/Makefile ] ; then \
101     echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/; \
102   else \
103     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
104       echo $(CC); \
105     else \
106       t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
107     fi; \
108   fi`
109
110 # start-sanitize-chill
111 CHILL_FOR_TARGET = ` \
112   if [ -f $${rootme}/gcc/Makefile ] ; then \
113     echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/ -L$${rootme}/chillrt/; \
114   else \
115     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
116       echo $(CC); \
117     else \
118       t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
119     fi; \
120   fi`
121
122 # end-sanitize-chill
123
124 CXX_FOR_TARGET = ` \
125   if [ -f $${rootme}/gcc/Makefile ] ; then \
126     echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/; \
127   else \
128     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
129       echo $(CXX); \
130     else \
131       t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
132     fi; \
133   fi`
134
135 AS_FOR_TARGET = ` \
136   if [ -f $${rootme}/gas/Makefile ] ; then \
137     echo $${rootme}/gas/as.new ; \
138   else \
139     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
140       echo $(AS); \
141     else \
142        t='$(program_transform_name)'; echo as | sed -e '' $$t ; \
143     fi; \
144   fi`
145
146 AR_FOR_TARGET = ` \
147   if [ -f $${rootme}/binutils/Makefile ] ; then \
148     echo $${rootme}/binutils/ar ; \
149   else \
150     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
151       echo $(AR); \
152     else \
153        t='$(program_transform_name)'; echo ar | sed -e '' $$t ; \
154     fi; \
155   fi`
156
157 RANLIB_FOR_TARGET = ` \
158   if [ -f $${rootme}/binutils/Makefile ] ; then \
159     echo $${rootme}/binutils/ranlib ; \
160   else \
161     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
162       echo $(RANLIB); \
163     else \
164        t='$(program_transform_name)'; echo ranlib | sed -e '' $$t ; \
165     fi; \
166   fi`
167
168 NM_FOR_TARGET = ` \
169   if [ -f $${rootme}/binutils/Makefile ] ; then \
170     echo $${rootme}/binutils/nm ; \
171   else \
172     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
173       echo $(NM); \
174     else \
175        t='$(program_transform_name)'; echo nm | sed -e '' $$t ; \
176     fi; \
177   fi`
178
179 # FIXME: This is badly named.
180 XTRAFLAGS = ` \
181   if [ -f $${rootme}/gcc/Makefile ] ; then \
182     if [ -f $${rootme}/newlib/Makefile ] ; then \
183       echo -I$${rootme}/newlib/targ-include -I$${srcroot}/newlib/libc/include -I$${rootme}/gcc/include -nostdinc ; \
184     else \
185       echo -I$${rootme}/gcc/include ; \
186     fi ; \
187   else \
188      echo ; \
189   fi`
190
191 PRMS = install-prms
192
193 #### host and target specific makefile fragments come in here.
194 ###
195
196 # Flags to pass down to all sub-makes.
197 # Please keep these in alphabetical order.
198 BASE_FLAGS_TO_PASS = \
199         "AR_FLAGS=$(AR_FLAGS)" \
200         "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
201         "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
202         "BISON=$(BISON)" \
203         "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
204         "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
205         "CFLAGS=$(CFLAGS)" \
206         $(start-sanitize-chill)\
207         "CHILLFLAGS=$(CHILLFLAGS)" \
208         "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
209         "CHILL_LIB=$(CHILL_LIB)" \
210         $(end-sanitize-chill)\
211         "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
212         "CXXFLAGS=$(CXXFLAGS)" \
213         "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
214         'GCC_FOR_TARGET=$$(CC_FOR_TARGET)' \
215         "INSTALL=$(INSTALL)" \
216         "INSTALL_DATA=$(INSTALL_DATA)" \
217         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
218         "LDFLAGS=$(LDFLAGS)" \
219         "LEX=$(LEX)" \
220         "LOADLIBES=$(LOADLIBES)" \
221         "MAKEINFO=$(MAKEINFO)" \
222         "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
223         "PRMS=$(PRMS)" \
224         "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
225         "XTRAFLAGS_FOR_TARGET=$(XTRAFLAGS)" \
226         "exec_prefix=$(exec_prefix)" \
227         "prefix=$(prefix)" \
228         "tooldir=$(tooldir)" 
229
230 # Flags to pass down to most sub-makes, in which we're building with
231 # the host environment.
232 # If any variables are added here, they must be added to do-*, below.
233 EXTRA_HOST_FLAGS = \
234         'AR=$(AR)' \
235         'AS=$(AS)' \
236         'CC=$(CC)' \
237         'CXX=$(CXX)' \
238         'NM=$(NM)' \
239         'RANLIB=$(RANLIB)' \
240         'XTRAFLAGS='
241
242 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
243
244 # Flags that are concerned with the location of the X11 include files
245 # and library files
246 X11_FLAGS_TO_PASS = \
247         "X11_INCLUDE_FLAGS=$(X11_INCLUDE_FLAGS)" \
248         "X11_LIB_FLAGS=$(X11_LIB_FLAGS)" \
249         "X11_LIB=$(X11_LIB)"
250
251 # Shell case of subdirectories which are built with the target environment.
252 TARGET_LIBS=libg++ | xiberty | newlib
253 # start-sanitize-chill
254 TARGET_LIBS=libg++ | xiberty | newlib | chillrt
255 # end-sanitize-chill
256
257 # Flags to pass down to makes which are built with the target environment.
258 # The double $ decreases the length of the command line; the variables
259 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
260 # If any variables are added here, they must be added to do-*, below.
261 EXTRA_TARGET_FLAGS = \
262         'AR=$$(AR_FOR_TARGET)' \
263         'AS=$$(AS_FOR_TARGET)' \
264         'CC=$$(CC_FOR_TARGET)' \
265         'CXX=$$(CXX_FOR_TARGET)' \
266         'NM=$$(NM_FOR_TARGET)' \
267         'RANLIB=$$(RANLIB_FOR_TARGET)' \
268         'XTRAFLAGS=$$(XTRAFLAGS_FOR_TARGET)'
269
270 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
271
272 # Flags to pass down to gcc.  gcc builds a library, libgcc.a, so it
273 # unfortunately needs the native compiler and the target ar and
274 # ranlib.
275 # If any variables are added here, they must be added to do-*, below.
276 EXTRA_GCC_FLAGS = \
277         'AR=$$(AR_FOR_TARGET)' \
278         'AS=$(AS)' \
279         'CC=$(CC)' \
280         'CXX=$(CXX)' \
281         'NM=$(NM)' \
282         'RANLIB=$$(RANLIB_FOR_TARGET)' \
283         'XTRAFLAGS='
284
285 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
286
287 # The first rule in the file had better be this one.  Don't put any above it.
288 all:    $(ALL)
289
290 .PHONY: all check installcheck dvi info install-info install-info-dirs
291 .PHONY: do-info do-check do-installcheck do-dvi do-install-info
292 .PHONY: do-clean do-mostlyclean do-distclean do-realclean
293 .NOEXPORT:
294 MAKEOVERRIDES=
295
296 # start-sanitize-chill
297 ## This is ugly, but I don't want GNU make to put these variables in
298 ## the environment.  Older makes will see this as a set of targets
299 ## with no dependencies and no actions.
300 unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
301 # end-sanitize-chill
302
303 # Do a target for all the subdirectories.  A ``make do-X'' will do a
304 # ``make X'' in all subdirectories (because, in general, there is a
305 # dependency (below) of X upon do-X, a ``make X'' will also do this,
306 # but it may do additional work as well).
307 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
308 # because it is so large that it can easily overflow the command line
309 # length limit on some systems.
310 do-info do-check do-installcheck do-dvi do-install-info do-clean do-mostlyclean do-distclean do-realclean:
311         @target=`echo $@ | sed -e 's/^do-//'`; \
312         rootme=`pwd`; export rootme; \
313         srcroot=`cd $(srcdir); pwd`; export srcroot; \
314         for i in $(SUBDIRS); do \
315           if [ -f ./$$i/Makefile ]; then \
316             case $$i in \
317             $(TARGET_LIBS) ) \
318               for flag in $(EXTRA_TARGET_FLAGS); do \
319                 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
320               done; \
321               ;; \
322             gcc) \
323               for flag in $(EXTRA_GCC_FLAGS); do \
324                 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
325               done; \
326               ;; \
327             *) \
328               for flag in $(EXTRA_HOST_FLAGS); do \
329                 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
330               done; \
331               ;; \
332             esac ; \
333             export AR AS CC CXX NM RANLIB XTRAFLAGS; \
334             if (cd ./$$i; \
335                 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
336                         "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
337                         "RANLIB=$${RANLIB}" "XTRAFLAGS=$${XTRAFLAGS}" \
338                         $${target}); \
339             then true; else exit 1; fi; \
340           else true; fi; \
341         done
342
343 info: do-info
344 check: do-check
345 installcheck: do-installcheck
346 dvi: do-dvi
347
348 install-info: install-info-dirs do-install-info dir.info
349         if [ -f dir.info ] ; then \
350           $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
351         else true ; fi
352
353 do-install-info: install-info-dirs
354
355 all.normal: all-m4 all-autoconf all-libiberty all-mmalloc all-texinfo \
356         all-byacc all-flex all-opcodes all-bfd all-ld all-gas all-tgas \
357         all-gcc all-binutils  all-libg++ all-readline all-sim all-gdb \
358         all-make all-rcs all-cvs all-diff all-grep \
359         all-patch all-emacs all-ispell all-etc \
360         all-tcl all-tk all-expect \
361         all-newlib \
362         $(start-sanitize-chill) \
363         all-chillrt \
364         $(end-sanitize-chill) \
365         all-gprof all-prms all-send-pr all-libm all-dejagnu \
366         all-fileutils all-find all-gawk all-sed all-shellutils \
367         all-textutils all-time all-wdiff all-uudecode \
368         all-hello all-tar all-gzip all-indent all-recode
369
370
371 all.cross: all-libiberty all-mmalloc all-gas all-byacc all-flex all-ld \
372         all-opcodes all-bfd all-readline all-sim \
373         all-gdb all-binutils all-gcc all-newlib \
374         $(start-sanitize-chill) \
375         all-chillrt \
376         $(end-sanitize-chill) \
377         all-dejagnu
378
379 .PHONY: clean distclean mostlyclean realclean local-clean local-distclean
380
381 local-clean:
382         -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
383
384 local-distclean:
385         -rm -f Makefile config.status
386
387 clean: do-clean local-clean
388 mostlyclean: do-mostlyclean local-clean
389 distclean: do-distclean local-clean local-distclean
390 realclean: do-realclean local-clean local-distclean
391
392 uninstall:
393         @echo "the uninstall target is not supported in this tree"
394
395 install: $(INSTALL_TARGET) 
396         -parent=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \
397         if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
398         -if [ -d $(man1dir) ] ; then true ; else mkdir $(man1dir) ; fi
399
400 install.all: install-no-fixedincludes
401         @if [ -f ./gcc/Makefile ] ; then \
402                 rootme=`pwd` ; export rootme ; \
403                 (cd ./gcc; \
404                 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
405         else \
406                 true ; \
407         fi
408
409 install-no-fixedincludes: install-dirs gcc-no-fixedincludes \
410         install-autoconf \
411         install-bfd \
412         install-binutils \
413         install-byacc \
414         $(start-sanitize-chill) \
415         install-chillrt \
416         $(end-sanitize-chill) \
417         install-cvs \
418         install-dejagnu \
419         install-diff \
420         install-emacs \
421         install-etc \
422         install-expect \
423         install-fileutils \
424         install-find \
425         install-flex \
426         install-gas \
427         install-gawk \
428         install-gdb \
429         install-glob \
430         install-gprof \
431         install-grep \
432         install-gzip \
433         install-hello \
434         install-indent \
435         install-ispell \
436         install-ld \
437         install-libg++ \
438         install-libiberty \
439         install-libm \
440         install-m4 \
441         install-make \
442         install-mmalloc \
443         install-newlib \
444         install-opcodes \
445         install-patch \
446         install-prms \
447         install-rcs \
448         install-readline \
449         install-recode \
450         install-sed \
451         install-send-pr \
452         install-shellutils \
453         install-sim \
454         install-tar \
455         install-tcl \
456         install-texinfo \
457         install-textutils \
458         install-time \
459         install-tk \
460         install-uudecode \
461         install-wdiff 
462
463
464 # Install the gcc headers files, but not the fixed include files,
465 # which we are not allowed to distribute.  This rule is very dependent
466 # on the workings of the gcc Makefile.in.
467 #
468 gcc-no-fixedincludes:
469         @if [ -f ./gcc/Makefile ]; then \
470           rm -rf gcc/tmp-include; \
471           mv gcc/include gcc/tmp-include 2>/dev/null; \
472           mkdir gcc/include; \
473           touch gcc/stmp-fixincludes; \
474           rm -f gcc/stmp-headers; \
475           rootme=`pwd`; export rootme; \
476           srcroot=`cd $(srcdir); pwd` ; export srcroot; \
477           (cd ./gcc; \
478            $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
479           rm -rf gcc/include; \
480           mv gcc/tmp-include gcc/include 2>/dev/null; \
481         else true; fi
482
483 install.cross: install-dirs install-libiberty install-mmalloc \
484         install-binutils install-opcodes install-byacc install-flex \
485         install-ld install-gas install-readline \
486         install-glob install-gdb install-mmalloc \
487         install-newlib \
488         $(start-sanitize-chill) \
489         install-chillrt \
490         $(end-sanitize-chill) \
491         install-gcc install-etc install-dejagnu
492
493 ### gzip
494 all-gzip: all-libiberty
495         @if [ -f ./gzip/Makefile ] ; then \
496                 rootme=`pwd` ; export rootme ; \
497                 (cd ./gzip; $(MAKE) $(FLAGS_TO_PASS) all) ; \
498         else \
499                 true ; \
500         fi
501
502 install-gzip: force
503         @if [ -f ./gzip/Makefile ] ; then \
504                 rootme=`pwd` ; export rootme ; \
505                 (cd ./gzip; $(MAKE) $(FLAGS_TO_PASS) install) ; \
506         else \
507                 true ; \
508         fi
509
510 ### hello
511 all-hello: all-libiberty
512         @if [ -f ./hello/Makefile ] ; then \
513                 rootme=`pwd` ; export rootme ; \
514                 (cd ./hello; $(MAKE) $(FLAGS_TO_PASS) all) ; \
515         else \
516                 true ; \
517         fi
518
519 install-hello: force
520         @if [ -f ./hello/Makefile ] ; then \
521                 rootme=`pwd` ; export rootme ; \
522                 (cd ./hello; $(MAKE) $(FLAGS_TO_PASS) install) ; \
523         else \
524                 true ; \
525         fi
526
527 ### recode
528 all-recode: all-libiberty
529         @if [ -f ./recode/Makefile ] ; then \
530                 rootme=`pwd` ; export rootme ; \
531                 (cd ./recode; $(MAKE) $(FLAGS_TO_PASS) all) ; \
532         else \
533                 true ; \
534         fi
535
536 install-recode: force
537         @if [ -f ./recode/Makefile ] ; then \
538                 rootme=`pwd` ; export rootme ; \
539                 (cd ./recode; $(MAKE) $(FLAGS_TO_PASS) install) ; \
540         else \
541                 true ; \
542         fi
543
544 ### indent
545 all-indent: force
546         @if [ -f ./indent/Makefile ] ; then \
547                 rootme=`pwd` ; export rootme ; \
548                 (cd ./indent; $(MAKE) $(FLAGS_TO_PASS) all) ; \
549         else \
550                 true ; \
551         fi
552
553 install-indent: force
554         @if [ -f ./indent/Makefile ] ; then \
555                 rootme=`pwd` ; export rootme ; \
556                 (cd ./indent; $(MAKE) $(FLAGS_TO_PASS) install) ; \
557         else \
558                 true ; \
559         fi
560
561 ### tar
562 all-tar: all-libiberty
563         @if [ -f ./tar/Makefile ] ; then \
564                 rootme=`pwd` ; export rootme ; \
565                 (cd ./tar; $(MAKE) $(FLAGS_TO_PASS) all) ; \
566         else \
567                 true ; \
568         fi
569
570 install-tar: force
571         @if [ -f ./tar/Makefile ] ; then \
572                 rootme=`pwd` ; export rootme ; \
573                 (cd ./tar; $(MAKE) $(FLAGS_TO_PASS) install) ; \
574         else \
575                 true ; \
576         fi
577
578
579 ### dejagnu
580 all-dejagnu: force
581         @if [ -f ./dejagnu/Makefile ] ; then \
582                 rootme=`pwd` ; export rootme ; \
583                 (cd ./dejagnu; $(MAKE) $(FLAGS_TO_PASS) all) ; \
584         else \
585                 true ; \
586         fi
587
588 install-dejagnu: force
589         @if [ -f ./dejagnu/Makefile ] ; then \
590                 rootme=`pwd` ; export rootme ; \
591                 (cd ./dejagnu;  $(MAKE) $(FLAGS_TO_PASS) install) ; \
592         else \
593                 true ; \
594         fi
595
596 ### autoconf
597 all-autoconf: force
598         @if [ -f ./autoconf/Makefile ] ; then \
599                 rootme=`pwd` ; export rootme ; \
600                 (cd ./autoconf; $(MAKE) $(FLAGS_TO_PASS) all) ; \
601         else \
602                 true ; \
603         fi
604
605 install-autoconf: force
606         @if [ -f ./autoconf/Makefile ] ; then \
607                 rootme=`pwd` ; export rootme ; \
608                 (cd ./autoconf; $(MAKE) $(FLAGS_TO_PASS) install) ; \
609         else \
610                 true ; \
611         fi
612
613 ### etc
614 all-etc: force
615         @if [ -f ./etc/Makefile ] ; then \
616                 rootme=`pwd` ; export rootme ; \
617                 (cd ./etc; $(MAKE) $(FLAGS_TO_PASS) all) ; \
618         else \
619                 true ; \
620         fi
621
622 install-etc: force
623         @if [ -f ./etc/Makefile ] ; then \
624                 rootme=`pwd` ; export rootme ; \
625                 (cd ./etc; $(MAKE) $(FLAGS_TO_PASS) install) ; \
626         else \
627                 true ; \
628         fi
629
630 ### libiberty
631 all-libiberty: force
632         @if [ -f ./libiberty/Makefile ] ; then \
633                 rootme=`pwd` ; export rootme ; \
634                 (cd ./libiberty; \
635                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
636         else \
637                 true ; \
638         fi
639
640 install-libiberty: force
641         @if [ -f ./libiberty/Makefile ] ; then \
642                 rootme=`pwd` ; export rootme ; \
643                 (cd ./libiberty; \
644                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
645         else \
646                 true ; \
647         fi
648
649 ### xiberty
650 all-xiberty: all-gcc all-newlib
651         @if [ -f ./xiberty/Makefile ] ; then \
652                 rootme=`pwd` ; export rootme ; \
653                 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
654                 (cd ./xiberty; \
655                 $(MAKE) $(TARGET_FLAGS_TO_PASS) all) ; \
656         else \
657                 true ; \
658         fi
659
660 install-xiberty: force
661         @if [ -f ./xiberty/Makefile ] ; then \
662                 rootme=`pwd` ; export rootme ; \
663                 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
664                 (cd ./xiberty; \
665                 $(MAKE) $(TARGET_FLAGS_TO_PASS) install) ; \
666         else \
667                 true ; \
668         fi
669
670 ### mmalloc
671 all-mmalloc: force
672         @if [ -f ./mmalloc/Makefile ] ; then \
673                 rootme=`pwd` ; export rootme ; \
674                 (cd ./mmalloc; \
675                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
676         else \
677                 true ; \
678         fi
679
680 install-mmalloc: force
681         @if [ -f ./mmalloc/Makefile ] ; then \
682                 rootme=`pwd` ; export rootme ; \
683                 (cd ./mmalloc; \
684                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
685         else \
686                 true ; \
687         fi
688
689 ### texinfo
690 all-texinfo: all-libiberty
691         @if [ -f ./texinfo/Makefile ] ; then \
692                 rootme=`pwd` ; export rootme ; \
693                 (cd ./texinfo; \
694                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
695         else \
696                 true ; \
697         fi
698
699 install-texinfo: force
700         @if [ -f ./texinfo/Makefile ] ; then \
701                 rootme=`pwd` ; export rootme ; \
702                 (cd ./texinfo; \
703                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
704         else \
705                 true ; \
706         fi
707
708 ### bfd
709 all-bfd: force
710         @if [ -f ./bfd/Makefile ] ; then \
711                 rootme=`pwd` ; export rootme ; \
712                 (cd ./bfd; \
713                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
714         else \
715                 true ; \
716         fi
717
718 install-bfd: force
719         @if [ -f ./bfd/Makefile ] ; then \
720                 rootme=`pwd` ; export rootme ; \
721                 (cd ./bfd; \
722                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
723         else \
724                 true ; \
725         fi
726
727
728 ### opcodes
729 all-opcodes: force
730         @if [ -f ./opcodes/Makefile ] ; then \
731                 rootme=`pwd` ; export rootme ; \
732                 (cd ./opcodes; \
733                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
734         else \
735                 true ; \
736         fi
737
738 install-opcodes: force
739         @if [ -f ./opcodes/Makefile ] ; then \
740                 rootme=`pwd` ; export rootme ; \
741                 (cd ./opcodes; \
742                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
743         else \
744                 true ; \
745         fi
746
747 ### binutils
748 all-binutils: all-opcodes all-libiberty all-bfd all-flex
749         @if [ -f ./binutils/Makefile ] ; then \
750                 rootme=`pwd` ; export rootme ; \
751                 (cd ./binutils; \
752                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
753         else \
754                 true ; \
755         fi
756
757 install-binutils: force
758         @if [ -f ./binutils/Makefile ] ; then \
759                 rootme=`pwd` ; export rootme ; \
760                 (cd ./binutils; \
761                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
762         else \
763                 true ; \
764         fi
765
766 ### newlib
767 all-newlib: all-binutils all-ld all-gas all-gcc
768         @if [ -f ./newlib/Makefile ] ; then \
769                 rootme=`pwd` ; export rootme ; \
770                 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
771                 (cd ./newlib; \
772                 $(MAKE) $(TARGET_FLAGS_TO_PASS) all) ; \
773         else \
774                 true ; \
775         fi
776
777 install-newlib: force
778         @if [ -f ./newlib/Makefile ] ; then \
779                 rootme=`pwd` ; export rootme ; \
780                 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
781                 (cd ./newlib; \
782                 $(MAKE) $(TARGET_FLAGS_TO_PASS) install) ; \
783         else \
784                 true ; \
785         fi
786
787 ### start-sanitize-chill
788 ### chillrt
789 all-chillrt: all-binutils all-ld all-gas all-gcc all-newlib
790         @if [ -f ./chillrt/Makefile ] ; then \
791                 rootme=`pwd` ; export rootme ; \
792                 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
793                 (cd ./chillrt; \
794                 $(MAKE) $(TARGET_FLAGS_TO_PASS) all) ; \
795         else \
796                 true ; \
797         fi
798
799 install-chillrt: force
800         @if [ -f ./chillrt/Makefile ] ; then \
801                 rootme=`pwd` ; export rootme ; \
802                 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
803                 (cd ./chillrt; \
804                 $(MAKE) $(TARGET_FLAGS_TO_PASS) install) ; \
805         else \
806                 true ; \
807         fi
808
809 ### end-sanitize-chill
810
811 ### gprof
812 all-gprof: all-libiberty all-bfd
813         @if [ -f ./gprof/Makefile ] ; then \
814                 rootme=`pwd` ; export rootme ; \
815                 (cd ./gprof; \
816                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
817         else \
818                 true ; \
819         fi
820
821 install-gprof: force
822         @if [ -f ./gprof/Makefile ] ; then \
823                 rootme=`pwd` ; export rootme ; \
824                 (cd ./gprof; \
825                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
826         else \
827                 true ; \
828         fi
829
830 ### byacc
831 all-byacc: force
832         @if [ -f ./byacc/Makefile ] ; then \
833                 rootme=`pwd` ; export rootme ; \
834                 (cd ./byacc; \
835                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
836         else \
837                 true ; \
838         fi
839
840 install-byacc: force
841         @if [ -f ./byacc/Makefile ] ; then \
842                 rootme=`pwd` ; export rootme ; \
843                 (cd ./byacc; \
844                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
845         else \
846                 true ; \
847         fi
848
849 ### flex
850 all-flex: all-libiberty
851         @if [ -f ./flex/Makefile ] ; then \
852                 rootme=`pwd` ; export rootme ; \
853                 (cd ./flex; \
854                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
855         else \
856                 true ; \
857         fi
858
859 install-flex: force
860         @if [ -f ./flex/Makefile ] ; then \
861                 rootme=`pwd` ; export rootme ; \
862                 (cd ./flex; \
863                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
864         else \
865                 true ; \
866         fi
867 ### gcc
868 all-gcc: all-libiberty all-byacc all-binutils all-gas
869         @if [ -f ./gcc/Makefile ] ; then \
870                 rootme=`pwd` ; export rootme ; \
871                 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
872                 (cd ./gcc; \
873                 $(MAKE) $(GCC_FLAGS_TO_PASS) all) ; \
874         else \
875                 true ; \
876         fi
877
878 install-gcc: force
879         @if [ -f ./gcc/Makefile ] ; then \
880                 rootme=`pwd` ; export rootme ; \
881                 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
882                 (cd ./gcc; \
883                 $(MAKE) $(GCC_FLAGS_TO_PASS) install) ; \
884         else \
885                 true ; \
886         fi
887
888 ### readline
889 all-readline: force
890         @if [ -f ./readline/Makefile ] ; then \
891                 rootme=`pwd` ; export rootme ; \
892                 (cd ./readline; \
893                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
894         else \
895                 true ; \
896         fi
897
898 install-readline: force
899         @if [ -f ./readline/Makefile ] ; then \
900                 rootme=`pwd` ; export rootme ; \
901                 (cd ./readline; \
902                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
903         else \
904                 true ; \
905         fi
906
907 ### glob
908 all-glob: force
909         @if [ -f ./glob/Makefile ] ; then \
910                 rootme=`pwd` ; export rootme ; \
911                 (cd ./glob; \
912                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
913         else \
914                 true ; \
915         fi
916
917 install-glob: force
918         @if [ -f ./glob/Makefile ] ; then \
919                 rootme=`pwd` ; export rootme ; \
920                 (cd ./glob; \
921                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
922         else \
923                 true ; \
924         fi
925
926 ### gas
927 all-gas: all-libiberty all-opcodes all-bfd
928         @if [ -f ./gas/Makefile ] ; then \
929                 rootme=`pwd` ; export rootme ; \
930                 (cd ./gas; \
931                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
932         else \
933                 true ; \
934         fi
935
936 install-gas: force
937         @if [ -f ./gas/Makefile ] ; then \
938                 rootme=`pwd` ; export rootme ; \
939                 (cd ./gas; \
940                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
941         else \
942                 true ; \
943         fi
944
945 ### gas
946 all-tgas: all-libiberty all-bfd
947         @if [ -f ./tgas/Makefile ] ; then \
948                 rootme=`pwd` ; export rootme ; \
949                 (cd ./tgas; \
950                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
951         else \
952                 true ; \
953         fi
954
955
956 ### ld
957 all-ld: all-libiberty all-bfd all-byacc all-flex
958         @if [ -f ./ld/Makefile ] ; then \
959                 rootme=`pwd` ; export rootme ; \
960                 (cd ./ld; \
961                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
962         else \
963                 true ; \
964         fi
965
966 install-ld: force
967         @if [ -f ./ld/Makefile ] ; then \
968                 rootme=`pwd` ; export rootme ; \
969                 (cd ./ld; \
970                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
971         else \
972                 true ; \
973         fi
974
975 ### gdb
976 all-gdb: all-bfd all-opcodes all-libiberty all-mmalloc all-readline all-glob all-byacc
977         @if [ -f ./gdb/Makefile ] ; then \
978                 rootme=`pwd` ; export rootme ; \
979                 (cd ./gdb; \
980                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
981         else \
982                 true ; \
983         fi
984
985 install-gdb: force
986         @if [ -f ./gdb/Makefile ] ; then \
987                 rootme=`pwd` ; export rootme ; \
988                 (cd ./gdb; \
989                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
990         else \
991                 true ; \
992         fi
993
994 ### make
995 all-make: all-libiberty
996         @if [ -f ./make/Makefile ] ; then \
997                 rootme=`pwd` ; export rootme ; \
998                 (cd ./make; \
999                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
1000         else \
1001                 true ; \
1002         fi
1003
1004 install-make: force
1005         @if [ -f ./make/Makefile ] ; then \
1006                 rootme=`pwd` ; export rootme ; \
1007                 (cd ./make; \
1008                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
1009         else \
1010                 true ; \
1011         fi
1012
1013 ### diff
1014 all-diff: all-libiberty
1015         @if [ -f ./diff/Makefile ] ; then \
1016                 rootme=`pwd` ; export rootme ; \
1017                 (cd ./diff; \
1018                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
1019         else \
1020                 true ; \
1021         fi
1022
1023 install-diff: force
1024         @if [ -f ./diff/Makefile ] ; then \
1025                 rootme=`pwd` ; export rootme ; \
1026                 (cd ./diff/; \
1027                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
1028         else \
1029                 true ; \
1030         fi
1031
1032 ### grep
1033 all-grep: force
1034         @if [ -f ./grep/Makefile ] ; then \
1035                 rootme=`pwd` ; export rootme ; \
1036                 (cd ./grep; \
1037                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
1038         else \
1039                 true ; \
1040         fi
1041
1042 install-grep: force
1043         @if [ -f ./grep/Makefile ] ; then \
1044                 rootme=`pwd` ; export rootme ; \
1045                 (cd ./grep; \
1046                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
1047         else \
1048                 true ; \
1049         fi
1050
1051 ### rcs
1052 all-rcs: force
1053         @if [ -f ./rcs/Makefile ] ; then \
1054                 rootme=`pwd` ; export rootme ; \
1055                 (cd ./rcs; \
1056                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
1057         else \
1058                 true ; \
1059         fi
1060
1061 install-rcs: force
1062         @if [ -f ./rcs/Makefile ] ; then \
1063                 rootme=`pwd` ; export rootme ; \
1064                 (cd ./rcs; \
1065                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
1066         else \
1067                 true ; \
1068         fi
1069
1070 ### cvs
1071 all-cvs: force
1072         @if [ -f ./cvs/Makefile ] ; then \
1073                 rootme=`pwd` ; export rootme ; \
1074                 (cd ./cvs; \
1075                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
1076         else \
1077                 true ; \
1078         fi
1079
1080 install-cvs: force
1081         @if [ -f ./cvs/Makefile ] ; then \
1082                 rootme=`pwd` ; export rootme ; \
1083                 (cd ./cvs; \
1084                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
1085         else \
1086                 true ; \
1087         fi
1088
1089 ### patch
1090 all-patch: force
1091         @if [ -f ./patch/Makefile ] ; then \
1092                 rootme=`pwd` ; export rootme ; \
1093                 (cd ./patch; \
1094                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
1095         else \
1096                 true ; \
1097         fi
1098
1099 install-patch: force
1100         @if [ -f ./patch/Makefile ] ; then \
1101                 rootme=`pwd` ; export rootme ; \
1102                 (cd ./patch; \
1103                 $(MAKE) $(FLAGS_TO_PASS) \
1104                         bindir=$(bindir) \
1105                         man1dir=$(man1dir) install) ; \
1106         else \
1107                 true ; \
1108         fi
1109
1110 ### emacs
1111 all-emacs: force
1112         @if [ -f ./emacs/Makefile ] ; then \
1113                 rootme=`pwd` ; export rootme ; \
1114                 (cd ./emacs; \
1115                 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) ; \
1116         else \
1117                 true ; \
1118         fi
1119
1120 install-emacs: force
1121         @if [ -f ./emacs/Makefile ] ; then \
1122                 rootme=`pwd` ; export rootme ; \
1123                 (cd ./emacs; \
1124                 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) ; \
1125         else \
1126                 true ; \
1127         fi
1128
1129 ### ispell
1130 all-ispell: all-emacs
1131         @if [ -f ./ispell/Makefile ] ; then \
1132                 rootme=`pwd` ; export rootme ; \
1133                 (cd ./ispell; \
1134                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
1135         else \
1136                 true ; \
1137         fi
1138
1139 install-ispell: force
1140         @if [ -f ./ispell/Makefile ] ; then \
1141                 rootme=`pwd` ; export rootme ; \
1142                 (cd ./ispell; \
1143                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
1144         else \
1145                 true ; \
1146         fi
1147
1148 ### prms
1149 all-prms: force
1150         @if [ -f ./prms/Makefile ] ; then \
1151                 rootme=`pwd` ; export rootme ; \
1152                 (cd ./prms; \
1153                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
1154         else \
1155                 true ; \
1156         fi
1157
1158 install-prms: force
1159         @if [ -f ./prms/Makefile ] ; then \
1160                 rootme=`pwd` ; export rootme ; \
1161                 (cd ./prms; \
1162                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
1163         else \
1164                 true ; \
1165         fi
1166
1167 ### send-pr
1168 all-send-pr: force
1169         @if [ -f ./send-pr/Makefile ] ; then \
1170                 rootme=`pwd` ; export rootme ; \
1171                 (cd ./send-pr; \
1172                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
1173         else \
1174                 true ; \
1175         fi
1176
1177 install-send-pr: force
1178         @if [ -f ./send-pr/Makefile ] ; then \
1179                 rootme=`pwd` ; export rootme ; \
1180                 (cd ./send-pr; \
1181                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
1182         else \
1183                 true ; \
1184         fi
1185
1186 ### libm
1187 all-libm: force
1188         @if [ -f ./libm/Makefile ] ; then \
1189                 rootme=`pwd` ; export rootme ; \
1190                 (cd ./libm; \
1191                 $(MAKE) $(TARGET_FLAGS_TO_PASS) all) ; \
1192         else \
1193                 true ; \
1194         fi
1195
1196 install-libm: force
1197         @if [ -f ./libm/Makefile ] ; then \
1198                 rootme=`pwd` ; export rootme ; \
1199                 (cd ./libm; \
1200                 $(MAKE) $(TARGET_FLAGS_TO_PASS) install) ; \
1201         else \
1202                 true ; \
1203         fi
1204
1205 ### libg++
1206
1207 all-libg++: all-gas all-ld all-gcc all-xiberty all-newlib
1208         @if [ -f ./libg++/Makefile ] ; then \
1209                 rootme=`pwd` ; export rootme ; \
1210                 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
1211                 (cd ./libg++; \
1212                 $(MAKE) $(TARGET_FLAGS_TO_PASS) all) ; \
1213         else \
1214                 true ; \
1215         fi
1216
1217 install-libg++: force
1218         @if [ -f ./libg++/Makefile ] ; then \
1219                 rootme=`pwd` ; export rootme ; \
1220                 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
1221                 (cd ./libg++; \
1222                 $(MAKE) $(TARGET_FLAGS_TO_PASS) install) ; \
1223         else \
1224                 true ; \
1225         fi
1226 ### tcl
1227 all-tcl: 
1228         @if [ -f ./tcl/Makefile ] ; then \
1229                 rootme=`pwd` ; export rootme ; \
1230                 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
1231                 (cd ./tcl; \
1232                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
1233         else \
1234                 true ; \
1235         fi
1236
1237 install-tcl: force
1238         @if [ -f ./tcl/Makefile ] ; then \
1239                 rootme=`pwd` ; export rootme ; \
1240                 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
1241                 (cd ./tcl; \
1242                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
1243         else \
1244                 true ; \
1245         fi
1246
1247
1248 ### tk
1249 all-tk: all-tcl
1250         @if [ -f ./tk/Makefile ] ; then \
1251                 rootme=`pwd` ; export rootme ; \
1252                 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
1253                 (cd ./tk; \
1254                 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) ; \
1255         else \
1256                 true ; \
1257         fi
1258
1259 install-tk: force
1260         @if [ -f ./tk/Makefile ] ; then \
1261                 rootme=`pwd` ; export rootme ; \
1262                 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
1263                 (cd ./tk; \
1264                 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) ; \
1265         else \
1266                 true ; \
1267         fi
1268
1269 ### tclX
1270 all-tclX: all-tcl all-tk
1271         @if [ -f ./tclX/Makefile ] ; then \
1272                 rootme=`pwd` ; export rootme ; \
1273                 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
1274                 (cd ./tclX; \
1275                 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) ; \
1276         else \
1277                 true ; \
1278         fi
1279
1280 install-tclX: force
1281         @if [ -f ./tclX/Makefile ] ; then \
1282                 rootme=`pwd` ; export rootme ; \
1283                 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
1284                 (cd ./tclX; \
1285                 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) ; \
1286         else \
1287                 true ; \
1288         fi
1289
1290
1291 ### expect
1292 all-expect: all-tcl
1293         @if [ -f ./expect/Makefile ] ; then \
1294                 rootme=`pwd` ; export rootme ; \
1295                 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
1296                 (cd ./expect; \
1297                 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) ; \
1298         else \
1299                 true ; \
1300         fi
1301
1302 install-expect: force
1303         @if [ -f ./expect/Makefile ] ; then \
1304                 rootme=`pwd` ; export rootme ; \
1305                 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
1306                 (cd ./expect; \
1307                 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) ; \
1308         else \
1309                 true ; \
1310         fi
1311
1312 ### sim
1313 all-sim: all-bfd 
1314         @if [ -f ./sim/Makefile ] ; then \
1315                 rootme=`pwd` ; export rootme ; \
1316                 (cd ./sim; \
1317                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
1318         else \
1319                 true ; \
1320         fi
1321
1322 install-sim: force
1323         @if [ -f ./sim/Makefile ] ; then \
1324                 rootme=`pwd` ; export rootme ; \
1325                 (cd ./sim; \
1326                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
1327         else \
1328                 true ; \
1329         fi
1330
1331 ### fileutils
1332 all-fileutils: force
1333         @if [ -f ./fileutils/Makefile ] ; then \
1334           rootme=`pwd` ; export rootme ; \
1335                 (cd ./fileutils; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1336         else \
1337                 true ; \
1338         fi
1339
1340 install-fileutils: force
1341         @if [ -f ./fileutils/Makefile ] ; then \
1342                 rootme=`pwd` ; export rootme ; \
1343                 (cd ./fileutils; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1344         else \
1345                 true ; \
1346         fi
1347
1348 ### find
1349 all-find: force
1350         @if [ -f ./find/Makefile ] ; then \
1351           rootme=`pwd` ; export rootme ; \
1352                 (cd ./find; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1353         else \
1354                 true ; \
1355         fi
1356
1357 install-find: force
1358         @if [ -f ./find/Makefile ] ; then \
1359                 rootme=`pwd` ; export rootme ; \
1360                 (cd ./find; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1361         else \
1362                 true ; \
1363         fi
1364
1365 ### gawk
1366 all-gawk: force
1367         @if [ -f ./gawk/Makefile ] ; then \
1368           rootme=`pwd` ; export rootme ; \
1369                 (cd ./gawk; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1370         else \
1371                 true ; \
1372         fi
1373
1374 install-gawk: force
1375         @if [ -f ./gawk/Makefile ] ; then \
1376                 rootme=`pwd` ; export rootme ; \
1377                 (cd ./gawk; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1378         else \
1379                 true ; \
1380         fi
1381
1382 ### m4
1383 all-m4: all-libiberty
1384         @if [ -f ./m4/Makefile ] ; then \
1385           rootme=`pwd` ; export rootme ; \
1386                 (cd ./m4; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1387         else \
1388                 true ; \
1389         fi
1390
1391 install-m4: force
1392         @if [ -f ./m4/Makefile ] ; then \
1393                 rootme=`pwd` ; export rootme ; \
1394                 (cd ./m4; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1395         else \
1396                 true ; \
1397         fi
1398
1399 ### sed
1400 all-sed: force
1401         @if [ -f ./sed/Makefile ] ; then \
1402           rootme=`pwd` ; export rootme ; \
1403                 (cd ./sed; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1404         else \
1405                 true ; \
1406         fi
1407
1408 install-sed: force
1409         @if [ -f ./sed/Makefile ] ; then \
1410                 rootme=`pwd` ; export rootme ; \
1411                 (cd ./sed; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1412         else \
1413                 true ; \
1414         fi
1415
1416 ### time
1417 all-time: force
1418         @if [ -f ./time/Makefile ] ; then \
1419           rootme=`pwd` ; export rootme ; \
1420                 (cd ./time; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1421         else \
1422                 true ; \
1423         fi
1424
1425 install-time: force
1426         @if [ -f ./time/Makefile ] ; then \
1427                 rootme=`pwd` ; export rootme ; \
1428                 (cd ./time; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1429         else \
1430                 true ; \
1431         fi
1432
1433 ### wdiff
1434 all-wdiff: force
1435         @if [ -f ./wdiff/Makefile ] ; then \
1436           rootme=`pwd` ; export rootme ; \
1437                 (cd ./wdiff; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1438         else \
1439                 true ; \
1440         fi
1441
1442 install-wdiff: force
1443         @if [ -f ./wdiff/Makefile ] ; then \
1444                 rootme=`pwd` ; export rootme ; \
1445                 (cd ./wdiff; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1446         else \
1447                 true ; \
1448         fi
1449
1450 ### uudecode
1451 all-uudecode: all-libiberty
1452         @if [ -f ./uudecode/Makefile ] ; then \
1453           rootme=`pwd` ; export rootme ; \
1454                 (cd ./uudecode; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1455         else \
1456                 true ; \
1457         fi
1458
1459 install-uudecode: force
1460         @if [ -f ./uudecode/Makefile ] ; then \
1461                 rootme=`pwd` ; export rootme ; \
1462                 (cd ./uudecode; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1463         else \
1464                 true ; \
1465         fi
1466
1467 ### shellutils
1468 all-shellutils: force
1469         @if [ -f ./shellutils/Makefile ] ; then \
1470           rootme=`pwd` ; export rootme ; \
1471                 (cd ./shellutils; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1472         else \
1473                 true ; \
1474         fi
1475
1476 install-shellutils: force
1477         @if [ -f ./shellutils/Makefile ] ; then \
1478                 rootme=`pwd` ; export rootme ; \
1479                 (cd ./shellutils; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1480         else \
1481                 true ; \
1482         fi
1483
1484 ### textutils
1485 all-textutils: force
1486         @if [ -f ./textutils/Makefile ] ; then \
1487           rootme=`pwd` ; export rootme ; \
1488                 (cd ./textutils; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1489         else \
1490                 true ; \
1491         fi
1492
1493 install-textutils: force
1494         @if [ -f ./textutils/Makefile ] ; then \
1495                 rootme=`pwd` ; export rootme ; \
1496                 (cd ./textutils; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1497         else \
1498                 true ; \
1499         fi
1500
1501
1502
1503 ### other supporting targets
1504
1505 MAKEDIRS= \
1506         $(prefix) \
1507         $(exec_prefix) \
1508         $(tooldir)
1509
1510 #       $(bindir) \
1511 #       $(libdir) \
1512 #       $(includedir) \
1513 #       $(datadir) \
1514 #       $(docdir) \
1515 #       $(mandir) \
1516 #       $(man1dir) \
1517 #       $(man5dir)
1518
1519 #       $(man2dir) \
1520 #       $(man3dir) \
1521 #       $(man4dir) \
1522 #       $(man6dir) \
1523 #       $(man7dir) \
1524 #       $(man8dir)
1525
1526 install-dirs:
1527         for i in $(MAKEDIRS) ; do \
1528                 echo Making $$i... ; \
1529                 parent=`echo $$i|sed -e 's@/[^/]*$$@@'`; \
1530                 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
1531                 if [ ! -d $$i ] ; then \
1532                         if mkdir $$i ; then \
1533                                 true ; \
1534                         else \
1535                                 exit 1 ; \
1536                         fi ; \
1537                 else \
1538                         true ; \
1539                 fi ; \
1540         done
1541
1542 install-info-dirs:
1543         if [ -d $(prefix) ] ; then true ; else mkdir $(prefix) ; fi
1544         -parent=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \
1545         if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
1546         -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi
1547
1548 dir.info: do-install-info
1549         if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
1550           $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
1551           mv -f dir.info.new dir.info ; \
1552         else true ; \
1553         fi
1554
1555 dist:
1556         @echo "Building a full distribution of this tree isn't done"
1557         @echo "via 'make dist'.  Check out the etc/ subdirectory" 
1558
1559 etags tags: TAGS
1560
1561 TAGS:
1562         etags `$(MAKE) ls`
1563
1564 ls:
1565         @echo Makefile
1566         @for i in $(SUBDIRS); \
1567         do \
1568                 (cd $$i; \
1569                         pwd=`pwd`; \
1570                         wd=`basename $$pwd`; \
1571                         for j in `$(MAKE) ls`; \
1572                         do \
1573                                 echo $$wd/$$j; \
1574                         done) \
1575         done
1576
1577 force:
1578
1579 # with the gnu make, this is done automatically.
1580
1581 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
1582         $(SHELL) ./config.status
1583
1584 #
1585 # Build GDB distributions that contain BFD, Include, Libiberty, Readline, etc
1586
1587 DEVO_SUPPORT= README Makefile.in configure configure.in \
1588         config.guess config.sub config move-if-change
1589 ETC_SUPPORT= Makefile.in cfg-paper.texi configure.in configure.man \
1590         configure.texi
1591 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline glob sim
1592 GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS)
1593
1594 setup-dirs-gdb: force
1595         ./configure sun4
1596         $(MAKE) clean
1597         ./configure -rm sun4
1598         chmod og=u `find etc $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
1599
1600 gdb.tar.Z: setup-dirs-gdb
1601         (cd gdb; $(MAKE) -f Makefile.in make-proto-gdb.dir BISON="byacc")
1602         $(MAKE) $(MFLAGS) -f Makefile.in make-gdb.tar.Z
1603
1604 make-gdb.tar.Z: $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS) gdb texinfo/texinfo.tex
1605         rm -rf proto-toplev; mkdir proto-toplev
1606         ln -s ../gdb/proto-gdb.dir proto-toplev/gdb
1607         (cd proto-toplev; for i in $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS); do \
1608                 ln -s ../$$i . ; \
1609         done)
1610         mkdir proto-toplev/etc
1611         (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \
1612                 ln -s ../../etc/$$i . ; \
1613         done)
1614         # Put only one copy (four hard links) of COPYING in the tar file.
1615         rm                          proto-toplev/bfd/COPYING
1616         ln proto-toplev/gdb/COPYING proto-toplev/bfd/COPYING
1617         rm                          proto-toplev/include/COPYING
1618         ln proto-toplev/gdb/COPYING proto-toplev/include/COPYING
1619         rm                          proto-toplev/readline/COPYING
1620         ln proto-toplev/gdb/COPYING proto-toplev/readline/COPYING
1621
1622         # Take out texinfo and glob from configurable dirs
1623         rm proto-toplev/configure.in
1624         sed -e '/^host_tools=/s/texinfo //' \
1625             -e '/^host_libs=/s/glob //' \
1626             <configure.in >proto-toplev/configure.in
1627
1628         # Take out texinfo from a few places; make simple BISON=bison line.
1629         rm proto-toplev/Makefile.in
1630         sed -e '/^all\.normal: /s/\all-texinfo //' \
1631             -e '/^      install-texinfo /d' \
1632             -e '/^BISON = /,/^$$/d' \
1633             -e '/^# BISON:/s/.*/BISON = bison -y/' \
1634         <Makefile.in >proto-toplev/Makefile.in
1635
1636         mkdir proto-toplev/texinfo
1637         ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1638         ln -s ../../texinfo/tex3patch   proto-toplev/texinfo/
1639         chmod og=u `find proto-toplev -print`
1640         (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
1641                 echo "==> Making gdb-$$VER.tar.Z"; \
1642                 ln -s proto-toplev gdb-$$VER; \
1643                 tar cfh - gdb-$$VER \
1644                 | compress -v >gdb-$$VER.tar.Z)
1645         $(GZIP) -d <gdb-$$VER.tar.Z | $(GZIP) -9 -v >gdb-$$VER.tar.z
1646
1647 # When you use `make setup-dirs' or `make taz' you should always redefine
1648 # this macro.
1649 SUPPORT_FILES = list-of-support-files-for-tool-in-question
1650 # Directories that might want `make proto-dir' run.
1651 PROTODIRS= gdb
1652
1653 setup-dirs: force
1654         ./configure sun4
1655         $(MAKE) clean
1656         ./configure -rm sun4
1657         chmod og=u `find etc $(DEVO_SUPPORT) $(SUPPORT_FILES) -print`
1658         for d in .. $(PROTODIRS) ; do \
1659           if [ $$d != ".." ] && [ -d $$d ]; then \
1660             (cd $$d ; $(MAKE) -f Makefile.in proto-dir) ; \
1661           else true ; fi ; \
1662         done
1663
1664 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
1665         rm -rf proto-toplev; mkdir proto-toplev
1666         for d in .. $(PROTODIRS) ; do \
1667           if [ $$d != .. ]; then \
1668             if [ -d $$d ]; then \
1669               ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1670             else true ; fi ; \
1671           else true ; fi ; \
1672         done
1673         (cd proto-toplev; for i in $(DEVO_SUPPORT) $(SUPPORT_FILES); do \
1674                 if [ ! -d $$i ]; then ln -s ../$$i . ; else true ; fi ; \
1675         done)
1676         mkdir proto-toplev/etc
1677         (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \
1678                 ln -s ../../etc/$$i . ; \
1679         done)
1680         # Put only one copy (four hard links) of COPYING in the tar file.
1681         ## FIX ME LATER
1682
1683         # Take out texinfo and glob from configurable dirs
1684         rm proto-toplev/configure.in
1685         sed -e '/^host_tools=/s/texinfo //' \
1686             -e '/^host_libs=/s/glob //' \
1687             <configure.in >proto-toplev/configure.in
1688
1689         # Take out texinfo from a few places; make simple BISON=bison line.
1690         rm proto-toplev/Makefile.in
1691         sed -e '/^all\.normal: /s/\all-texinfo //' \
1692             -e '/^      install-texinfo /d' \
1693             -e '/^BISON = /,/^$$/d' \
1694             -e '/^# BISON:/s/.*/BISON = bison -y/' \
1695         <Makefile.in >proto-toplev/Makefile.in
1696
1697         mkdir proto-toplev/texinfo
1698         ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1699         ln -s ../../texinfo/tex3patch   proto-toplev/texinfo/
1700         chmod og=u `find proto-toplev -print`
1701         (VER=`sed <$(TOOL)/Makefile.in -n 's/VERSION *= *//p'`; \
1702                 echo "==> Making $(TOOL)-$$VER.tar.z"; \
1703                 ln -s proto-toplev $(TOOL)-$$VER; \
1704                 tar cfh - $(TOOL)-$$VER \
1705                 | $(GZIP) -v >$(TOOL)-$$VER.tar.z)
1706
1707 GAS_SUPPORT_DIRS= bfd include libiberty opcodes
1708
1709 gas.tar.z: $(DEVO_SUPPORT) $(GAS_SUPPORT_DIRS) gas texinfo/texinfo.tex
1710         $(MAKE) -f Makefile.in setup-dirs SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
1711         $(MAKE) -f Makefile.in taz SUPPORT_FILES="$(GAS_SUPPORT_DIRS)" TOOL=gas
1712
1713 # end of Makefile.in