2 # Makefile for directory with subdirs to build.
3 # Copyright (C) 1990, 1991, 1992, 1993 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
27 tooldir
= $(exec_prefix)/$(target
)
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
)
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 ; \
75 LEX
= `if [ -f $${rootme}/flex/flex ] ; \
76 then echo $${rootme}/flex/flex ; \
79 MAKEINFO
= `if [ -f $${rootme}/texinfo/makeinfo/makeinfo ] ; \
80 then echo $${rootme}/texinfo/makeinfo/makeinfo ; \
81 else echo makeinfo ; fi`
83 EXPECT
= `if [ -f $${rootme}/expect/expect ] ; \
84 then echo $${rootme}/expect/expect ; \
85 else echo expect ; fi`
87 RUNTEST
= `if [ -f $${srcroot}/dejagnu/runtest ] ; \
88 then echo $${srcroot}/dejagnu/runtest ; \
89 else echo runtest ; fi`
92 # libraries that may need to be augmented on a system-by-system basis
95 # compilers to use to create programs which must be run in the build
98 CXX_FOR_BUILD
= $(CXX
)
100 SUBDIRS
= "this is set via configure, don't edit this"
104 INSTALL_TARGET
= install-dirs
$(INSTALL_MODULES
) $(INSTALL_TARGET_MODULES
) $(INSTALL_X11_MODULES
)
107 if [ -f $${rootme}/gcc/Makefile ] ; then \
108 echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/; \
110 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
113 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
117 # start-sanitize-chill
118 CHILL_FOR_TARGET
= ` \
119 if [ -f $${rootme}/gcc/Makefile ] ; then \
120 echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/ -L$${rootme}/chillrt/; \
122 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
125 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
132 if [ -f $${rootme}/gcc/Makefile ] ; then \
133 echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/; \
135 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
138 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
143 if [ -f $${rootme}/gas/Makefile ] ; then \
144 echo $${rootme}/gas/as.new ; \
146 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
149 t='$(program_transform_name)'; echo as | sed -e '' $$t ; \
154 if [ -f $${rootme}/binutils/Makefile ] ; then \
155 echo $${rootme}/binutils/ar ; \
157 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
160 t='$(program_transform_name)'; echo ar | sed -e '' $$t ; \
164 RANLIB_FOR_TARGET
= ` \
165 if [ -f $${rootme}/binutils/Makefile ] ; then \
166 echo $${rootme}/binutils/ranlib ; \
168 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
171 t='$(program_transform_name)'; echo ranlib | sed -e '' $$t ; \
176 if [ -f $${rootme}/binutils/Makefile ] ; then \
177 echo $${rootme}/binutils/nm ; \
179 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
182 t='$(program_transform_name)'; echo nm | sed -e '' $$t ; \
186 # FIXME: This is badly named.
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 ; \
200 #### host and target specific makefile fragments come in here.
203 # Flags to pass down to all sub-makes.
204 # Please keep these in alphabetical order.
205 BASE_FLAGS_TO_PASS
= \
206 "AR_FLAGS=$(AR_FLAGS)" \
207 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
208 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
210 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
211 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
213 $(start-sanitize-chill
)\
214 "CHILLFLAGS=$(CHILLFLAGS)" \
215 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
216 "CHILL_LIB=$(CHILL_LIB)" \
217 $(end-sanitize-chill
)\
218 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
219 "CXXFLAGS=$(CXXFLAGS)" \
220 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
221 'GCC_FOR_TARGET=$$(CC_FOR_TARGET)' \
222 "INSTALL=$(INSTALL)" \
223 "INSTALL_DATA=$(INSTALL_DATA)" \
224 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
225 "LDFLAGS=$(LDFLAGS)" \
227 "LOADLIBES=$(LOADLIBES)" \
228 "MAKEINFO=$(MAKEINFO)" \
229 "MUNCH_NM=$(MUNCH_NM)" \
230 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
232 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
234 "RUNTEST=$(RUNTEST)" \
235 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
236 "XTRAFLAGS_FOR_TARGET=$(XTRAFLAGS)" \
237 "exec_prefix=$(exec_prefix)" \
241 # Flags to pass down to most sub-makes, in which we're building with
242 # the host environment.
243 # If any variables are added here, they must be added to do-*, below.
253 FLAGS_TO_PASS
= $(BASE_FLAGS_TO_PASS
) $(EXTRA_HOST_FLAGS
)
255 # Flags that are concerned with the location of the X11 include files
257 X11_FLAGS_TO_PASS
= \
258 "X11_INCLUDE_FLAGS=$(X11_INCLUDE_FLAGS)" \
259 "X11_LIB_FLAGS=$(X11_LIB_FLAGS)" \
262 # Flags to pass down to makes which are built with the target environment.
263 # The double $ decreases the length of the command line; the variables
264 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
265 # If any variables are added here, they must be added to do-*, below.
266 EXTRA_TARGET_FLAGS
= \
267 'AR=$$(AR_FOR_TARGET)' \
268 'AS=$$(AS_FOR_TARGET)' \
269 'CC=$$(CC_FOR_TARGET)' \
270 'CXX=$$(CXX_FOR_TARGET)' \
271 'NM=$$(NM_FOR_TARGET)' \
272 'RANLIB=$$(RANLIB_FOR_TARGET)' \
273 'XTRAFLAGS=$$(XTRAFLAGS_FOR_TARGET)'
275 TARGET_FLAGS_TO_PASS
= $(BASE_FLAGS_TO_PASS
) $(EXTRA_TARGET_FLAGS
)
277 # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
278 # unfortunately needs the native compiler and the target ar and
280 # If any variables are added here, they must be added to do-*, below.
281 # The HOST_* variables are a special case, which are used for the gcc
282 # cross-building scheme.
283 HOST_CC
= $(CC_FOR_BUILD
)
285 HOST_PREFIX_1
= loser-
287 'AR=$$(AR_FOR_TARGET)' \
291 'HOST_CC=$(CC_FOR_BUILD)' \
292 'HOST_PREFIX=$(HOST_PREFIX)' \
293 'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
295 'RANLIB=$$(RANLIB_FOR_TARGET)' \
298 GCC_FLAGS_TO_PASS
= $(BASE_FLAGS_TO_PASS
) $(EXTRA_GCC_FLAGS
)
300 # This is a list of the targets for all of the modules which are compiled
301 # using $(FLAGS_TO_PASS).
348 # This is a list of the check targets for all of the modules which are
349 # compiled using $(FLAGS_TO_PASS).
395 # This is a list of the install targets for all of the modules which are
396 # compiled using $(FLAGS_TO_PASS).
443 # This is a list of the targets for all of the modules which are compiled
444 # using $(X11_FLAGS_TO_PASS).
451 # This is a list of the check targets for all of the modules which are
452 # compiled using $(X11_FLAGS_TO_PASS).
453 CHECK_X11_MODULES
= \
459 # This is a list of the install targets for all the modules which are
460 # compiled using $(X11_FLAGS_TO_PASS).
461 INSTALL_X11_MODULES
= \
467 # This is a list of the targets for all of the modules which are compiled
468 # using $(TARGET_FLAGS_TO_PASS).
469 ALL_TARGET_MODULES
= \
470 $(start-sanitize-chill
) \
472 $(end-sanitize-chill
) \
477 # This is a list of the check targets for all of the modules which are
478 # compiled using $(TARGET_FLAGS_TO_PASS).
479 CHECK_TARGET_MODULES
= \
480 $(start-sanitize-chill
) \
482 $(end-sanitize-chill
) \
487 # This is a list of the install targets for all of the modules which are
488 # compiled using $(TARGET_FLAGS_TO_PASS).
489 INSTALL_TARGET_MODULES
= \
490 $(start-sanitize-chill
) \
492 $(end-sanitize-chill
) \
497 # This is a shell case of all modules which are compiled using
498 # $(TARGET_FLAGS_TO_PASS), used in the do-X rule.
499 TARGET_LIBS
= libg
++ | newlib | xiberty
500 # start-sanitize-chill
501 TARGET_LIBS
= chillrt | libg
++ | newlib | xiberty
504 # The first rule in the file had better be this one. Don't put any above it.
508 # The target built for a native build.
512 $(ALL_TARGET_MODULES
) \
516 # The target built for a cross build.
533 $(ALL_TARGET_MODULES
)
535 # Do a target for all the subdirectories. A ``make do-X'' will do a
536 # ``make X'' in all subdirectories (because, in general, there is a
537 # dependency (below) of X upon do-X, a ``make X'' will also do this,
538 # but it may do additional work as well).
539 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
540 # because it is so large that it can easily overflow the command line
541 # length limit on some systems.
553 @target
=`echo $@ | sed -e 's/^do-//'`; \
554 rootme
=`pwd`; export rootme
; \
555 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
556 for i in
$(SUBDIRS
); do \
557 if
[ -f .
/$$i/Makefile
]; then \
560 for flag in
$(EXTRA_TARGET_FLAGS
); do \
561 eval
`echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
565 for flag in
$(EXTRA_GCC_FLAGS
); do \
566 eval
`echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
570 for flag in
$(EXTRA_HOST_FLAGS
); do \
571 eval
`echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
575 export AR AS CC CXX NM RANLIB XTRAFLAGS
; \
577 $(MAKE
) $(BASE_FLAGS_TO_PASS
) "AR=$${AR}" "AS=$${AS}" \
578 "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
579 "RANLIB=$${RANLIB}" "XTRAFLAGS=$${XTRAFLAGS}" \
581 then true
; else exit
1; fi
; \
585 # Here are the targets which correspond to the do-X targets.
587 .PHONY
: info installcheck dvi install-info
588 .PHONY
: clean distclean mostlyclean realclean local-clean local-distclean
590 installcheck: do-installcheck
593 install-info
: install-info-dirs do-install-info
dir.
info
594 if
[ -f
dir.
info ] ; then \
595 $(INSTALL_DATA
) dir.
info $(infodir)/dir.
info ; \
598 do-install-info
: install-info-dirs
601 -rm -f
*.a TEMP errs core
*.o
*~ \
#* TAGS *.E
604 -rm -f Makefile config.status
606 clean: do-clean local-clean
607 mostlyclean: do-mostlyclean local-clean
608 distclean: do-distclean local-clean local-distclean
609 realclean: do-realclean local-clean local-distclean
614 check: $(CHECK_MODULES
) \
615 $(CHECK_TARGET_MODULES
) \
616 $(CHECK_X11_MODULES
) \
619 # Installation targets.
621 .PHONY
: install uninstall vault-install
622 install: $(INSTALL_TARGET
)
625 @echo
"the uninstall target is not supported in this tree"
628 @if
[ -f .
/release
/vault-install
] ; then \
629 .
/release
/vault-install
$(host_alias
) $(target_alias
) ; \
635 install.
all: install-no-fixedincludes
636 @if
[ -f .
/gcc
/Makefile
] ; then \
637 rootme
=`pwd` ; export rootme
; \
639 $(MAKE
) $(FLAGS_TO_PASS
) install-headers
) ; \
644 # install-no-fixedincludes is used because Cygnus can not distribute
645 # the fixed header files.
646 .PHONY
: install-no-fixedincludes
647 install-no-fixedincludes
: \
650 $(INSTALL_TARGET_MODULES
) \
651 $(INSTALL_X11_MODULES
) \
652 gcc-no-fixedincludes \
654 # Install the gcc headers files, but not the fixed include files,
655 # which Cygnus is not allowed to distribute. This rule is very
656 # dependent on the workings of the gcc Makefile.in.
657 .PHONY
: gcc-no-fixedincludes
658 gcc-no-fixedincludes
:
659 @if
[ -f .
/gcc
/Makefile
]; then \
660 rm -rf gcc
/tmp-include
; \
661 mv gcc
/include gcc
/tmp-include
2>/dev
/null
; \
663 cp
$(srcdir)/gcc
/gsyslimits.h gcc
/include/syslimits.h
; \
664 touch gcc
/stmp-fixinc
; \
665 rm -f gcc
/stmp-headers gcc
/stmp-int-hdrs
; \
666 rootme
=`pwd`; export rootme
; \
667 srcroot
=`cd $(srcdir); pwd` ; export srcroot
; \
669 $(MAKE
) $(GCC_FLAGS_TO_PASS
) install); \
670 rm -rf gcc
/include; \
671 mv gcc
/tmp-include gcc
/include 2>/dev
/null
; \
674 .PHONY
: install.cross
691 $(INSTALL_TARGET_MODULES
)
693 # This rule is used to build the modules which use FLAGS_TO_PASS. To
694 # build a target all-X means to cd to X and make all.
695 # all-glob is handled specially because it doesn't actually build.
696 .PHONY
: $(ALL_MODULES
) all-glob
697 $(ALL_MODULES
) all-glob
:
698 @
dir=`echo $@ | sed -e 's/all-//'`; \
699 if
[ -f .
/$${dir}/Makefile
] ; then \
700 rootme
=`pwd`; export rootme
; \
701 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
702 (cd
$${dir}; $(MAKE
) $(FLAGS_TO_PASS
) all); \
707 # This rule is used to check the modules which use FLAGS_TO_PASS. To
708 # build a target check-X means to cd to X and make all.
709 .PHONY
: $(CHECK_MODULES
)
711 @
dir=`echo $@ | sed -e 's/check-//'`; \
712 if
[ -f .
/$${dir}/Makefile
] ; then \
713 rootme
=`pwd`; export rootme
; \
714 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
715 (cd
$${dir}; $(MAKE
) $(FLAGS_TO_PASS
) check); \
720 # This rule is used to install the modules which use FLAGS_TO_PASS.
721 # To build a target install-X means to cd to X and make install.
722 .PHONY
: $(INSTALL_MODULES
)
723 $(INSTALL_MODULES
): install-dirs
724 @
dir=`echo $@ | sed -e 's/install-//'`; \
725 if
[ -f .
/$${dir}/Makefile
] ; then \
726 rootme
=`pwd`; export rootme
; \
727 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
728 (cd
$${dir}; $(MAKE
) install); \
733 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
734 # To build a target all-X means to cd to X and make all.
735 .PHONY
: $(ALL_TARGET_MODULES
)
736 $(ALL_TARGET_MODULES
):
737 @
dir=`echo $@ | sed -e 's/all-//'`; \
738 if
[ -f .
/$${dir}/Makefile
] ; then \
739 rootme
=`pwd`; export rootme
; \
740 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
741 (cd
$${dir}; $(MAKE
) $(TARGET_FLAGS_TO_PASS
) all); \
746 # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
747 # To build a target install-X means to cd to X and make install.
748 .PHONY
: $(CHECK_TARGET_MODULES
)
749 $(CHECK_TARGET_MODULES
):
750 @
dir=`echo $@ | sed -e 's/check-//'`; \
751 if
[ -f .
/$${dir}/Makefile
] ; then \
752 rootme
=`pwd`; export rootme
; \
753 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
754 (cd
$${dir}; $(MAKE
) $(TARGET_FLAGS_TO_PASS
) check); \
759 # This rule is used to install the modules which use
760 # TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
762 .PHONY
: $(INSTALL_TARGET_MODULES
)
763 $(INSTALL_TARGET_MODULES
): install-dirs
764 @
dir=`echo $@ | sed -e 's/install-//'`; \
765 if
[ -f .
/$${dir}/Makefile
] ; then \
766 rootme
=`pwd`; export rootme
; \
767 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
768 (cd
$${dir}; $(MAKE
) $(TARGET_FLAGS_TO_PASS
) install); \
773 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
774 # To build a target all-X means to cd to X and make all.
775 .PHONY
: $(ALL_X11_MODULES
)
777 @
dir=`echo $@ | sed -e 's/all-//'`; \
778 if
[ -f .
/$${dir}/Makefile
] ; then \
779 rootme
=`pwd`; export rootme
; \
780 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
782 $(MAKE
) $(FLAGS_TO_PASS
) $(X11_FLAGS_TO_PASS
) all); \
787 # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
788 # To build a target check-X means to cd to X and make all.
789 .PHONY
: $(CHECK_X11_MODULES
)
790 $(CHECK_X11_MODULES
):
791 @
dir=`echo $@ | sed -e 's/check-//'`; \
792 if
[ -f .
/$${dir}/Makefile
] ; then \
793 rootme
=`pwd`; export rootme
; \
794 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
796 $(MAKE
) $(FLAGS_TO_PASS
) $(X11_FLAGS_TO_PASS
) check); \
801 # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
802 # To build a target install-X means to cd to X and make install.
803 .PHONY
: $(INSTALL_X11_MODULES
)
804 $(INSTALL_X11_MODULES
):
805 @
dir=`echo $@ | sed -e 's/install-//'`; \
806 if
[ -f .
/$${dir}/Makefile
] ; then \
807 rootme
=`pwd`; export rootme
; \
808 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
810 $(MAKE
) $(FLAGS_TO_PASS
) $(X11_FLAGS_TO_PASS
) install); \
815 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
818 @if
[ -f .
/gcc
/Makefile
] ; then \
819 rootme
=`pwd`; export rootme
; \
820 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
821 (cd gcc
; $(MAKE
) $(GCC_FLAGS_TO_PASS
) all); \
828 @if
[ -f .
/gcc
/Makefile
] ; then \
829 rootme
=`pwd`; export rootme
; \
830 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
831 (cd gcc
; $(MAKE
) $(GCC_FLAGS_TO_PASS
) check); \
838 @if
[ -f .
/gcc
/Makefile
] ; then \
839 rootme
=`pwd`; export rootme
; \
840 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
841 (cd gcc
; $(MAKE
) $(GCC_FLAGS_TO_PASS
) install); \
846 # This is a list of inter-dependencies among modules.
849 all-binutils
: all-libiberty all-opcodes all-bfd all-flex
851 # start-sanitize-chill
852 all-chillrt
: all-binutils all-gas all-gcc all-newlib
856 all-diff
: all-libiberty
859 all-expect
: all-tcl all-tk
860 all-fileutils
: all-libiberty
862 all-flex
: all-libiberty all-byacc
863 all-gas
: all-libiberty all-opcodes all-bfd
865 all-gcc
: all-libiberty all-byacc all-binutils all-gas
866 all-gdb
: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-glob all-byacc all-sim
868 all-gprof
: all-libiberty all-bfd
870 all-gzip
: all-libiberty
871 all-hello
: all-libiberty
873 all-ispell
: all-emacs
874 all-ld
: all-libiberty all-bfd all-byacc all-flex
875 all-libg
++: all-gas all-ld all-gcc all-xiberty all-newlib
877 all-m4
: all-libiberty
878 all-make
: all-libiberty
880 all-newlib
: all-binutils all-gas all-gcc
886 all-recode
: all-libiberty
890 all-sim
: all-libiberty all-bfd
891 all-tar
: all-libiberty
893 all-tclX
: all-tcl all-tk
895 all-texinfo
: all-libiberty
897 all-tgas
: all-libiberty all-bfd
900 all-uudecode
: all-libiberty
901 all-xiberty
: all-gcc all-newlib
903 ### other supporting targets
912 @for i in
$(MAKEDIRS
) ; do \
913 echo Making
$$i...
; \
914 parent
=`echo $$i|sed -e 's@/[^/]*$$@@'`; \
915 if
[ -d
$$parent ] ; then true
; else mkdir
$$parent ; fi
; \
916 if
[ ! -d
$$i ] ; then \
917 if mkdir
$$i ; then \
927 .PHONY
: install-info-dirs
929 if
[ -d
$(prefix) ] ; then true
; else mkdir
$(prefix) ; fi
930 -parent
=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \
931 if
[ -d
$$parent ] ; then true
; else mkdir
$$parent ; fi
932 -if
[ -d
$(infodir) ] ; then true
; else mkdir
$(infodir) ; fi
934 dir.
info: do-install-info
935 if
[ -f
$(srcdir)/texinfo
/gen-info-dir
] ; then \
936 $(srcdir)/texinfo
/gen-info-dir
$(infodir) $(srcdir)/texinfo
/dir.info-template
> dir.
info.new
; \
937 mv
-f
dir.
info.new
dir.
info ; \
942 @echo
"Building a full distribution of this tree isn't done"
943 @echo
"via 'make dist'. Check out the etc/ subdirectory"
952 @for i in
$(SUBDIRS
); \
956 wd
=`basename $$pwd`; \
957 for j in
`$(MAKE) ls`; \
963 # with the gnu make, this is done automatically.
965 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
966 $(SHELL
) .
/config.status
969 # Build GDB distributions that contain BFD, Include, Libiberty, Readline, etc
971 DEVO_SUPPORT
= README Makefile.in configure configure.in \
972 config.guess config.sub config move-if-change
973 ETC_SUPPORT
= Makefile.in cfg-paper.texi configure.in configure.man \
974 configure.texi standards.texi make-stds.texi
975 GDB_SUPPORT_DIRS
= bfd
include libiberty mmalloc opcodes readline glob sim
976 GDB_SUPPORT_FILES
= $(GDB_SUPPORT_DIRS
)
978 .PHONY
: setup-dirs-gdb gdb.
tar.Z make-gdb.
tar.Z
983 chmod og
=u
`find etc $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
985 gdb.
tar.Z
: setup-dirs-gdb
986 (cd gdb
; $(MAKE
) -f Makefile.in make-proto-gdb.
dir BISON
="byacc")
987 (cd gdb
; $(MAKE
) -f Makefile.in make-proto-testsuite.
dir)
988 $(MAKE
) $(MFLAGS
) -f Makefile.in make-gdb.
tar.Z
990 make-gdb.
tar.Z
: $(DEVO_SUPPORT
) $(GDB_SUPPORT_DIRS
) gdb texinfo
/texinfo.
tex
991 rm -rf proto-toplev
; mkdir proto-toplev
992 ln
-s ..
/gdb
/proto-gdb.
dir proto-toplev
/gdb
993 (cd proto-toplev
; for i in
$(DEVO_SUPPORT
) $(GDB_SUPPORT_DIRS
); do \
996 mkdir proto-toplev
/etc
997 (cd proto-toplev
/etc
; for i in
$(ETC_SUPPORT
); do \
998 ln
-s ..
/..
/etc
/$$i .
; \
1000 # Put only one copy (four hard links) of COPYING in the tar file.
1001 rm proto-toplev
/bfd
/COPYING
1002 ln proto-toplev
/gdb
/COPYING proto-toplev
/bfd
/COPYING
1003 rm proto-toplev
/include/COPYING
1004 ln proto-toplev
/gdb
/COPYING proto-toplev
/include/COPYING
1005 rm proto-toplev
/readline
/COPYING
1006 ln proto-toplev
/gdb
/COPYING proto-toplev
/readline
/COPYING
1008 # Take out texinfo and glob from configurable dirs
1009 rm proto-toplev
/configure.in
1010 sed
-e
'/^host_tools=/s/texinfo //' \
1011 -e
'/^host_libs=/s/glob //' \
1012 <configure.in
>proto-toplev
/configure.in
1014 # Take out texinfo from a few places; make simple BISON=bison line.
1015 rm proto-toplev
/Makefile.in
1016 sed
-e
'/^all\.normal: /s/\all-texinfo //' \
1017 -e
'/^ install-texinfo /d' \
1018 -e
'/^BISON = /,/^$$/d' \
1019 -e
'/^# BISON:/s/.*/BISON = bison -y/' \
1020 <Makefile.in
>proto-toplev
/Makefile.in
1022 mkdir proto-toplev
/texinfo
1023 ln
-s ..
/..
/texinfo
/texinfo.
tex proto-toplev
/texinfo
/
1024 ln
-s ..
/..
/texinfo
/tex3patch proto-toplev
/texinfo
/
1025 chmod og
=u
`find proto-toplev -print`
1026 (VER
=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
1027 ln
-s proto-toplev gdb-
$$VER; \
1028 echo
"==> Making gdb-$$VER.tar.Z"; \
1029 tar cfh
- gdb-
$$VER |
$(COMPRESS
) -v
>gdb-
$$VER.
tar.Z
; \
1030 echo
"==> Making gdb-$$VER.tar.z"; \
1031 tar cfh
- gdb-
$$VER |
$(GZIP
) -v
-9 >gdb-
$$VER.
tar.z
)
1033 # Make the testsuite archive separately.
1034 ln
-s ..
/..
/gdb
/proto-testsuite.
dir/testsuite proto-toplev
/gdb
/testsuite
1035 # Blow away the Chill test that requires a Chill compiled executable,
1036 # since GNU Chill is not yet publically available.
1037 rm -rf proto-toplev
/gdb
/testsuite
/gdb.t31
1039 # Put a copy of COPYING in the tar file.
1040 ln proto-toplev
/gdb
/COPYING proto-toplev
/gdb
/testsuite
/COPYING
1041 chmod og
=u
`find proto-toplev/gdb/testsuite -print`
1042 (VER
=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
1043 echo
"==> Making gdb-$$VER-testsuite.tar.Z"; \
1044 tar cfh
- gdb-
$$VER/configure gdb-
$$VER/config.guess \
1045 gdb-
$$VER/config.sub gdb-
$$VER/move-if-change \
1046 gdb-
$$VER/gdb
/testsuite | \
1047 $(COMPRESS
) -v
>gdb-
$$VER-testsuite.
tar.Z
; \
1048 echo
"==> Making gdb-$$VER-testsuite.tar.z"; \
1049 tar cfh
- gdb-
$$VER/configure gdb-
$$VER/config.guess \
1050 gdb-
$$VER/config.sub gdb-
$$VER/move-if-change \
1051 gdb-
$$VER/gdb
/testsuite | \
1052 $(GZIP
) -v
-9 >gdb-
$$VER-testsuite.
tar.z
)
1054 # When you use `make setup-dirs' or `make taz' you should always redefine
1056 SUPPORT_FILES
= list-of-support-files-for-tool-in-question
1057 # Directories that might want `make diststuff' run.
1058 DISTSTUFFDIRS
= ld gprof gdb
1062 taz
: $(DEVO_SUPPORT
) $(SUPPORT_FILES
) texinfo
/texinfo.
tex texinfo
/gpl.texinfo
1065 .
/configure
-rm sun4
1066 chmod og
=u
`find etc $(DEVO_SUPPORT) $(SUPPORT_FILES) $(TOOL) -print`
1067 # Make links, and run "make diststuff" when needed.
1068 # The `echo' for setting `p' is to convert all whitespace to spaces.
1069 # Then the `case' further below should tell whether $$d is in
1071 rm -rf proto-toplev
; mkdir proto-toplev
1072 set
-e
; dirs
="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1073 p
=" `echo $(DISTSTUFFDIRS)` " ; \
1074 for d in
$$dirs ; do \
1075 if
[ -d
$$d ]; then \
1078 echo making diststuff in
$$d ; \
1079 (cd
$$d ; $(MAKE
) -f Makefile.in diststuff
) || exit
1 ;; \
1081 if
[ -d
$$d/proto-
$$d.
dir ]; then \
1082 ln
-s ..
/$$d/proto-
$$d.
dir proto-toplev
/$$d ; \
1084 ln
-s ..
/$$d proto-toplev
/$$d ; \
1086 else ln
-s ..
/$$d proto-toplev
/$$d ; fi
; \
1089 mkdir proto-toplev
/etc
1090 (cd proto-toplev
/etc
; for i in
$(ETC_SUPPORT
); do \
1091 ln
-s ..
/..
/etc
/$$i .
; \
1094 # Take out texinfo and glob from configurable dirs
1095 rm proto-toplev
/configure.in
1096 sed
-e
'/^host_tools=/s/texinfo //' \
1097 -e
'/^host_libs=/s/glob //' \
1098 <configure.in
>proto-toplev
/configure.in
1100 # Take out texinfo from a few places; make simple BISON=bison line.
1101 rm proto-toplev
/Makefile.in
1102 sed
-e
'/^all\.normal: /s/\all-texinfo //' \
1103 -e
'/^ install-texinfo /d' \
1104 -e
'/^BISON = /,/^$$/d' \
1105 -e
'/^# BISON:/s/.*/BISON = bison -y/' \
1106 <Makefile.in
>proto-toplev
/Makefile.in
1108 mkdir proto-toplev
/texinfo
1109 ln
-s ..
/..
/texinfo
/texinfo.
tex proto-toplev
/texinfo
/
1110 ln
-s ..
/..
/texinfo
/gpl.texinfo proto-toplev
/texinfo
/
1111 ln
-s ..
/..
/texinfo
/tex3patch proto-toplev
/texinfo
/
1112 chmod og
=u
`find proto-toplev -print`
1113 (VER
=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
1114 echo
"==> Making $(TOOL)-$$VER.tar.z"; \
1115 ln
-s proto-toplev
$(TOOL
)-$$VER; \
1116 tar cfh
- $(TOOL
)-$$VER \
1117 |
$(GZIP
) -v
-9 >$(TOOL
)-$$VER.
tar.gz
)
1119 TEXINFO_SUPPORT
= texinfo
/texinfo.
tex texinfo
/gpl.texinfo
1120 DIST_SUPPORT
= $(DEVO_SUPPORT
) $(TEXINFO_SUPPORT
)
1123 GAS_SUPPORT_DIRS
= bfd
include libiberty opcodes
1124 gas.
tar.gz
: $(DIST_SUPPORT
) $(GAS_SUPPORT_DIRS
) gas
1125 $(MAKE
) -f Makefile.in taz SUPPORT_FILES
="$(GAS_SUPPORT_DIRS)" TOOL
=gas
1127 # The FSF "binutils" release includes gprof and ld.
1128 .PHONY
: binutils.
tar.gz
1129 BINUTILS_SUPPORT_DIRS
= bfd
include libiberty opcodes
ld gprof
1130 binutils.
tar.gz
: $(DIST_SUPPORT
) $(BINUTILS_SUPPORT_DIRS
) binutils
1131 $(MAKE
) -f Makefile.in taz SUPPORT_FILES
="$(BINUTILS_SUPPORT_DIRS)" TOOL
=binutils
1133 .PHONY
: gas
+binutils.
tar.gz
1134 GASB_SUPPORT_DIRS
= $(GAS_SUPPORT_DIRS
) binutils
ld gprof
1135 gas
+binutils.
tar.gz
: $(DIST_SUPPORT
) $(GASB_SUPPORT_DIRS
) gas
1136 $(MAKE
) -f Makefile.in taz SUPPORT_FILES
="$(GASB_SUPPORT_DIRS)" TOOL
=gas
1141 # start-sanitize-chill
1142 ## This is ugly, but I don't want GNU make to put these variables in
1143 ## the environment. Older makes will see this as a set of targets
1144 ## with no dependencies and no actions.
1145 unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET
:
1146 # end-sanitize-chill
1148 # end of Makefile.in