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 Thu Nov 14 03:17:05 PST 1991, by rich@cygnus.com
26 ddestdir
= $(idestdir
)
34 BISON
= `if [ -d $(unsubdir)/../bison ] ; \
35 then echo \`pwd\
`/$(unsubdir)/../bison$(subdir)/bison -y -L \`pwd\
`/$(unsubdir)/../bison$(subdir)/ ; \
38 MAKEINFO
= `if [ -d $(unsubdir)/../texinfo/C ] ; \
39 then echo \`pwd\
`/$(unsubdir)/../texinfo/C$(subdir)/makeinfo ; \
42 #\`(cd $(srcdir)/bison ; \\`pwd\\`)\`
43 SUBDIRS
= libiberty glob readline bfd gdb binutils
ld gas gcc gnulib clib
47 INSTALL_HEADERS
= install-headers
48 INSTALL_FIXED_INCLUDES
= install-fixed-includes
53 #### host and target specific makefile fragments come in here.
58 $(MAKE
) subdir_do DO
=all-info
"DODIRS=$(SUBDIRS)"
60 install-info
: dir.
info install-info-dirs
force
61 $(MAKE
) subdir_do DO
=install-info
"DODIRS=$(SUBDIRS)"
62 $(MAKE
) install-dir.
info
65 $(MAKE
) subdir_do DO
=all "DODIRS=$(SUBDIRS) $(OTHERS)"
68 if
[ -d .
/fixed-includes
] ; then
rm -rf .
/fixed-includes
; else true
; fi
69 mkdir .
/fixed-includes
70 $(srcdir)/gcc
/fixincludes
`pwd`/fixed-includes
74 if
[ -d clib
] ; then \
75 (cd clib
; $(MAKE
)) ; \
79 for i in
$(DODIRS
); do \
80 if
[ -f
$(unsubdir
)/$$i/localenv
] ; then \
81 if
(cd
$(unsubdir
)/$$i$(subdir
); \
83 "against=$(against)" \
85 "MAKEINFO=$(MAKEINFO)" \
86 $(DO
)) ; then true
; \
88 else if
[ -d
$(unsubdir
)/$$i ] ; then \
89 if
(cd
$(unsubdir
)/$$i$(subdir
); \
91 "against=$(against)" \
94 "AR_FLAGS=$(AR_FLAGS)" \
96 "LOADLIBES=$(LOADLIBES)" \
97 "LDFLAGS=$(LDFLAGS)" \
99 "MAKEINFO=$(MAKEINFO)" \
100 $(DO
)) ; then true
; \
106 bootstrap
: .
/fixed-includes
109 $(MAKE
) pass
"stagepass=stage1"
111 $(MAKE
) pass
"stagepass=stage2"
114 bootstrap2
: .
/fixed-includes
115 $(MAKE
) pass
"stagepass=stage1"
117 $(MAKE
) pass
"stagepass=stage2"
120 bootstrap3
: .
/fixed-includes
121 $(MAKE
) pass
"stagepass=stage2"
124 pass
: .
/fixed-includes
125 cp
$(srcdir)/gcc
/gstdarg.h
$(unsubdir
)/gas
$(subdir
)/stdarg.h
126 $(MAKE
) subdir_do
"DO=all all-info" "DODIRS=$(SUBDIRS)" \
127 "CC=`pwd`/$(unsubdir)/gcc$(subdir)/$(stagepass)/gcc \
128 -O $(GCCVERBOSE) -I`pwd`/fixed-includes \
129 -B`pwd`/$(unsubdir)/gcc$(subdir)/$(stagepass)/ \
130 -B`pwd`/$(unsubdir)/gas$(subdir)/$(stagepass)/ \
131 -B`pwd`/$(unsubdir)/ld$(subdir)/$(stagepass)/" \
132 "AR=`pwd`/$(unsubdir)/binutils$(subdir)/$(stagepass)/ar" \
133 "LD=`pwd`/$(unsubdir)/gcc$(subdir)/$(stagepass)/gcc $(GCCVERBOSE)" \
134 "RANLIB=`pwd`/$(unsubdir)/binutils$(subdir)/$(stagepass)/ranlib" \
135 "LOADLIBES=`pwd`/$(unsubdir)/gnulib$(subdir)/$(stagepass)/gnulib.a /lib/libc.a" \
136 "LDFLAGS=-nostdlib /lib/crt0.o \
137 -L`pwd`/$(unsubdir)/gnulib$(subdir)/$(stagepass)/ \
138 -B`pwd`/$(unsubdir)/ld$(subdir)/$(stagepass)/"
141 stage1
: .
/fixed-includes
142 $(MAKE
) subdir_do DO
=stage1
"DODIRS=$(SUBDIRS)"
144 stage2
: .
/fixed-includes
145 $(MAKE
) subdir_do DO
=stage2
"DODIRS=$(SUBDIRS)"
147 stage3
: .
/fixed-includes
148 $(MAKE
) subdir_do DO
=stage3
"DODIRS=$(SUBDIRS)"
150 stage4
: .
/fixed-includes
151 $(MAKE
) subdir_do DO
=stage4
"DODIRS=$(SUBDIRS)"
155 comparison
:; $(MAKE
) subdir_do DO
=comparison against
=$(against
) "DODIRS=$(SUBDIRS)"
157 de-stage1
:; $(MAKE
) subdir_do DO
=de-stage1
"DODIRS=$(SUBDIRS)"
158 de-stage2
:; $(MAKE
) subdir_do DO
=de-stage2
"DODIRS=$(SUBDIRS)"
159 de-stage3
:; $(MAKE
) subdir_do DO
=de-stage3
"DODIRS=$(SUBDIRS)"
160 de-stage4
:; $(MAKE
) subdir_do DO
=de-stage4
"DODIRS=$(SUBDIRS)"
163 rm -rf
*.a TEMP errs core
*.o
*~ \
#* TAGS *.E
164 $(MAKE
) subdir_do DO
=clean "DODIRS=$(SUBDIRS) $(OTHERS)"
166 install: install-no-fixincludes
$(INSTALL_FIXED_INCLUDES
)
168 install-no-fixincludes
: install-dirs
$(INSTALL_HEADERS
)
169 $(MAKE
) subdir_do DO
=install "DODIRS=$(SUBDIRS) $(OTHERS)"
171 # The "else true" stuff is for Ultrix; the shell returns the exit code
172 # of the "if" command, if no commands are run in the "then" or "else" part,
173 # causing Make to quit.
178 $(ddestdir
)/include \
180 $(ddestdir
)/lib
/emacs \
185 $(idestdir
)/man
/man1 \
189 for i in
$(MAKEDIRS
) ; do \
190 echo Making
$$i...
; \
191 if
[ -d
$$i ] ; then true
; else mkdir
$$i ; fi
; \
198 install-info-dirs
: force
199 for i in
$(MAKEINFODIRS
) ; do \
200 echo Making
$$i...
; \
201 if
[ -d
$$i ] ; then true
; else mkdir
$$i ; fi
; \
205 if
[ -d
$(unsubdir
)/gcc
$(subdir
) ] ; then \
206 (cd
$(unsubdir
)/gcc
$(subdir
) ; \
207 $(MAKE
) install-dir
) ; \
211 install-fixed-includes
: force
212 if
[ -d
$(unsubdir
)/gcc
$(subdir
) ] ; then \
213 (cd
$(unsubdir
)/gcc
$(subdir
) ; \
214 $(MAKE
) install-fixed-includes
) ; \
218 install-dir.info-in-place
: force
219 rdir
=`cd $(srcdir)/texinfo ; pwd` \
220 && cd
$(idestdir
)/info \
221 && ($${rdir}/gen-info-dir
`pwd`) > dir
224 $(srcdir)/texinfo
/gen-info-dir .
> dir.
info.new
225 mv
-f
dir.
info.new
dir.
info
234 @for i in
$(SUBDIRS
); \
238 wd
=`basename $$pwd`; \
239 for j in
`$(MAKE) ls`; \
247 # with the gnu make, this is done automatically.
249 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
250 $(SHELL
) .
/config.status
253 # Build GDB distributions that contain BFD, Include, Libiberty, Readline, etc
255 DEVO_SUPPORT
= README DOC.configure Makefile.in configure configure.in \
257 GDB_SUPPORT_DIRS
= bfd
include libiberty readline glob
258 GDB_SUPPORT_FILES
= $(GDB_SUPPORT_DIRS
) texinfo
/fsf
/texinfo.
tex
260 setup-dirs
: force_update
264 chmod og
=u
`find $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
266 bfd.ilrt.
tar.Z
: setup-dirs
268 tar cf
- $(DEVO_SUPPORT
) $(GDB_SUPPORT_FILES
) \
269 | compress
-v
>bfd.ilrt.
tar.Z
271 gdb.
tar.Z
: setup-dirs
272 (cd gdb
; $(MAKE
) -f Makefile.in make-proto-gdb.
dir)
273 $(MAKE
) $(MFLAGS
) -f Makefile.in make-gdb.
tar.Z
275 make-gdb.
tar.Z
: $(DEVO_SUPPORT
) $(GDB_SUPPORT_DIRS
) gdb texinfo
/fsf
/texinfo.
tex
276 rm -rf proto-toplev
; mkdir proto-toplev
277 ln
-s ..
/gdb
/proto-gdb.
dir proto-toplev
/gdb
278 (cd proto-toplev
; for i in
$(DEVO_SUPPORT
) $(GDB_SUPPORT_DIRS
); do \
281 # Take out texinfo from configurable dirs
282 rm proto-toplev
/configure.in
283 sed
'/^configdirs=/s/texinfo //' <configure.in
>proto-toplev
/configure.in
284 mkdir proto-toplev
/texinfo
285 mkdir proto-toplev
/texinfo
/fsf
286 ln
-s ..
/..
/..
/texinfo
/fsf
/texinfo.
tex proto-toplev
/texinfo
/fsf
/
287 chmod og
=u
`find proto-toplev -print`
288 (VER
=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
289 echo
"==> Making gdb-$$VER.tar.Z"; \
290 ln
-s proto-toplev gdb-
$$VER; \
291 tar cfh
- gdb-
$$VER \
292 | compress
-v
>gdb-
$$VER.
tar.Z
)