2 # Makefile for directory with subdirs to build.
3 # Copyright (C) 1990, 1991, 1992 Free Software Foundation
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.
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.
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. */
24 exec_prefix = $(prefix)
25 bindir = $(exec_prefix)/bin
26 libdir = $(exec_prefix)/lib
29 program_transform_name =
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
49 INSTALL_PROGRAM = $(INSTALL)
50 INSTALL_DATA = $(INSTALL)
57 $(start-sanitize-chill)
58 CHILLFLAGS = $(CFLAGS)
66 BISON = `if [ -f $${rootme}/byacc/byacc ] ; \
67 then echo $${rootme}/byacc/byacc ; \
71 LEX = `if [ -f $${rootme}/flex/flex ] ; \
72 then echo $${rootme}/flex/flex ; \
75 MAKEINFO = `if [ -f $${rootme}/texinfo/C/makeinfo ] ; \
76 then echo $${rootme}/texinfo/C/makeinfo ; \
77 else echo makeinfo ; fi`
80 # libraries that may need to be augmented on a system-by-system basis
83 # compilers to use to create programs which must be run in the build
86 CXX_FOR_BUILD = $(CXX)
88 SUBDIRS = "this is set via configure, don't edit this"
92 INSTALL_TARGET = install.all
98 if [ -f $${rootme}/gcc/Makefile ] ; then \
99 echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/; \
101 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
104 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
109 if [ -f $${rootme}/gcc/Makefile ] ; then \
110 echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/; \
112 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
115 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
119 $(start-sanitize-chill)
120 CHILL_FOR_TARGET = ` \
121 if [ -f $${rootme}/gcc/Makefile ] ; then \
122 echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/ -L$${rootme}/chillrt/; \
124 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
127 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
130 $(end-sanitize-chill)
133 if [ -f $${rootme}/gcc/Makefile ] ; then \
134 echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/; \
136 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
139 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
144 if [ -f $${rootme}/gas/Makefile ] ; then \
145 echo $${rootme}/gas/as.new ; \
147 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
150 t='$(program_transform_name)'; echo as | sed -e '' $$t ; \
155 if [ -f $${rootme}/binutils/Makefile ] ; then \
156 echo $${rootme}/binutils/ar ; \
158 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
161 t='$(program_transform_name)'; echo ar | sed -e '' $$t ; \
165 RANLIB_FOR_TARGET = ` \
166 if [ -f $${rootme}/binutils/Makefile ] ; then \
167 echo $${rootme}/binutils/ranlib ; \
169 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
172 t='$(program_transform_name)'; echo ranlib | sed -e '' $$t ; \
177 if [ -f $${rootme}/binutils/Makefile ] ; then \
178 echo $${rootme}/binutils/nm ; \
180 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
183 t='$(program_transform_name)'; echo nm | sed -e '' $$t ; \
188 if [ -f $${rootme}/gcc/Makefile ] ; then \
189 if [ -f $${rootme}/newlib/Makefile ] ; then \
190 echo -I$${rootme}/newlib/targ-include -I$${srcroot}/newlib/libc/include -I$${rootme}/gcc/include -nostdinc ; \
192 echo -I$${rootme}/gcc/include ; \
199 #### host and target specific makefile fragments come in here.
202 # Flags to pass down to sub-makes -- please keep these in alphabetical order
205 "AR_FLAGS=$(AR_FLAGS)" \
206 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
208 "CXXFLAGS=$(CXXFLAGS)" \
209 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
211 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
213 $(start-sanitize-chill)\
214 "CHILLFLAGS=$(CHILLFLAGS)" \
215 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
216 "CHILL_LIB=$(CHILL_LIB)" \
217 $(end-sanitize-chill)\
218 "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
219 "INSTALL=$(INSTALL)" \
220 "INSTALL_DATA=$(INSTALL_DATA)" \
221 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
222 "LDFLAGS=$(LDFLAGS)" \
224 "LOADLIBES=$(LOADLIBES)" \
225 "MAKEINFO=$(MAKEINFO)" \
227 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
228 "exec_prefix=$(exec_prefix)" \
232 # Flags that are concerned with the location of the X11 include files
235 X11_FLAGS_TO_PASS = \
236 "X11_INCLUDE_FLAGS=$(X11_INCLUDE_FLAGS)" \
237 "X11_LIB_FLAGS=$(X11_LIB_FLAGS)" \
240 # Flags to pass down to makes which are built with the target
241 # environment (e.g. libg++, xiberty, newlib). -- keep these in alpha order please
242 TARGET_FLAGS_TO_PASS = \
243 "AR=$(AR_FOR_TARGET)" \
244 "AR_FLAGS=$(AR_FLAGS)" \
245 "AS=$(AS_FOR_TARGET)" \
247 "CXX=$(CXX_FOR_TARGET)" \
248 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
249 "CXXFLAGS=$(CXXFLAGS)" \
250 "CC=$(CC_FOR_TARGET)" \
251 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
253 "INSTALL=$(INSTALL)" \
254 "INSTALL_DATA=$(INSTALL_DATA)" \
255 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
256 "LDFLAGS=$(LDFLAGS)" \
258 "LOADLIBES=$(LOADLIBES)" \
259 "MAKEINFO=$(MAKEINFO)" \
260 "NM=$(NM_FOR_TARGET)" \
261 "RANLIB=$(RANLIB_FOR_TARGET)" \
262 "XTRAFLAGS=$(XTRAFLAGS)" \
263 "exec_prefix=$(exec_prefix)" \
267 # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
268 # unfortunately needs the native compiler and the target ar and
269 # ranlib. Keep these in alphabetical order, please.
270 GCC_FLAGS_TO_PASS = \
271 "AR=$(AR_FOR_TARGET)" \
272 "AR_FLAGS=$(AR_FLAGS)" \
273 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
277 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
278 "CXXFLAGS=$(CXXFLAGS)" \
280 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
282 "INSTALL=$(INSTALL)" \
283 "INSTALL_DATA=$(INSTALL_DATA)" \
284 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
285 "LDFLAGS=$(LDFLAGS)" \
287 "LOADLIBES=$(LOADLIBES)" \
288 "MAKEINFO=$(MAKEINFO)" \
290 "RANLIB=$(RANLIB_FOR_TARGET)" \
291 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
292 "XTRAFLAGS=$(XTRAFLAGS)" \
293 "exec_prefix=$(exec_prefix)" \
297 # The first rule in the file had better be this one. Don't put any above it.
300 .PHONY: all check dvi info install-info
304 @rootme=`pwd` ; export rootme ; \
305 $(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
307 install-info: install-info-dirs force
308 -parent=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \
309 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
310 -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi
311 @rootme='pwd' ; export rootme ; $(MAKE) $(FLAGS_TO_PASS) DO=install-info "DODIRS=$(SUBDIRS)" subdir_do
312 @rootme='pwd' ; export rootme ; $(MAKE) $(FLAGS_TO_PASS) dir.info install-dir.info
315 -parent=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \
316 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
317 -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi
318 $(INSTALL_DATA) dir.info $(infodir)/dir.info
320 all.normal: all-m4 all-autoconf all-libiberty all-mmalloc all-texinfo \
321 all-byacc all-flex all-opcodes all-bfd all-ld all-gas all-tgas \
322 all-gcc all-binutils all-libg++ all-readline all-z8ksim all-h8300sim all-gdb \
323 all-make all-rcs all-cvs all-diff all-grep \
324 all-patch all-emacs all-ispell all-etc \
325 all-tcl all-tk all-expect \
327 $(start-sanitize-chill) \
329 $(end-sanitize-chill) \
330 all-gprof all-send_pr all-libm all-deja-gnu \
331 all-fileutils all-find all-gawk all-sed all-shellutils \
332 all-textutils all-time all-wdiff
335 all.cross: all-libiberty all-mmalloc all-gas all-byacc all-flex all-ld \
336 all-opcodes all-z8ksim all-h8300sim all-bfd all-readline \
337 all-gdb all-binutils all-gcc all-newlib \
338 $(start-sanitize-chill) \
340 $(end-sanitize-chill) \
343 .PHONY: clean distclean mostlyclean realclean do_clean
346 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
348 clean mostlyclean: do_clean
349 @rootme=`pwd` ; export rootme ; \
350 $(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
352 distclean realclean: do_clean
353 @rootme=`pwd` ; export rootme ; \
354 $(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
355 -rm -f Makefile config.status
358 @echo "the uninstall target is not supported in this tree"
360 install: $(INSTALL_TARGET)
361 -parent=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \
362 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
363 -if [ -d $(man1dir) ] ; then true ; else mkdir $(man1dir) ; fi
365 install.all: install-no-fixedincludes
366 @if [ -f ./gcc/Makefile ] ; then \
367 rootme=`pwd` ; export rootme ; \
369 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
374 install-no-fixedincludes: install-dirs gcc-no-fixedincludes \
400 $(start-sanitize-chill) \
402 $(end-sanitize-chill) \
412 install-fileutils install-find install-gawk install-m4 install-sed install-shellutils \
413 install-textutils install-time install-wdiff
416 # Install the gcc headers files, but not the fixed include files,
417 # which we are not allowed to distribute. This rule is very dependent
418 # on the workings of the gcc Makefile.in.
420 gcc-no-fixedincludes:
421 @if [ -f ./gcc/Makefile ]; then \
422 rm -rf gcc/tmp-include; \
423 mv gcc/include gcc/tmp-include 2>/dev/null; \
425 touch gcc/stmp-fixincludes; \
426 rm -f gcc/stmp-headers; \
427 rootme=`pwd`; export rootme; \
428 srcroot=`cd $(srcdir); pwd` ; export srcroot; \
430 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
431 rm -rf gcc/include; \
432 mv gcc/tmp-include gcc/include 2>/dev/null; \
435 install.cross: install-dirs install-libiberty install-mmalloc \
436 install-binutils install-opcodes install-byacc install-flex \
437 install-ld install-gas install-readline \
438 install-glob install-gdb install-mmalloc \
440 $(start-sanitize-chill) \
442 $(end-sanitize-chill) \
443 install-gcc install-etc install-deja-gnu
447 @if [ -f ./deja-gnu/Makefile ] ; then \
448 rootme=`pwd` ; export rootme ; \
449 (cd ./deja-gnu; $(MAKE) $(FLAGS_TO_PASS) all) ; \
454 install-deja-gnu: force
455 @if [ -f ./deja-gnu/Makefile ] ; then \
456 rootme=`pwd` ; export rootme ; \
457 (cd ./deja-gnu; $(MAKE) $(FLAGS_TO_PASS) install) ; \
464 @if [ -f ./autoconf/Makefile ] ; then \
465 rootme=`pwd` ; export rootme ; \
466 (cd ./autoconf; $(MAKE) $(FLAGS_TO_PASS) all) ; \
471 install-autoconf: force
472 @if [ -f ./autoconf/Makefile ] ; then \
473 rootme=`pwd` ; export rootme ; \
474 (cd ./autoconf; $(MAKE) $(FLAGS_TO_PASS) install) ; \
481 @if [ -f ./etc/Makefile ] ; then \
482 rootme=`pwd` ; export rootme ; \
483 (cd ./etc; $(MAKE) $(FLAGS_TO_PASS) all) ; \
489 @if [ -f ./etc/Makefile ] ; then \
490 rootme=`pwd` ; export rootme ; \
491 (cd ./etc; $(MAKE) $(FLAGS_TO_PASS) install) ; \
498 @if [ -f ./libiberty/Makefile ] ; then \
499 rootme=`pwd` ; export rootme ; \
501 $(MAKE) $(FLAGS_TO_PASS) all) ; \
506 install-libiberty: force
507 @if [ -f ./libiberty/Makefile ] ; then \
508 rootme=`pwd` ; export rootme ; \
510 $(MAKE) $(FLAGS_TO_PASS) install) ; \
516 all-xiberty: all-gcc all-newlib
517 @if [ -f ./xiberty/Makefile ] ; then \
518 rootme=`pwd` ; export rootme ; \
519 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
521 $(MAKE) $(TARGET_FLAGS_TO_PASS) all) ; \
526 install-xiberty: force
527 @if [ -f ./xiberty/Makefile ] ; then \
528 rootme=`pwd` ; export rootme ; \
529 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
531 $(MAKE) $(TARGET_FLAGS_TO_PASS) install) ; \
538 @if [ -f ./mmalloc/Makefile ] ; then \
539 rootme=`pwd` ; export rootme ; \
541 $(MAKE) $(FLAGS_TO_PASS) all) ; \
546 install-mmalloc: force
547 @if [ -f ./mmalloc/Makefile ] ; then \
548 rootme=`pwd` ; export rootme ; \
550 $(MAKE) $(FLAGS_TO_PASS) install) ; \
556 all-texinfo: all-libiberty
557 @if [ -f ./texinfo/Makefile ] ; then \
558 rootme=`pwd` ; export rootme ; \
560 $(MAKE) $(FLAGS_TO_PASS) all) ; \
565 install-texinfo: force
566 @if [ -f ./texinfo/Makefile ] ; then \
567 rootme=`pwd` ; export rootme ; \
569 $(MAKE) $(FLAGS_TO_PASS) install) ; \
576 @if [ -f ./bfd/Makefile ] ; then \
577 rootme=`pwd` ; export rootme ; \
579 $(MAKE) $(FLAGS_TO_PASS) all) ; \
585 @if [ -f ./bfd/Makefile ] ; then \
586 rootme=`pwd` ; export rootme ; \
588 $(MAKE) $(FLAGS_TO_PASS) install) ; \
596 @if [ -f ./opcodes/Makefile ] ; then \
597 rootme=`pwd` ; export rootme ; \
599 $(MAKE) $(FLAGS_TO_PASS) all) ; \
604 install-opcodes: force
605 @if [ -f ./opcodes/Makefile ] ; then \
606 rootme=`pwd` ; export rootme ; \
608 $(MAKE) $(FLAGS_TO_PASS) install) ; \
614 all-binutils: all-opcodes all-libiberty all-bfd all-flex
615 @if [ -f ./binutils/Makefile ] ; then \
616 rootme=`pwd` ; export rootme ; \
618 $(MAKE) $(FLAGS_TO_PASS) all) ; \
623 install-binutils: force
624 @if [ -f ./binutils/Makefile ] ; then \
625 rootme=`pwd` ; export rootme ; \
627 $(MAKE) $(FLAGS_TO_PASS) install) ; \
633 all-newlib: all-binutils all-ld all-gas all-gcc
634 @if [ -f ./newlib/Makefile ] ; then \
635 rootme=`pwd` ; export rootme ; \
636 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
638 $(MAKE) $(TARGET_FLAGS_TO_PASS) all) ; \
643 install-newlib: force
644 @if [ -f ./newlib/Makefile ] ; then \
645 rootme=`pwd` ; export rootme ; \
646 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
648 $(MAKE) $(TARGET_FLAGS_TO_PASS) install) ; \
653 ### start-sanitize-chill
655 all-chillrt: all-binutils all-ld all-gas all-gcc all-newlib
656 @if [ -f ./chillrt/Makefile ] ; then \
657 rootme=`pwd` ; export rootme ; \
658 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
660 $(MAKE) $(TARGET_FLAGS_TO_PASS) all) ; \
665 install-chillrt: force
666 @if [ -f ./chillrt/Makefile ] ; then \
667 rootme=`pwd` ; export rootme ; \
668 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
670 $(MAKE) $(TARGET_FLAGS_TO_PASS) install) ; \
674 ### end-sanitize-chill
677 all-gprof: all-libiberty all-bfd
678 @if [ -f ./gprof/Makefile ] ; then \
679 rootme=`pwd` ; export rootme ; \
681 $(MAKE) $(FLAGS_TO_PASS) all) ; \
687 @if [ -f ./gprof/Makefile ] ; then \
688 rootme=`pwd` ; export rootme ; \
690 $(MAKE) $(FLAGS_TO_PASS) install) ; \
697 @if [ -f ./byacc/Makefile ] ; then \
698 rootme=`pwd` ; export rootme ; \
700 $(MAKE) $(FLAGS_TO_PASS) all) ; \
706 @if [ -f ./byacc/Makefile ] ; then \
707 rootme=`pwd` ; export rootme ; \
709 $(MAKE) $(FLAGS_TO_PASS) install) ; \
715 all-flex: all-libiberty
716 @if [ -f ./flex/Makefile ] ; then \
717 rootme=`pwd` ; export rootme ; \
719 $(MAKE) $(FLAGS_TO_PASS) all) ; \
725 @if [ -f ./flex/Makefile ] ; then \
726 rootme=`pwd` ; export rootme ; \
728 $(MAKE) $(FLAGS_TO_PASS) install) ; \
733 all-gcc: all-libiberty all-byacc all-binutils
734 @if [ -f ./gcc/Makefile ] ; then \
735 rootme=`pwd` ; export rootme ; \
736 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
738 $(MAKE) $(GCC_FLAGS_TO_PASS) all) ; \
744 @if [ -f ./gcc/Makefile ] ; then \
745 rootme=`pwd` ; export rootme ; \
746 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
748 $(MAKE) $(GCC_FLAGS_TO_PASS) install) ; \
755 @if [ -f ./readline/Makefile ] ; then \
756 rootme=`pwd` ; export rootme ; \
758 $(MAKE) $(FLAGS_TO_PASS) all) ; \
763 install-readline: force
764 @if [ -f ./readline/Makefile ] ; then \
765 rootme=`pwd` ; export rootme ; \
767 $(MAKE) $(FLAGS_TO_PASS) install) ; \
774 @if [ -f ./glob/Makefile ] ; then \
775 rootme=`pwd` ; export rootme ; \
777 $(MAKE) $(FLAGS_TO_PASS) all) ; \
783 @if [ -f ./glob/Makefile ] ; then \
784 rootme=`pwd` ; export rootme ; \
786 $(MAKE) $(FLAGS_TO_PASS) install) ; \
792 all-gas: all-libiberty all-opcodes all-bfd
793 @if [ -f ./gas/Makefile ] ; then \
794 rootme=`pwd` ; export rootme ; \
796 $(MAKE) $(FLAGS_TO_PASS) all) ; \
802 @if [ -f ./gas/Makefile ] ; then \
803 rootme=`pwd` ; export rootme ; \
805 $(MAKE) $(FLAGS_TO_PASS) install) ; \
811 all-tgas: all-libiberty all-bfd
812 @if [ -f ./tgas/Makefile ] ; then \
813 rootme=`pwd` ; export rootme ; \
815 $(MAKE) $(FLAGS_TO_PASS) all) ; \
822 all-ld: all-libiberty all-bfd all-byacc all-flex
823 @if [ -f ./ld/Makefile ] ; then \
824 rootme=`pwd` ; export rootme ; \
826 $(MAKE) $(FLAGS_TO_PASS) all) ; \
832 @if [ -f ./ld/Makefile ] ; then \
833 rootme=`pwd` ; export rootme ; \
835 $(MAKE) $(FLAGS_TO_PASS) install) ; \
841 all-gdb: all-bfd all-opcodes all-libiberty all-mmalloc all-readline all-glob all-byacc
842 @if [ -f ./gdb/Makefile ] ; then \
843 rootme=`pwd` ; export rootme ; \
845 $(MAKE) $(FLAGS_TO_PASS) all) ; \
851 @if [ -f ./gdb/Makefile ] ; then \
852 rootme=`pwd` ; export rootme ; \
854 $(MAKE) $(FLAGS_TO_PASS) install) ; \
860 all-make: all-libiberty
861 @if [ -f ./make/Makefile ] ; then \
862 rootme=`pwd` ; export rootme ; \
864 $(MAKE) $(FLAGS_TO_PASS) all) ; \
870 @if [ -f ./make/Makefile ] ; then \
871 rootme=`pwd` ; export rootme ; \
873 $(MAKE) $(FLAGS_TO_PASS) install) ; \
880 @if [ -f ./diff/Makefile ] ; then \
881 rootme=`pwd` ; export rootme ; \
883 $(MAKE) $(FLAGS_TO_PASS) all) ; \
889 @if [ -f ./diff/Makefile ] ; then \
890 rootme=`pwd` ; export rootme ; \
892 $(MAKE) $(FLAGS_TO_PASS) install) ; \
899 @if [ -f ./grep/Makefile ] ; then \
900 rootme=`pwd` ; export rootme ; \
902 $(MAKE) $(FLAGS_TO_PASS) all) ; \
908 @if [ -f ./grep/Makefile ] ; then \
909 rootme=`pwd` ; export rootme ; \
911 $(MAKE) $(FLAGS_TO_PASS) install) ; \
918 @if [ -f ./rcs/Makefile ] ; then \
919 rootme=`pwd` ; export rootme ; \
921 $(MAKE) $(FLAGS_TO_PASS) all) ; \
927 @if [ -f ./rcs/Makefile ] ; then \
928 rootme=`pwd` ; export rootme ; \
930 $(MAKE) $(FLAGS_TO_PASS) install) ; \
937 @if [ -f ./cvs/Makefile ] ; then \
938 rootme=`pwd` ; export rootme ; \
940 $(MAKE) $(FLAGS_TO_PASS) all) ; \
946 @if [ -f ./cvs/Makefile ] ; then \
947 rootme=`pwd` ; export rootme ; \
949 $(MAKE) $(FLAGS_TO_PASS) install) ; \
956 @if [ -f ./patch/Makefile ] ; then \
957 rootme=`pwd` ; export rootme ; \
959 $(MAKE) $(FLAGS_TO_PASS) all) ; \
965 @if [ -f ./patch/Makefile ] ; then \
966 rootme=`pwd` ; export rootme ; \
968 $(MAKE) $(FLAGS_TO_PASS) \
970 man1dir=$(man1dir) install) ; \
977 @if [ -f ./emacs/Makefile ] ; then \
978 rootme=`pwd` ; export rootme ; \
980 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) ; \
986 @if [ -f ./emacs/Makefile ] ; then \
987 rootme=`pwd` ; export rootme ; \
989 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) ; \
995 all-ispell: all-emacs
996 @if [ -f ./ispell/Makefile ] ; then \
997 rootme=`pwd` ; export rootme ; \
999 $(MAKE) $(FLAGS_TO_PASS) all) ; \
1004 install-ispell: force
1005 @if [ -f ./ispell/Makefile ] ; then \
1006 rootme=`pwd` ; export rootme ; \
1008 $(MAKE) $(FLAGS_TO_PASS) install) ; \
1015 @if [ -f ./send_pr/Makefile ] ; then \
1016 rootme=`pwd` ; export rootme ; \
1018 $(MAKE) $(FLAGS_TO_PASS) all) ; \
1023 install-send_pr: force
1024 @if [ -f ./send_pr/Makefile ] ; then \
1025 rootme=`pwd` ; export rootme ; \
1027 $(MAKE) $(FLAGS_TO_PASS) install) ; \
1034 @if [ -f ./libm/Makefile ] ; then \
1035 rootme=`pwd` ; export rootme ; \
1037 $(MAKE) $(TARGET_FLAGS_TO_PASS) all) ; \
1043 @if [ -f ./libm/Makefile ] ; then \
1044 rootme=`pwd` ; export rootme ; \
1046 $(MAKE) $(TARGET_FLAGS_TO_PASS) install) ; \
1053 all-libg++: all-gas all-ld all-gcc all-xiberty all-newlib
1054 @if [ -f ./libg++/Makefile ] ; then \
1055 rootme=`pwd` ; export rootme ; \
1056 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
1058 $(MAKE) $(TARGET_FLAGS_TO_PASS) all) ; \
1063 install-libg++: force
1064 @if [ -f ./libg++/Makefile ] ; then \
1065 rootme=`pwd` ; export rootme ; \
1066 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
1068 $(MAKE) $(TARGET_FLAGS_TO_PASS) install) ; \
1074 @if [ -f ./tcl/Makefile ] ; then \
1075 rootme=`pwd` ; export rootme ; \
1076 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
1078 $(MAKE) $(FLAGS_TO_PASS) all) ; \
1084 @if [ -f ./tcl/Makefile ] ; then \
1085 rootme=`pwd` ; export rootme ; \
1086 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
1088 $(MAKE) $(FLAGS_TO_PASS) install) ; \
1096 @if [ -f ./tk/Makefile ] ; then \
1097 rootme=`pwd` ; export rootme ; \
1098 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
1100 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) ; \
1106 @if [ -f ./tk/Makefile ] ; then \
1107 rootme=`pwd` ; export rootme ; \
1108 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
1110 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) ; \
1117 @if [ -f ./expect/Makefile ] ; then \
1118 rootme=`pwd` ; export rootme ; \
1119 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
1121 $(MAKE) $(FLAGS_TO_PASS) all) ; \
1126 install-expect: force
1127 @if [ -f ./expect/Makefile ] ; then \
1128 rootme=`pwd` ; export rootme ; \
1129 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
1131 $(MAKE) $(FLAGS_TO_PASS) install) ; \
1138 @if [ -f ./z8ksim/Makefile ] ; then \
1139 rootme=`pwd` ; export rootme ; \
1141 $(MAKE) $(FLAGS_TO_PASS) all) ; \
1146 install-z8ksim: force
1147 @if [ -f ./z8ksim/Makefile ] ; then \
1148 rootme=`pwd` ; export rootme ; \
1150 $(MAKE) $(FLAGS_TO_PASS) install) ; \
1156 all-h8300sim: all-bfd
1157 @if [ -f ./h8300sim/Makefile ] ; then \
1158 rootme=`pwd` ; export rootme ; \
1160 $(MAKE) $(FLAGS_TO_PASS) all) ; \
1165 install-h8300sim: force
1166 @if [ -f ./h8300sim/Makefile ] ; then \
1167 rootme=`pwd` ; export rootme ; \
1169 $(MAKE) $(FLAGS_TO_PASS) install) ; \
1176 all-fileutils: force
1177 @if [ -f ./fileutils/Makefile ] ; then \
1178 rootme=`pwd` ; export rootme ; \
1179 (cd ./fileutils; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1184 install-fileutils: force
1185 @if [ -f ./fileutils/Makefile ] ; then \
1186 rootme=`pwd` ; export rootme ; \
1187 (cd ./fileutils; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1194 @if [ -f ./find/Makefile ] ; then \
1195 rootme=`pwd` ; export rootme ; \
1196 (cd ./find; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1202 @if [ -f ./find/Makefile ] ; then \
1203 rootme=`pwd` ; export rootme ; \
1204 (cd ./find; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1211 @if [ -f ./gawk/Makefile ] ; then \
1212 rootme=`pwd` ; export rootme ; \
1213 (cd ./gawk; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1219 @if [ -f ./gawk/Makefile ] ; then \
1220 rootme=`pwd` ; export rootme ; \
1221 (cd ./gawk; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1227 all-m4: all-libiberty
1228 @if [ -f ./m4/Makefile ] ; then \
1229 rootme=`pwd` ; export rootme ; \
1230 (cd ./m4; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1236 @if [ -f ./m4/Makefile ] ; then \
1237 rootme=`pwd` ; export rootme ; \
1238 (cd ./m4; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1245 @if [ -f ./sed/Makefile ] ; then \
1246 rootme=`pwd` ; export rootme ; \
1247 (cd ./sed; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1253 @if [ -f ./sed/Makefile ] ; then \
1254 rootme=`pwd` ; export rootme ; \
1255 (cd ./sed; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1262 @if [ -f ./time/Makefile ] ; then \
1263 rootme=`pwd` ; export rootme ; \
1264 (cd ./time; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1270 @if [ -f ./time/Makefile ] ; then \
1271 rootme=`pwd` ; export rootme ; \
1272 (cd ./time; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1279 @if [ -f ./wdiff/Makefile ] ; then \
1280 rootme=`pwd` ; export rootme ; \
1281 (cd ./wdiff; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1286 install-wdiff: force
1287 @if [ -f ./wdiff/Makefile ] ; then \
1288 rootme=`pwd` ; export rootme ; \
1289 (cd ./wdiff; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1295 all-shellutils: force
1296 @if [ -f ./shellutils/Makefile ] ; then \
1297 rootme=`pwd` ; export rootme ; \
1298 (cd ./shellutils; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1303 install-shellutils: force
1304 @if [ -f ./shellutils/Makefile ] ; then \
1305 rootme=`pwd` ; export rootme ; \
1306 (cd ./shellutils; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1312 all-textutils: force
1313 @if [ -f ./textutils/Makefile ] ; then \
1314 rootme=`pwd` ; export rootme ; \
1315 (cd ./textutils; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1320 install-textutils: force
1321 @if [ -f ./textutils/Makefile ] ; then \
1322 rootme=`pwd` ; export rootme ; \
1323 (cd ./textutils; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1330 ### other supporting targets
1333 ### start-sanitize-chill
1335 ### WARNING: THIS IS VERY UGLY AND I DID NOT DO THIS WILLINGLY
1337 ### if you change the code for libg++ et al, also change the
1338 ### code for chillrt
1340 ### end-sanitize-chill
1341 @for i in $(DODIRS); do \
1342 if [ -f ./$$i/localenv ] || [ -f ./$$i/Makefile ] ; then \
1344 libg++ | xiberty | newlib) \
1345 if (rootme=`pwd` ; export rootme ; \
1346 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
1348 $(MAKE) $(TARGET_FLAGS_TO_PASS) $(DO)) ; then true ; \
1351 $(start-sanitize-chill) \
1353 if (rootme=`pwd` ; export rootme ; \
1354 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
1356 $(MAKE) $(TARGET_FLAGS_TO_PASS) $(DO)) ; then true ; \
1359 $(end-sanitize-chill) \
1361 if (rootme=`pwd` ; export rootme ; \
1362 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
1364 $(MAKE) $(GCC_FLAGS_TO_PASS) $(DO)) ; then true ; \
1368 if (rootme=`pwd` ; export rootme ; \
1370 $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \
1377 # The "else true" stuff is for Ultrix; the shell returns the exit code
1378 # of the "if" command, if no commands are run in the "then" or "else" part,
1379 # causing Make to quit.
1403 for i in $(MAKEDIRS) ; do \
1404 echo Making $$i... ; \
1405 parent=`echo $$i|sed -e 's@/[^/]*$$@@'`; \
1406 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
1407 if [ ! -d $$i ] ; then \
1408 if mkdir $$i ; then \
1419 if [ -d $(prefix) ] ; then true ; else mkdir $(prefix) ; fi
1422 $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new
1423 mv -f dir.info.new dir.info
1426 @echo "Building a full distribution of this tree isn't done"
1427 @echo "via 'make dist'. Check out the etc/ subdirectory"
1436 @for i in $(SUBDIRS); \
1440 wd=`basename $$pwd`; \
1441 for j in `$(MAKE) ls`; \
1449 # with the gnu make, this is done automatically.
1451 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
1452 $(SHELL) ./config.status
1455 # Build GDB distributions that contain BFD, Include, Libiberty, Readline, etc
1457 DEVO_SUPPORT= README Makefile.in configure configure.in \
1458 config.guess config.sub config etc move-if-change \
1460 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline glob
1461 GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS)
1466 ./configure -rm sun4
1467 chmod og=u `find $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
1469 gdb.tar.Z: setup-dirs
1470 (cd gdb; $(MAKE) -f Makefile.in make-proto-gdb.dir)
1471 $(MAKE) $(MFLAGS) -f Makefile.in make-gdb.tar.Z
1473 make-gdb.tar.Z: $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS) gdb texinfo/texinfo.tex
1474 rm -rf proto-toplev; mkdir proto-toplev
1475 ln -s ../gdb/proto-gdb.dir proto-toplev/gdb
1476 (cd proto-toplev; for i in $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS); do \
1479 # Put only one copy (four hard links) of COPYING in the tar file.
1480 rm proto-toplev/bfd/COPYING
1481 ln proto-toplev/gdb/COPYING proto-toplev/bfd/COPYING
1482 rm proto-toplev/include/COPYING
1483 ln proto-toplev/gdb/COPYING proto-toplev/include/COPYING
1484 rm proto-toplev/readline/COPYING
1485 ln proto-toplev/gdb/COPYING proto-toplev/readline/COPYING
1487 # Take out texinfo and glob from configurable dirs
1488 rm proto-toplev/configure.in
1489 sed -e '/^host_tools=/s/texinfo //' \
1490 -e '/^host_libs=/s/glob //' \
1491 <configure.in >proto-toplev/configure.in
1493 # Take out texinfo from a few places; make simple BISON=bison line.
1494 rm proto-toplev/Makefile.in
1495 sed -e '/^all\.normal: /s/\all-texinfo //' \
1496 -e '/^ install-texinfo /d' \
1497 -e '\/^BISON =/,\/^$$/c\
1499 <Makefile.in >proto-toplev/Makefile.in
1501 mkdir proto-toplev/texinfo
1502 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1503 chmod og=u `find proto-toplev -print`
1504 (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
1505 echo "==> Making gdb-$$VER.tar.Z"; \
1506 ln -s proto-toplev gdb-$$VER; \
1507 tar cfh - gdb-$$VER \
1508 | compress -v >gdb-$$VER.tar.Z)
1511 # end of Makefile.in