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)
62 BISON = `if [ -f $${rootme}/byacc/byacc ] ; \
63 then echo $${rootme}/byacc/byacc ; \
67 LEX = `if [ -f $${rootme}/flex/flex ] ; \
68 then echo $${rootme}/flex/flex ; \
71 MAKEINFO = `if [ -f $${rootme}/texinfo/C/makeinfo ] ; \
72 then echo $${rootme}/texinfo/C/makeinfo ; \
73 else echo makeinfo ; fi`
75 # compilers to use to create programs which must be run in the build
78 CXX_FOR_BUILD = $(CXX)
80 SUBDIRS = libiberty mmalloc glob readline opcodes bfd z8ksim gdb binutils ld gas tgas gcc libg++ newlib deja-gnu
84 INSTALL_TARGET = install.all
90 if [ -f $${rootme}/gcc/Makefile ] ; then \
91 echo $${rootme}/gcc/gcc -B$${rootme}/gcc/; \
93 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
96 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
101 if [ -f $${rootme}/gcc/Makefile ] ; then \
102 echo $${rootme}/gcc/gcc -B$${rootme}/gcc/; \
104 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
107 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
112 if [ -f $${rootme}/gas/Makefile ] ; then \
113 echo $${rootme}/gas/as.new ; \
115 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
118 t='$(program_transform_name)'; echo as | sed -e '' $$t ; \
123 if [ -f $${rootme}/binutils/Makefile ] ; then \
124 echo $${rootme}/binutils/ar ; \
126 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
129 t='$(program_transform_name)'; echo ar | sed -e '' $$t ; \
133 RANLIB_FOR_TARGET = ` \
134 if [ -f $${rootme}/binutils/Makefile ] ; then \
135 echo $${rootme}/binutils/ranlib ; \
137 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
140 t='$(program_transform_name)'; echo ranlib | sed -e '' $$t ; \
145 if [ -f $${rootme}/binutils/Makefile ] ; then \
146 echo $${rootme}/binutils/nm ; \
148 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
151 t='$(program_transform_name)'; echo nm | sed -e '' $$t ; \
156 if [ -f $${rootme}/gcc/Makefile ] ; then \
157 if [ -f $${rootme}/newlib/Makefile ] ; then \
158 echo -I$${rootme}/newlib/targ-include -I$${srcroot}/newlib/libc/include -I$${rootme}/gcc/include -nostdinc ; \
160 echo -I$${rootme}/gcc/include ; \
167 #### host and target specific makefile fragments come in here.
170 # Flags to pass down to sub-makes -- please keep these in alphabetical order
173 "AR_FLAGS=$(AR_FLAGS)" \
175 "CXXFLAGS=$(CXXFLAGS)" \
176 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
178 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
180 "INSTALL=$(INSTALL)" \
181 "INSTALL_DATA=$(INSTALL_DATA)" \
182 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
183 "LDFLAGS=$(LDFLAGS)" \
185 "LOADLIBES=$(LOADLIBES)" \
186 "MAKEINFO=$(MAKEINFO)" \
188 "exec_prefix=$(exec_prefix)" \
192 # Flags that are concerned with the location of the X11 include files
194 X11_FLAGS_TO_PASS = \
195 "X11_INCLUDE_FLAGS=$(X11_INCLUDE_FLAGS)" \
196 "X11_LIB_FLAGS=$(X11_LIB_FLAGS)"
198 # Flags to pass down to makes which are built with the target
199 # environment (e.g. libg++, xiberty, newlib). -- keep these in alpha order please
200 TARGET_FLAGS_TO_PASS = \
201 "AR=$(AR_FOR_TARGET)" \
202 "AR_FLAGS=$(AR_FLAGS)" \
203 "AS=$(AS_FOR_TARGET)" \
205 "CXX=$(CXX_FOR_TARGET)" \
206 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
207 "CXXFLAGS=$(CXXFLAGS)" \
208 "CC=$(CC_FOR_TARGET)" \
209 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
211 "INSTALL=$(INSTALL)" \
212 "INSTALL_DATA=$(INSTALL_DATA)" \
213 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
214 "LDFLAGS=$(LDFLAGS)" \
216 "LOADLIBES=$(LOADLIBES)" \
217 "MAKEINFO=$(MAKEINFO)" \
218 "NM=$(NM_FOR_TARGET)" \
219 "RANLIB=$(RANLIB_FOR_TARGET)" \
220 "XTRAFLAGS=$(XTRAFLAGS)" \
221 "exec_prefix=$(exec_prefix)" \
225 # The first rule in the file had better be this one. Don't put any above it.
228 .PHONY: all info install-info clean-info distclean mostlyclean realclean
231 info check clean-info distclean mostlyclean realclean:
232 @rootme=`pwd` ; export rootme ; \
233 $(MAKE) $(FLAGS_TO_PASS) DO=info "DODIRS=$(SUBDIRS)" subdir_do
235 install-info: install-info-dirs force
236 -parent=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \
237 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
238 -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi
239 @rootme='pwd' ; export rootme ; $(MAKE) $(FLAGS_TO_PASS) DO=install-info "DODIRS=$(SUBDIRS)" subdir_do
240 @rootme='pwd' ; export rootme ; $(MAKE) $(FLAGS_TO_PASS) dir.info install-dir.info
243 -parent=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \
244 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
245 -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi
246 $(INSTALL_DATA) dir.info $(infodir)/dir.info
248 all.normal: all-m4 all-autoconf all-libiberty all-mmalloc all-texinfo \
249 all-byacc all-flex all-opcodes all-bfd all-ld all-gas all-tgas \
250 all-gcc all-binutils all-libg++ all-readline all-z8ksim all-gdb \
251 all-make all-rcs all-cvs all-diff all-grep \
252 all-patch all-emacs all-ispell all-etc \
253 all-tcl all-tk all-expect \
254 all-newlib all-gprof all-send_pr all-libm all-deja-gnu \
255 all-fileutils all-find all-gawk all-sed all-shellutils \
256 all-textutils all-time all-wdiff
259 all.cross: all-libiberty all-mmalloc all-gas all-byacc all-flex all-ld \
260 all-opcodes all-z8ksim all-bfd all-readline all-gdb all-binutils all-gcc \
261 all-newlib all-deja-gnu
265 @rootme=`pwd` ; export rootme ; \
266 $(MAKE) $(FLAGS_TO_PASS) DO=clean "DODIRS=$(SUBDIRS)" subdir_do
267 -rm -rf *.a TEMP errs core *.o *~ \#* TAGS *.E
270 @echo "the uninstall target is not supported in this tree"
272 install: $(INSTALL_TARGET)
273 -parent=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \
274 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
275 -if [ -d $(man1dir) ] ; then true ; else mkdir $(man1dir) ; fi
277 install.all: install-no-fixedincludes
278 @if [ -f ./gcc/Makefile ] ; then \
279 rootme=`pwd` ; export rootme ; \
281 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
286 install-no-fixedincludes: install-dirs gcc-no-fixedincludes \
320 install-fileutils install-find install-gawk install-m4 install-sed install-shellutils \
321 install-textutils install-time install-wdiff
323 gcc-no-fixedincludes:
324 @if [ -f ./gcc/Makefile ] ; then \
325 rootme=`pwd` ; export rootme ; \
327 $(MAKE) $(FLAGS_TO_PASS) install install-man \
328 "INSTALL_HEADERS=install-common-headers install-float-h install-limits-h") ; \
333 install.cross: install-dirs install-libiberty install-mmalloc \
334 install-binutils install-opcodes install-byacc install-flex \
335 install-ld install-gas install-readline \
336 install-glob install-gdb install-mmalloc \
337 install-newlib install-gcc install-etc install-deja-gnu
341 @if [ -f ./deja-gnu/Makefile ] ; then \
342 rootme=`pwd` ; export rootme ; \
343 (cd ./deja-gnu; $(MAKE) $(FLAGS_TO_PASS) all) ; \
348 install-deja-gnu: force
349 @if [ -f ./deja-gnu/Makefile ] ; then \
350 rootme=`pwd` ; export rootme ; \
351 (cd ./deja-gnu; $(MAKE) $(FLAGS_TO_PASS) install) ; \
358 @if [ -f ./autoconf/Makefile ] ; then \
359 rootme=`pwd` ; export rootme ; \
360 (cd ./autoconf; $(MAKE) $(FLAGS_TO_PASS) all) ; \
365 install-autoconf: force
366 @if [ -f ./autoconf/Makefile ] ; then \
367 rootme=`pwd` ; export rootme ; \
368 (cd ./autoconf; $(MAKE) $(FLAGS_TO_PASS) install) ; \
375 @if [ -f ./etc/Makefile ] ; then \
376 rootme=`pwd` ; export rootme ; \
377 (cd ./etc; $(MAKE) $(FLAGS_TO_PASS) all) ; \
383 @if [ -f ./etc/Makefile ] ; then \
384 rootme=`pwd` ; export rootme ; \
385 (cd ./etc; $(MAKE) $(FLAGS_TO_PASS) install) ; \
392 @if [ -f ./libiberty/Makefile ] ; then \
393 rootme=`pwd` ; export rootme ; \
395 $(MAKE) $(FLAGS_TO_PASS) all) ; \
400 install-libiberty: force
401 @if [ -f ./libiberty/Makefile ] ; then \
402 rootme=`pwd` ; export rootme ; \
404 $(MAKE) $(FLAGS_TO_PASS) install) ; \
410 all-xiberty: all-gcc all-newlib
411 @if [ -f ./xiberty/Makefile ] ; then \
412 rootme=`pwd` ; export rootme ; \
413 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
415 $(MAKE) $(FLAGS_TO_PASS) all) ; \
420 install-xiberty: force
421 @if [ -f ./xiberty/Makefile ] ; then \
422 rootme=`pwd` ; export rootme ; \
423 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
425 $(MAKE) $(FLAGS_TO_PASS) install) ; \
432 @if [ -f ./mmalloc/Makefile ] ; then \
433 rootme=`pwd` ; export rootme ; \
435 $(MAKE) $(FLAGS_TO_PASS) all) ; \
440 install-mmalloc: force
441 @if [ -f ./mmalloc/Makefile ] ; then \
442 rootme=`pwd` ; export rootme ; \
444 $(MAKE) $(FLAGS_TO_PASS) install) ; \
450 all-texinfo: all-libiberty
451 @if [ -f ./texinfo/Makefile ] ; then \
452 rootme=`pwd` ; export rootme ; \
454 $(MAKE) $(FLAGS_TO_PASS) all) ; \
459 install-texinfo: force
460 @if [ -f ./texinfo/Makefile ] ; then \
461 rootme=`pwd` ; export rootme ; \
463 $(MAKE) $(FLAGS_TO_PASS) install) ; \
470 @if [ -f ./bfd/Makefile ] ; then \
471 rootme=`pwd` ; export rootme ; \
473 $(MAKE) $(FLAGS_TO_PASS) all) ; \
479 @if [ -f ./bfd/Makefile ] ; then \
480 rootme=`pwd` ; export rootme ; \
482 $(MAKE) $(FLAGS_TO_PASS) install) ; \
490 @if [ -f ./opcodes/Makefile ] ; then \
491 rootme=`pwd` ; export rootme ; \
493 $(MAKE) $(FLAGS_TO_PASS) all) ; \
498 install-opcodes: force
499 @if [ -f ./opcodes/Makefile ] ; then \
500 rootme=`pwd` ; export rootme ; \
502 $(MAKE) $(FLAGS_TO_PASS) install) ; \
508 all-binutils: all-opcodes all-libiberty all-bfd all-flex
509 @if [ -f ./binutils/Makefile ] ; then \
510 rootme=`pwd` ; export rootme ; \
512 $(MAKE) $(FLAGS_TO_PASS) all) ; \
517 install-binutils: force
518 @if [ -f ./binutils/Makefile ] ; then \
519 rootme=`pwd` ; export rootme ; \
521 $(MAKE) $(FLAGS_TO_PASS) install) ; \
527 all-newlib: all-binutils all-ld all-gas all-gcc
528 @if [ -f ./newlib/Makefile ] ; then \
529 rootme=`pwd` ; export rootme ; \
530 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
532 $(MAKE) $(TARGET_FLAGS_TO_PASS) all) ; \
537 install-newlib: force
538 @if [ -f ./newlib/Makefile ] ; then \
539 rootme=`pwd` ; export rootme ; \
540 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
542 $(MAKE) $(TARGET_FLAGS_TO_PASS) install) ; \
548 all-gprof: all-libiberty all-bfd
549 @if [ -f ./gprof/Makefile ] ; then \
550 rootme=`pwd` ; export rootme ; \
552 $(MAKE) $(FLAGS_TO_PASS) all) ; \
558 @if [ -f ./gprof/Makefile ] ; then \
559 rootme=`pwd` ; export rootme ; \
561 $(MAKE) $(FLAGS_TO_PASS) install) ; \
568 @if [ -f ./byacc/Makefile ] ; then \
569 rootme=`pwd` ; export rootme ; \
571 $(MAKE) $(FLAGS_TO_PASS) all) ; \
577 @if [ -f ./byacc/Makefile ] ; then \
578 rootme=`pwd` ; export rootme ; \
580 $(MAKE) $(FLAGS_TO_PASS) install) ; \
586 all-flex: all-libiberty
587 @if [ -f ./flex/Makefile ] ; then \
588 rootme=`pwd` ; export rootme ; \
590 $(MAKE) $(FLAGS_TO_PASS) all) ; \
596 @if [ -f ./flex/Makefile ] ; then \
597 rootme=`pwd` ; export rootme ; \
599 $(MAKE) $(FLAGS_TO_PASS) install) ; \
604 all-gcc: all-libiberty all-byacc all-binutils
605 @if [ -f ./gcc/Makefile ] ; then \
606 rootme=`pwd` ; export rootme ; \
608 $(MAKE) $(FLAGS_TO_PASS) all) ; \
614 @if [ -f ./gcc/Makefile ] ; then \
615 rootme=`pwd` ; export rootme ; \
617 $(MAKE) $(FLAGS_TO_PASS) install) ; \
624 @if [ -f ./readline/Makefile ] ; then \
625 rootme=`pwd` ; export rootme ; \
627 $(MAKE) $(FLAGS_TO_PASS) all) ; \
632 install-readline: force
633 @if [ -f ./readline/Makefile ] ; then \
634 rootme=`pwd` ; export rootme ; \
636 $(MAKE) $(FLAGS_TO_PASS) install) ; \
643 @if [ -f ./glob/Makefile ] ; then \
644 rootme=`pwd` ; export rootme ; \
646 $(MAKE) $(FLAGS_TO_PASS) all) ; \
652 @if [ -f ./glob/Makefile ] ; then \
653 rootme=`pwd` ; export rootme ; \
655 $(MAKE) $(FLAGS_TO_PASS) install) ; \
661 all-gas: all-libiberty all-opcodes all-bfd
662 @if [ -f ./gas/Makefile ] ; then \
663 rootme=`pwd` ; export rootme ; \
665 $(MAKE) $(FLAGS_TO_PASS) all) ; \
671 @if [ -f ./gas/Makefile ] ; then \
672 rootme=`pwd` ; export rootme ; \
674 $(MAKE) $(FLAGS_TO_PASS) install) ; \
680 all-tgas: all-libiberty all-bfd
681 @if [ -f ./tgas/Makefile ] ; then \
682 rootme=`pwd` ; export rootme ; \
684 $(MAKE) $(FLAGS_TO_PASS) all) ; \
691 all-ld: all-libiberty all-bfd all-byacc all-flex
692 @if [ -f ./ld/Makefile ] ; then \
693 rootme=`pwd` ; export rootme ; \
695 $(MAKE) $(FLAGS_TO_PASS) all) ; \
701 @if [ -f ./ld/Makefile ] ; then \
702 rootme=`pwd` ; export rootme ; \
704 $(MAKE) $(FLAGS_TO_PASS) install) ; \
710 all-gdb: all-bfd all-opcodes all-libiberty all-mmalloc all-readline all-glob all-byacc
711 @if [ -f ./gdb/Makefile ] ; then \
712 rootme=`pwd` ; export rootme ; \
714 $(MAKE) $(FLAGS_TO_PASS) all) ; \
720 @if [ -f ./gdb/Makefile ] ; then \
721 rootme=`pwd` ; export rootme ; \
723 $(MAKE) $(FLAGS_TO_PASS) install) ; \
729 all-make: all-libiberty
730 @if [ -f ./make/Makefile ] ; then \
731 rootme=`pwd` ; export rootme ; \
733 $(MAKE) $(FLAGS_TO_PASS) all) ; \
739 @if [ -f ./make/Makefile ] ; then \
740 rootme=`pwd` ; export rootme ; \
742 $(MAKE) $(FLAGS_TO_PASS) install) ; \
749 @if [ -f ./diff/Makefile ] ; then \
750 rootme=`pwd` ; export rootme ; \
752 $(MAKE) $(FLAGS_TO_PASS) all) ; \
758 @if [ -f ./diff/Makefile ] ; then \
759 rootme=`pwd` ; export rootme ; \
761 $(MAKE) $(FLAGS_TO_PASS) install) ; \
768 @if [ -f ./grep/Makefile ] ; then \
769 rootme=`pwd` ; export rootme ; \
771 $(MAKE) $(FLAGS_TO_PASS) all) ; \
777 @if [ -f ./grep/Makefile ] ; then \
778 rootme=`pwd` ; export rootme ; \
780 $(MAKE) $(FLAGS_TO_PASS) install) ; \
787 @if [ -f ./rcs/Makefile ] ; then \
788 rootme=`pwd` ; export rootme ; \
790 $(MAKE) $(FLAGS_TO_PASS) all) ; \
796 @if [ -f ./rcs/Makefile ] ; then \
797 rootme=`pwd` ; export rootme ; \
799 $(MAKE) $(FLAGS_TO_PASS) install) ; \
806 @if [ -f ./cvs/Makefile ] ; then \
807 rootme=`pwd` ; export rootme ; \
809 $(MAKE) $(FLAGS_TO_PASS) all) ; \
815 @if [ -f ./cvs/Makefile ] ; then \
816 rootme=`pwd` ; export rootme ; \
818 $(MAKE) $(FLAGS_TO_PASS) install) ; \
825 @if [ -f ./patch/Makefile ] ; then \
826 rootme=`pwd` ; export rootme ; \
828 $(MAKE) $(FLAGS_TO_PASS) all) ; \
834 @if [ -f ./patch/Makefile ] ; then \
835 rootme=`pwd` ; export rootme ; \
837 $(MAKE) $(FLAGS_TO_PASS) \
839 man1dir=$(man1dir) install) ; \
846 @if [ -f ./emacs/Makefile ] ; then \
847 rootme=`pwd` ; export rootme ; \
849 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) ; \
855 @if [ -f ./emacs/Makefile ] ; then \
856 rootme=`pwd` ; export rootme ; \
858 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) ; \
864 all-ispell: all-emacs
865 @if [ -f ./ispell/Makefile ] ; then \
866 rootme=`pwd` ; export rootme ; \
868 $(MAKE) $(FLAGS_TO_PASS) all) ; \
873 install-ispell: force
874 @if [ -f ./ispell/Makefile ] ; then \
875 rootme=`pwd` ; export rootme ; \
877 $(MAKE) $(FLAGS_TO_PASS) install) ; \
884 @if [ -f ./send_pr/Makefile ] ; then \
885 rootme=`pwd` ; export rootme ; \
887 $(MAKE) $(FLAGS_TO_PASS) all) ; \
892 install-send_pr: force
893 @if [ -f ./send_pr/Makefile ] ; then \
894 rootme=`pwd` ; export rootme ; \
896 $(MAKE) $(FLAGS_TO_PASS) install) ; \
903 @if [ -f ./libm/Makefile ] ; then \
904 rootme=`pwd` ; export rootme ; \
906 $(MAKE) $(FLAGS_TO_PASS) all) ; \
912 @if [ -f ./libm/Makefile ] ; then \
913 rootme=`pwd` ; export rootme ; \
915 $(MAKE) $(FLAGS_TO_PASS) install) ; \
922 all-libg++: all-gas all-ld all-gcc all-xiberty all-newlib
923 @if [ -f ./libg++/Makefile ] ; then \
924 rootme=`pwd` ; export rootme ; \
925 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
927 $(MAKE) $(TARGET_FLAGS_TO_PASS) all) ; \
932 install-libg++: force
933 @if [ -f ./libg++/Makefile ] ; then \
934 rootme=`pwd` ; export rootme ; \
935 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
937 $(MAKE) $(TARGET_FLAGS_TO_PASS) install) ; \
943 @if [ -f ./tcl/Makefile ] ; then \
944 rootme=`pwd` ; export rootme ; \
945 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
947 $(MAKE) $(FLAGS_TO_PASS) all) ; \
953 @if [ -f ./tcl/Makefile ] ; then \
954 rootme=`pwd` ; export rootme ; \
955 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
957 $(MAKE) $(FLAGS_TO_PASS) install) ; \
965 @if [ -f ./tk/Makefile ] ; then \
966 rootme=`pwd` ; export rootme ; \
967 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
969 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) ; \
975 @if [ -f ./tk/Makefile ] ; then \
976 rootme=`pwd` ; export rootme ; \
977 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
979 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) ; \
986 @if [ -f ./expect/Makefile ] ; then \
987 rootme=`pwd` ; export rootme ; \
988 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
990 $(MAKE) $(FLAGS_TO_PASS) all) ; \
995 install-expect: force
996 @if [ -f ./expect/Makefile ] ; then \
997 rootme=`pwd` ; export rootme ; \
998 srcroot=`cd $(srcdir); pwd`; export srcroot ; \
1000 $(MAKE) $(FLAGS_TO_PASS) install) ; \
1007 @if [ -f ./z8ksim/Makefile ] ; then \
1008 rootme=`pwd` ; export rootme ; \
1010 $(MAKE) $(FLAGS_TO_PASS) all) ; \
1015 install-z8ksim: force
1016 @if [ -f ./z8ksim/Makefile ] ; then \
1017 rootme=`pwd` ; export rootme ; \
1019 $(MAKE) $(FLAGS_TO_PASS) install) ; \
1025 all-fileutils: force
1026 @if [ -f ./fileutils/Makefile ] ; then \
1027 rootme=`pwd` ; export rootme ; \
1028 (cd ./fileutils; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1033 install-fileutils: force
1034 @if [ -f ./fileutils/Makefile ] ; then \
1035 rootme=`pwd` ; export rootme ; \
1036 (cd ./fileutils; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1043 @if [ -f ./find/Makefile ] ; then \
1044 rootme=`pwd` ; export rootme ; \
1045 (cd ./find; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1051 @if [ -f ./find/Makefile ] ; then \
1052 rootme=`pwd` ; export rootme ; \
1053 (cd ./find; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1060 @if [ -f ./gawk/Makefile ] ; then \
1061 rootme=`pwd` ; export rootme ; \
1062 (cd ./gawk; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1068 @if [ -f ./gawk/Makefile ] ; then \
1069 rootme=`pwd` ; export rootme ; \
1070 (cd ./gawk; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1076 all-m4: all-libiberty
1077 @if [ -f ./m4/Makefile ] ; then \
1078 rootme=`pwd` ; export rootme ; \
1079 (cd ./m4; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1085 @if [ -f ./m4/Makefile ] ; then \
1086 rootme=`pwd` ; export rootme ; \
1087 (cd ./m4; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1094 @if [ -f ./sed/Makefile ] ; then \
1095 rootme=`pwd` ; export rootme ; \
1096 (cd ./sed; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1102 @if [ -f ./sed/Makefile ] ; then \
1103 rootme=`pwd` ; export rootme ; \
1104 (cd ./sed; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1111 @if [ -f ./time/Makefile ] ; then \
1112 rootme=`pwd` ; export rootme ; \
1113 (cd ./time; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1119 @if [ -f ./time/Makefile ] ; then \
1120 rootme=`pwd` ; export rootme ; \
1121 (cd ./time; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1128 @if [ -f ./wdiff/Makefile ] ; then \
1129 rootme=`pwd` ; export rootme ; \
1130 (cd ./wdiff; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1135 install-wdiff: force
1136 @if [ -f ./wdiff/Makefile ] ; then \
1137 rootme=`pwd` ; export rootme ; \
1138 (cd ./wdiff; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1144 all-shellutils: force
1145 @if [ -f ./shellutils/Makefile ] ; then \
1146 rootme=`pwd` ; export rootme ; \
1147 (cd ./shellutils; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1152 install-shellutils: force
1153 @if [ -f ./shellutils/Makefile ] ; then \
1154 rootme=`pwd` ; export rootme ; \
1155 (cd ./shellutils; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1161 all-textutils: force
1162 @if [ -f ./textutils/Makefile ] ; then \
1163 rootme=`pwd` ; export rootme ; \
1164 (cd ./textutils; $(MAKE) $(FLAGS_TO_PASS) all) ; \
1169 install-textutils: force
1170 @if [ -f ./textutils/Makefile ] ; then \
1171 rootme=`pwd` ; export rootme ; \
1172 (cd ./textutils; $(MAKE) $(FLAGS_TO_PASS) install) ; \
1179 ### other supporting targets
1182 @for i in $(DODIRS); do \
1183 if [ -f ./$$i/localenv ] || [ -f ./$$i/Makefile ] ; then \
1185 libg++ | xiberty | newlib) \
1186 if (rootme=`pwd` ; export rootme ; \
1187 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
1189 $(MAKE) $(TARGET_FLAGS_TO_PASS) $(DO)) ; then true ; \
1193 if (rootme=`pwd` ; export rootme ; \
1195 $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \
1202 # The "else true" stuff is for Ultrix; the shell returns the exit code
1203 # of the "if" command, if no commands are run in the "then" or "else" part,
1204 # causing Make to quit.
1228 for i in $(MAKEDIRS) ; do \
1229 echo Making $$i... ; \
1230 parent=`echo $$i|sed -e 's@/[^/]*$$@@'`; \
1231 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
1232 if [ ! -d $$i ] ; then \
1233 if mkdir $$i ; then \
1244 if [ -d $(prefix) ] ; then true ; else mkdir $(prefix) ; fi
1247 $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new
1248 mv -f dir.info.new dir.info
1251 @echo "Building a full distribution of this tree isn't done"
1252 @echo "via 'make dist'. Check out the etc/ subdirectory"
1261 @for i in $(SUBDIRS); \
1265 wd=`basename $$pwd`; \
1266 for j in `$(MAKE) ls`; \
1274 # with the gnu make, this is done automatically.
1276 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
1277 $(SHELL) ./config.status
1280 # Build GDB distributions that contain BFD, Include, Libiberty, Readline, etc
1282 DEVO_SUPPORT= README cfg-paper.texi Makefile.in configure configure.in \
1283 config.sub config configure.man configure.texi move-if-change \
1285 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline glob
1286 GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS) texinfo/fsf/texinfo.tex
1291 ./configure -rm sun4
1292 chmod og=u `find $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
1294 gdb.tar.Z: setup-dirs
1295 (cd gdb; $(MAKE) -f Makefile.in make-proto-gdb.dir)
1296 $(MAKE) $(MFLAGS) -f Makefile.in make-gdb.tar.Z
1298 make-gdb.tar.Z: $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS) gdb texinfo/fsf/texinfo.tex
1299 rm -rf proto-toplev; mkdir proto-toplev
1300 ln -s ../gdb/proto-gdb.dir proto-toplev/gdb
1301 (cd proto-toplev; for i in $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS); do \
1304 # Put only one copy (four hard links) of COPYING in the tar file.
1305 rm proto-toplev/bfd/COPYING
1306 ln proto-toplev/gdb/COPYING proto-toplev/bfd/COPYING
1307 rm proto-toplev/include/COPYING
1308 ln proto-toplev/gdb/COPYING proto-toplev/include/COPYING
1309 rm proto-toplev/readline/COPYING
1310 ln proto-toplev/gdb/COPYING proto-toplev/readline/COPYING
1311 # Take out texinfo from configurable dirs
1312 rm proto-toplev/configure.in
1313 sed '/^configdirs=/s/texinfo //' <configure.in >proto-toplev/configure.in
1314 # Take out glob from buildable dirs
1315 rm proto-toplev/Makefile.in
1317 sed -e '/^SUBDIRS =/s/glob //' \
1318 -e '/^all\.normal: /s/\all-texinfo //' \
1319 -e '/^clean: /s/clean-texinfo //' \
1320 -e '/^install\.all: /s/install-texinfo //' \
1321 <Makefile.in >proto-toplev/Makefile.in
1323 mkdir proto-toplev/texinfo
1324 mkdir proto-toplev/texinfo/fsf
1325 ln -s ../../../texinfo/fsf/texinfo.tex proto-toplev/texinfo/fsf/
1326 chmod og=u `find proto-toplev -print`
1327 (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
1328 echo "==> Making gdb-$$VER.tar.Z"; \
1329 ln -s proto-toplev gdb-$$VER; \
1330 tar cfh - gdb-$$VER \
1331 | compress -v >gdb-$$VER.tar.Z)
1334 # end of Makefile.in