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 Oct 8 15:43:17 PDT 1991, by rich@cygnus.com
28 #CC = gcc -b$(target) # -B$(srcdir)/../gas/Host-$(host)/Target-$(target)/
29 #CFLAGS = -g -nostdinc -nostdlib -I- -I/usr/local/lib/gcc/$(target)/1.92/include -I$(srcdir) -I$(srcdir)/../include -I$(OSINCLUDE)
36 BISON
= `if [ -d $(unsubdir)/../bison ] ; \
37 then echo \`pwd\
`/$(unsubdir)/../bison$(subdir)/bison -L \`pwd\
`/$(unsubdir)/../bison/ ; \
40 SUBDIRS
= libiberty readline bfd gdb binutils
ld gas gcc gnulib
43 #### host and target specific makefile fragments come in here.
47 $(MAKE
) subdir_do DO
=all "DODIRS=$(SUBDIRS) $(OTHERS)"
50 for i in
$(DODIRS
); do \
51 if
[ -d
$(unsubdir
)/$$i -o
-d
$(unsubdir
)/$$i.
$(target
) ] ; then \
52 if
(cd
$(unsubdir
)/$$i`if [ -d $(unsubdir)/$$i.$(target) ] ; \
53 then echo .$(target) ; fi`$(subdir
); \
55 "against=$(against)" \
58 "AR_FLAGS=$(AR_FLAGS)" \
60 "LOADLIBES=$(LOADLIBES)" \
61 "LDFLAGS=$(LDFLAGS)" \
62 "BISON=$(BISON)" $(DO
)) ; then true
; \
70 $(MAKE
) pass
"stagepass=stage1"
72 $(MAKE
) pass
"stagepass=stage2"
76 $(MAKE
) pass
"stagepass=stage1"
78 $(MAKE
) pass
"stagepass=stage2"
82 $(MAKE
) pass
"stagepass=stage2"
86 cp
$(unsubdir
)/gcc
`if [ -d $(unsubdir)/gcc.$(target) ] ; \
87 then echo .$(target) ; fi`/gstdarg.h
$(unsubdir
)/gas
/stdarg.h
88 $(MAKE
) subdir_do DO
=all "DODIRS=$(SUBDIRS)" \
89 "CC=`pwd`/$(unsubdir)/gcc`if [ -d $(unsubdir)/gcc.$(target) ] ; \
90 then echo .$(target) ; fi`$(subdir)/$(stagepass)/gcc \
92 -B`pwd`/$(unsubdir)/gcc`if [ -d $(unsubdir)/gcc.$(target) ] ; \
93 then echo .$(target) ; fi`$(subdir)/$(stagepass)/ \
94 -B`pwd`/$(unsubdir)/gas`if [ -d $(unsubdir)/gas.$(target) ] ; \
95 then echo .$(target) ; fi`$(subdir)/$(stagepass)/ \
96 -B`pwd`/$(unsubdir)/ld`if [ -d $(unsubdir)/ld.$(target) ] ; \
97 then echo .$(target) ; fi`$(subdir)/$(stagepass)/" \
98 "AR=`pwd`/$(unsubdir)/binutils`if [ -d $(unsubdir)/binutils.$(target) ] ; \
99 then echo .$(target) ; fi`$(subdir)/$(stagepass)/ar" \
100 "RANLIB=`pwd`/$(unsubdir)/binutils`if [ -d $(unsubdir)/binutils.$(target) ] ; \
101 then echo .$(target) ; fi`$(subdir)/$(stagepass)/ranlib" \
102 "LOADLIBES=`pwd`/$(unsubdir)/gnulib`if [ -d $(unsubdir)/binutils.$(target) ] ; \
103 then echo .$(target) ; fi`$(subdir)/$(stagepass)/gnulib.a /lib/libc.a" \
104 "LDFLAGS=-nostdlib /lib/crt0.o \
105 -L`pwd`/$(unsubdir)/gnulib`if [ -d $(unsubdir)/gnulib.$(target) ] ; \
106 then echo .$(target) ; fi`$(subdir)/$(stagepass)/ \
107 -B`pwd`/$(unsubdir)/ld`if [ -d $(unsubdir)/ld.$(target) ] ; \
108 then echo .$(target) ; fi`$(subdir)/$(stagepass)/"
112 $(MAKE
) subdir_do DO
=stage1
"DODIRS=$(SUBDIRS)"
115 $(MAKE
) subdir_do DO
=stage2
"DODIRS=$(SUBDIRS)"
118 $(MAKE
) subdir_do DO
=stage3
"DODIRS=$(SUBDIRS)"
121 $(MAKE
) subdir_do DO
=stage4
"DODIRS=$(SUBDIRS)"
125 comparison
:; $(MAKE
) subdir_do DO
=comparison against
=$(against
) "DODIRS=$(SUBDIRS)"
127 de-stage1
:; $(MAKE
) subdir_do DO
=de-stage1
"DODIRS=$(SUBDIRS)"
128 de-stage2
:; $(MAKE
) subdir_do DO
=de-stage2
"DODIRS=$(SUBDIRS)"
129 de-stage3
:; $(MAKE
) subdir_do DO
=de-stage3
"DODIRS=$(SUBDIRS)"
130 de-stage4
:; $(MAKE
) subdir_do DO
=de-stage4
"DODIRS=$(SUBDIRS)"
133 rm -rf
*.a TEMP errs core
*.o
*~ \
#* TAGS *.E
134 $(MAKE
) subdir_do DO
=clean "DODIRS=$(SUBDIRS) $(OTHERS)"
136 install: install-dirs install-fixed-includes
137 $(MAKE
) subdir_do DO
=install "DODIRS=$(SUBDIRS) $(OTHERS)"
139 # The "else true" stuff is for Ultrix; the shell returns the exit code
140 # of the "if" command, if no commands are run in the "then" or "else" part,
141 # causing Make to quit.
144 - mkdir
$(destdir
)/bin
145 - mkdir
$(destdir
)/lib
146 - mkdir
$(destdir
)/include
147 - mkdir
$(destdir
)/doc
148 - mkdir
$(destdir
)/man
149 - mkdir
$(destdir
)/man
/man1
150 - mkdir
$(destdir
)/man
/man2
151 - mkdir
$(destdir
)/man
/man3
152 - mkdir
$(destdir
)/man
/man4
153 - mkdir
$(destdir
)/man
/man5
154 - mkdir
$(destdir
)/man
/man6
155 - mkdir
$(destdir
)/man
/man7
156 - mkdir
$(destdir
)/man
/man8
157 if
[ -d
$(unsubdir
)/gcc
`if [ -d $(unsubdir)/gcc.$(target) ] ; \
158 then echo .$(target) ; fi`$(subdir
) ] ; then \
159 (cd
$(unsubdir
)/gcc
`if [ -d $(unsubdir)/gcc.$(target) ] ; \
160 then echo .$(target) ; fi`$(subdir
) ; \
161 $(MAKE
) install-dir
) ; \
165 install-fixed-includes
: force
166 if
[ -d
$(unsubdir
)/gcc
`if [ -d $(unsubdir)/gcc.$(target) ] ; \
167 then echo .$(target) ; fi`$(subdir
) ] ; then \
168 (cd
$(unsubdir
)/gcc
`if [ -d $(unsubdir)/gcc.$(target) ] ; \
169 then echo .$(target) ; fi`$(subdir
) ; \
170 $(MAKE
) install-fixed-includes
) ; \
181 @for i in
$(SUBDIRS
); \
185 wd
=`basename $$pwd`; \
186 for j in
`$(MAKE) ls`; \
194 # with the gnu make, this is done automatically.
196 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
197 $(SHELL
) .
/config.status
200 # Build GDB distributions that contain BFD, Include, Libiberty, Readline, etc
202 DEVO_SUPPORT
= README README.configure Makefile.in configure configure.in \
204 GDB_SUPPORT_DIRS
= bfd
include libiberty readline
205 GDB_SUPPORT_FILES
= $(GDB_SUPPORT_DIRS
) texinfo
/fsf
/texinfo.
tex
207 setup-dirs
: force_update
208 .
/configure
-template
=.
/configure
212 chmod og
=u
`find $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
214 bfd.ilrt.
tar.Z
: setup-dirs
216 tar cf
- $(DEVO_SUPPORT
) $(GDB_SUPPORT_FILES
) \
217 | compress
-v
>bfd.ilrt.
tar.Z
219 gdb.
tar.Z
: setup-dirs
220 (cd gdb
; $(MAKE
) -f Makefile.in make-proto-gdb.
dir)
221 $(MAKE
) $(MFLAGS
) -f Makefile.in make-gdb.
tar.Z
223 make-gdb.
tar.Z
: $(DEVO_SUPPORT
) $(GDB_SUPPORT_DIRS
) gdb texinfo
/fsf
/texinfo.
tex
224 rm -rf proto-toplev
; mkdir proto-toplev
225 ln
-s ..
/gdb
/proto-gdb.
dir proto-toplev
/gdb
226 (cd proto-toplev
; for i in
$(DEVO_SUPPORT
) $(GDB_SUPPORT_DIRS
); do \
229 mkdir proto-toplev
/texinfo
230 mkdir proto-toplev
/texinfo
/fsf
231 ln
-s ..
/..
/..
/texinfo
/fsf
/texinfo.
tex proto-toplev
/texinfo
/fsf
/
232 chmod og
=u
`find proto-toplev -print`
233 (VER
=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
234 echo
"==> Making gdb-$$VER.tar.Z"; \
235 ln
-s proto-toplev gdb-
$$VER; \
236 tar cfh
- gdb-
$$VER \
237 | compress
-v
>gdb-
$$VER.
tar.Z
)
243 # Revision 1.40 1991/10/09 00:11:14 rich
244 # Getting BISON right.
246 # Revision 1.39 1991/10/02 10:03:15 rich
247 # Some $(srcdir)'s become $(unsubdir)'s in order to support +objdir.
249 # Revision 1.38 1991/10/02 07:21:55 rich
250 # no more configure on which to depend
252 # Revision 1.37 1991/10/01 13:41:00 gnu
253 # Avoid 'v' flag on archive updates, since it just wastes space in the log.
255 # Revision 1.36 1991/10/01 03:45:39 rich
256 # Exploit the new executable config.status
258 # Revision 1.35 1991/09/25 04:34:40 rich
259 # Pass command names with absolute paths. Easier than keeping relative
260 # paths right when dealing with sub/sub/directories.
262 # Revision 1.34 1991/09/20 09:08:56 gnu
263 # Set file permissions on all files when building a distribution.
265 # Revision 1.33 1991/09/20 08:41:45 gnu
266 # New rules for building distributions. Normal distribution
267 # is built by doing `make -f Makefile.in gdb.tar.Z' in the devo dir.
269 # Revision 1.32 1991/09/19 20:56:05 steve
270 # More changes for 68k and 386 coff support. (Sorry about the previous
273 # Revision 1.31 1991/09/03 13:28:38 gnu
274 # Add "else true" clauses for really dumb sh's such as Ultrix.
276 # Revision 1.30 1991/08/26 06:37:57 rich
277 # Correcting configurations and installs.
279 # Revision 1.29 1991/08/26 04:45:57 rich
280 # Correcting install target when gcc not present.
282 # Revision 1.28 1991/08/25 23:40:22 rich
283 # rcs enters the soup.
285 # Revision 1.27 1991/08/23 07:15:56 gnu
286 # Make README stick...
288 # Revision 1.26 1991/08/22 09:20:07 gnu
289 # Build a top-level README for devo.
291 # Revision 1.25 1991/08/22 07:15:49 rich
292 # Three part names, etc.
294 # Revision 1.24 1991/08/20 01:57:31 rich
295 # Another try at passing gnulib's location.
297 # Revision 1.23 1991/08/16 21:47:41 rich
298 # Pass on BISON as bison only if bison is here.
300 # Revision 1.22 1991/08/07 19:15:26 rich
301 # +forcesubdirs -> +subdirs
303 # Revision 1.21 1991/07/31 18:07:59 gnu
304 # Set file permissions the same for everyone before making tar file.
306 # Revision 1.20 1991/07/31 02:47:14 gnu
307 # Add bfd.ilrt.tar.Z "make" rules.
309 # Revision 1.19 1991/07/27 07:46:34 rich
310 # Changes to accomodate using the freshly built bison in place.
312 # Revision 1.18 1991/07/16 00:01:40 gnu
313 # Add back gdb and readline.
315 # Revision 1.17 1991/06/18 15:30:55 rich
316 # added install-dirs target.
318 # Revision 1.16 1991/06/14 13:35:40 rich
319 # install fixed include files on install.
321 # Revision 1.15 1991/06/09 20:27:01 rich
322 # added support for binary comparisons.
324 # Revision 1.14 1991/05/31 12:34:55 gnu
325 # Avoid error stop from Make if a directory doesn't exist during subdir_do.
327 # Revision 1.13 1991/05/27 23:03:20 rich
328 # Put gcc/gstdarg.h where gas can find it; gas/stdarg.h.
330 # Revision 1.12 1991/05/19 00:36:44 rich
333 # Revision 1.11 1991/05/03 21:30:41 gnu
334 # Rename getopt to libiberty.
336 # Revision 1.10 1991/04/24 16:50:53 rich
337 # Three staging checkpoint.
339 # Revision 1.9 1991/04/17 01:34:36 rich
340 # Added getopt for binutils, fixed problem with host dependancies in
341 # configure.template.
343 # Revision 1.8 1991/04/15 23:43:45 rich
344 # Now handles multiple hosts and targets.
346 # Revision 1.7 1991/04/13 13:06:16 tiemann
347 # Don't depend `install' on `all'. Actually, the way things work, all
348 # depends on things being incrementally installed, and install depends
349 # on everything happening in a topological fashion.
351 # This will need to be worked on further, but for now it's ok.
353 # Revision 1.6 1991/04/13 10:04:14 rich
354 # Now can build gas for a29k on a29k.
356 # Revision 1.5 1991/04/13 07:40:41 rich
357 # Fixed an ordering bug. Now everything is built, and then installed.
359 # Revision 1.4 1991/04/13 02:11:09 rich
360 # Config cut 3. We now almost install a29k.
362 # Revision 1.3 1991/04/11 02:41:53 rich
363 # Cut 2 config. Subdirs.