Fri Jan 8 16:19:26 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
[platform/upstream/binutils.git] / Makefile.in
1 #
2 # Makefile for directory with subdirs to build.
3 #   Copyright (C) 1990, 1991, 1992 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 CXX = gcc
58 CXXFLAGS = -g -O
59 GCC_FOR_TARGET = ./gcc -B./
60 RANLIB = ranlib
61 NM = nm
62
63 BISON = `if [ -f $${rootme}/byacc/byacc ] ; \
64             then echo $${rootme}/byacc/byacc ; \
65             else echo byacc ; \
66         fi`
67
68 LEX = `if [ -f $${rootme}/flex/flex ] ; \
69         then echo $${rootme}/flex/flex ; \
70         else echo flex ; fi`
71
72 MAKEINFO = `if [ -f $${rootme}/texinfo/C/makeinfo ] ; \
73         then echo $${rootme}/texinfo/C/makeinfo ; \
74         else echo makeinfo ; fi`
75
76 # compilers to use to create programs which must be run in the build
77 # environment.
78 CC_FOR_BUILD = $(CC)
79 CXX_FOR_BUILD = $(CXX)
80
81 SUBDIRS = libiberty mmalloc glob readline opcodes bfd h8300sim z8ksim \
82         $(start-sanitize-chill) \
83           chillrt \
84         $(end-sanitize-chill) \
85           gdb binutils ld gas tgas gcc libg++ newlib deja-gnu
86 OTHERS = 
87
88 ALL = all.normal
89 INSTALL_TARGET = install.all
90
91 ### for debugging
92 #GCCVERBOSE=-v
93
94 CC_FOR_TARGET = ` \
95   if [ -f $${rootme}/gcc/Makefile ] ; then \
96     echo $${rootme}/gcc/gcc -B$${rootme}/gcc/; \
97   else \
98     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
99       echo $(CC); \
100     else \
101       t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
102     fi; \
103   fi`
104
105 CXX_FOR_TARGET = ` \
106   if [ -f $${rootme}/gcc/Makefile ] ; then \
107     echo $${rootme}/gcc/gcc -B$${rootme}/gcc/; \
108   else \
109     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
110       echo $(CXX); \
111     else \
112       t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
113     fi; \
114   fi`
115
116 AS_FOR_TARGET = ` \
117   if [ -f $${rootme}/gas/Makefile ] ; then \
118     echo $${rootme}/gas/as.new ; \
119   else \
120     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
121       echo $(AS); \
122     else \
123        t='$(program_transform_name)'; echo as | sed -e '' $$t ; \
124     fi \
125   fi`
126
127 AR_FOR_TARGET = ` \
128   if [ -f $${rootme}/binutils/Makefile ] ; then \
129     echo $${rootme}/binutils/ar ; \
130   else \
131     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
132       echo $(AR); \
133     else \
134        t='$(program_transform_name)'; echo ar | sed -e '' $$t ; \
135     fi \
136   fi`
137
138 RANLIB_FOR_TARGET = ` \
139   if [ -f $${rootme}/binutils/Makefile ] ; then \
140     echo $${rootme}/binutils/ranlib ; \
141   else \
142     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
143       echo $(RANLIB); \
144     else \
145        t='$(program_transform_name)'; echo ranlib | sed -e '' $$t ; \
146     fi \
147   fi`
148
149 NM_FOR_TARGET = ` \
150   if [ -f $${rootme}/binutils/Makefile ] ; then \
151     echo $${rootme}/binutils/nm ; \
152   else \
153     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
154       echo $(NM); \
155     else \
156        t='$(program_transform_name)'; echo nm | sed -e '' $$t ; \
157     fi \
158   fi`
159
160 XTRAFLAGS = ` \
161   if [ -f $${rootme}/gcc/Makefile ] ; then \
162     if [ -f $${rootme}/newlib/Makefile ] ; then \
163       echo -I$${rootme}/newlib/targ-include -I$${srcroot}/newlib/libc/include -I$${rootme}/gcc/include -nostdinc ; \
164     else \
165       echo -I$${rootme}/gcc/include ; \
166     fi ; \
167   else \
168      echo ; \
169   fi`
170
171
172 #### host and target specific makefile fragments come in here.
173 ###
174
175 # Flags to pass down to sub-makes -- please keep these in alphabetical order
176 FLAGS_TO_PASS = \
177         "AR=$(AR)" \
178         "AR_FLAGS=$(AR_FLAGS)" \
179         "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
180         "BISON=$(BISON)" \
181         "CXXFLAGS=$(CXXFLAGS)" \
182         "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
183         "CC=$(CC)" \
184         "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
185         "CFLAGS=$(CFLAGS)" \
186         "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
187         "INSTALL=$(INSTALL)" \
188         "INSTALL_DATA=$(INSTALL_DATA)" \
189         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
190         "LDFLAGS=$(LDFLAGS)" \
191         "LEX=$(LEX)" \
192         "LOADLIBES=$(LOADLIBES)" \
193         "MAKEINFO=$(MAKEINFO)" \
194         "RANLIB=$(RANLIB)" \
195         "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
196         "exec_prefix=$(exec_prefix)" \
197         "prefix=$(prefix)" \
198         "tooldir=$(tooldir)" 
199
200 # Flags that are concerned with the location of the X11 include files
201 # and library files
202 X11_FLAGS_TO_PASS = \
203         "X11_INCLUDE_FLAGS=$(X11_INCLUDE_FLAGS)" \
204         "X11_LIB_FLAGS=$(X11_LIB_FLAGS)"
205
206 # Flags to pass down to makes which are built with the target
207 # environment (e.g. libg++, xiberty, newlib).  -- keep these in alpha order please
208 TARGET_FLAGS_TO_PASS = \
209         "AR=$(AR_FOR_TARGET)" \
210         "AR_FLAGS=$(AR_FLAGS)" \
211         "AS=$(AS_FOR_TARGET)" \
212         "BISON=$(BISON)" \
213         "CXX=$(CXX_FOR_TARGET)" \
214         "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
215         "CXXFLAGS=$(CXXFLAGS)" \
216         "CC=$(CC_FOR_TARGET)" \
217         "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
218         "CFLAGS=$(CFLAGS)" \
219         "INSTALL=$(INSTALL)" \
220         "INSTALL_DATA=$(INSTALL_DATA)" \
221         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
222         "LDFLAGS=$(LDFLAGS)" \
223         "LEX=$(LEX)" \
224         "LOADLIBES=$(LOADLIBES)" \
225         "MAKEINFO=$(MAKEINFO)" \
226         "NM=$(NM_FOR_TARGET)" \
227         "RANLIB=$(RANLIB_FOR_TARGET)" \
228         "XTRAFLAGS=$(XTRAFLAGS)" \
229         "exec_prefix=$(exec_prefix)" \
230         "prefix=$(prefix)" \
231         "tooldir=$(tooldir)" 
232
233 # The first rule in the file had better be this one.  Don't put any above it.
234 all:    $(ALL)
235
236 .PHONY: all check dvi info install-info 
237 .NOEXPORT:
238
239 info check dvi: 
240         @rootme=`pwd` ; export rootme ; \
241           $(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
242
243 install-info: install-info-dirs force
244         -parent=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \
245         if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
246         -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi
247         @rootme='pwd' ; export rootme ; $(MAKE) $(FLAGS_TO_PASS) DO=install-info "DODIRS=$(SUBDIRS)" subdir_do
248         @rootme='pwd' ; export rootme ; $(MAKE) $(FLAGS_TO_PASS) dir.info install-dir.info
249
250 install-dir.info:
251         -parent=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \
252         if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
253         -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi
254         $(INSTALL_DATA) dir.info $(infodir)/dir.info
255
256 all.normal: all-m4 all-autoconf all-libiberty all-mmalloc all-texinfo \
257         all-byacc all-flex all-opcodes all-bfd all-ld all-gas all-tgas \
258         all-gcc all-binutils  all-libg++ all-readline all-z8ksim all-h8300sim all-gdb \
259         all-make all-rcs all-cvs all-diff all-grep \
260         all-patch all-emacs all-ispell all-etc \
261         all-tcl all-tk all-expect \
262         all-newlib \
263         $(start-sanitize-chill) \
264         all-chillrt \
265         $(end-sanitize-chill) \
266         all-gprof all-send_pr all-libm all-deja-gnu \
267         all-fileutils all-find all-gawk all-sed all-shellutils \
268         all-textutils all-time all-wdiff
269
270
271 all.cross: all-libiberty all-mmalloc all-gas all-byacc all-flex all-ld \
272         all-opcodes all-z8ksim all-h8300sim all-bfd all-readline \
273         all-gdb all-binutils all-gcc all-newlib \
274         $(start-sanitize-chill) \
275         all-chillrt \
276         $(end-sanitize-chill) \
277         all-deja-gnu
278
279 .PHONY: clean distclean mostlyclean realclean do_clean
280
281 do_clean:
282         -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
283
284 clean mostlyclean: do_clean
285         @rootme=`pwd` ; export rootme ; \
286           $(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
287
288 distclean realclean: do_clean
289         @rootme=`pwd` ; export rootme ; \
290           $(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
291         -rm -f Makefile config.status
292
293 uninstall:
294         @echo "the uninstall target is not supported in this tree"
295
296 install: $(INSTALL_TARGET) 
297         -parent=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \
298         if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
299         -if [ -d $(man1dir) ] ; then true ; else mkdir $(man1dir) ; fi
300
301 install.all: install-no-fixedincludes
302         @if [ -f ./gcc/Makefile ] ; then \
303                 rootme=`pwd` ; export rootme ; \
304                 (cd ./gcc; \
305                 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
306         else \
307                 true ; \
308         fi
309
310 install-no-fixedincludes: install-dirs gcc-no-fixedincludes \
311         install-autoconf \
312         install-bfd \
313         install-binutils \
314         install-opcodes \
315         install-byacc \
316         install-cvs \
317         install-diff \
318         install-deja-gnu \
319         install-emacs \
320         install-etc \
321         install-expect \
322         install-flex \
323         install-gas \
324         install-gdb \
325         install-glob \
326         install-gprof \
327         install-grep \
328         install-ispell \
329         install-ld \
330         install-libg++ \
331         install-libiberty \
332         install-libm \
333         install-make \
334         install-mmalloc \
335         install-newlib \
336         $(start-sanitize-chill) \
337         install-chillrt \
338         $(end-sanitize-chill) \
339         install-patch \
340         install-rcs \
341         install-readline \
342         install-send_pr \
343         install-tcl \
344         install-texinfo \
345         install-tk  \
346         install-z8ksim \
347         install-h8300sim \
348         install-fileutils install-find install-gawk install-m4 install-sed install-shellutils \
349         install-textutils install-time install-wdiff
350
351 gcc-no-fixedincludes:
352         @if [ -f ./gcc/Makefile ] ; then \
353                 rootme=`pwd` ; export rootme ; \
354                 (cd ./gcc; \
355                 $(MAKE) $(FLAGS_TO_PASS) install install-man \
356                         "INSTALL_HEADERS=install-common-headers install-float-h install-limits-h") ; \
357         else \
358                 true ; \
359         fi
360
361 install.cross: install-dirs install-libiberty install-mmalloc \
362         install-binutils install-opcodes install-byacc install-flex \
363         install-ld install-gas install-readline \
364         install-glob install-gdb install-mmalloc \
365         install-newlib \
366         $(start-sanitize-chill) \
367         install-chillrt \
368         $(end-sanitize-chill) \
369         install-gcc install-etc install-deja-gnu
370
371 ### deja-gnu
372 all-deja-gnu: force
373         @if [ -f ./deja-gnu/Makefile ] ; then \
374                 rootme=`pwd` ; export rootme ; \
375                 (cd ./deja-gnu; $(MAKE) $(FLAGS_TO_PASS) all) ; \
376         else \
377                 true ; \
378         fi
379
380 install-deja-gnu: force
381         @if [ -f ./deja-gnu/Makefile ] ; then \
382                 rootme=`pwd` ; export rootme ; \
383                 (cd ./deja-gnu; $(MAKE) $(FLAGS_TO_PASS) install) ; \
384         else \
385                 true ; \
386         fi
387
388 ### autoconf
389 all-autoconf: force
390         @if [ -f ./autoconf/Makefile ] ; then \
391                 rootme=`pwd` ; export rootme ; \
392                 (cd ./autoconf; $(MAKE) $(FLAGS_TO_PASS) all) ; \
393         else \
394                 true ; \
395         fi
396
397 install-autoconf: force
398         @if [ -f ./autoconf/Makefile ] ; then \
399                 rootme=`pwd` ; export rootme ; \
400                 (cd ./autoconf; $(MAKE) $(FLAGS_TO_PASS) install) ; \
401         else \
402                 true ; \
403         fi
404
405 ### etc
406 all-etc: force
407         @if [ -f ./etc/Makefile ] ; then \
408                 rootme=`pwd` ; export rootme ; \
409                 (cd ./etc; $(MAKE) $(FLAGS_TO_PASS) all) ; \
410         else \
411                 true ; \
412         fi
413
414 install-etc: force
415         @if [ -f ./etc/Makefile ] ; then \
416                 rootme=`pwd` ; export rootme ; \
417                 (cd ./etc; $(MAKE) $(FLAGS_TO_PASS) install) ; \
418         else \
419                 true ; \
420         fi
421
422 ### libiberty
423 all-libiberty: force
424         @if [ -f ./libiberty/Makefile ] ; then \
425                 rootme=`pwd` ; export rootme ; \
426                 (cd ./libiberty; \
427                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
428         else \
429                 true ; \
430         fi
431
432 install-libiberty: force
433         @if [ -f ./libiberty/Makefile ] ; then \
434                 rootme=`pwd` ; export rootme ; \
435                 (cd ./libiberty; \
436                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
437         else \
438                 true ; \
439         fi
440
441 ### xiberty
442 all-xiberty: all-gcc all-newlib
443         @if [ -f ./xiberty/Makefile ] ; then \
444                 rootme=`pwd` ; export rootme ; \
445                 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
446                 (cd ./xiberty; \
447                 $(MAKE) $(TARGET_FLAGS_TO_PASS) all) ; \
448         else \
449                 true ; \
450         fi
451
452 install-xiberty: force
453         @if [ -f ./xiberty/Makefile ] ; then \
454                 rootme=`pwd` ; export rootme ; \
455                 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
456                 (cd ./xiberty; \
457                 $(MAKE) $(TARGET_FLAGS_TO_PASS) install) ; \
458         else \
459                 true ; \
460         fi
461
462 ### mmalloc
463 all-mmalloc: force
464         @if [ -f ./mmalloc/Makefile ] ; then \
465                 rootme=`pwd` ; export rootme ; \
466                 (cd ./mmalloc; \
467                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
468         else \
469                 true ; \
470         fi
471
472 install-mmalloc: force
473         @if [ -f ./mmalloc/Makefile ] ; then \
474                 rootme=`pwd` ; export rootme ; \
475                 (cd ./mmalloc; \
476                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
477         else \
478                 true ; \
479         fi
480
481 ### texinfo
482 all-texinfo: all-libiberty
483         @if [ -f ./texinfo/Makefile ] ; then \
484                 rootme=`pwd` ; export rootme ; \
485                 (cd ./texinfo; \
486                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
487         else \
488                 true ; \
489         fi
490
491 install-texinfo: force
492         @if [ -f ./texinfo/Makefile ] ; then \
493                 rootme=`pwd` ; export rootme ; \
494                 (cd ./texinfo; \
495                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
496         else \
497                 true ; \
498         fi
499
500 ### bfd
501 all-bfd: force
502         @if [ -f ./bfd/Makefile ] ; then \
503                 rootme=`pwd` ; export rootme ; \
504                 (cd ./bfd; \
505                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
506         else \
507                 true ; \
508         fi
509
510 install-bfd: force
511         @if [ -f ./bfd/Makefile ] ; then \
512                 rootme=`pwd` ; export rootme ; \
513                 (cd ./bfd; \
514                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
515         else \
516                 true ; \
517         fi
518
519
520 ### opcodes
521 all-opcodes: force
522         @if [ -f ./opcodes/Makefile ] ; then \
523                 rootme=`pwd` ; export rootme ; \
524                 (cd ./opcodes; \
525                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
526         else \
527                 true ; \
528         fi
529
530 install-opcodes: force
531         @if [ -f ./opcodes/Makefile ] ; then \
532                 rootme=`pwd` ; export rootme ; \
533                 (cd ./opcodes; \
534                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
535         else \
536                 true ; \
537         fi
538
539 ### binutils
540 all-binutils: all-opcodes all-libiberty all-bfd all-flex
541         @if [ -f ./binutils/Makefile ] ; then \
542                 rootme=`pwd` ; export rootme ; \
543                 (cd ./binutils; \
544                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
545         else \
546                 true ; \
547         fi
548
549 install-binutils: force
550         @if [ -f ./binutils/Makefile ] ; then \
551                 rootme=`pwd` ; export rootme ; \
552                 (cd ./binutils; \
553                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
554         else \
555                 true ; \
556         fi
557
558 ### newlib
559 all-newlib: all-binutils all-ld all-gas all-gcc
560         @if [ -f ./newlib/Makefile ] ; then \
561                 rootme=`pwd` ; export rootme ; \
562                 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
563                 (cd ./newlib; \
564                 $(MAKE) $(TARGET_FLAGS_TO_PASS) all) ; \
565         else \
566                 true ; \
567         fi
568
569 install-newlib: force
570         @if [ -f ./newlib/Makefile ] ; then \
571                 rootme=`pwd` ; export rootme ; \
572                 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
573                 (cd ./newlib; \
574                 $(MAKE) $(TARGET_FLAGS_TO_PASS) install) ; \
575         else \
576                 true ; \
577         fi
578
579 ### start-sanitize-chill
580 ### chillrt
581 all-chillrt: all-binutils all-ld all-gas all-gcc
582         @if [ -f ./chillrt/Makefile ] ; then \
583                 rootme=`pwd` ; export rootme ; \
584                 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
585                 (cd ./chillrt; \
586                 $(MAKE) $(TARGET_FLAGS_TO_PASS) all) ; \
587         else \
588                 true ; \
589         fi
590
591 install-chillrt: force
592         @if [ -f ./chillrt/Makefile ] ; then \
593                 rootme=`pwd` ; export rootme ; \
594                 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
595                 (cd ./chillrt; \
596                 $(MAKE) $(TARGET_FLAGS_TO_PASS) install) ; \
597         else \
598                 true ; \
599         fi
600 ### end-sanitize-chill
601
602 ### gprof
603 all-gprof: all-libiberty all-bfd
604         @if [ -f ./gprof/Makefile ] ; then \
605                 rootme=`pwd` ; export rootme ; \
606                 (cd ./gprof; \
607                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
608         else \
609                 true ; \
610         fi
611
612 install-gprof: force
613         @if [ -f ./gprof/Makefile ] ; then \
614                 rootme=`pwd` ; export rootme ; \
615                 (cd ./gprof; \
616                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
617         else \
618                 true ; \
619         fi
620
621 ### byacc
622 all-byacc: force
623         @if [ -f ./byacc/Makefile ] ; then \
624                 rootme=`pwd` ; export rootme ; \
625                 (cd ./byacc; \
626                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
627         else \
628                 true ; \
629         fi
630
631 install-byacc: force
632         @if [ -f ./byacc/Makefile ] ; then \
633                 rootme=`pwd` ; export rootme ; \
634                 (cd ./byacc; \
635                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
636         else \
637                 true ; \
638         fi
639
640 ### flex
641 all-flex: all-libiberty
642         @if [ -f ./flex/Makefile ] ; then \
643                 rootme=`pwd` ; export rootme ; \
644                 (cd ./flex; \
645                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
646         else \
647                 true ; \
648         fi
649
650 install-flex: force
651         @if [ -f ./flex/Makefile ] ; then \
652                 rootme=`pwd` ; export rootme ; \
653                 (cd ./flex; \
654                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
655         else \
656                 true ; \
657         fi
658 ### gcc
659 all-gcc: all-libiberty all-byacc all-binutils
660         @if [ -f ./gcc/Makefile ] ; then \
661                 rootme=`pwd` ; export rootme ; \
662                 (cd ./gcc; \
663                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
664         else \
665                 true ; \
666         fi
667
668 install-gcc: force
669         @if [ -f ./gcc/Makefile ] ; then \
670                 rootme=`pwd` ; export rootme ; \
671                 (cd ./gcc; \
672                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
673         else \
674                 true ; \
675         fi
676
677 ### readline
678 all-readline: force
679         @if [ -f ./readline/Makefile ] ; then \
680                 rootme=`pwd` ; export rootme ; \
681                 (cd ./readline; \
682                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
683         else \
684                 true ; \
685         fi
686
687 install-readline: force
688         @if [ -f ./readline/Makefile ] ; then \
689                 rootme=`pwd` ; export rootme ; \
690                 (cd ./readline; \
691                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
692         else \
693                 true ; \
694         fi
695
696 ### glob
697 all-glob: force
698         @if [ -f ./glob/Makefile ] ; then \
699                 rootme=`pwd` ; export rootme ; \
700                 (cd ./glob; \
701                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
702         else \
703                 true ; \
704         fi
705
706 install-glob: force
707         @if [ -f ./glob/Makefile ] ; then \
708                 rootme=`pwd` ; export rootme ; \
709                 (cd ./glob; \
710                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
711         else \
712                 true ; \
713         fi
714
715 ### gas
716 all-gas: all-libiberty all-opcodes all-bfd
717         @if [ -f ./gas/Makefile ] ; then \
718                 rootme=`pwd` ; export rootme ; \
719                 (cd ./gas; \
720                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
721         else \
722                 true ; \
723         fi
724
725 install-gas: force
726         @if [ -f ./gas/Makefile ] ; then \
727                 rootme=`pwd` ; export rootme ; \
728                 (cd ./gas; \
729                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
730         else \
731                 true ; \
732         fi
733
734 ### gas
735 all-tgas: all-libiberty all-bfd
736         @if [ -f ./tgas/Makefile ] ; then \
737                 rootme=`pwd` ; export rootme ; \
738                 (cd ./tgas; \
739                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
740         else \
741                 true ; \
742         fi
743
744
745 ### ld
746 all-ld: all-libiberty all-bfd all-byacc all-flex
747         @if [ -f ./ld/Makefile ] ; then \
748                 rootme=`pwd` ; export rootme ; \
749                 (cd ./ld; \
750                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
751         else \
752                 true ; \
753         fi
754
755 install-ld: force
756         @if [ -f ./ld/Makefile ] ; then \
757                 rootme=`pwd` ; export rootme ; \
758                 (cd ./ld; \
759                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
760         else \
761                 true ; \
762         fi
763
764 ### gdb
765 all-gdb: all-bfd all-opcodes all-libiberty all-mmalloc all-readline all-glob all-byacc
766         @if [ -f ./gdb/Makefile ] ; then \
767                 rootme=`pwd` ; export rootme ; \
768                 (cd ./gdb; \
769                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
770         else \
771                 true ; \
772         fi
773
774 install-gdb: force
775         @if [ -f ./gdb/Makefile ] ; then \
776                 rootme=`pwd` ; export rootme ; \
777                 (cd ./gdb; \
778                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
779         else \
780                 true ; \
781         fi
782
783 ### make
784 all-make: all-libiberty
785         @if [ -f ./make/Makefile ] ; then \
786                 rootme=`pwd` ; export rootme ; \
787                 (cd ./make; \
788                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
789         else \
790                 true ; \
791         fi
792
793 install-make: force
794         @if [ -f ./make/Makefile ] ; then \
795                 rootme=`pwd` ; export rootme ; \
796                 (cd ./make; \
797                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
798         else \
799                 true ; \
800         fi
801
802 ### diff
803 all-diff: force
804         @if [ -f ./diff/Makefile ] ; then \
805                 rootme=`pwd` ; export rootme ; \
806                 (cd ./diff; \
807                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
808         else \
809                 true ; \
810         fi
811
812 install-diff: force
813         @if [ -f ./diff/Makefile ] ; then \
814                 rootme=`pwd` ; export rootme ; \
815                 (cd ./diff/; \
816                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
817         else \
818                 true ; \
819         fi
820
821 ### grep
822 all-grep: force
823         @if [ -f ./grep/Makefile ] ; then \
824                 rootme=`pwd` ; export rootme ; \
825                 (cd ./grep; \
826                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
827         else \
828                 true ; \
829         fi
830
831 install-grep: force
832         @if [ -f ./grep/Makefile ] ; then \
833                 rootme=`pwd` ; export rootme ; \
834                 (cd ./grep; \
835                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
836         else \
837                 true ; \
838         fi
839
840 ### rcs
841 all-rcs: force
842         @if [ -f ./rcs/Makefile ] ; then \
843                 rootme=`pwd` ; export rootme ; \
844                 (cd ./rcs; \
845                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
846         else \
847                 true ; \
848         fi
849
850 install-rcs: force
851         @if [ -f ./rcs/Makefile ] ; then \
852                 rootme=`pwd` ; export rootme ; \
853                 (cd ./rcs; \
854                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
855         else \
856                 true ; \
857         fi
858
859 ### cvs
860 all-cvs: force
861         @if [ -f ./cvs/Makefile ] ; then \
862                 rootme=`pwd` ; export rootme ; \
863                 (cd ./cvs; \
864                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
865         else \
866                 true ; \
867         fi
868
869 install-cvs: force
870         @if [ -f ./cvs/Makefile ] ; then \
871                 rootme=`pwd` ; export rootme ; \
872                 (cd ./cvs; \
873                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
874         else \
875                 true ; \
876         fi
877
878 ### patch
879 all-patch: force
880         @if [ -f ./patch/Makefile ] ; then \
881                 rootme=`pwd` ; export rootme ; \
882                 (cd ./patch; \
883                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
884         else \
885                 true ; \
886         fi
887
888 install-patch: force
889         @if [ -f ./patch/Makefile ] ; then \
890                 rootme=`pwd` ; export rootme ; \
891                 (cd ./patch; \
892                 $(MAKE) $(FLAGS_TO_PASS) \
893                         bindir=$(bindir) \
894                         man1dir=$(man1dir) install) ; \
895         else \
896                 true ; \
897         fi
898
899 ### emacs
900 all-emacs: force
901         @if [ -f ./emacs/Makefile ] ; then \
902                 rootme=`pwd` ; export rootme ; \
903                 (cd ./emacs; \
904                 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) ; \
905         else \
906                 true ; \
907         fi
908
909 install-emacs: force
910         @if [ -f ./emacs/Makefile ] ; then \
911                 rootme=`pwd` ; export rootme ; \
912                 (cd ./emacs; \
913                 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) ; \
914         else \
915                 true ; \
916         fi
917
918 ### ispell
919 all-ispell: all-emacs
920         @if [ -f ./ispell/Makefile ] ; then \
921                 rootme=`pwd` ; export rootme ; \
922                 (cd ./ispell; \
923                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
924         else \
925                 true ; \
926         fi
927
928 install-ispell: force
929         @if [ -f ./ispell/Makefile ] ; then \
930                 rootme=`pwd` ; export rootme ; \
931                 (cd ./ispell; \
932                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
933         else \
934                 true ; \
935         fi
936
937 ### send_pr
938 all-send_pr: force
939         @if [ -f ./send_pr/Makefile ] ; then \
940                 rootme=`pwd` ; export rootme ; \
941                 (cd ./send_pr; \
942                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
943         else \
944                 true ; \
945         fi
946
947 install-send_pr: force
948         @if [ -f ./send_pr/Makefile ] ; then \
949                 rootme=`pwd` ; export rootme ; \
950                 (cd ./send_pr; \
951                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
952         else \
953                 true ; \
954         fi
955
956 ### libm
957 all-libm: force
958         @if [ -f ./libm/Makefile ] ; then \
959                 rootme=`pwd` ; export rootme ; \
960                 (cd ./libm; \
961                 $(MAKE) $(TARGET_FLAGS_TO_PASS) all) ; \
962         else \
963                 true ; \
964         fi
965
966 install-libm: force
967         @if [ -f ./libm/Makefile ] ; then \
968                 rootme=`pwd` ; export rootme ; \
969                 (cd ./libm; \
970                 $(MAKE) $(TARGET_FLAGS_TO_PASS) install) ; \
971         else \
972                 true ; \
973         fi
974
975 ### libg++
976
977 all-libg++: all-gas all-ld all-gcc all-xiberty all-newlib
978         @if [ -f ./libg++/Makefile ] ; then \
979                 rootme=`pwd` ; export rootme ; \
980                 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
981                 (cd ./libg++; \
982                 $(MAKE) $(TARGET_FLAGS_TO_PASS) all) ; \
983         else \
984                 true ; \
985         fi
986
987 install-libg++: force
988         @if [ -f ./libg++/Makefile ] ; then \
989                 rootme=`pwd` ; export rootme ; \
990                 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
991                 (cd ./libg++; \
992                 $(MAKE) $(TARGET_FLAGS_TO_PASS) install) ; \
993         else \
994                 true ; \
995         fi
996 ### tcl
997 all-tcl: 
998         @if [ -f ./tcl/Makefile ] ; then \
999                 rootme=`pwd` ; export rootme ; \
1000                 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
1001                 (cd ./tcl; \
1002                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
1003         else \
1004                 true ; \
1005         fi
1006
1007 install-tcl: force
1008         @if [ -f ./tcl/Makefile ] ; then \
1009                 rootme=`pwd` ; export rootme ; \
1010                 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
1011                 (cd ./tcl; \
1012                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
1013         else \
1014                 true ; \
1015         fi
1016
1017
1018 ### tk
1019 all-tk: all-tcl
1020         @if [ -f ./tk/Makefile ] ; then \
1021                 rootme=`pwd` ; export rootme ; \
1022                 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
1023                 (cd ./tk; \
1024                 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) ; \
1025         else \
1026                 true ; \
1027         fi
1028
1029 install-tk: force
1030         @if [ -f ./tk/Makefile ] ; then \
1031                 rootme=`pwd` ; export rootme ; \
1032                 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
1033                 (cd ./tk; \
1034                 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) ; \
1035         else \
1036                 true ; \
1037         fi
1038
1039 ### expect
1040 all-expect: all-tcl
1041         @if [ -f ./expect/Makefile ] ; then \
1042                 rootme=`pwd` ; export rootme ; \
1043                 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
1044                 (cd ./expect; \
1045                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
1046         else \
1047                 true ; \
1048         fi
1049
1050 install-expect: force
1051         @if [ -f ./expect/Makefile ] ; then \
1052                 rootme=`pwd` ; export rootme ; \
1053                 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
1054                 (cd ./expect; \
1055                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
1056         else \
1057                 true ; \
1058         fi
1059
1060 ### z8ksim
1061 all-z8ksim: all-bfd 
1062         @if [ -f ./z8ksim/Makefile ] ; then \
1063                 rootme=`pwd` ; export rootme ; \
1064                 (cd ./z8ksim; \
1065                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
1066         else \
1067                 true ; \
1068         fi
1069
1070 install-z8ksim: force
1071         @if [ -f ./z8ksim/Makefile ] ; then \
1072                 rootme=`pwd` ; export rootme ; \
1073                 (cd ./z8ksim; \
1074                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
1075         else \
1076                 true ; \
1077         fi
1078
1079 ### h8300sim:
1080 all-h8300sim:  all-bfd 
1081         @if [ -f ./h8300sim/Makefile ] ; then \
1082                 rootme=`pwd` ; export rootme ; \
1083                 (cd ./h8300sim; \
1084                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
1085         else \
1086                 true ; \
1087         fi
1088
1089 install-h8300sim: force
1090         @if [ -f ./h8300sim/Makefile ] ; then \
1091                 rootme=`pwd` ; export rootme ; \
1092                 (cd ./h8300sim; \
1093                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
1094         else \
1095                 true ; \
1096         fi
1097
1098
1099 ### fileutils
1100 all-fileutils: force
1101         @if [ -f ./fileutils/Makefile ] ; then \
1102           rootme=`pwd` ; export rootme ; \
1103                 (cd ./fileutils; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1104         else \
1105                 true ; \
1106         fi
1107
1108 install-fileutils: force
1109         @if [ -f ./fileutils/Makefile ] ; then \
1110                 rootme=`pwd` ; export rootme ; \
1111                 (cd ./fileutils; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1112         else \
1113                 true ; \
1114         fi
1115
1116 ### find
1117 all-find: force
1118         @if [ -f ./find/Makefile ] ; then \
1119           rootme=`pwd` ; export rootme ; \
1120                 (cd ./find; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1121         else \
1122                 true ; \
1123         fi
1124
1125 install-find: force
1126         @if [ -f ./find/Makefile ] ; then \
1127                 rootme=`pwd` ; export rootme ; \
1128                 (cd ./find; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1129         else \
1130                 true ; \
1131         fi
1132
1133 ### gawk
1134 all-gawk: force
1135         @if [ -f ./gawk/Makefile ] ; then \
1136           rootme=`pwd` ; export rootme ; \
1137                 (cd ./gawk; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1138         else \
1139                 true ; \
1140         fi
1141
1142 install-gawk: force
1143         @if [ -f ./gawk/Makefile ] ; then \
1144                 rootme=`pwd` ; export rootme ; \
1145                 (cd ./gawk; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1146         else \
1147                 true ; \
1148         fi
1149
1150 ### m4
1151 all-m4: all-libiberty
1152         @if [ -f ./m4/Makefile ] ; then \
1153           rootme=`pwd` ; export rootme ; \
1154                 (cd ./m4; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1155         else \
1156                 true ; \
1157         fi
1158
1159 install-m4: force
1160         @if [ -f ./m4/Makefile ] ; then \
1161                 rootme=`pwd` ; export rootme ; \
1162                 (cd ./m4; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1163         else \
1164                 true ; \
1165         fi
1166
1167 ### sed
1168 all-sed: force
1169         @if [ -f ./sed/Makefile ] ; then \
1170           rootme=`pwd` ; export rootme ; \
1171                 (cd ./sed; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1172         else \
1173                 true ; \
1174         fi
1175
1176 install-sed: force
1177         @if [ -f ./sed/Makefile ] ; then \
1178                 rootme=`pwd` ; export rootme ; \
1179                 (cd ./sed; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1180         else \
1181                 true ; \
1182         fi
1183
1184 ### time
1185 all-time: force
1186         @if [ -f ./time/Makefile ] ; then \
1187           rootme=`pwd` ; export rootme ; \
1188                 (cd ./time; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1189         else \
1190                 true ; \
1191         fi
1192
1193 install-time: force
1194         @if [ -f ./time/Makefile ] ; then \
1195                 rootme=`pwd` ; export rootme ; \
1196                 (cd ./time; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1197         else \
1198                 true ; \
1199         fi
1200
1201 ### wdiff
1202 all-wdiff: force
1203         @if [ -f ./wdiff/Makefile ] ; then \
1204           rootme=`pwd` ; export rootme ; \
1205                 (cd ./wdiff; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1206         else \
1207                 true ; \
1208         fi
1209
1210 install-wdiff: force
1211         @if [ -f ./wdiff/Makefile ] ; then \
1212                 rootme=`pwd` ; export rootme ; \
1213                 (cd ./wdiff; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1214         else \
1215                 true ; \
1216         fi
1217
1218 ### shellutils
1219 all-shellutils: force
1220         @if [ -f ./shellutils/Makefile ] ; then \
1221           rootme=`pwd` ; export rootme ; \
1222                 (cd ./shellutils; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1223         else \
1224                 true ; \
1225         fi
1226
1227 install-shellutils: force
1228         @if [ -f ./shellutils/Makefile ] ; then \
1229                 rootme=`pwd` ; export rootme ; \
1230                 (cd ./shellutils; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1231         else \
1232                 true ; \
1233         fi
1234
1235 ### textutils
1236 all-textutils: force
1237         @if [ -f ./textutils/Makefile ] ; then \
1238           rootme=`pwd` ; export rootme ; \
1239                 (cd ./textutils; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1240         else \
1241                 true ; \
1242         fi
1243
1244 install-textutils: force
1245         @if [ -f ./textutils/Makefile ] ; then \
1246                 rootme=`pwd` ; export rootme ; \
1247                 (cd ./textutils; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1248         else \
1249                 true ; \
1250         fi
1251
1252
1253
1254 ### other supporting targets
1255
1256 subdir_do:
1257         @for i in $(DODIRS); do \
1258           if [ -f ./$$i/localenv ] || [ -f ./$$i/Makefile ] ; then \
1259             case $$i in \
1260             libg++ | xiberty | newlib) \
1261               if (rootme=`pwd` ; export rootme ; \
1262                   srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
1263                   cd ./$$i ; \
1264                   $(MAKE) $(TARGET_FLAGS_TO_PASS) $(DO)) ; then true ; \
1265               else exit 1 ; fi \
1266               ;; \
1267 ### start-sanitize-chill
1268 ### 
1269 ### WARNING: THIS IS VERY UGLY AND I DID NOT DO THIS WILLINGLY
1270 ###
1271 ### if you change the above code for libg++ et al, also change the
1272 ### code down here
1273 ###
1274             chillrt) \
1275               if (rootme=`pwd` ; export rootme ; \
1276                   srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
1277                   cd ./$$i ; \
1278                   $(MAKE) $(TARGET_FLAGS_TO_PASS) $(DO)) ; then true ; \
1279               else exit 1 ; fi \
1280               ;; \
1281 ### end-sanitize-chill
1282             *) \
1283               if (rootme=`pwd` ; export rootme ; \
1284                   cd ./$$i ; \
1285                   $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \
1286               else exit 1 ; fi \
1287               ;; \
1288             esac ; \
1289           else true ; fi ; \
1290         done
1291
1292 # The "else true" stuff is for Ultrix; the shell returns the exit code
1293 # of the "if" command, if no commands are run in the "then" or "else" part,
1294 # causing Make to quit.
1295
1296 MAKEDIRS= \
1297         $(prefix) \
1298         $(exec_prefix) \
1299         $(tooldir)
1300
1301 #       $(bindir) \
1302 #       $(libdir) \
1303 #       $(includedir) \
1304 #       $(datadir) \
1305 #       $(docdir) \
1306 #       $(mandir) \
1307 #       $(man1dir) \
1308 #       $(man5dir)
1309
1310 #       $(man2dir) \
1311 #       $(man3dir) \
1312 #       $(man4dir) \
1313 #       $(man6dir) \
1314 #       $(man7dir) \
1315 #       $(man8dir)
1316
1317 install-dirs:
1318         for i in $(MAKEDIRS) ; do \
1319                 echo Making $$i... ; \
1320                 parent=`echo $$i|sed -e 's@/[^/]*$$@@'`; \
1321                 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
1322                 if [ ! -d $$i ] ; then \
1323                         if mkdir $$i ; then \
1324                                 true ; \
1325                         else \
1326                                 exit 1 ; \
1327                         fi ; \
1328                 else \
1329                         true ; \
1330                 fi ; \
1331         done
1332
1333 install-info-dirs:
1334         if [ -d $(prefix) ] ; then true ; else mkdir $(prefix) ; fi
1335
1336 dir.info:
1337         $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new
1338         mv -f dir.info.new dir.info
1339
1340 dist:
1341         @echo "Building a full distribution of this tree isn't done"
1342         @echo "via 'make dist'.  Check out the etc/ subdirectory" 
1343
1344 etags tags: TAGS
1345
1346 TAGS:
1347         etags `$(MAKE) ls`
1348
1349 ls:
1350         @echo Makefile
1351         @for i in $(SUBDIRS); \
1352         do \
1353                 (cd $$i; \
1354                         pwd=`pwd`; \
1355                         wd=`basename $$pwd`; \
1356                         for j in `$(MAKE) ls`; \
1357                         do \
1358                                 echo $$wd/$$j; \
1359                         done) \
1360         done
1361
1362 force:
1363
1364 # with the gnu make, this is done automatically.
1365
1366 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
1367         $(SHELL) ./config.status
1368
1369 #
1370 # Build GDB distributions that contain BFD, Include, Libiberty, Readline, etc
1371
1372 DEVO_SUPPORT= README cfg-paper.texi Makefile.in configure configure.in \
1373         config.sub config configure.man configure.texi move-if-change \
1374         COPYING.LIB
1375 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline glob
1376 GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS) texinfo/fsf/texinfo.tex
1377
1378 setup-dirs: force
1379         ./configure sun4
1380         make clean
1381         ./configure -rm sun4
1382         chmod og=u `find $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
1383
1384 gdb.tar.Z: setup-dirs
1385         (cd gdb; $(MAKE) -f Makefile.in make-proto-gdb.dir)
1386         $(MAKE) $(MFLAGS) -f Makefile.in make-gdb.tar.Z
1387
1388 make-gdb.tar.Z: $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS) gdb texinfo/fsf/texinfo.tex
1389         rm -rf proto-toplev; mkdir proto-toplev
1390         ln -s ../gdb/proto-gdb.dir proto-toplev/gdb
1391         (cd proto-toplev; for i in $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS); do \
1392                 ln -s ../$$i . ; \
1393         done)
1394         # Put only one copy (four hard links) of COPYING in the tar file.
1395         rm                          proto-toplev/bfd/COPYING
1396         ln proto-toplev/gdb/COPYING proto-toplev/bfd/COPYING
1397         rm                          proto-toplev/include/COPYING
1398         ln proto-toplev/gdb/COPYING proto-toplev/include/COPYING
1399         rm                          proto-toplev/readline/COPYING
1400         ln proto-toplev/gdb/COPYING proto-toplev/readline/COPYING
1401         # Take out texinfo from configurable dirs
1402         rm proto-toplev/configure.in
1403         sed '/^configdirs=/s/texinfo //' <configure.in >proto-toplev/configure.in
1404         # Take out glob from buildable dirs
1405         rm proto-toplev/Makefile.in
1406
1407         sed -e '/^SUBDIRS =/s/glob //' \
1408             -e '/^all\.normal: /s/\all-texinfo //' \
1409             -e '/^clean: /s/clean-texinfo //' \
1410             -e '/^install\.all: /s/install-texinfo //' \
1411         <Makefile.in >proto-toplev/Makefile.in
1412
1413         mkdir proto-toplev/texinfo
1414         mkdir proto-toplev/texinfo/fsf
1415         ln -s ../../../texinfo/fsf/texinfo.tex proto-toplev/texinfo/fsf/
1416         chmod og=u `find proto-toplev -print`
1417         (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
1418                 echo "==> Making gdb-$$VER.tar.Z"; \
1419                 ln -s proto-toplev gdb-$$VER; \
1420                 tar cfh - gdb-$$VER \
1421                 | compress -v >gdb-$$VER.tar.Z)
1422
1423
1424 # end of Makefile.in