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
48 INSTALL
= $${srcroot}/install.sh
-c
49 INSTALL_PROGRAM
= $(INSTALL
)
50 INSTALL_DATA
= $(INSTALL
) -m
644
51 INSTALL_XFORM
= $(INSTALL
) -t
='$(program_transform_name)'
53 INSTALL_DOSREL
= install-dosrel-fake
60 # Special variables passed down in EXTRA_GCC_FLAGS. They are defined
61 # here so that they can be overridden by Makefile fragments.
62 HOST_CC
= $(CC_FOR_BUILD
)
64 HOST_PREFIX_1
= loser-
66 # We don't specify -g -O because many compilers don't support -g -O,
67 # and/or -O is broken in and of itself.
70 # start-sanitize-chill
71 CHILLFLAGS
= $(CFLAGS
)
76 # Use -O to stress test the compiler.
77 CXXFLAGS
= -g
-O
-fexternal-templates
81 # Not plain GZIP, since gzip looks there for extra command-line options.
84 # BISON: This line sed'ed to BISON = bison -y for FSF releases, don't remove.
85 BISON
= `if [ -f $$r/byacc/byacc ] ; \
86 then echo $$r/byacc/byacc ; \
90 LEX
= `if [ -f $$r/flex/flex ] ; \
91 then echo $$r/flex/flex ; \
94 M4
= `if [ -f $$r/m4/m4 ] ; \
95 then echo $$r/m4/m4 ; \
98 MAKEINFO
= `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
99 then echo $$r/texinfo/makeinfo/makeinfo ; \
100 else echo makeinfo ; fi`
102 # This just becomes part of the MAKEINFO definition passed down to
103 # sub-makes. It lets flags be given on the command line while still
104 # using the makeinfo from the object tree.
107 EXPECT
= `if [ -f $$r/expect/expect ] ; \
108 then echo $$r/expect/expect ; \
109 else echo expect ; fi`
111 RUNTEST
= `if [ -f $${srcroot}/dejagnu/runtest ] ; \
112 then echo $${srcroot}/dejagnu/runtest ; \
113 else echo runtest ; fi`
116 # libraries that may need to be augmented on a system-by-system basis
119 # compilers to use to create programs which must be run in the build
122 CXX_FOR_BUILD
= $(CXX
)
124 SUBDIRS
= "this is set via configure, don't edit this"
128 INSTALL_TARGET
= install-dirs \
130 $(INSTALL_TARGET_MODULES
) \
131 $(INSTALL_X11_MODULES
) \
137 if [ -f $$r/gcc/Makefile ] ; then \
138 if [ -f $$r/newlib/Makefile ] ; then \
139 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
141 echo $$r/gcc/xgcc -B$$r/gcc/; \
144 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
147 t='$(program_transform_name)'; echo gcc | sed -e 's/brokensed/brokensed/' $$t; \
151 # start-sanitize-chill
152 CHILL_FOR_TARGET
= ` \
153 if [ -f $$r/gcc/Makefile ] ; then \
154 echo $$r/gcc/xgcc -B$$r/gcc/ -L$$r/chillrt/; \
156 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
159 t='$(program_transform_name)'; echo gcc | sed -e 's/brokensed/brokensed/' $$t; \
166 if [ -f $$r/gcc/Makefile ] ; then \
167 if [ -f $$r/newlib/Makefile ] ; then \
168 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
170 echo $$r/gcc/xgcc -B$$r/gcc/; \
173 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
176 t='$(program_transform_name)'; echo gcc | sed -e 's/brokensed/brokensed/' $$t; \
181 if [ -f $$r/gas/Makefile ] ; then \
182 echo $$r/gas/as.new ; \
184 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
187 t='$(program_transform_name)'; echo as | sed -e 's/brokensed/brokensed/' $$t ; \
192 if [ -f $$r/binutils/ar ] ; then \
193 echo $$r/binutils/ar ; \
195 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
198 t='$(program_transform_name)'; echo ar | sed -e 's/brokensed/brokensed/' $$t ; \
202 RANLIB_FOR_TARGET
= ` \
203 if [ -f $$r/binutils/ranlib ] ; then \
204 echo $$r/binutils/ranlib ; \
206 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
209 t='$(program_transform_name)'; echo ranlib | sed -e 's/brokensed/brokensed/' $$t ; \
214 if [ -f $$r/binutils/Makefile ] ; then \
215 echo $$r/binutils/nm.new ; \
217 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
220 t='$(program_transform_name)'; echo nm | sed -e 's/brokensed/brokensed/' $$t ; \
225 #### host and target specific makefile fragments come in here.
228 # Flags to pass down to all sub-makes.
229 # Please keep these in alphabetical order.
230 BASE_FLAGS_TO_PASS
= \
231 "AR_FLAGS=$(AR_FLAGS)" \
232 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
233 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
235 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
236 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
238 $(start-sanitize-chill
)\
239 "CHILLFLAGS=$(CHILLFLAGS)" \
240 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
241 "CHILL_LIB=$(CHILL_LIB)" \
242 $(end-sanitize-chill
)\
243 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
244 "CXXFLAGS=$(CXXFLAGS)" \
245 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
246 "GCC_FOR_TARGET=$(CC_FOR_TARGET)" \
247 "INSTALL=$(INSTALL)" \
248 "INSTALL_DATA=$(INSTALL_DATA)" \
249 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
250 "INSTALL_XFORM=$(INSTALL_XFORM)" \
251 "LDFLAGS=$(LDFLAGS)" \
254 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
255 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
256 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
259 "RUNTEST=$(RUNTEST)" \
260 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
262 "exec_prefix=$(exec_prefix)" \
266 # Flags to pass down to most sub-makes, in which we're building with
267 # the host environment.
268 # If any variables are added here, they must be added to do-*, below.
277 FLAGS_TO_PASS
= $(BASE_FLAGS_TO_PASS
) $(EXTRA_HOST_FLAGS
)
279 # Flags that are concerned with the location of the X11 include files
281 X11_FLAGS_TO_PASS
= \
282 "X11_INCLUDE_FLAGS=$(X11_INCLUDE_FLAGS)" \
283 "X11_LIB_FLAGS=$(X11_LIB_FLAGS)" \
286 # Flags to pass down to makes which are built with the target environment.
287 # The double $ decreases the length of the command line; the variables
288 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
289 # If any variables are added here, they must be added to do-*, below.
290 EXTRA_TARGET_FLAGS
= \
291 'AR=$$(AR_FOR_TARGET)' \
292 'AS=$$(AS_FOR_TARGET)' \
293 'CC=$$(CC_FOR_TARGET)' \
294 'CXX=$$(CXX_FOR_TARGET)' \
295 'NM=$$(NM_FOR_TARGET)' \
296 'RANLIB=$$(RANLIB_FOR_TARGET)'
298 TARGET_FLAGS_TO_PASS
= $(BASE_FLAGS_TO_PASS
) $(EXTRA_TARGET_FLAGS
)
300 # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
301 # unfortunately needs the native compiler and the target ar and
303 # If any variables are added here, they must be added to do-*, below.
304 # The HOST_* variables are a special case, which are used for the gcc
305 # cross-building scheme.
307 'AR=$$(AR_FOR_TARGET)' \
311 'HOST_CC=$(CC_FOR_BUILD)' \
312 'HOST_PREFIX=$(HOST_PREFIX)' \
313 'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
315 'RANLIB=$$(RANLIB_FOR_TARGET)'
317 GCC_FLAGS_TO_PASS
= $(BASE_FLAGS_TO_PASS
) $(EXTRA_GCC_FLAGS
)
319 # This is a list of the targets for all of the modules which are compiled
320 # using $(FLAGS_TO_PASS).
370 # This is a list of the check targets for all of the modules which are
371 # compiled using $(FLAGS_TO_PASS).
418 # This is a list of the install targets for all of the modules which are
419 # compiled using $(FLAGS_TO_PASS).
468 # This is a list of the targets for all of the modules which are compiled
469 # using $(X11_FLAGS_TO_PASS).
477 # This is a list of the check targets for all of the modules which are
478 # compiled using $(X11_FLAGS_TO_PASS).
479 CHECK_X11_MODULES
= \
486 # This is a list of the install targets for all the modules which are
487 # compiled using $(X11_FLAGS_TO_PASS).
488 INSTALL_X11_MODULES
= \
495 # This is a list of the targets for all of the modules which are compiled
496 # using $(TARGET_FLAGS_TO_PASS).
497 ALL_TARGET_MODULES
= \
498 $(start-sanitize-chill
) \
500 $(end-sanitize-chill
) \
506 # This is a list of the check targets for all of the modules which are
507 # compiled using $(TARGET_FLAGS_TO_PASS).
508 CHECK_TARGET_MODULES
= \
509 $(start-sanitize-chill
) \
511 $(end-sanitize-chill
) \
517 # This is a list of the install targets for all of the modules which are
518 # compiled using $(TARGET_FLAGS_TO_PASS).
519 INSTALL_TARGET_MODULES
= \
520 $(start-sanitize-chill
) \
522 $(end-sanitize-chill
) \
528 # This is a shell case of all modules which are compiled using
529 # $(TARGET_FLAGS_TO_PASS), used in the do-X rule.
530 TARGET_LIBS
= libio | libg
++ | newlib | xiberty
531 # start-sanitize-chill
532 TARGET_LIBS
= chillrt | libio | libg
++ | newlib | xiberty
535 # The first rule in the file had better be this one. Don't put any above it.
539 # The target built for a native build.
543 $(ALL_TARGET_MODULES
) \
547 # Do a target for all the subdirectories. A ``make do-X'' will do a
548 # ``make X'' in all subdirectories (because, in general, there is a
549 # dependency (below) of X upon do-X, a ``make X'' will also do this,
550 # but it may do additional work as well).
551 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
552 # because it is so large that it can easily overflow the command line
553 # length limit on some systems.
566 @target
=`echo $@ | sed -e 's/^do-//'`; \
568 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
569 for i in
$(SUBDIRS
); do \
570 if
[ -f .
/$$i/Makefile
]; then \
573 for flag in
$(EXTRA_TARGET_FLAGS
); do \
574 eval
`echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
578 for flag in
$(EXTRA_GCC_FLAGS
); do \
579 eval
`echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
583 for flag in
$(EXTRA_HOST_FLAGS
); do \
584 eval
`echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
588 export AR AS CC CXX NM RANLIB
; \
590 $(MAKE
) $(BASE_FLAGS_TO_PASS
) "AR=$${AR}" "AS=$${AS}" \
591 "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
592 "RANLIB=$${RANLIB}" \
594 then true
; else exit
1; fi
; \
598 # Here are the targets which correspond to the do-X targets.
600 .PHONY
: info installcheck dvi install-info
601 .PHONY
: clean distclean mostlyclean realclean local-clean local-distclean
603 installcheck: do-installcheck
606 install-info
: do-install-info
dir.
info
607 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
608 if
[ -f
dir.
info ] ; then \
609 $(INSTALL_DATA
) dir.
info $(infodir)/dir.
info ; \
613 -rm -f
*.a TEMP errs core
*.o
*~ \
#* TAGS *.E
616 -rm -f Makefile config.status
618 clean: do-clean local-clean
619 mostlyclean: do-mostlyclean local-clean
620 distclean: do-distclean local-clean local-distclean
621 realclean: do-realclean local-clean local-distclean
626 check: $(CHECK_MODULES
) \
627 $(CHECK_TARGET_MODULES
) \
628 $(CHECK_X11_MODULES
) \
631 # Installation targets.
633 .PHONY
: install uninstall vault-install
634 install: $(INSTALL_TARGET
)
637 @echo
"the uninstall target is not supported in this tree"
640 @if
[ -f .
/release
/vault-install
] ; then \
641 .
/release
/vault-install
$(host_alias
) $(target_alias
) ; \
647 install.
all: install-no-fixedincludes
648 @if
[ -f .
/gcc
/Makefile
] ; then \
649 r
=`pwd` ; export r
; \
651 $(MAKE
) $(FLAGS_TO_PASS
) install-headers
) ; \
656 # install-no-fixedincludes is used because Cygnus can not distribute
657 # the fixed header files.
658 .PHONY
: install-no-fixedincludes
659 install-no-fixedincludes
: \
662 $(INSTALL_TARGET_MODULES
) \
663 $(INSTALL_X11_MODULES
) \
666 # Install the gcc headers files, but not the fixed include files,
667 # which Cygnus is not allowed to distribute. This rule is very
668 # dependent on the workings of the gcc Makefile.in.
669 .PHONY
: gcc-no-fixedincludes
670 gcc-no-fixedincludes
:
671 @if
[ -f .
/gcc
/Makefile
]; then \
672 rm -rf gcc
/tmp-include
; \
673 mv gcc
/include gcc
/tmp-include
2>/dev
/null
; \
675 cp
$(srcdir)/gcc
/gsyslimits.h gcc
/include/syslimits.h
; \
676 touch gcc
/stmp-fixinc gcc
/include/fixed
; \
677 rm -f gcc
/stmp-headers gcc
/stmp-int-hdrs
; \
679 srcroot
=`cd $(srcdir); pwd` ; export srcroot
; \
681 $(MAKE
) $(GCC_FLAGS_TO_PASS
) install); \
682 rm -rf gcc
/include; \
683 mv gcc
/tmp-include gcc
/include 2>/dev
/null
; \
686 # This rule is used to build the modules which use FLAGS_TO_PASS. To
687 # build a target all-X means to cd to X and make all.
688 # all-glob is handled specially because it doesn't actually build.
689 # all-gui is handled specially because it is still experimental, and
690 # if it fails to build, that shouldn't stop "make all".
691 .PHONY
: $(ALL_MODULES
) all-glob all-gui
692 $(ALL_MODULES
) all-glob all-gui
:
693 @
dir=`echo $@ | sed -e 's/all-//'`; \
694 if
[ -f .
/$${dir}/Makefile
] ; then \
696 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
697 (cd
$${dir}; $(MAKE
) $(FLAGS_TO_PASS
) all); \
702 # This rule is used to check the modules which use FLAGS_TO_PASS. To
703 # build a target check-X means to cd to X and make all.
704 .PHONY
: $(CHECK_MODULES
)
706 @
dir=`echo $@ | sed -e 's/check-//'`; \
707 if
[ -f .
/$${dir}/Makefile
] ; then \
709 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
710 (cd
$${dir}; $(MAKE
) $(FLAGS_TO_PASS
) check); \
715 # This rule is used to install the modules which use FLAGS_TO_PASS.
716 # To build a target install-X means to cd to X and make install.
717 .PHONY
: $(INSTALL_MODULES
)
718 $(INSTALL_MODULES
): install-dirs
719 @
dir=`echo $@ | sed -e 's/install-//'`; \
720 if
[ -f .
/$${dir}/Makefile
] ; then \
722 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
723 (cd
$${dir}; $(MAKE
) $(FLAGS_TO_PASS
) install); \
728 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
729 # To build a target all-X means to cd to X and make all.
730 .PHONY
: $(ALL_TARGET_MODULES
)
731 $(ALL_TARGET_MODULES
):
732 @
dir=`echo $@ | sed -e 's/all-//'`; \
733 if
[ -f .
/$${dir}/Makefile
] ; then \
735 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
736 (cd
$${dir}; $(MAKE
) $(TARGET_FLAGS_TO_PASS
) all); \
741 # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
742 # To build a target install-X means to cd to X and make install.
743 .PHONY
: $(CHECK_TARGET_MODULES
)
744 $(CHECK_TARGET_MODULES
):
745 @
dir=`echo $@ | sed -e 's/check-//'`; \
746 if
[ -f .
/$${dir}/Makefile
] ; then \
748 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
749 (cd
$${dir}; $(MAKE
) $(TARGET_FLAGS_TO_PASS
) check); \
754 # This rule is used to install the modules which use
755 # TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
757 .PHONY
: $(INSTALL_TARGET_MODULES
)
758 $(INSTALL_TARGET_MODULES
): install-dirs
759 @
dir=`echo $@ | sed -e 's/install-//'`; \
760 if
[ -f .
/$${dir}/Makefile
] ; then \
762 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
763 (cd
$${dir}; $(MAKE
) $(TARGET_FLAGS_TO_PASS
) install); \
768 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
769 # To build a target all-X means to cd to X and make all.
770 .PHONY
: $(ALL_X11_MODULES
)
772 @
dir=`echo $@ | sed -e 's/all-//'`; \
773 if
[ -f .
/$${dir}/Makefile
] ; then \
775 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
777 $(MAKE
) $(FLAGS_TO_PASS
) $(X11_FLAGS_TO_PASS
) all); \
782 # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
783 # To build a target check-X means to cd to X and make all.
784 .PHONY
: $(CHECK_X11_MODULES
)
785 $(CHECK_X11_MODULES
):
786 @
dir=`echo $@ | sed -e 's/check-//'`; \
787 if
[ -f .
/$${dir}/Makefile
] ; then \
789 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
791 $(MAKE
) $(FLAGS_TO_PASS
) $(X11_FLAGS_TO_PASS
) check); \
796 # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
797 # To build a target install-X means to cd to X and make install.
798 .PHONY
: $(INSTALL_X11_MODULES
)
799 $(INSTALL_X11_MODULES
):
800 @
dir=`echo $@ | sed -e 's/install-//'`; \
801 if
[ -f .
/$${dir}/Makefile
] ; then \
803 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
805 $(MAKE
) $(FLAGS_TO_PASS
) $(X11_FLAGS_TO_PASS
) install); \
810 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
813 @if
[ -f .
/gcc
/Makefile
] ; then \
815 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
816 (cd gcc
; $(MAKE
) $(GCC_FLAGS_TO_PASS
) all); \
823 @if
[ -f .
/gcc
/Makefile
] ; then \
825 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
826 (cd gcc
; $(MAKE
) $(GCC_FLAGS_TO_PASS
) check); \
833 @if
[ -f .
/gcc
/Makefile
] ; then \
835 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
836 (cd gcc
; $(MAKE
) $(GCC_FLAGS_TO_PASS
) install); \
843 # This rule is used to install the modules which use FLAGS_TO_PASS.
844 # To build a target install-X means to cd to X and make install.
845 .PHONY
: install-dosrel
846 install-dosrel
: install-dirs
info
847 @
dir=`echo $@ | sed -e 's/install-//'`; \
848 if
[ -f .
/$${dir}/Makefile
] ; then \
850 srcroot
=`cd $(srcdir); pwd`; export srcroot
; \
851 (cd
$${dir}; $(MAKE
) $(FLAGS_TO_PASS
) install); \
859 # This is a list of inter-dependencies among modules.
862 all-binutils
: all-libiberty all-opcodes all-bfd all-flex
864 # start-sanitize-chill
865 all-chillrt
: all-binutils all-gas all-gcc all-newlib
869 all-diff
: all-libiberty
872 all-expect
: all-tcl all-tk
873 all-fileutils
: all-libiberty
875 all-flex
: all-libiberty all-byacc
876 all-gas
: all-libiberty all-opcodes all-bfd
879 all-gcc
: all-libiberty all-byacc all-binutils all-gas all-pagas
880 all-gdb
: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-glob all-byacc all-sim
882 all-gprof
: all-libiberty all-bfd
883 all-grep
: all-libiberty
885 all-gzip
: all-libiberty
886 all-hello
: all-libiberty
888 all-ispell
: all-emacs
889 all-ld
: all-libiberty all-bfd all-byacc all-flex
890 all-libg
++: all-gas all-pagas all-ld all-gcc all-xiberty all-newlib all-libio
891 all-libio
: all-gas all-pagas all-ld all-gcc all-xiberty all-newlib
893 all-m4
: all-libiberty
894 all-make
: all-libiberty
896 all-newlib
: all-binutils all-gas all-pagas all-gcc
899 all-prms
: all-libiberty
902 all-recode
: all-libiberty
903 all-sed
: all-libiberty
904 all-send-pr
: all-prms
906 all-sim
: all-libiberty all-bfd
907 all-tar
: all-libiberty
909 all-tclX
: all-tcl all-tk
911 all-texinfo
: all-libiberty
913 all-tgas
: all-libiberty all-bfd
916 all-uudecode
: all-libiberty
917 all-xiberty
: all-gcc all-newlib
919 ### other supporting targets
928 @for i in
$(MAKEDIRS
) ; do \
929 echo Making
$$i...
; \
930 parent
=`echo $$i | sed -e 's@/[^/]*$$@@' | sed -e 's@^$$@/@'`; \
931 if
[ -d
$$parent ] ; then true
; else mkdir
$$parent ; fi
; \
932 if
[ ! -d
$$i ] ; then \
933 if mkdir
$$i ; then \
944 dir.
info: do-install-info
945 if
[ -f
$(srcdir)/texinfo
/gen-info-dir
] ; then \
946 $(srcdir)/texinfo
/gen-info-dir
$(infodir) $(srcdir)/texinfo
/dir.info-template
> dir.
info.new
; \
947 mv
-f
dir.
info.new
dir.
info ; \
952 @echo
"Building a full distribution of this tree isn't done"
953 @echo
"via 'make dist'. Check out the etc/ subdirectory"
957 # Right now this just builds TAGS in each subdirectory. emacs19 has the
958 # ability to use several tags files at once, so there is probably no need
959 # to combine them into one big TAGS file (like CVS 1.3 does). We could
960 # (if we felt like it) have this Makefile write a piece of elisp which
961 # the user could load to tell emacs19 where all the TAGS files we just
965 # with the gnu make, this is done automatically.
967 Makefile
: Makefile.in configure.in
$(host_makefile_frag
) $(target_makefile_frag
)
968 $(SHELL
) .
/config.status
971 # Support for building net releases
973 # Files in devo used in any net release.
974 # ChangeLog omitted because it may refer to files which are not in this
975 # distribution (perhaps it would be better to include it anyway).
976 DEVO_SUPPORT
= README Makefile.in configure configure.in \
977 config.guess config.sub config move-if-change \
978 COPYING COPYING.LIB
install.sh
980 # Files in devo/etc used in any net release.
981 # ChangeLog omitted because it may refer to files which are not in this
982 # distribution (perhaps it would be better to include it anyway).
983 ETC_SUPPORT
= Makefile.in cfg-paper.texi configure.in configure.man \
984 configure.texi standards.texi make-stds.texi
986 GDB_SUPPORT_DIRS
= bfd
include libiberty mmalloc opcodes readline glob sim
987 GDB_SUPPORT_FILES
= $(GDB_SUPPORT_DIRS
)
989 .PHONY
: setup-dirs-gdb gdb.
tar.gz make-gdb.
tar.gz
991 $(start-sanitize-Sanitize
)
992 @if
[ -f .Sanitize
] ; then echo
"RUN Sanitize FIRST!" ; false
; fi
;
993 $(end-sanitize-Sanitize
)
997 chmod og
=u
`find etc $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
999 gdb.
tar.gz
: setup-dirs-gdb
1000 (cd gdb
; $(MAKE
) -f Makefile.in make-proto-gdb.
dir BISON
="byacc")
1001 (cd gdb
; $(MAKE
) -f Makefile.in make-proto-testsuite.
dir)
1002 $(MAKE
) $(MFLAGS
) -f Makefile.in make-gdb.
tar.gz
1004 make-gdb.
tar.gz
: $(DEVO_SUPPORT
) $(GDB_SUPPORT_DIRS
) gdb texinfo
/texinfo.
tex
1005 rm -rf proto-toplev
; mkdir proto-toplev
1006 ln
-s ..
/gdb
/proto-gdb.
dir proto-toplev
/gdb
1007 (cd proto-toplev
; for i in
$(DEVO_SUPPORT
) $(GDB_SUPPORT_DIRS
); do \
1010 mkdir proto-toplev
/etc
1011 (cd proto-toplev
/etc
; for i in
$(ETC_SUPPORT
); do \
1012 ln
-s ..
/..
/etc
/$$i .
; \
1014 # Put only one copy (four hard links) of COPYING in the tar file.
1015 rm proto-toplev
/bfd
/COPYING
1016 ln proto-toplev
/gdb
/COPYING proto-toplev
/bfd
/COPYING
1017 rm proto-toplev
/include/COPYING
1018 ln proto-toplev
/gdb
/COPYING proto-toplev
/include/COPYING
1019 rm proto-toplev
/readline
/COPYING
1020 ln proto-toplev
/gdb
/COPYING proto-toplev
/readline
/COPYING
1022 # Change the bug reporting address in configure to bug-gdb
1023 rm proto-toplev
/configure
1024 sed
-e
's/configure@cygnus.com/bug-gdb@prep.ai.mit.edu/' \
1025 <configure
>proto-toplev
/configure
1026 chmod a
+x proto-toplev
/configure
1028 # Take out texinfo and glob from configurable dirs
1029 rm proto-toplev
/configure.in
1030 sed
-e
'/^host_tools=/s/texinfo //' \
1031 -e
'/^host_libs=/s/glob //' \
1032 <configure.in
>proto-toplev
/configure.in
1034 # Take out texinfo from a few places; make simple BISON=bison line.
1035 rm proto-toplev
/Makefile.in
1036 sed
-e
'/^all\.normal: /s/\all-texinfo //' \
1037 -e
'/^ install-texinfo /d' \
1038 -e
'/^BISON = /,/^$$/d' \
1039 -e
'/^# BISON:/s/.*/BISON = bison -y/' \
1040 <Makefile.in
>proto-toplev
/Makefile.in
1042 mkdir proto-toplev
/texinfo
1043 ln
-s ..
/..
/texinfo
/texinfo.
tex proto-toplev
/texinfo
/
1044 ln
-s ..
/..
/texinfo
/gpl.texinfo proto-toplev
/texinfo
/
1045 ln
-s ..
/..
/texinfo
/tex3patch proto-toplev
/texinfo
/
1046 chmod og
=u
`find proto-toplev -print`
1047 (VER
=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
1048 echo
"==> Making gdb-$$VER.tar.gz"; \
1049 rm -f gdb-
$$VER; ln
-s proto-toplev gdb-
$$VER; \
1050 tar cfh
- gdb-
$$VER \
1051 |
$(GZIPPROG
) -v
-9 >gdb-
$$VER.
tar.gz
)
1053 # Make the testsuite archive separately.
1054 ln
-s ..
/..
/gdb
/proto-testsuite.
dir/testsuite proto-toplev
/gdb
/testsuite
1055 # Blow away the Chill test that requires a Chill compiled executable,
1056 # since GNU Chill is not yet publically available.
1057 rm -rf proto-toplev
/gdb
/testsuite
/gdb.t31
1059 # Put a copy of COPYING in the tar file.
1060 ln proto-toplev
/gdb
/COPYING proto-toplev
/gdb
/testsuite
/COPYING
1061 chmod og
=u
`find proto-toplev/gdb/testsuite -print`
1062 (VER
=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
1063 echo
"==> Making gdb-$$VER-testsuite.tar.gz"; \
1064 tar cfh
- gdb-
$$VER/configure gdb-
$$VER/config.guess \
1065 gdb-
$$VER/config.sub gdb-
$$VER/move-if-change \
1066 gdb-
$$VER/gdb
/testsuite \
1067 |
$(GZIPPROG
) -v
-9 >gdb-
$$VER-testsuite.
tar.gz
)
1069 # When you use `make setup-dirs' or `make taz' you should always redefine
1071 SUPPORT_FILES
= list-of-support-files-for-tool-in-question
1072 # Directories that might want `make diststuff' run.
1073 DISTSTUFFDIRS
= ld gprof gdb libg
++ binutils gnats
1074 # Files where "byacc" (Cygnus version) should be changed to "bison -y" (FSF).
1075 DISTBISONFILES
= binutils
/Makefile.in gas
/Makefile.in gdb
/Makefile.in
1076 # Directories where "info" should be built.
1077 DISTDOCDIRS
= ld gprof binutils gas bfd libg
++ libio gdb gnats send-pr
1081 taz
: $(DEVO_SUPPORT
) $(SUPPORT_FILES
) \
1082 texinfo
/texinfo.
tex texinfo
/gpl.texinfo texinfo
/lgpl.texinfo
1083 # Make sure "diststuff" files get built properly.
1084 for f in
$(DISTBISONFILES
) ; do \
1085 if
[ -r
$$f ]; then \
1086 sed
'/^BISON *=.*$$/s/.*/BISON = bison -y/' <$$f >tmp
; \
1090 # Take out texinfo from a few places; make simple BISON=bison line.
1091 sed
-e
'/^all\.normal: /s/\all-texinfo //' \
1092 -e
'/^ install-texinfo /d' \
1093 -e
'/^BISON = /,/^$$/d' \
1094 -e
'/^# BISON:/s/.*/BISON = bison -y/' \
1096 mv
-f tmp Makefile.in
1099 # Doc files don't change; include them in distribution.
1100 for f in
$(DISTDOCDIRS
) ; do \
1101 if
[ -r
$$f/Makefile
]; then \
1102 (cd
$$f ; $(MAKE
) info) || exit
1 ; \
1105 # Make links, and run "make diststuff" when needed.
1106 # The `echo' for setting `p' is to convert all whitespace to spaces.
1107 # Then the `case' further below should tell whether $$d is in
1109 rm -rf proto-toplev
; mkdir proto-toplev
1110 set
-e
; dirs
="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1111 p
=" `echo $(DISTSTUFFDIRS)` " ; \
1112 for d in
$$dirs ; do \
1113 if
[ -d
$$d ]; then \
1116 echo making diststuff in
$$d ; \
1117 (cd
$$d ; pwd
; $(MAKE
) diststuff
) || exit
1 ;; \
1119 if
[ -d
$$d/proto-
$$d.
dir ]; then \
1120 ln
-s ..
/$$d/proto-
$$d.
dir proto-toplev
/$$d ; \
1122 ln
-s ..
/$$d proto-toplev
/$$d ; \
1124 else ln
-s ..
/$$d proto-toplev
/$$d ; fi
; \
1128 mkdir proto-toplev
/etc
1129 (cd proto-toplev
/etc
; for i in
$(ETC_SUPPORT
); do \
1130 ln
-s ..
/..
/etc
/$$i .
; \
1133 # Take out texinfo and glob from configurable dirs
1134 rm proto-toplev
/configure.in
1135 sed
-e
'/^host_tools=/s/texinfo //' \
1136 -e
'/^host_libs=/s/glob //' \
1137 <configure.in
>proto-toplev
/configure.in
1139 mkdir proto-toplev
/texinfo
1140 ln
-s ..
/..
/texinfo
/texinfo.
tex proto-toplev
/texinfo
/
1141 ln
-s ..
/..
/texinfo
/gpl.texinfo proto-toplev
/texinfo
/
1142 ln
-s ..
/..
/texinfo
/lgpl.texinfo proto-toplev
/texinfo
/
1143 ln
-s ..
/..
/texinfo
/tex3patch proto-toplev
/texinfo
/
1144 chmod og
=u
`find . -print`
1145 (VER
=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
1146 echo
"==> Making $(TOOL)-$$VER.tar.gz"; \
1147 rm -f
$(TOOL
)-$$VER; ln
-s proto-toplev
$(TOOL
)-$$VER; \
1148 tar cfh
- $(TOOL
)-$$VER \
1149 |
$(GZIPPROG
) -v
-9 >$(TOOL
)-$$VER.
tar.gz
)
1151 TEXINFO_SUPPORT
= texinfo
/texinfo.
tex texinfo
/gpl.texinfo texinfo
/lgpl.texinfo
1152 DIST_SUPPORT
= $(DEVO_SUPPORT
) $(TEXINFO_SUPPORT
)
1155 GAS_SUPPORT_DIRS
= bfd
include libiberty opcodes
1156 gas.
tar.gz
: $(DIST_SUPPORT
) $(GAS_SUPPORT_DIRS
) gas
1157 $(MAKE
) -f Makefile.in taz TOOL
=gas \
1158 SUPPORT_FILES
="$(GAS_SUPPORT_DIRS)"
1160 # The FSF "binutils" release includes gprof and ld.
1161 .PHONY
: binutils.
tar.gz
1162 BINUTILS_SUPPORT_DIRS
= bfd
include libiberty opcodes
ld gprof
1163 binutils.
tar.gz
: $(DIST_SUPPORT
) $(BINUTILS_SUPPORT_DIRS
) binutils
1164 $(MAKE
) -f Makefile.in taz TOOL
=binutils \
1165 SUPPORT_FILES
="$(BINUTILS_SUPPORT_DIRS)"
1167 .PHONY
: gas
+binutils.
tar.gz
1168 GASB_SUPPORT_DIRS
= $(GAS_SUPPORT_DIRS
) binutils
ld gprof
1169 gas
+binutils.
tar.gz
: $(DIST_SUPPORT
) $(GASB_SUPPORT_DIRS
) gas
1170 $(MAKE
) -f Makefile.in taz TOOL
=gas \
1171 SUPPORT_FILES
="$(GASB_SUPPORT_DIRS)"
1173 .PHONY
: libg
++.
tar.gz
1174 LIBGXX_SUPPORT_DIRS
=include libio libiberty xiberty
1175 libg
++.
tar.gz
: $(DIST_SUPPORT
) libg
++
1176 $(MAKE
) -f Makefile.in taz TOOL
=libg
++ \
1177 SUPPORT_FILES
="$(LIBGXX_SUPPORT_DIRS)"
1179 GNATS_SUPPORT_DIRS
=include libiberty send-pr
1180 gnats.
tar.gz
: $(DIST_SUPPORT
) $(GNATS_SUPPORT_DIRS
) gnats
1181 $(MAKE
) -f Makefile.in taz TOOL
=gnats \
1182 SUPPORT_FILES
="$(GNATS_SUPPORT_DIRS)"
1187 # start-sanitize-chill
1188 ## This is ugly, but I don't want GNU make to put these variables in
1189 ## the environment. Older makes will see this as a set of targets
1190 ## with no dependencies and no actions.
1191 unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET
:
1192 # end-sanitize-chill
1194 # end of Makefile.in