More cleanup in gdb packaging...
[external/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 datadir = $(prefix)/lib
30 mandir = $(prefix)/man
31 man1dir = $(mandir)/man1
32 man2dir = $(mandir)/man2
33 man3dir = $(mandir)/man3
34 man4dir = $(mandir)/man4
35 man5dir = $(mandir)/man5
36 man6dir = $(mandir)/man6
37 man7dir = $(mandir)/man7
38 man8dir = $(mandir)/man8
39 man9dir = $(mandir)/man9
40 infodir = $(prefix)/info
41 includedir = $(prefix)/include
42 docdir = $(datadir)/doc
43
44 SHELL = /bin/sh
45
46 INSTALL = install -c
47 INSTALL_PROGRAM = $(INSTALL)
48 INSTALL_DATA = $(INSTALL)
49
50 AR = ar
51 AR_FLAGS = qc
52 CFLAGS = -g
53 RANLIB = ranlib
54
55 BISON = `if [ -d $${rootme}/byacc ] ; \
56         then echo $${rootme}/byacc/byacc ; \
57         else echo byacc ; fi`
58
59 LEX = `if [ -d $${rootme}/flex ] ; \
60         then echo $${rootme}/flex/flex -S$${rootme}/flex/flex.skel ; \
61         else echo flex ; fi`
62
63 MAKEINFO = `if [ -d $${rootme}/texinfo/C ] ; \
64         then echo $${rootme}/texinfo/C/makeinfo ; \
65         else echo makeinfo ; fi`
66
67 SUBDIRS = libiberty mmalloc glob readline bfd gdb binutils ld gas gcc libg++ libgcc clib newlib
68 OTHERS = 
69
70 ALL = all.normal
71 INSTALL_TARGET = install.all
72
73 ### for debugging
74 #GCCVERBOSE=-v
75
76 GXX = `if [ -d $${rootme}/gcc ] ; \
77         then echo $${rootme}/gcc/gcc -B$${rootme}/gcc/ ; \
78         else echo gcc ; fi`
79
80 XTRAFLAGS = `if [ -d $${rootme}/gcc ] ; \
81         then echo -I$${rootme}/gcc/include ; \
82         else echo ; fi`
83
84 #### host and target specific makefile fragments come in here.
85 ###
86
87 FLAGS_TO_PASS = \
88         "prefix=$(prefix)" \
89         "exec_prefix=$(exec_prefix)" \
90         "tooldir=$(tooldir)" \
91         "AR=$(AR)" \
92         "AR_FLAGS=$(AR_FLAGS)" \
93         "CC=$(CC)" \
94         "CFLAGS=$(CFLAGS)" \
95         "RANLIB=$(RANLIB)" \
96         "LOADLIBES=$(LOADLIBES)" \
97         "LDFLAGS=$(LDFLAGS)" \
98         "BISON=$(BISON)" \
99         "LEX=$(LEX)" \
100         "MAKEINFO=$(MAKEINFO)" \
101         "INSTALL=$(INSTALL)" \
102         "INSTALL_DATA=$(INSTALL_DATA)" \
103         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)"
104
105 .PHONY: all info install-info clean-info
106 .NOEXPORT:
107
108 all:    $(ALL)
109
110 info:   cfg-paper.info configure.info standards.info
111         @rootme=`pwd` ; export rootme ; $(MAKE) subdir_do DO=info "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
112
113 # Note libg++ has to be handled specially (we can't compile it with CC=cc).
114 check:
115         @rootme=`pwd` ; export rootme ; $(MAKE) subdir_do DO=check \
116           "DODIRS=`echo $(SUBDIRS) | sed -e \"s/libg\+\+//\"" $(FLAGS_TO_PASS)
117         @rootme=`pwd` ; export rootme ; $(MAKE) subdir_do DO=check \
118           "DODIRS=libg++" $(FLAGS_TO_PASS) "CC=${GXX}" "XTRAFLAGS=${XTRAFLAGS}"
119
120 clean-info:
121         @$(MAKE) subdir_do DO=clean-info "DODIRS=$(SUBDIRS)"
122         rm -f *.info*
123
124 cfg-paper.info: cfg-paper.texi
125         rootme=`pwd` ; export rootme ; $(MAKEINFO) -o cfg-paper.info $(srcdir)/cfg-paper.texi
126
127 configure.info: configure.texi
128         rootme=`pwd` ; export rootme ; $(MAKEINFO) -o configure.info $(srcdir)/configure.texi
129
130 standards.info: standards.texi
131         rootme=`pwd` ; export rootme ; $(MAKEINFO) -o standards.info $(srcdir)/standards.texi
132
133 install-info: install-info-dirs force
134         [ -d $(infodir) ] || mkdir $(infodir)
135         @$(MAKE) subdir_do DO=install-info "DODIRS=$(SUBDIRS)"
136         $(INSTALL_DATA) cfg-paper.info $(infodir)/cfg-paper.info
137         $(INSTALL_DATA) configure.info $(infodir)/configure.info
138         $(INSTALL_DATA) standards.info $(infodir)/standards.info
139         @$(MAKE) dir.info install-dir.info
140
141 install-dir.info:
142         $(INSTALL_DATA) dir.info $(infodir)/dir.info
143
144 all.normal: all-autoconf all-libiberty all-mmalloc all-texinfo \
145         all-bison all-byacc all-flex all-bfd all-ld all-gas all-gcc \
146         all-binutils all-libg++ all-readline all-gdb \
147         all-make all-rcs all-cvs all-diff all-grep \
148         all-patch all-emacs all-ispell \
149         all-newlib all-gprof all-send_pr
150
151 all.cross: all-libiberty all-mmalloc all-gas all-byacc all-ld \
152         all-bfd all-libgcc all-readline all-gdb
153 #       $(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS) $(OTHERS)"
154
155 clean: clean-autoconf clean-libiberty clean-mmalloc clean-texinfo \
156         clean-bfd clean-newlib clean-binutils clean-flex \
157         clean-bison clean-byacc clean-ld clean-gas \
158         clean-gcc clean-libgcc clean-readline clean-glob clean-gdb \
159         clean-make clean-diff clean-grep clean-rcs \
160         clean-cvs clean-patch clean-emacs clean-ispell \
161         clean-libg++ clean-gprof clean-send_pr
162         -rm -rf *.a TEMP errs core *.o *~ \#* TAGS *.E
163
164 clean-stamps:
165         -rm -f all-*
166
167 install: $(INSTALL_TARGET) $(srcdir)/configure.man
168         $(INSTALL_DATA) $(srcdir)/configure.man $(man1dir)/configure.1
169
170
171 install.all: install-dirs install-autoconf install-texinfo \
172         install-mmalloc install-libiberty install-bfd install-binutils \
173         install-bison install-byacc install-flex install-ld \
174         install-gas install-gcc install-gprof install-libgcc \
175         install-readline install-glob install-gdb install-make \
176         install-cvs install-patch install-emacs install-ispell \
177         install-libg++ install-newlib \
178         install-send_pr
179
180 install.cross: install-dirs install-libiberty install-mmalloc \
181         install-binutils install-bison install-byacc install-flex \
182         install-ld install-gas install-libgcc install-readline \
183         install-glob install-gdb install-mmalloc install-gprof
184
185 ### autoconf
186 all-autoconf: force
187         @if [ -d ./autoconf ] ; then \
188                 rootme=`pwd` ; export rootme ; \
189                 (cd ./autoconf; \
190                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
191         else \
192                 true ; \
193         fi
194
195 clean-autoconf: force
196         @if [ -d ./autoconf ] ; then \
197                 rootme=`pwd` ; export rootme ; \
198                 (cd ./autoconf; \
199                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
200         else \
201                 true ; \
202         fi
203
204 install-autoconf: force
205         @if [ -d ./autoconf ] ; then \
206                 rootme=`pwd` ; export rootme ; \
207                 (cd ./autoconf; \
208                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
209         else \
210                 true ; \
211         fi
212
213 ### libiberty
214 all-libiberty: force
215         @if [ -d ./libiberty ] ; then \
216                 rootme=`pwd` ; export rootme ; \
217                 (cd ./libiberty; \
218                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
219         else \
220                 true ; \
221         fi
222
223 clean-libiberty: force
224         @if [ -d ./libiberty ] ; then \
225                 rootme=`pwd` ; export rootme ; \
226                 (cd ./libiberty; \
227                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
228         else \
229                 true ; \
230         fi
231
232 install-libiberty: force
233         @if [ -d ./libiberty ] ; then \
234                 rootme=`pwd` ; export rootme ; \
235                 (cd ./libiberty; \
236                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
237         else \
238                 true ; \
239         fi
240
241 ### mmalloc
242 all-mmalloc: force
243         @if [ -d ./mmalloc ] ; then \
244                 rootme=`pwd` ; export rootme ; \
245                 (cd ./mmalloc; \
246                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
247         else \
248                 true ; \
249         fi
250
251 clean-mmalloc: force
252         @if [ -d ./mmalloc ] ; then \
253                 rootme=`pwd` ; export rootme ; \
254                 (cd ./mmalloc; \
255                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
256         else \
257                 true ; \
258         fi
259
260 install-mmalloc: force
261         @if [ -d ./mmalloc ] ; then \
262                 rootme=`pwd` ; export rootme ; \
263                 (cd ./mmalloc; \
264                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
265         else \
266                 true ; \
267         fi
268
269 ### texinfo
270 all-texinfo: all-libiberty
271         @if [ -d ./texinfo ] ; then \
272                 rootme=`pwd` ; export rootme ; \
273                 rootme=`pwd` ; export rootme ; \
274                 (cd ./texinfo; \
275                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
276         else \
277                 true ; \
278         fi
279
280 clean-texinfo: force
281         @if [ -d ./texinfo ] ; then \
282                 rootme=`pwd` ; export rootme ; \
283                 (cd ./texinfo; \
284                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
285         else \
286                 true ; \
287         fi
288
289 install-texinfo: force
290         @if [ -d ./texinfo ] ; then \
291                 rootme=`pwd` ; export rootme ; \
292                 (cd ./texinfo; \
293                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
294         else \
295                 true ; \
296         fi
297
298 ### bfd
299 all-bfd: force
300         @if [ -d ./bfd ] ; then \
301                 rootme=`pwd` ; export rootme ; \
302                 (cd ./bfd; \
303                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
304         else \
305                 true ; \
306         fi
307
308 clean-bfd: force
309         @if [ -d ./bfd ] ; then \
310                 rootme=`pwd` ; export rootme ; \
311                 (cd ./bfd; \
312                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
313         else \
314                 true ; \
315         fi
316
317 install-bfd: force
318         @if [ -d ./bfd ] ; then \
319                 rootme=`pwd` ; export rootme ; \
320                 (cd ./bfd; \
321                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
322         else \
323                 true ; \
324         fi
325
326 ### binutils
327 all-binutils: all-libiberty all-bfd all-flex
328         @if [ -d ./binutils ] ; then \
329                 rootme=`pwd` ; export rootme ; \
330                 (cd ./binutils; \
331                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
332         else \
333                 true ; \
334         fi
335
336 clean-binutils: force
337         @if [ -d ./binutils ] ; then \
338                 rootme=`pwd` ; export rootme ; \
339                 (cd ./binutils; \
340                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
341         else \
342                 true ; \
343         fi
344
345 install-binutils: force
346         @if [ -d ./binutils ] ; then \
347                 rootme=`pwd` ; export rootme ; \
348                 (cd ./binutils; \
349                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
350         else \
351                 true ; \
352         fi
353
354 ### newlib
355 all-newlib: force
356         @if [ -d ./newlib ] ; then \
357                 rootme=`pwd` ; export rootme ; \
358                 (cd ./newlib; \
359                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
360         else \
361                 true ; \
362         fi
363
364 clean-newlib: force
365         @if [ -d ./newlib ] ; then \
366                 rootme=`pwd` ; export rootme ; \
367                 (cd ./newlib; \
368                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
369         else \
370                 true ; \
371         fi
372
373 install-newlib: force
374         @if [ -d ./newlib ] ; then \
375                 rootme=`pwd` ; export rootme ; \
376                 (cd ./newlib; \
377                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
378         else \
379                 true ; \
380         fi
381
382 ### gprof
383 all-gprof: all-libiberty all-bfd
384         @if [ -d ./gprof ] ; then \
385                 rootme=`pwd` ; export rootme ; \
386                 (cd ./gprof; \
387                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
388         else \
389                 true ; \
390         fi
391
392 clean-gprof: force
393         @if [ -d ./gprof ] ; then \
394                 rootme=`pwd` ; export rootme ; \
395                 (cd ./gprof; \
396                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
397         else \
398                 true ; \
399         fi
400
401 install-gprof: force
402         @if [ -d ./gprof ] ; then \
403                 rootme=`pwd` ; export rootme ; \
404                 (cd ./gprof; \
405                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
406         else \
407                 true ; \
408         fi
409
410 ### byacc
411 all-byacc: force
412         @if [ -d ./byacc ] ; then \
413                 rootme=`pwd` ; export rootme ; \
414                 (cd ./byacc; \
415                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
416         else \
417                 true ; \
418         fi
419
420 clean-byacc: force
421         @if [ -d ./byacc ] ; then \
422                 rootme=`pwd` ; export rootme ; \
423                 (cd ./byacc; \
424                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
425         else \
426                 true ; \
427         fi
428
429 install-byacc: force
430         @if [ -d ./byacc ] ; then \
431                 rootme=`pwd` ; export rootme ; \
432                 (cd ./byacc; \
433                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
434         else \
435                 true ; \
436         fi
437
438 ### bison
439 all-bison: all-libiberty
440         @if [ -d ./bison ] ; then \
441                 rootme=`pwd` ; export rootme ; \
442                 (cd ./bison; \
443                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
444         else \
445                 true ; \
446         fi
447
448 clean-bison: force
449         @if [ -d ./bison ] ; then \
450                 rootme=`pwd` ; export rootme ; \
451                 (cd ./bison; \
452                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
453         else \
454                 true ; \
455         fi
456
457 install-bison: force
458         @if [ -d ./bison ] ; then \
459                 rootme=`pwd` ; export rootme ; \
460                 (cd ./bison; \
461                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
462         else \
463                 true ; \
464         fi
465
466 ### flex
467 all-flex: all-libiberty
468         @if [ -d ./flex ] ; then \
469                 rootme=`pwd` ; export rootme ; \
470                 (cd ./flex; \
471                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
472         else \
473                 true ; \
474         fi
475
476 clean-flex: force
477         @if [ -d ./flex ] ; then \
478                 rootme=`pwd` ; export rootme ; \
479                 (cd ./flex; \
480                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
481         else \
482                 true ; \
483         fi
484
485 install-flex: force
486         @if [ -d ./flex ] ; then \
487                 rootme=`pwd` ; export rootme ; \
488                 (cd ./flex; \
489                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
490         else \
491                 true ; \
492         fi
493 ### gcc
494 all-gcc: all-libiberty all-byacc
495         @if [ -d ./gcc ] ; then \
496                 rootme=`pwd` ; export rootme ; \
497                 (cd ./gcc; \
498                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
499         else \
500                 true ; \
501         fi
502
503 clean-gcc: force
504         @if [ -d ./gcc ] ; then \
505                 rootme=`pwd` ; export rootme ; \
506                 (cd ./gcc; \
507                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
508         else \
509                 true ; \
510         fi
511
512 install-gcc: force
513         @if [ -d ./gcc ] ; then \
514                 rootme=`pwd` ; export rootme ; \
515                 (cd ./gcc; \
516                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
517         else \
518                 true ; \
519         fi
520
521 ### readline
522 all-readline: force
523         @if [ -d ./readline ] ; then \
524                 rootme=`pwd` ; export rootme ; \
525                 (cd ./readline; \
526                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
527         else \
528                 true ; \
529         fi
530
531 clean-readline: force
532         @if [ -d ./readline ] ; then \
533                 rootme=`pwd` ; export rootme ; \
534                 (cd ./readline; \
535                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
536         else \
537                 true ; \
538         fi
539
540 install-readline: force
541         @if [ -d ./readline ] ; then \
542                 rootme=`pwd` ; export rootme ; \
543                 (cd ./readline; \
544                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
545         else \
546                 true ; \
547         fi
548
549 ### glob
550 all-glob: force
551         @if [ -d ./glob ] ; then \
552                 rootme=`pwd` ; export rootme ; \
553                 (cd ./glob; \
554                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
555         else \
556                 true ; \
557         fi
558
559 clean-glob: force
560         @if [ -d ./glob ] ; then \
561                 rootme=`pwd` ; export rootme ; \
562                 (cd ./glob; \
563                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
564         else \
565                 true ; \
566         fi
567
568 install-glob: force
569         @if [ -d ./glob ] ; then \
570                 rootme=`pwd` ; export rootme ; \
571                 (cd ./glob; \
572                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
573         else \
574                 true ; \
575         fi
576
577 ### gas
578 all-gas: all-libiberty all-bfd
579         @if [ -d ./gas ] ; then \
580                 rootme=`pwd` ; export rootme ; \
581                 (cd ./gas; \
582                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
583         else \
584                 true ; \
585         fi
586
587 clean-gas: force
588         @if [ -d ./gas ] ; then \
589                 rootme=`pwd` ; export rootme ; \
590                 (cd ./gas; \
591                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
592         else \
593                 true ; \
594         fi
595
596 install-gas: force
597         @if [ -d ./gas ] ; then \
598                 rootme=`pwd` ; export rootme ; \
599                 (cd ./gas; \
600                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
601         else \
602                 true ; \
603         fi
604
605 ### ld
606 all-ld: all-libiberty all-bfd all-byacc all-flex
607         @if [ -d ./ld ] ; then \
608                 rootme=`pwd` ; export rootme ; \
609                 (cd ./ld; \
610                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
611         else \
612                 true ; \
613         fi
614
615 clean-ld: force
616         @if [ -d ./ld ] ; then \
617                 rootme=`pwd` ; export rootme ; \
618                 (cd ./ld; \
619                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
620         else \
621                 true ; \
622         fi
623
624 install-ld: force
625         @if [ -d ./ld ] ; then \
626                 rootme=`pwd` ; export rootme ; \
627                 (cd ./ld; \
628                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
629         else \
630                 true ; \
631         fi
632
633 ### libgcc (and libgcc1)
634 all-libgcc1: all-gas all-binutils
635         @if [ -d ./libgcc ] ; then \
636                 rootme=`pwd` ; export rootme ; \
637                 (cd ./libgcc; \
638                 $(MAKE) $(FLAGS_TO_PASS) libgcc1.a) ; \
639         else \
640                 true ; \
641         fi
642
643 clean-libgcc1: force
644         @if [ -d ./libgcc ] ; then \
645                 rootme=`pwd` ; export rootme ; \
646                 (cd ./libgcc; \
647                 $(MAKE) $(FLAGS_TO_PASS) clean-libgcc1) ; \
648         else \
649                 true ; \
650         fi
651
652 install-libgcc1: force
653         echo libgcc1 is a component, not an installable target
654
655 all-libgcc: all-gas all-gcc all-binutils
656         true
657         @if [ -d ./libgcc ] ; then \
658                 rootme=`pwd` ; export rootme ; \
659                 (cd ./libgcc; \
660                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
661         else \
662                 true ; \
663         fi
664
665 clean-libgcc: force
666         @if [ -d ./libgcc ] ; then \
667                 rootme=`pwd` ; export rootme ; \
668                 (cd ./libgcc; \
669                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
670         else \
671                 true ; \
672         fi
673
674 install-libgcc: force
675         @if [ -d ./libgcc ] ; then \
676                 rootme=`pwd` ; export rootme ; \
677                 (cd ./libgcc; \
678                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
679         else \
680                 true ; \
681         fi
682
683 ### gdb
684 all-gdb: all-bfd all-libiberty all-mmalloc all-readline all-glob all-byacc
685         @if [ -d ./gdb ] ; then \
686                 rootme=`pwd` ; export rootme ; \
687                 (cd ./gdb; \
688                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
689         else \
690                 true ; \
691         fi
692
693 clean-gdb: force
694         @if [ -d ./gdb ] ; then \
695                 rootme=`pwd` ; export rootme ; \
696                 (cd ./gdb; \
697                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
698         else \
699                 true ; \
700         fi
701
702 install-gdb: force
703         @if [ -d ./gdb ] ; then \
704                 rootme=`pwd` ; export rootme ; \
705                 (cd ./gdb; \
706                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
707         else \
708                 true ; \
709         fi
710
711 ### make
712 all-make: all-libiberty
713         @if [ -d ./make ] ; then \
714                 rootme=`pwd` ; export rootme ; \
715                 (cd ./make; \
716                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
717         else \
718                 true ; \
719         fi
720
721 clean-make: force
722         @if [ -d ./make ] ; then \
723                 rootme=`pwd` ; export rootme ; \
724                 (cd ./make; \
725                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
726         else \
727                 true ; \
728         fi
729
730 install-make: force
731         @if [ -d ./make ] ; then \
732                 rootme=`pwd` ; export rootme ; \
733                 (cd ./make; \
734                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
735         else \
736                 true ; \
737         fi
738
739 ### diff
740 all-diff: force
741         @if [ -d ./diff ] ; then \
742                 rootme=`pwd` ; export rootme ; \
743                 (cd ./diff; \
744                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
745         else \
746                 true ; \
747         fi
748
749 clean-diff: force
750         @if [ -d ./diff ] ; then \
751                 rootme=`pwd` ; export rootme ; \
752                 (cd ./diff; \
753                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
754         else \
755                 true ; \
756         fi
757
758 install-diff: force
759         @if [ -d ./diff ] ; then \
760                 rootme=`pwd` ; export rootme ; \
761                 (cd ./diff/; \
762                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
763         else \
764                 true ; \
765         fi
766
767 ### grep
768 all-grep: force
769         @if [ -d ./grep ] ; then \
770                 rootme=`pwd` ; export rootme ; \
771                 (cd ./grep; \
772                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
773         else \
774                 true ; \
775         fi
776
777 clean-grep: force
778         @if [ -d ./grep ] ; then \
779                 rootme=`pwd` ; export rootme ; \
780                 (cd ./grep; \
781                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
782         else \
783                 true ; \
784         fi
785
786 install-grep: force
787         @if [ -d ./grep ] ; then \
788                 rootme=`pwd` ; export rootme ; \
789                 (cd ./grep; \
790                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
791         else \
792                 true ; \
793         fi
794
795 ### rcs
796 all-rcs: force
797         @if [ -d ./rcs ] ; then \
798                 rootme=`pwd` ; export rootme ; \
799                 (cd ./rcs; \
800                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
801         else \
802                 true ; \
803         fi
804
805 clean-rcs: force
806         @if [ -d ./rcs ] ; then \
807                 rootme=`pwd` ; export rootme ; \
808                 (cd ./rcs; \
809                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
810         else \
811                 true ; \
812         fi
813
814 install-rcs: force
815         @if [ -d ./rcs ] ; then \
816                 rootme=`pwd` ; export rootme ; \
817                 (cd ./rcs; \
818                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
819         else \
820                 true ; \
821         fi
822
823 ### cvs
824 all-cvs: force
825         @if [ -d ./cvs ] ; then \
826                 rootme=`pwd` ; export rootme ; \
827                 (cd ./cvs; \
828                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
829         else \
830                 true ; \
831         fi
832
833 clean-cvs: force
834         @if [ -d ./cvs ] ; then \
835                 rootme=`pwd` ; export rootme ; \
836                 (cd ./cvs; \
837                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
838         else \
839                 true ; \
840         fi
841
842 install-cvs: force
843         @if [ -d ./cvs ] ; then \
844                 rootme=`pwd` ; export rootme ; \
845                 (cd ./cvs; \
846                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
847         else \
848                 true ; \
849         fi
850
851 ### patch
852 all-patch: force
853         @if [ -d ./patch ] ; then \
854                 rootme=`pwd` ; export rootme ; \
855                 (cd ./patch; \
856                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
857         else \
858                 true ; \
859         fi
860
861 clean-patch: force
862         @if [ -d ./patch ] ; then \
863                 rootme=`pwd` ; export rootme ; \
864                 (cd ./patch; \
865                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
866         else \
867                 true ; \
868         fi
869
870 install-patch: force
871         @if [ -d ./patch ] ; then \
872                 rootme=`pwd` ; export rootme ; \
873                 (cd ./patch; \
874                 $(MAKE) $(FLAGS_TO_PASS) \
875                         bindir=$(bindir) \
876                         man1dir=$(man1dir) install) ; \
877         else \
878                 true ; \
879         fi
880
881 ### emacs
882 all-emacs: force
883         @if [ -d ./emacs ] ; then \
884                 rootme=`pwd` ; export rootme ; \
885                 (cd ./emacs; \
886                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
887         else \
888                 true ; \
889         fi
890
891 clean-emacs: force
892         @if [ -d ./emacs ] ; then \
893                 rootme=`pwd` ; export rootme ; \
894                 (cd ./emacs; \
895                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
896         else \
897                 true ; \
898         fi
899
900 install-emacs: force
901         @if [ -d ./emacs ] ; then \
902                 rootme=`pwd` ; export rootme ; \
903                 (cd ./emacs; \
904                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
905         else \
906                 true ; \
907         fi
908
909 ### ispell
910 all-ispell: all-emacs
911         @if [ -d ./ispell ] ; then \
912                 rootme=`pwd` ; export rootme ; \
913                 (cd ./ispell; \
914                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
915         else \
916                 true ; \
917         fi
918
919 clean-ispell: force
920         @if [ -d ./ispell ] ; then \
921                 rootme=`pwd` ; export rootme ; \
922                 (cd ./ispell; \
923                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
924         else \
925                 true ; \
926         fi
927
928 install-ispell: force
929         @if [ -d ./ispell ] ; 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 [ -d ./send_pr ] ; then \
940                 rootme=`pwd` ; export rootme ; \
941                 (cd ./send_pr; \
942                 $(MAKE) $(FLAGS_TO_PASS) all) ; \
943         else \
944                 true ; \
945         fi
946
947 clean-send_pr: force
948         @if [ -d ./send_pr ] ; then \
949                 rootme=`pwd` ; export rootme ; \
950                 (cd ./send_pr; \
951                 $(MAKE) $(FLAGS_TO_PASS) clean) ; \
952         else \
953                 true ; \
954         fi
955
956 install-send_pr: force
957         @if [ -d ./send_pr ] ; then \
958                 rootme=`pwd` ; export rootme ; \
959                 (cd ./send_pr; \
960                 $(MAKE) $(FLAGS_TO_PASS) install) ; \
961         else \
962                 true ; \
963         fi
964
965 ### libg++
966
967 all-libg++: all-gas all-ld all-gcc
968         @if [ -d ./libg++ ] ; then \
969                 rootme=`pwd` ; export rootme ; \
970                 (cd ./libg++; \
971                 $(MAKE) $(FLAGS_TO_PASS) "CC=${GXX}" all) ; \
972         else \
973                 true ; \
974         fi
975
976 clean-libg++: force
977         @if [ -d ./libg++ ] ; then \
978                 rootme=`pwd` ; export rootme ; \
979                 (cd ./libg++; \
980                 $(MAKE) $(FLAGS_TO_PASS) "CC=${GXX}" clean) ; \
981         else \
982                 true ; \
983         fi
984
985 install-libg++: force
986         @if [ -d ./libg++ ] ; then \
987                 rootme=`pwd` ; export rootme ; \
988                 (cd ./libg++; \
989                 $(MAKE) $(FLAGS_TO_PASS) "CC=${GXX}" install) ; \
990         else \
991                 true ; \
992         fi
993
994 ### other supporting targets
995 # this is a bad hack.
996 all.xclib:      all.normal
997         if [ -d clib ] ; then \
998                 (cd clib ; $(MAKE) $(FLAGS_TO_PASS)) ; \
999         fi
1000
1001 subdir_do:
1002         @for i in $(DODIRS); do \
1003                 if [ -f ./$$i/localenv ] ; then \
1004                         if (rootme=`pwd` ; export rootme ; cd ./$$i; \
1005                                 $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \
1006                                 else exit 1 ; fi ; \
1007                 else if [ -d ./$$i ] ; then \
1008                         if (rootme=`pwd` ; export rootme ; cd ./$$i; \
1009                                 $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \
1010                         else exit 1 ; fi ; \
1011                 else true ; fi ; \
1012         fi ; \
1013         done
1014
1015 # The "else true" stuff is for Ultrix; the shell returns the exit code
1016 # of the "if" command, if no commands are run in the "then" or "else" part,
1017 # causing Make to quit.
1018
1019 MAKEDIRS= \
1020         $(prefix) \
1021         $(exec_prefix) \
1022         $(bindir) \
1023         $(libdir) \
1024         $(tooldir) \
1025         $(includedir) \
1026         $(datadir) \
1027         $(docdir) \
1028         $(mandir) \
1029         $(man1dir) \
1030         $(man5dir)
1031
1032 #       $(man2dir) \
1033 #       $(man3dir) \
1034 #       $(man4dir) \
1035 #       $(man6dir) \
1036 #       $(man7dir) \
1037 #       $(man8dir)
1038
1039 install-dirs:
1040         for i in $(MAKEDIRS) ; do \
1041                 echo Making $$i... ; \
1042                 [ -d $$i ] || mkdir $$i || exit 1 ; \
1043         done
1044
1045 MAKEINFODIRS= \
1046         $(prefix) \
1047         $(infodir)
1048
1049 install-info-dirs:
1050         if [ -d $(prefix) ] ; then true ; else mkdir $(prefix) ; fi
1051         if [ -d $(datadir) ] ; then true ; else mkdir $(datadir) ; fi
1052         if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi
1053
1054 dir.info:
1055         $(srcdir)/texinfo/gen-info-dir $(infodir) > dir.info.new
1056         mv -f dir.info.new dir.info
1057
1058 etags tags: TAGS
1059
1060 TAGS:
1061         etags `$(MAKE) ls`
1062
1063 ls:
1064         @echo Makefile
1065         @for i in $(SUBDIRS); \
1066         do \
1067                 (cd $$i; \
1068                         pwd=`pwd`; \
1069                         wd=`basename $$pwd`; \
1070                         for j in `$(MAKE) ls`; \
1071                         do \
1072                                 echo $$wd/$$j; \
1073                         done) \
1074         done
1075
1076 force:
1077
1078 # with the gnu make, this is done automatically.
1079
1080 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
1081         $(SHELL) ./config.status
1082
1083 #
1084 # Build GDB distributions that contain BFD, Include, Libiberty, Readline, etc
1085
1086 DEVO_SUPPORT= README cfg-paper.texi Makefile.in configure configure.in \
1087         config.sub config configure.man
1088 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc readline glob
1089 GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS) texinfo/fsf/texinfo.tex
1090
1091 setup-dirs: force_update
1092         ./configure sun4
1093         make clean
1094         ./configure -rm sun4
1095         chmod og=u `find $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
1096
1097 bfd.ilrt.tar.Z: setup-dirs
1098         rm -f bfd.ilrt.tar.Z
1099         tar cf - $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) \
1100                 | compress -v >bfd.ilrt.tar.Z
1101
1102 gdb.tar.Z: setup-dirs
1103         (cd gdb; $(MAKE) -f Makefile.in make-proto-gdb.dir)
1104         $(MAKE) $(MFLAGS) -f Makefile.in make-gdb.tar.Z
1105
1106 make-gdb.tar.Z: $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS) gdb texinfo/fsf/texinfo.tex
1107         rm -rf proto-toplev; mkdir proto-toplev
1108         ln -s ../gdb/proto-gdb.dir proto-toplev/gdb
1109         (cd proto-toplev; for i in $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS); do \
1110                 ln -s ../$$i . ; \
1111         done)
1112         # Put only one copy (four hard links) of COPYING in the tar file.
1113         rm                          proto-toplev/bfd/COPYING
1114         ln proto-toplev/gdb/COPYING proto-toplev/bfd/COPYING
1115         rm                          proto-toplev/include/COPYING
1116         ln proto-toplev/gdb/COPYING proto-toplev/include/COPYING
1117         rm                          proto-toplev/readline/COPYING
1118         ln proto-toplev/gdb/COPYING proto-toplev/readline/COPYING
1119         # Take out texinfo from configurable dirs
1120         rm proto-toplev/configure.in
1121         sed '/^configdirs=/s/texinfo //' <configure.in >proto-toplev/configure.in
1122         # Take out glob from buildable dirs
1123         rm proto-toplev/Makefile.in
1124
1125         sed -e '/^SUBDIRS =/s/glob //' \
1126             -e '/^all\.normal: /s/\all-texinfo //' \
1127             -e '/^clean: /s/clean-texinfo //' \
1128             -e '/^install\.all: /s/install-texinfo //' \
1129         <Makefile.in >proto-toplev/Makefile.in
1130
1131         mkdir proto-toplev/texinfo
1132         mkdir proto-toplev/texinfo/fsf
1133         ln -s ../../../texinfo/fsf/texinfo.tex proto-toplev/texinfo/fsf/
1134         chmod og=u `find proto-toplev -print`
1135         (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
1136                 echo "==> Making gdb-$$VER.tar.Z"; \
1137                 ln -s proto-toplev gdb-$$VER; \
1138                 tar cfh - gdb-$$VER \
1139                 | compress -v >gdb-$$VER.tar.Z)
1140
1141 force_update:
1142
1143 nothing:
1144
1145 # end of Makefile.in