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 Sun Aug 25 22:42:31 PDT 1991, by rich@cygint.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 $(srcdir)/../bison\`if
[ -d
$(srcdir)/bison.
$(target
) ] ; then echo .
$(target
) ; fi\
`$(subdir) ] ; then echo $(srcdir)/../bison\`if
[ -d
$(srcdir)/bison.
$(target
) ] ; then echo .
$(target
) ; fi\
`$(subdir)/bison -L $(srcdir)/../bison\`if
[ -d
$(srcdir)/bison.
$(target
) ] ; then echo .
$(target
) ; fi\
`/; else echo yacc ; fi`
38 SUBDIRS
= libiberty readline bfd gdb binutils
ld gas gcc gnulib
41 #### host and target specific makefile fragments come in here.
45 $(MAKE
) subdir_do DO
=all "DODIRS=$(SUBDIRS) $(OTHERS)"
48 for i in
$(DODIRS
); do \
49 if
[ -d
$(srcdir)/$$i -o
-d
$(srcdir)/$$i.
$(target
) ] ; then \
50 if
(cd
$(srcdir)/$$i`if [ -d $(srcdir)/$$i.$(target) ] ; \
51 then echo .$(target) ; fi`$(subdir
); \
53 "against=$(against)" \
56 "AR_FLAGS=$(AR_FLAGS)" \
58 "BISON=$(BISON)" $(DO
)) ; then true
; \
66 $(MAKE
) pass
"stagepass=stage1"
68 $(MAKE
) pass
"stagepass=stage2"
72 $(MAKE
) pass
"stagepass=stage1"
74 $(MAKE
) pass
"stagepass=stage2"
78 $(MAKE
) pass
"stagepass=stage2"
82 cp
$(srcdir)/gcc
`if [ -d $(srcdir)/gcc.$(target) ] ; \
83 then echo .$(target) ; fi`/gstdarg.h
$(srcdir)/gas
/stdarg.h
84 $(MAKE
) subdir_do DO
=all "DODIRS=$(SUBDIRS)" \
85 "CC=$(srcdir)/../gcc`if [ -d $(srcdir)/gcc.$(target) ] ; \
86 then echo .$(target) ; fi`$(subdir)/$(stagepass)/gcc -O \
87 -B$(srcdir)/../gcc`if [ -d $(srcdir)/gcc.$(target) ] ; \
88 then echo .$(target) ; fi`$(subdir)/$(stagepass)/ \
89 -B$(srcdir)/../gas`if [ -d $(srcdir)/gas.$(target) ] ; \
90 then echo .$(target) ; fi`$(subdir)/$(stagepass)/" \
91 "AR=$(srcdir)/../binutils`if [ -d $(srcdir)/binutils.$(target) ] ; \
92 then echo .$(target) ; fi`$(subdir)/$(stagepass)/ar" \
93 "RANLIB=$(srcdir)/../binutils`if [ -d $(srcdir)/binutils.$(target) ] ; \
94 then echo .$(target) ; fi`$(subdir)/$(stagepass)/ranlib" \
95 "LOADLIBES=$(srcdir)/../gnulib`if [ -d $(srcdir)/binutils.$(target) ] ; \
96 then echo .$(target) ; fi`$(subdir)/$(stagepass)/gnulib.a /lib/libc.a" \
97 "LDFLAGS=-nostdlib /lib/crt0.o \
98 -L$(srcdir)/../gnulib`if [ -d $(srcdir)/gnulib.$(target) ] ; \
99 then echo .$(target) ; fi`$(subdir)/$(stagepass)/ \
100 -B$(srcdir)/../ld`if [ -d $(srcdir)/ld.$(target) ] ; \
101 then echo .$(target) ; fi`$(subdir)/$(stagepass)/"
105 $(MAKE
) subdir_do DO
=stage1
"DODIRS=$(SUBDIRS)"
108 $(MAKE
) subdir_do DO
=stage2
"DODIRS=$(SUBDIRS)"
111 $(MAKE
) subdir_do DO
=stage3
"DODIRS=$(SUBDIRS)"
114 $(MAKE
) subdir_do DO
=stage4
"DODIRS=$(SUBDIRS)"
118 comparison
:; $(MAKE
) subdir_do DO
=comparison against
=$(against
) "DODIRS=$(SUBDIRS)"
120 de-stage1
:; $(MAKE
) subdir_do DO
=de-stage1
"DODIRS=$(SUBDIRS)"
121 de-stage2
:; $(MAKE
) subdir_do DO
=de-stage2
"DODIRS=$(SUBDIRS)"
122 de-stage3
:; $(MAKE
) subdir_do DO
=de-stage3
"DODIRS=$(SUBDIRS)"
123 de-stage4
:; $(MAKE
) subdir_do DO
=de-stage4
"DODIRS=$(SUBDIRS)"
126 rm -rf
*.a TEMP errs core
*.o
*~ \
#* TAGS *.E
127 $(MAKE
) subdir_do DO
=clean "DODIRS=$(SUBDIRS) $(OTHERS)"
129 install: install-dirs install-fixed-includes
130 $(MAKE
) subdir_do DO
=install "DODIRS=$(SUBDIRS) $(OTHERS)"
132 # The "else true" stuff is for Ultrix; the shell returns the exit code
133 # of the "if" command, if no commands are run in the "then" or "else" part,
134 # causing Make to quit.
137 - mkdir
$(destdir
)/bin
138 - mkdir
$(destdir
)/lib
139 - mkdir
$(destdir
)/include
140 - mkdir
$(destdir
)/doc
141 - mkdir
$(destdir
)/man
142 - mkdir
$(destdir
)/man
/man1
143 - mkdir
$(destdir
)/man
/man2
144 - mkdir
$(destdir
)/man
/man3
145 - mkdir
$(destdir
)/man
/man4
146 - mkdir
$(destdir
)/man
/man5
147 - mkdir
$(destdir
)/man
/man6
148 - mkdir
$(destdir
)/man
/man7
149 - mkdir
$(destdir
)/man
/man8
150 if
[ -d
$(srcdir)/gcc
`if [ -d $(srcdir)/gcc.$(target) ] ; \
151 then echo .$(target) ; fi`$(subdir
) ] ; then \
152 (cd
$(srcdir)/gcc
`if [ -d $(srcdir)/gcc.$(target) ] ; \
153 then echo .$(target) ; fi`$(subdir
) ; \
154 $(MAKE
) install-dir
) ; \
158 install-fixed-includes
: force
159 if
[ -d
$(srcdir)/gcc
`if [ -d $(srcdir)/gcc.$(target) ] ; \
160 then echo .$(target) ; fi`$(subdir
) ] ; then \
161 (cd
$(srcdir)/gcc
`if [ -d $(srcdir)/gcc.$(target) ] ; \
162 then echo .$(target) ; fi`$(subdir
) ; \
163 $(MAKE
) install-fixed-includes
) ; \
174 @for i in
$(SUBDIRS
); \
178 wd
=`basename $$pwd`; \
179 for j in
`$(MAKE) ls`; \
187 # with the gnu make, this is done automatically.
189 Makefile
: $(srcdir)/Makefile.in
$(srcdir)/configure
191 .
/configure
+destdir
=$(destdir
) +norecurse \
192 `if [ "$(srcdir)" != "." ] ; then echo +subdirs; fi` \
193 $(host
) +target
=$(target
))
196 # Build GDB distributions that contain BFD, Include, Libiberty, Readline, etc
198 DEVO_SUPPORT
= README README.configure Makefile.in configure configure.in \
200 GDB_SUPPORT_DIRS
= bfd
include libiberty readline
201 GDB_SUPPORT_FILES
= $(GDB_SUPPORT_DIRS
) texinfo
/fsf
/texinfo.
tex
203 setup-dirs
: force_update
204 .
/configure
-template
=.
/configure
209 bfd.ilrt.
tar.Z
: setup-dirs
211 chmod og
=u
`find $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
212 tar cf
- $(DEVO_SUPPORT
) $(GDB_SUPPORT_FILES
) \
213 | compress
-v
>bfd.ilrt.
tar.Z
215 gdb.
tar.Z
: setup-dirs
216 (cd gdb
; $(MAKE
) -f Makefile.in make-proto-gdb.
dir)
217 $(MAKE
) $(MFLAGS
) -f Makefile.in make-gdb.
tar.Z
219 make-gdb.
tar.Z
: $(DEVO_SUPPORT
) $(GDB_SUPPORT_DIRS
) gdb texinfo
/fsf
/texinfo.
tex
220 rm -rf proto-toplev
; mkdir proto-toplev
221 ln
-s ..
/gdb
/proto-gdb.
dir proto-toplev
/gdb
222 (cd proto-toplev
; for i in
$(DEVO_SUPPORT
) $(GDB_SUPPORT_DIRS
); do \
225 mkdir proto-toplev
/texinfo
226 mkdir proto-toplev
/texinfo
/fsf
227 ln
-s ..
/..
/..
/texinfo
/fsf
/texinfo.
tex proto-toplev
/texinfo
/fsf
/
228 (VER
=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
229 echo
"==> Making gdb-$$VER.tar.Z"; \
230 ln
-s proto-toplev gdb-
$$VER; \
231 tar cfh
- gdb-
$$VER \
232 | compress
-v
>gdb-
$$VER.
tar.Z
)
238 # Revision 1.33 1991/09/20 08:41:45 gnu
239 # New rules for building distributions. Normal distribution
240 # is built by doing `make -f Makefile.in gdb.tar.Z' in the devo dir.
242 # Revision 1.32 1991/09/19 20:56:05 steve
243 # More changes for 68k and 386 coff support. (Sorry about the previous
246 # Revision 1.31 1991/09/03 13:28:38 gnu
247 # Add "else true" clauses for really dumb sh's such as Ultrix.
249 # Revision 1.30 1991/08/26 06:37:57 rich
250 # Correcting configurations and installs.
252 # Revision 1.29 1991/08/26 04:45:57 rich
253 # Correcting install target when gcc not present.
255 # Revision 1.28 1991/08/25 23:40:22 rich
256 # rcs enters the soup.
258 # Revision 1.27 1991/08/23 07:15:56 gnu
259 # Make README stick...
261 # Revision 1.26 1991/08/22 09:20:07 gnu
262 # Build a top-level README for devo.
264 # Revision 1.25 1991/08/22 07:15:49 rich
265 # Three part names, etc.
267 # Revision 1.24 1991/08/20 01:57:31 rich
268 # Another try at passing gnulib's location.
270 # Revision 1.23 1991/08/16 21:47:41 rich
271 # Pass on BISON as bison only if bison is here.
273 # Revision 1.22 1991/08/07 19:15:26 rich
274 # +forcesubdirs -> +subdirs
276 # Revision 1.21 1991/07/31 18:07:59 gnu
277 # Set file permissions the same for everyone before making tar file.
279 # Revision 1.20 1991/07/31 02:47:14 gnu
280 # Add bfd.ilrt.tar.Z "make" rules.
282 # Revision 1.19 1991/07/27 07:46:34 rich
283 # Changes to accomodate using the freshly built bison in place.
285 # Revision 1.18 1991/07/16 00:01:40 gnu
286 # Add back gdb and readline.
288 # Revision 1.17 1991/06/18 15:30:55 rich
289 # added install-dirs target.
291 # Revision 1.16 1991/06/14 13:35:40 rich
292 # install fixed include files on install.
294 # Revision 1.15 1991/06/09 20:27:01 rich
295 # added support for binary comparisons.
297 # Revision 1.14 1991/05/31 12:34:55 gnu
298 # Avoid error stop from Make if a directory doesn't exist during subdir_do.
300 # Revision 1.13 1991/05/27 23:03:20 rich
301 # Put gcc/gstdarg.h where gas can find it; gas/stdarg.h.
303 # Revision 1.12 1991/05/19 00:36:44 rich
306 # Revision 1.11 1991/05/03 21:30:41 gnu
307 # Rename getopt to libiberty.
309 # Revision 1.10 1991/04/24 16:50:53 rich
310 # Three staging checkpoint.
312 # Revision 1.9 1991/04/17 01:34:36 rich
313 # Added getopt for binutils, fixed problem with host dependancies in
314 # configure.template.
316 # Revision 1.8 1991/04/15 23:43:45 rich
317 # Now handles multiple hosts and targets.
319 # Revision 1.7 1991/04/13 13:06:16 tiemann
320 # Don't depend `install' on `all'. Actually, the way things work, all
321 # depends on things being incrementally installed, and install depends
322 # on everything happening in a topological fashion.
324 # This will need to be worked on further, but for now it's ok.
326 # Revision 1.6 1991/04/13 10:04:14 rich
327 # Now can build gas for a29k on a29k.
329 # Revision 1.5 1991/04/13 07:40:41 rich
330 # Fixed an ordering bug. Now everything is built, and then installed.
332 # Revision 1.4 1991/04/13 02:11:09 rich
333 # Config cut 3. We now almost install a29k.
335 # Revision 1.3 1991/04/11 02:41:53 rich
336 # Cut 2 config. Subdirs.