* Makefile.in (all-send-pr): depends on all-prms
[platform/upstream/binutils.git] / Makefile.in
1 #
2 # Makefile for directory with subdirs to build.
3 #   Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation
4 #
5 # This file is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 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 = $(exec_prefix)/$(target)
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 = $${srcroot}/install.sh -c
49 INSTALL_PROGRAM = $(INSTALL)
50 INSTALL_DATA = $(INSTALL)
51 INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
52
53 AS = as
54 AR = ar
55 AR_FLAGS = rc
56 CC = cc
57 CFLAGS = -g
58 # start-sanitize-chill
59 CHILLFLAGS = $(CFLAGS)
60 CHILL_LIB = -lchill
61 # end-sanitize-chill
62 CXX = gcc
63 CXXFLAGS = -g -O
64 RANLIB = ranlib
65 NM = nm
66 MUNCH_NM = $(NM)
67 GZIP = gzip
68
69 # BISON: This line sed'ed to BISON = bison -y for FSF releases, don't remove.
70 BISON = `if [ -f $${rootme}/byacc/byacc ] ; \
71             then echo $${rootme}/byacc/byacc ; \
72             else echo byacc ; \
73         fi`
74
75 LEX = `if [ -f $${rootme}/flex/flex ] ; \
76         then echo $${rootme}/flex/flex ; \
77         else echo flex ; fi`
78
79 MAKEINFO = `if [ -f $${rootme}/texinfo/makeinfo/makeinfo ] ; \
80         then echo $${rootme}/texinfo/makeinfo/makeinfo ; \
81         else echo makeinfo ; fi`
82 # This just becomes part of the MAKEINFO definition passed down to
83 # sub-makes.  It lets flags be given on the command line while still
84 # using the makeinfo from the object tree.
85 MAKEINFOFLAGS =
86
87 EXPECT = `if [ -f $${rootme}/expect/expect ] ; \
88         then echo $${rootme}/expect/expect ; \
89         else echo expect ; fi`
90
91 RUNTEST = `if [ -f $${srcroot}/dejagnu/runtest ] ; \
92         then echo $${srcroot}/dejagnu/runtest ; \
93         else echo runtest ; fi`
94
95
96 # libraries that may need to be augmented on a system-by-system basis
97 X11_LIB = -lX11
98
99 # compilers to use to create programs which must be run in the build
100 # environment.
101 CC_FOR_BUILD = $(CC)
102 CXX_FOR_BUILD = $(CXX)
103
104 SUBDIRS = "this is set via configure, don't edit this"
105 OTHERS = 
106
107 ALL = all.normal
108 INSTALL_TARGET = install-dirs \
109         $(INSTALL_MODULES) \
110         $(INSTALL_TARGET_MODULES) \
111         $(INSTALL_X11_MODULES) \
112         install-gcc
113
114 CC_FOR_TARGET = ` \
115   if [ -f $${rootme}/gcc/Makefile ] ; then \
116     echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/; \
117   else \
118     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
119       echo $(CC); \
120     else \
121       t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
122     fi; \
123   fi`
124
125 # start-sanitize-chill
126 CHILL_FOR_TARGET = ` \
127   if [ -f $${rootme}/gcc/Makefile ] ; then \
128     echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/ -L$${rootme}/chillrt/; \
129   else \
130     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
131       echo $(CC); \
132     else \
133       t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
134     fi; \
135   fi`
136
137 # end-sanitize-chill
138
139 CXX_FOR_TARGET = ` \
140   if [ -f $${rootme}/gcc/Makefile ] ; then \
141     echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/; \
142   else \
143     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
144       echo $(CXX); \
145     else \
146       t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
147     fi; \
148   fi`
149
150 AS_FOR_TARGET = ` \
151   if [ -f $${rootme}/gas/Makefile ] ; then \
152     echo $${rootme}/gas/as.new ; \
153   else \
154     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
155       echo $(AS); \
156     else \
157        t='$(program_transform_name)'; echo as | sed -e '' $$t ; \
158     fi; \
159   fi`
160
161 AR_FOR_TARGET = ` \
162   if [ -f $${rootme}/binutils/Makefile ] ; then \
163     echo $${rootme}/binutils/ar ; \
164   else \
165     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
166       echo $(AR); \
167     else \
168        t='$(program_transform_name)'; echo ar | sed -e '' $$t ; \
169     fi; \
170   fi`
171
172 RANLIB_FOR_TARGET = ` \
173   if [ -f $${rootme}/binutils/Makefile ] ; then \
174     echo $${rootme}/binutils/ranlib ; \
175   else \
176     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
177       echo $(RANLIB); \
178     else \
179        t='$(program_transform_name)'; echo ranlib | sed -e '' $$t ; \
180     fi; \
181   fi`
182
183 NM_FOR_TARGET = ` \
184   if [ -f $${rootme}/binutils/Makefile ] ; then \
185     echo $${rootme}/binutils/nm ; \
186   else \
187     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
188       echo $(NM); \
189     else \
190        t='$(program_transform_name)'; echo nm | sed -e '' $$t ; \
191     fi; \
192   fi`
193
194 # FIXME: This is badly named.
195 XTRAFLAGS = ` \
196   if [ -f $${rootme}/gcc/Makefile ] ; then \
197     if [ -f $${rootme}/newlib/Makefile ] ; then \
198       echo -I$${rootme}/newlib/targ-include -I$${srcroot}/newlib/libc/include -I$${rootme}/gcc/include -nostdinc ; \
199     else \
200       echo -I$${rootme}/gcc/include ; \
201     fi ; \
202   else \
203      echo ; \
204   fi`
205
206 PRMS = all-prms
207
208 #### host and target specific makefile fragments come in here.
209 ###
210
211 # Flags to pass down to all sub-makes.
212 # Please keep these in alphabetical order.
213 BASE_FLAGS_TO_PASS = \
214         "AR_FLAGS=$(AR_FLAGS)" \
215         "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
216         "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
217         "BISON=$(BISON)" \
218         "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
219         "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
220         "CFLAGS=$(CFLAGS)" \
221         $(start-sanitize-chill)\
222         "CHILLFLAGS=$(CHILLFLAGS)" \
223         "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
224         "CHILL_LIB=$(CHILL_LIB)" \
225         $(end-sanitize-chill)\
226         "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
227         "CXXFLAGS=$(CXXFLAGS)" \
228         "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
229         "GCC_FOR_TARGET=$(CC_FOR_TARGET)" \
230         "INSTALL=$(INSTALL)" \
231         "INSTALL_DATA=$(INSTALL_DATA)" \
232         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
233         "INSTALL_XFORM=$(INSTALL_XFORM)" \
234         "LDFLAGS=$(LDFLAGS)" \
235         "LEX=$(LEX)" \
236         "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
237         "MUNCH_NM=$(MUNCH_NM)" \
238         "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
239         "PRMS=$(PRMS)" \
240         "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
241         "EXPECT=$(EXPECT)" \
242         "RUNTEST=$(RUNTEST)" \
243         "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
244         "XTRAFLAGS_FOR_TARGET=$(XTRAFLAGS)" \
245         "exec_prefix=$(exec_prefix)" \
246         "prefix=$(prefix)" \
247         "tooldir=$(tooldir)" 
248
249 # Flags to pass down to most sub-makes, in which we're building with
250 # the host environment.
251 # If any variables are added here, they must be added to do-*, below.
252 EXTRA_HOST_FLAGS = \
253         'AR=$(AR)' \
254         'AS=$(AS)' \
255         'CC=$(CC)' \
256         'CXX=$(CXX)' \
257         'NM=$(NM)' \
258         'RANLIB=$(RANLIB)' \
259         'XTRAFLAGS='
260
261 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
262
263 # Flags that are concerned with the location of the X11 include files
264 # and library files
265 X11_FLAGS_TO_PASS = \
266         "X11_INCLUDE_FLAGS=$(X11_INCLUDE_FLAGS)" \
267         "X11_LIB_FLAGS=$(X11_LIB_FLAGS)" \
268         "X11_LIB=$(X11_LIB)"
269
270 # Flags to pass down to makes which are built with the target environment.
271 # The double $ decreases the length of the command line; the variables
272 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
273 # If any variables are added here, they must be added to do-*, below.
274 EXTRA_TARGET_FLAGS = \
275         'AR=$$(AR_FOR_TARGET)' \
276         'AS=$$(AS_FOR_TARGET)' \
277         'CC=$$(CC_FOR_TARGET)' \
278         'CXX=$$(CXX_FOR_TARGET)' \
279         'NM=$$(NM_FOR_TARGET)' \
280         'RANLIB=$$(RANLIB_FOR_TARGET)' \
281         'XTRAFLAGS=$$(XTRAFLAGS_FOR_TARGET)'
282
283 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
284
285 # Flags to pass down to gcc.  gcc builds a library, libgcc.a, so it
286 # unfortunately needs the native compiler and the target ar and
287 # ranlib.
288 # If any variables are added here, they must be added to do-*, below.
289 # The HOST_* variables are a special case, which are used for the gcc
290 # cross-building scheme.
291 HOST_CC = $(CC_FOR_BUILD)
292 HOST_PREFIX = 
293 HOST_PREFIX_1 = loser-
294 EXTRA_GCC_FLAGS = \
295         'AR=$$(AR_FOR_TARGET)' \
296         'AS=$(AS)' \
297         'CC=$(CC)' \
298         'CXX=$(CXX)' \
299         'HOST_CC=$(CC_FOR_BUILD)' \
300         'HOST_PREFIX=$(HOST_PREFIX)' \
301         'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
302         'NM=$(NM)' \
303         'RANLIB=$$(RANLIB_FOR_TARGET)' \
304         'XTRAFLAGS='
305
306 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
307
308 # This is a list of the targets for all of the modules which are compiled
309 # using $(FLAGS_TO_PASS).
310 ALL_MODULES = \
311         all-autoconf \
312         all-bfd \
313         all-binutils \
314         all-byacc \
315         all-cvs \
316         all-dejagnu \
317         all-diff \
318         all-dosutils \
319         all-etc \
320         all-fileutils \
321         all-find \
322         all-flex \
323         all-gas \
324         all-gawk \
325         all-gdb \
326         all-gprof \
327         all-grep \
328         all-gzip \
329         all-hello \
330         all-indent \
331         all-ispell \
332         all-ld \
333         all-libiberty \
334         all-m4 \
335         all-make \
336         all-mmalloc \
337         all-opcodes \
338         all-patch \
339         all-prms \
340         all-rcs \
341         all-readline \
342         all-release \
343         all-recode \
344         all-sed \
345         all-send-pr \
346         all-shellutils \
347         all-sim \
348         all-tar \
349         all-tcl \
350         all-texinfo \
351         all-textutils \
352         all-tgas \
353         all-time \
354         all-uudecode \
355         all-wdiff
356
357 # This is a list of the check targets for all of the modules which are
358 # compiled using $(FLAGS_TO_PASS).
359 CHECK_MODULES = \
360         check-autoconf \
361         check-bfd \
362         check-binutils \
363         check-byacc \
364         check-cvs \
365         check-dejagnu \
366         check-diff \
367         check-etc \
368         check-fileutils \
369         check-find \
370         check-flex \
371         check-gas \
372         check-gawk \
373         check-gdb \
374         check-gprof \
375         check-grep \
376         check-gzip \
377         check-hello \
378         check-indent \
379         check-ispell \
380         check-ld \
381         check-libiberty \
382         check-m4 \
383         check-make \
384         check-mmcheckoc \
385         check-opcodes \
386         check-patch \
387         check-prms \
388         check-rcs \
389         check-readline \
390         check-recode \
391         check-sed \
392         check-send-pr \
393         check-shellutils \
394         check-sim \
395         check-tar \
396         check-tcl \
397         check-texinfo \
398         check-textutils \
399         check-tgas \
400         check-time \
401         check-uudecode \
402         check-wdiff
403
404 # This is a list of the install targets for all of the modules which are
405 # compiled using $(FLAGS_TO_PASS).
406 INSTALL_MODULES = \
407         install-autoconf \
408         install-bfd \
409         install-binutils \
410         install-byacc \
411         install-cvs \
412         install-dejagnu \
413         install-diff \
414         install-etc \
415         install-fileutils \
416         install-find \
417         install-flex \
418         install-gas \
419         install-gawk \
420         install-gdb \
421         install-glob \
422         install-gprof \
423         install-grep \
424         install-gzip \
425         install-hello \
426         install-indent \
427         install-ispell \
428         install-ld \
429         install-libiberty \
430         install-m4 \
431         install-make \
432         install-mmalloc \
433         install-opcodes \
434         install-patch \
435         install-prms \
436         install-rcs \
437         install-readline \
438         install-recode \
439         install-sed \
440         install-send-pr \
441         install-shellutils \
442         install-sim \
443         install-tar \
444         install-tcl \
445         install-texinfo \
446         install-textutils \
447         install-tgas \
448         install-time \
449         install-uudecode \
450         install-wdiff
451
452 # This is a list of the targets for all of the modules which are compiled
453 # using $(X11_FLAGS_TO_PASS).
454 ALL_X11_MODULES = \
455         all-emacs \
456         all-expect \
457         all-tclX \
458         all-tk
459
460 # This is a list of the check targets for all of the modules which are
461 # compiled using $(X11_FLAGS_TO_PASS).
462 CHECK_X11_MODULES = \
463         check-emacs \
464         check-expect \
465         check-tclX \
466         check-tk
467
468 # This is a list of the install targets for all the modules which are
469 # compiled using $(X11_FLAGS_TO_PASS).
470 INSTALL_X11_MODULES = \
471         install-emacs \
472         install-expect \
473         install-tclX \
474         install-tk
475
476 # This is a list of the targets for all of the modules which are compiled
477 # using $(TARGET_FLAGS_TO_PASS).
478 ALL_TARGET_MODULES = \
479         $(start-sanitize-chill) \
480         all-chillrt \
481         $(end-sanitize-chill) \
482         all-libg++ \
483         all-newlib \
484         all-xiberty
485
486 # This is a list of the check targets for all of the modules which are
487 # compiled using $(TARGET_FLAGS_TO_PASS).
488 CHECK_TARGET_MODULES = \
489         $(start-sanitize-chill) \
490         check-chillrt \
491         $(end-sanitize-chill) \
492         check-libg++ \
493         check-newlib \
494         check-xiberty
495
496 # This is a list of the install targets for all of the modules which are
497 # compiled using $(TARGET_FLAGS_TO_PASS).
498 INSTALL_TARGET_MODULES = \
499         $(start-sanitize-chill) \
500         install-chillrt \
501         $(end-sanitize-chill) \
502         install-libg++ \
503         install-newlib \
504         install-xiberty
505
506 # This is a shell case of all modules which are compiled using
507 # $(TARGET_FLAGS_TO_PASS), used in the do-X rule.
508 TARGET_LIBS = libg++ | newlib | xiberty
509 # start-sanitize-chill
510 TARGET_LIBS = chillrt | libg++ | newlib | xiberty
511 # end-sanitize-chill
512
513 # The first rule in the file had better be this one.  Don't put any above it.
514 all: all.normal
515 .PHONY: all
516
517 # The target built for a native build.
518 .PHONY: all.normal
519 all.normal: \
520         $(ALL_MODULES) \
521         $(ALL_TARGET_MODULES) \
522         $(ALL_X11_MODULES) \
523         all-gcc
524
525 # Do a target for all the subdirectories.  A ``make do-X'' will do a
526 # ``make X'' in all subdirectories (because, in general, there is a
527 # dependency (below) of X upon do-X, a ``make X'' will also do this,
528 # but it may do additional work as well).
529 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
530 # because it is so large that it can easily overflow the command line
531 # length limit on some systems.
532 DO_X = \
533         do-clean \
534         do-distclean \
535         do-dvi \
536         do-info \
537         do-install-info \
538         do-installcheck \
539         do-mostlyclean \
540         do-realclean
541 .PHONY: $(DO_X)
542 $(DO_X):
543         @target=`echo $@ | sed -e 's/^do-//'`; \
544         rootme=`pwd`; export rootme; \
545         srcroot=`cd $(srcdir); pwd`; export srcroot; \
546         for i in $(SUBDIRS); do \
547           if [ -f ./$$i/Makefile ]; then \
548             case $$i in \
549             $(TARGET_LIBS) ) \
550               for flag in $(EXTRA_TARGET_FLAGS); do \
551                 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
552               done; \
553               ;; \
554             gcc) \
555               for flag in $(EXTRA_GCC_FLAGS); do \
556                 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
557               done; \
558               ;; \
559             *) \
560               for flag in $(EXTRA_HOST_FLAGS); do \
561                 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
562               done; \
563               ;; \
564             esac ; \
565             export AR AS CC CXX NM RANLIB XTRAFLAGS; \
566             if (cd ./$$i; \
567                 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
568                         "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
569                         "RANLIB=$${RANLIB}" "XTRAFLAGS=$${XTRAFLAGS}" \
570                         $${target}); \
571             then true; else exit 1; fi; \
572           else true; fi; \
573         done
574
575 # Here are the targets which correspond to the do-X targets.
576
577 .PHONY: info installcheck dvi install-info
578 .PHONY: clean distclean mostlyclean realclean local-clean local-distclean
579 info: do-info
580 installcheck: do-installcheck
581 dvi: do-dvi
582
583 install-info: do-install-info dir.info
584         srcroot=`cd $(srcdir); pwd`; export srcroot; \
585         if [ -f dir.info ] ; then \
586           $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
587         else true ; fi
588
589 local-clean:
590         -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
591
592 local-distclean:
593         -rm -f Makefile config.status
594
595 clean: do-clean local-clean
596 mostlyclean: do-mostlyclean local-clean
597 distclean: do-distclean local-clean local-distclean
598 realclean: do-realclean local-clean local-distclean
599
600 # Check target.
601
602 .PHONY: check
603 check: $(CHECK_MODULES) \
604         $(CHECK_TARGET_MODULES) \
605         $(CHECK_X11_MODULES) \
606         check-gcc
607
608 # Installation targets.
609
610 .PHONY: install uninstall vault-install
611 install: $(INSTALL_TARGET) 
612
613 uninstall:
614         @echo "the uninstall target is not supported in this tree"
615
616 vault-install:
617         @if [ -f ./release/vault-install ] ; then \
618           ./release/vault-install $(host_alias) $(target_alias) ; \
619         else \
620           true ; \
621         fi
622
623 .PHONY: install.all
624 install.all: install-no-fixedincludes
625         @if [ -f ./gcc/Makefile ] ; then \
626                 rootme=`pwd` ; export rootme ; \
627                 (cd ./gcc; \
628                 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
629         else \
630                 true ; \
631         fi
632
633 # install-no-fixedincludes is used because Cygnus can not distribute
634 # the fixed header files.
635 .PHONY: install-no-fixedincludes
636 install-no-fixedincludes: \
637         install-dirs \
638         $(INSTALL_MODULES) \
639         $(INSTALL_TARGET_MODULES) \
640         $(INSTALL_X11_MODULES) \
641         gcc-no-fixedincludes 
642
643 # Install the gcc headers files, but not the fixed include files,
644 # which Cygnus is not allowed to distribute.  This rule is very
645 # dependent on the workings of the gcc Makefile.in.
646 .PHONY: gcc-no-fixedincludes
647 gcc-no-fixedincludes:
648         @if [ -f ./gcc/Makefile ]; then \
649           rm -rf gcc/tmp-include; \
650           mv gcc/include gcc/tmp-include 2>/dev/null; \
651           mkdir gcc/include; \
652           cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
653           touch gcc/stmp-fixinc; \
654           rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
655           rootme=`pwd`; export rootme; \
656           srcroot=`cd $(srcdir); pwd` ; export srcroot; \
657           (cd ./gcc; \
658            $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
659           rm -rf gcc/include; \
660           mv gcc/tmp-include gcc/include 2>/dev/null; \
661         else true; fi
662
663 # This rule is used to build the modules which use FLAGS_TO_PASS.  To
664 # build a target all-X means to cd to X and make all.
665 # all-glob is handled specially because it doesn't actually build.
666 .PHONY: $(ALL_MODULES) all-glob
667 $(ALL_MODULES) all-glob:
668         @dir=`echo $@ | sed -e 's/all-//'`; \
669         if [ -f ./$${dir}/Makefile ] ; then \
670           rootme=`pwd`; export rootme; \
671           srcroot=`cd $(srcdir); pwd`; export srcroot; \
672           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
673         else \
674           true; \
675         fi
676
677 # This rule is used to check the modules which use FLAGS_TO_PASS.  To
678 # build a target check-X means to cd to X and make all.
679 .PHONY: $(CHECK_MODULES) 
680 $(CHECK_MODULES):
681         @dir=`echo $@ | sed -e 's/check-//'`; \
682         if [ -f ./$${dir}/Makefile ] ; then \
683           rootme=`pwd`; export rootme; \
684           srcroot=`cd $(srcdir); pwd`; export srcroot; \
685           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
686         else \
687           true; \
688         fi
689
690 # This rule is used to install the modules which use FLAGS_TO_PASS.
691 # To build a target install-X means to cd to X and make install.
692 .PHONY: $(INSTALL_MODULES)
693 $(INSTALL_MODULES): install-dirs
694         @dir=`echo $@ | sed -e 's/install-//'`; \
695         if [ -f ./$${dir}/Makefile ] ; then \
696           rootme=`pwd`; export rootme; \
697           srcroot=`cd $(srcdir); pwd`; export srcroot; \
698           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
699         else \
700           true; \
701         fi
702
703 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
704 # To build a target all-X means to cd to X and make all.
705 .PHONY: $(ALL_TARGET_MODULES)
706 $(ALL_TARGET_MODULES):
707         @dir=`echo $@ | sed -e 's/all-//'`; \
708         if [ -f ./$${dir}/Makefile ] ; then \
709           rootme=`pwd`; export rootme; \
710           srcroot=`cd $(srcdir); pwd`; export srcroot; \
711           (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
712         else \
713           true; \
714         fi
715
716 # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
717 # To build a target install-X means to cd to X and make install.
718 .PHONY: $(CHECK_TARGET_MODULES)
719 $(CHECK_TARGET_MODULES):
720         @dir=`echo $@ | sed -e 's/check-//'`; \
721         if [ -f ./$${dir}/Makefile ] ; then \
722           rootme=`pwd`; export rootme; \
723           srcroot=`cd $(srcdir); pwd`; export srcroot; \
724           (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) check); \
725         else \
726           true; \
727         fi
728
729 # This rule is used to install the modules which use
730 # TARGET_FLAGS_TO_PASS.  To build a target install-X means to cd to X
731 # and make install.
732 .PHONY: $(INSTALL_TARGET_MODULES)
733 $(INSTALL_TARGET_MODULES): install-dirs
734         @dir=`echo $@ | sed -e 's/install-//'`; \
735         if [ -f ./$${dir}/Makefile ] ; then \
736           rootme=`pwd`; export rootme; \
737           srcroot=`cd $(srcdir); pwd`; export srcroot; \
738           (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
739         else \
740           true; \
741         fi
742
743 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
744 # To build a target all-X means to cd to X and make all.
745 .PHONY: $(ALL_X11_MODULES)
746 $(ALL_X11_MODULES):
747         @dir=`echo $@ | sed -e 's/all-//'`; \
748         if [ -f ./$${dir}/Makefile ] ; then \
749           rootme=`pwd`; export rootme; \
750           srcroot=`cd $(srcdir); pwd`; export srcroot; \
751           (cd $${dir}; \
752            $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
753         else \
754           true; \
755         fi
756
757 # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
758 # To build a target check-X means to cd to X and make all.
759 .PHONY: $(CHECK_X11_MODULES)
760 $(CHECK_X11_MODULES):
761         @dir=`echo $@ | sed -e 's/check-//'`; \
762         if [ -f ./$${dir}/Makefile ] ; then \
763           rootme=`pwd`; export rootme; \
764           srcroot=`cd $(srcdir); pwd`; export srcroot; \
765           (cd $${dir}; \
766            $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
767         else \
768           true; \
769         fi
770
771 # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
772 # To build a target install-X means to cd to X and make install.
773 .PHONY: $(INSTALL_X11_MODULES)
774 $(INSTALL_X11_MODULES):
775         @dir=`echo $@ | sed -e 's/install-//'`; \
776         if [ -f ./$${dir}/Makefile ] ; then \
777           rootme=`pwd`; export rootme; \
778           srcroot=`cd $(srcdir); pwd`; export srcroot; \
779           (cd $${dir}; \
780            $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
781         else \
782           true; \
783         fi
784
785 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
786 .PHONY: all-gcc
787 all-gcc:
788         @if [ -f ./gcc/Makefile ] ; then \
789           rootme=`pwd`; export rootme; \
790           srcroot=`cd $(srcdir); pwd`; export srcroot; \
791           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
792         else \
793           true; \
794         fi
795
796 .PHONY: check-gcc
797 check-gcc:
798         @if [ -f ./gcc/Makefile ] ; then \
799           rootme=`pwd`; export rootme; \
800           srcroot=`cd $(srcdir); pwd`; export srcroot; \
801           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
802         else \
803           true; \
804         fi
805
806 .PHONY: install-gcc
807 install-gcc:
808         @if [ -f ./gcc/Makefile ] ; then \
809           rootme=`pwd`; export rootme; \
810           srcroot=`cd $(srcdir); pwd`; export srcroot; \
811           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
812         else \
813           true; \
814         fi
815
816 # This is a list of inter-dependencies among modules.
817 all-autoconf:
818 all-bfd:
819 all-binutils: all-libiberty all-opcodes all-bfd all-flex
820 all-byacc:
821 # start-sanitize-chill
822 all-chillrt: all-binutils all-gas all-gcc all-newlib
823 # end-sanitize-chill
824 all-cvs:
825 all-dejagnu:
826 all-diff: all-libiberty
827 all-emacs:
828 all-etc:
829 all-expect: all-tcl all-tk
830 all-fileutils: all-libiberty
831 all-find:
832 all-flex: all-libiberty all-byacc
833 all-gas: all-libiberty all-opcodes all-bfd
834 all-gawk:
835 all-gcc: all-libiberty all-byacc all-binutils all-gas
836 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-glob all-byacc all-sim
837 all-glob:
838 all-gprof: all-libiberty all-bfd
839 all-grep:
840 all-gzip: all-libiberty
841 all-hello: all-libiberty
842 all-indent:
843 all-ispell: all-emacs
844 all-ld: all-libiberty all-bfd all-byacc all-flex
845 all-libg++: all-gas all-ld all-gcc all-xiberty all-newlib
846 all-libiberty:
847 all-m4: all-libiberty
848 all-make: all-libiberty
849 all-mmalloc:
850 all-newlib: all-binutils all-gas all-gcc
851 all-opcodes: all-bfd
852 all-patch:
853 all-prms: all-libiberty
854 all-rcs:
855 all-readline:
856 all-recode: all-libiberty
857 all-sed: all-libiberty
858 all-send-pr: all-prms
859 all-shellutils:
860 all-sim: all-libiberty all-bfd
861 all-tar: all-libiberty
862 all-tcl:
863 all-tclX: all-tcl all-tk
864 all-tk: all-tcl
865 all-texinfo: all-libiberty
866 all-textutils:
867 all-tgas: all-libiberty all-bfd
868 all-time:
869 all-wdiff:
870 all-uudecode: all-libiberty
871 all-xiberty: all-gcc all-newlib
872
873 ### other supporting targets
874
875 MAKEDIRS= \
876         $(prefix) \
877         $(exec_prefix) \
878         $(tooldir)
879
880 .PHONY: install-dirs
881 install-dirs:
882         @for i in $(MAKEDIRS) ; do \
883                 echo Making $$i... ; \
884                 parent=`echo $$i | sed -e 's@/[^/]*$$@@' | sed -e 's@^$$@/@'`; \
885                 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
886                 if [ ! -d $$i ] ; then \
887                         if mkdir $$i ; then \
888                                 true ; \
889                         else \
890                                 exit 1 ; \
891                         fi ; \
892                 else \
893                         true ; \
894                 fi ; \
895         done
896
897
898 dir.info: do-install-info
899         if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
900           $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
901           mv -f dir.info.new dir.info ; \
902         else true ; \
903         fi
904
905 dist:
906         @echo "Building a full distribution of this tree isn't done"
907         @echo "via 'make dist'.  Check out the etc/ subdirectory" 
908
909 etags tags: TAGS
910
911 TAGS:
912         etags `$(MAKE) ls`
913
914 ls:
915         @echo Makefile
916         @for i in $(SUBDIRS); \
917         do \
918                 (cd $$i; \
919                         pwd=`pwd`; \
920                         wd=`basename $$pwd`; \
921                         for j in `$(MAKE) ls`; \
922                         do \
923                                 echo $$wd/$$j; \
924                         done) \
925         done
926
927 # with the gnu make, this is done automatically.
928
929 Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
930         $(SHELL) ./config.status
931
932 #
933 # Support for building net releases
934
935 # Files in devo used in any net release.
936 # ChangeLog omitted because it may refer to files which are not in this
937 # distribution (perhaps it would be better to include it anyway).
938 DEVO_SUPPORT= README Makefile.in configure configure.in \
939         config.guess config.sub config move-if-change \
940         COPYING COPYING.LIB install.sh
941
942 # Files in devo/etc used in any net release.
943 # ChangeLog omitted because it may refer to files which are not in this
944 # distribution (perhaps it would be better to include it anyway).
945 ETC_SUPPORT= Makefile.in cfg-paper.texi configure.in configure.man \
946         configure.texi standards.texi make-stds.texi
947
948 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline glob sim
949 GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS)
950
951 .PHONY: setup-dirs-gdb gdb.tar.gz make-gdb.tar.gz
952 setup-dirs-gdb:
953         ./configure sun4
954         $(MAKE) clean
955         ./configure -rm sun4
956         chmod og=u `find etc $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
957
958 gdb.tar.gz: setup-dirs-gdb
959         (cd gdb; $(MAKE) -f Makefile.in make-proto-gdb.dir BISON="byacc")
960         (cd gdb; $(MAKE) -f Makefile.in make-proto-testsuite.dir)
961         $(MAKE) $(MFLAGS) -f Makefile.in make-gdb.tar.gz
962
963 make-gdb.tar.gz: $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS) gdb texinfo/texinfo.tex
964         rm -rf proto-toplev; mkdir proto-toplev
965         ln -s ../gdb/proto-gdb.dir proto-toplev/gdb
966         (cd proto-toplev; for i in $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS); do \
967                 ln -s ../$$i . ; \
968         done)
969         mkdir proto-toplev/etc
970         (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \
971                 ln -s ../../etc/$$i . ; \
972         done)
973         # Put only one copy (four hard links) of COPYING in the tar file.
974         rm                          proto-toplev/bfd/COPYING
975         ln proto-toplev/gdb/COPYING proto-toplev/bfd/COPYING
976         rm                          proto-toplev/include/COPYING
977         ln proto-toplev/gdb/COPYING proto-toplev/include/COPYING
978         rm                          proto-toplev/readline/COPYING
979         ln proto-toplev/gdb/COPYING proto-toplev/readline/COPYING
980
981         # Change the bug reporting address in configure to bug-gdb
982         rm proto-toplev/configure
983         sed -e 's/configure@cygnus.com/bug-gdb@prep.ai.mit.edu/' \
984             <configure >proto-toplev/configure
985         chmod a+x proto-toplev/configure
986
987         # Take out texinfo and glob from configurable dirs
988         rm proto-toplev/configure.in
989         sed -e '/^host_tools=/s/texinfo //' \
990             -e '/^host_libs=/s/glob //' \
991             <configure.in >proto-toplev/configure.in
992
993         # Take out texinfo from a few places; make simple BISON=bison line.
994         rm proto-toplev/Makefile.in
995         sed -e '/^all\.normal: /s/\all-texinfo //' \
996             -e '/^      install-texinfo /d' \
997             -e '/^BISON = /,/^$$/d' \
998             -e '/^# BISON:/s/.*/BISON = bison -y/' \
999         <Makefile.in >proto-toplev/Makefile.in
1000
1001         mkdir proto-toplev/texinfo
1002         ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1003         ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
1004         ln -s ../../texinfo/tex3patch   proto-toplev/texinfo/
1005         chmod og=u `find proto-toplev -print`
1006         (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
1007                 echo "==> Making gdb-$$VER.tar.gz"; \
1008                 rm -f gdb-$$VER; ln -s proto-toplev gdb-$$VER; \
1009                 tar cfh - gdb-$$VER \
1010                 | $(GZIP) -v -9 >gdb-$$VER.tar.gz)
1011
1012         # Make the testsuite archive separately.
1013         ln -s ../../gdb/proto-testsuite.dir/testsuite proto-toplev/gdb/testsuite
1014         # Blow away the Chill test that requires a Chill compiled executable,
1015         # since GNU Chill is not yet publically available.
1016         rm -rf proto-toplev/gdb/testsuite/gdb.t31
1017
1018         # Put a copy of COPYING in the tar file.
1019         ln proto-toplev/gdb/COPYING proto-toplev/gdb/testsuite/COPYING
1020         chmod og=u `find proto-toplev/gdb/testsuite -print`
1021         (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
1022                 echo "==> Making gdb-$$VER-testsuite.tar.gz"; \
1023                 tar cfh - gdb-$$VER/configure gdb-$$VER/config.guess \
1024                         gdb-$$VER/config.sub gdb-$$VER/move-if-change \
1025                         gdb-$$VER/gdb/testsuite \
1026                         | $(GZIP) -v -9 >gdb-$$VER-testsuite.tar.gz)
1027
1028 # When you use `make setup-dirs' or `make taz' you should always redefine
1029 # this macro.
1030 SUPPORT_FILES = list-of-support-files-for-tool-in-question
1031 # Directories that might want `make diststuff' run.
1032 DISTSTUFFDIRS= ld gprof gdb libg++
1033
1034 .PHONY: taz
1035
1036 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex texinfo/gpl.texinfo
1037         ./configure sun4
1038         # Make links, and run "make diststuff" when needed.
1039         # The `echo' for setting `p' is to convert all whitespace to spaces.
1040         # Then the `case' further below should tell whether $$d is in
1041         # DISTSTUFFDIRS.
1042         rm -rf proto-toplev ; mkdir proto-toplev
1043         set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1044         p=" `echo $(DISTSTUFFDIRS)` " ; \
1045         for d in $$dirs ; do \
1046           if [ -d $$d ]; then \
1047             case " $$p " in \
1048             *" $$d "*)  \
1049                 echo making diststuff in $$d ; \
1050                 (cd $$d ; $(MAKE) diststuff) || exit 1  ;; \
1051             esac ; \
1052             if [ -d $$d/proto-$$d.dir ]; then \
1053               ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1054             else \
1055               ln -s ../$$d proto-toplev/$$d ; \
1056             fi ; \
1057           else ln -s ../$$d proto-toplev/$$d ; fi ; \
1058         done
1059         $(MAKE) distclean
1060         #
1061         mkdir proto-toplev/etc
1062         (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \
1063                 ln -s ../../etc/$$i . ; \
1064         done)
1065         #
1066         # Take out texinfo and glob from configurable dirs
1067         rm proto-toplev/configure.in
1068         sed -e '/^host_tools=/s/texinfo //' \
1069             -e '/^host_libs=/s/glob //' \
1070             <configure.in >proto-toplev/configure.in
1071         #
1072         # Take out texinfo from a few places; make simple BISON=bison line.
1073         rm proto-toplev/Makefile.in
1074         sed -e '/^all\.normal: /s/\all-texinfo //' \
1075             -e '/^      install-texinfo /d' \
1076             -e '/^BISON = /,/^$$/d' \
1077             -e '/^# BISON:/s/.*/BISON = bison -y/' \
1078         <Makefile.in >proto-toplev/Makefile.in
1079         #
1080         mkdir proto-toplev/texinfo
1081         ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1082         ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
1083         ln -s ../../texinfo/tex3patch   proto-toplev/texinfo/
1084         chmod og=u `find . -print`
1085         (VER=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
1086                 echo "==> Making $(TOOL)-$$VER.tar.gz"; \
1087                 rm -f $(TOOL)-$$VER; ln -s proto-toplev $(TOOL)-$$VER; \
1088                 tar cfh - $(TOOL)-$$VER \
1089                 | $(GZIP) -v -9 >$(TOOL)-$$VER.tar.gz)
1090
1091 TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo
1092 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
1093
1094 .PHONY: gas.tar.gz
1095 GAS_SUPPORT_DIRS= bfd include libiberty opcodes
1096 gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
1097         $(MAKE) -f Makefile.in taz SUPPORT_FILES="$(GAS_SUPPORT_DIRS)" TOOL=gas
1098
1099 # The FSF "binutils" release includes gprof and ld.
1100 .PHONY: binutils.tar.gz
1101 BINUTILS_SUPPORT_DIRS= bfd include libiberty opcodes ld gprof
1102 binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
1103         $(MAKE) -f Makefile.in taz SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)" TOOL=binutils
1104
1105 .PHONY: gas+binutils.tar.gz
1106 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
1107 gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
1108         $(MAKE) -f Makefile.in taz SUPPORT_FILES="$(GASB_SUPPORT_DIRS)" TOOL=gas
1109
1110 .PHONY: libg++.tar.gz
1111 LIBGXX_SUPPORT_DIRS=include libiberty xiberty
1112 libg++.tar.gz: $(DIST_SUPPORT) libg++
1113         $(MAKE) -f Makefile.in taz SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)" TOOL=libg++
1114
1115 .NOEXPORT:
1116 MAKEOVERRIDES=
1117
1118 # start-sanitize-chill
1119 ## This is ugly, but I don't want GNU make to put these variables in
1120 ## the environment.  Older makes will see this as a set of targets
1121 ## with no dependencies and no actions.
1122 unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
1123 # end-sanitize-chill
1124
1125 # end of Makefile.in