2 # Makefile for directory with subdirs to build.
3 # Copyright (C) 1990, 1991 Cygnus Support
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. */
19 # Last Mod Tue Nov 12 00:21:50 PST 1991, by rich@sendai
26 ddestdir
= $(idestdir
)
34 BISON
= `if [ -d $(unsubdir)/../bison ] ; \
35 then echo \`pwd\
`/$(unsubdir)/../bison$(subdir)/bison -L \`pwd\
`/$(unsubdir)/../bison$(subdir)/ ; \
38 #\`(cd $(srcdir)/bison ; \\`pwd\\`)\`
39 SUBDIRS
= libiberty readline bfd gdb binutils
ld gas gcc gnulib clib
43 INSTALL_HEADERS
= install-headers
44 INSTALL_FIXED_INCLUDES
= install-fixed-includes
49 #### host and target specific makefile fragments come in here.
55 $(MAKE
) subdir_do DO
=all "DODIRS=$(SUBDIRS) $(OTHERS)"
59 if
[ -d clib
] ; then \
60 (cd clib
; $(MAKE
)) ; \
64 for i in
$(DODIRS
); do \
65 if
[ -f
$(unsubdir
)/$$i/localenv
] ; then \
66 if
(cd
$(unsubdir
)/$$i$(subdir
); \
68 "against=$(against)" \
69 "BISON=$(BISON)" $(DO
)) ; then true
; \
71 else if
[ -d
$(unsubdir
)/$$i ] ; then \
72 if
(cd
$(unsubdir
)/$$i$(subdir
); \
74 "against=$(against)" \
77 "AR_FLAGS=$(AR_FLAGS)" \
79 "LOADLIBES=$(LOADLIBES)" \
80 "LDFLAGS=$(LDFLAGS)" \
81 "BISON=$(BISON)" $(DO
)) ; then true
; \
92 $(MAKE
) pass
"stagepass=stage1"
94 $(MAKE
) pass
"stagepass=stage2"
98 $(MAKE
) pass
"stagepass=stage1"
100 $(MAKE
) pass
"stagepass=stage2"
104 $(MAKE
) pass
"stagepass=stage2"
108 cp
$(srcdir)/gcc
/gstdarg.h
$(unsubdir
)/gas
$(subdir
)/stdarg.h
109 $(MAKE
) subdir_do DO
=all "DODIRS=$(SUBDIRS)" \
110 "CC=`pwd`/$(unsubdir)/gcc$(subdir)/$(stagepass)/gcc \
112 -B`pwd`/$(unsubdir)/gcc$(subdir)/$(stagepass)/ \
113 -B`pwd`/$(unsubdir)/gas$(subdir)/$(stagepass)/ \
114 -B`pwd`/$(unsubdir)/ld$(subdir)/$(stagepass)/" \
115 "AR=`pwd`/$(unsubdir)/binutils$(subdir)/$(stagepass)/ar" \
116 "LD=`pwd`/$(unsubdir)/ld$(subdir)/$(stagepass)/ld $(GCCVERBOSE)" \
117 "RANLIB=`pwd`/$(unsubdir)/binutils$(subdir)/$(stagepass)/ranlib" \
118 "LOADLIBES=`pwd`/$(unsubdir)/gnulib$(subdir)/$(stagepass)/gnulib.a /lib/libc.a" \
119 "LDFLAGS=-nostdlib /lib/crt0.o \
120 -L`pwd`/$(unsubdir)/gnulib$(subdir)/$(stagepass)/ \
121 -B`pwd`/$(unsubdir)/ld$(subdir)/$(stagepass)/"
125 $(MAKE
) subdir_do DO
=stage1
"DODIRS=$(SUBDIRS)"
128 $(MAKE
) subdir_do DO
=stage2
"DODIRS=$(SUBDIRS)"
131 $(MAKE
) subdir_do DO
=stage3
"DODIRS=$(SUBDIRS)"
134 $(MAKE
) subdir_do DO
=stage4
"DODIRS=$(SUBDIRS)"
138 comparison
:; $(MAKE
) subdir_do DO
=comparison against
=$(against
) "DODIRS=$(SUBDIRS)"
140 de-stage1
:; $(MAKE
) subdir_do DO
=de-stage1
"DODIRS=$(SUBDIRS)"
141 de-stage2
:; $(MAKE
) subdir_do DO
=de-stage2
"DODIRS=$(SUBDIRS)"
142 de-stage3
:; $(MAKE
) subdir_do DO
=de-stage3
"DODIRS=$(SUBDIRS)"
143 de-stage4
:; $(MAKE
) subdir_do DO
=de-stage4
"DODIRS=$(SUBDIRS)"
146 rm -rf
*.a TEMP errs core
*.o
*~ \
#* TAGS *.E
147 $(MAKE
) subdir_do DO
=clean "DODIRS=$(SUBDIRS) $(OTHERS)"
149 install: install-no-fixincludes
$(INSTALL_FIXED_INCLUDES
)
151 install-no-fixincludes
: install-dirs
$(INSTALL_HEADERS
)
152 $(MAKE
) subdir_do DO
=install "DODIRS=$(SUBDIRS) $(OTHERS)"
154 # The "else true" stuff is for Ultrix; the shell returns the exit code
155 # of the "if" command, if no commands are run in the "then" or "else" part,
156 # causing Make to quit.
161 $(ddestdir
)/include \
163 $(ddestdir
)/lib
/emacs \
169 $(idestdir
)/man
/man1 \
173 for i in
$(MAKEDIRS
) ; do \
174 echo Making
$$i...
; \
175 if
[ -d
$$i ] ; then true
; else mkdir
$$i ; fi
; \
179 if
[ -d
$(unsubdir
)/gcc
$(subdir
) ] ; then \
180 (cd
$(unsubdir
)/gcc
$(subdir
) ; \
181 $(MAKE
) install-dir
) ; \
185 install-fixed-includes
: force
186 if
[ -d
$(unsubdir
)/gcc
$(subdir
) ] ; then \
187 (cd
$(unsubdir
)/gcc
$(subdir
) ; \
188 $(MAKE
) install-fixed-includes
) ; \
199 @for i in
$(SUBDIRS
); \
203 wd
=`basename $$pwd`; \
204 for j in
`$(MAKE) ls`; \
212 # with the gnu make, this is done automatically.
214 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
215 $(SHELL
) .
/config.status
218 # Build GDB distributions that contain BFD, Include, Libiberty, Readline, etc
220 DEVO_SUPPORT
= README README.configure Makefile.in configure configure.in \
222 GDB_SUPPORT_DIRS
= bfd
include libiberty readline
223 GDB_SUPPORT_FILES
= $(GDB_SUPPORT_DIRS
) texinfo
/fsf
/texinfo.
tex
225 setup-dirs
: force_update
229 chmod og
=u
`find $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
231 bfd.ilrt.
tar.Z
: setup-dirs
233 tar cf
- $(DEVO_SUPPORT
) $(GDB_SUPPORT_FILES
) \
234 | compress
-v
>bfd.ilrt.
tar.Z
236 gdb.
tar.Z
: setup-dirs
237 (cd gdb
; $(MAKE
) -f Makefile.in make-proto-gdb.
dir)
238 $(MAKE
) $(MFLAGS
) -f Makefile.in make-gdb.
tar.Z
240 make-gdb.
tar.Z
: $(DEVO_SUPPORT
) $(GDB_SUPPORT_DIRS
) gdb texinfo
/fsf
/texinfo.
tex
241 rm -rf proto-toplev
; mkdir proto-toplev
242 ln
-s ..
/gdb
/proto-gdb.
dir proto-toplev
/gdb
243 (cd proto-toplev
; for i in
$(DEVO_SUPPORT
) $(GDB_SUPPORT_DIRS
); do \
246 mkdir proto-toplev
/texinfo
247 mkdir proto-toplev
/texinfo
/fsf
248 ln
-s ..
/..
/..
/texinfo
/fsf
/texinfo.
tex proto-toplev
/texinfo
/fsf
/
249 chmod og
=u
`find proto-toplev -print`
250 (VER
=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
251 echo
"==> Making gdb-$$VER.tar.Z"; \
252 ln
-s proto-toplev gdb-
$$VER; \
253 tar cfh
- gdb-
$$VER \
254 | compress
-v
>gdb-
$$VER.
tar.Z
)