New installed binary layout.
[deliverable/binutils-gdb.git] / Makefile.in
CommitLineData
eb02fd64 1#
131a3881 2# Makefile for directory with subdirs to build.
4dfe09da 3# Copyright (C) 1990, 1991 Cygnus Support
eb02fd64 4#
4dfe09da
RP
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.
9#
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.
14#
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. */
18#
7dbcd409 19# Last Mod Wed Oct 9 23:25:49 PDT 1991, by rich@ok.cygnus.com
eb02fd64 20#
f149eb99
RP
21# $Id$
22
eb02fd64 23srcdir = .
ec342d7d 24destdir = /usr/local
eb02fd64 25
3c8735af
RP
26SHELL=/bin/sh
27
ec342d7d
RP
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)
eb02fd64 30
eb02fd64 31RANLIB = ranlib
ec342d7d 32AR = ar
090811c1 33AR_FLAGS = cq
4dfe09da 34BISONPATH =
eb02fd64 35
2bc9434c
RP
36BISON = `if [ -d $(unsubdir)/../bison ] ; \
37 then echo \`pwd\`/$(unsubdir)/../bison$(subdir)/bison -L \`pwd\`/$(unsubdir)/../bison/ ; \
38 else echo yacc ; fi`
2645fb0c
RP
39
40SUBDIRS = libiberty readline bfd gdb binutils ld gas gcc gnulib
6a3958b2
RP
41OTHERS =
42
eb02fd64 43#### host and target specific makefile fragments come in here.
ec342d7d 44###
eb02fd64 45
6a3958b2 46all:
3c81fef5 47 $(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS) $(OTHERS)"
6a3958b2 48
3c81fef5 49subdir_do: force
a01bf1fb 50 for i in $(DODIRS); do \
2bc9434c
RP
51 if [ -d $(unsubdir)/$$i -o -d $(unsubdir)/$$i.$(target) ] ; then \
52 if (cd $(unsubdir)/$$i`if [ -d $(unsubdir)/$$i.$(target) ] ; \
a01bf1fb
RP
53 then echo .$(target) ; fi`$(subdir); \
54 $(MAKE) \
55 "against=$(against)" \
56 "AR=$(AR)" \
abc52b80 57 "CC=$(CC)" \
a01bf1fb 58 "AR_FLAGS=$(AR_FLAGS)" \
2645fb0c 59 "RANLIB=$(RANLIB)" \
905bb120
RP
60 "LOADLIBES=$(LOADLIBES)" \
61 "LDFLAGS=$(LDFLAGS)" \
2645fb0c 62 "BISON=$(BISON)" $(DO)) ; then true ; \
a01bf1fb
RP
63 else exit 1 ; fi ; \
64 else true ; fi ; \
65 done
eb02fd64 66
2b34da49
RP
67bootstrap:
68 $(MAKE) all
69 $(MAKE) stage1
6a3958b2
RP
70 $(MAKE) pass "stagepass=stage1"
71 $(MAKE) stage2
72 $(MAKE) pass "stagepass=stage2"
a01bf1fb 73 $(MAKE) comparison
6a3958b2
RP
74
75bootstrap2:
76 $(MAKE) pass "stagepass=stage1"
77 $(MAKE) stage2
78 $(MAKE) pass "stagepass=stage2"
a01bf1fb 79 $(MAKE) comparison
6a3958b2
RP
80
81bootstrap3:
82 $(MAKE) pass "stagepass=stage2"
a01bf1fb 83 $(MAKE) comparison
6a3958b2
RP
84
85pass:
2bc9434c
RP
86 cp $(unsubdir)/gcc`if [ -d $(unsubdir)/gcc.$(target) ] ; \
87 then echo .$(target) ; fi`/gstdarg.h $(unsubdir)/gas/stdarg.h
3c81fef5 88 $(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS)" \
2bc9434c 89 "CC=`pwd`/$(unsubdir)/gcc`if [ -d $(unsubdir)/gcc.$(target) ] ; \
905bb120
RP
90 then echo .$(target) ; fi`$(subdir)/$(stagepass)/gcc \
91 -O \
2bc9434c 92 -B`pwd`/$(unsubdir)/gcc`if [ -d $(unsubdir)/gcc.$(target) ] ; \
6a3958b2 93 then echo .$(target) ; fi`$(subdir)/$(stagepass)/ \
2bc9434c 94 -B`pwd`/$(unsubdir)/gas`if [ -d $(unsubdir)/gas.$(target) ] ; \
905bb120 95 then echo .$(target) ; fi`$(subdir)/$(stagepass)/ \
2bc9434c 96 -B`pwd`/$(unsubdir)/ld`if [ -d $(unsubdir)/ld.$(target) ] ; \
6a3958b2 97 then echo .$(target) ; fi`$(subdir)/$(stagepass)/" \
2bc9434c 98 "AR=`pwd`/$(unsubdir)/binutils`if [ -d $(unsubdir)/binutils.$(target) ] ; \
6a3958b2 99 then echo .$(target) ; fi`$(subdir)/$(stagepass)/ar" \
2bc9434c 100 "RANLIB=`pwd`/$(unsubdir)/binutils`if [ -d $(unsubdir)/binutils.$(target) ] ; \
6a3958b2 101 then echo .$(target) ; fi`$(subdir)/$(stagepass)/ranlib" \
2bc9434c 102 "LOADLIBES=`pwd`/$(unsubdir)/gnulib`if [ -d $(unsubdir)/binutils.$(target) ] ; \
6a3958b2
RP
103 then echo .$(target) ; fi`$(subdir)/$(stagepass)/gnulib.a /lib/libc.a" \
104 "LDFLAGS=-nostdlib /lib/crt0.o \
2bc9434c 105 -L`pwd`/$(unsubdir)/gnulib`if [ -d $(unsubdir)/gnulib.$(target) ] ; \
4dfe09da 106 then echo .$(target) ; fi`$(subdir)/$(stagepass)/ \
2bc9434c 107 -B`pwd`/$(unsubdir)/ld`if [ -d $(unsubdir)/ld.$(target) ] ; \
6a3958b2 108 then echo .$(target) ; fi`$(subdir)/$(stagepass)/"
2b34da49 109
eb02fd64 110
6a3958b2 111stage1:
3c81fef5 112 $(MAKE) subdir_do DO=stage1 "DODIRS=$(SUBDIRS)"
eb02fd64 113
6a3958b2 114stage2:
3c81fef5 115 $(MAKE) subdir_do DO=stage2 "DODIRS=$(SUBDIRS)"
eb02fd64 116
6a3958b2 117stage3:
3c81fef5 118 $(MAKE) subdir_do DO=stage3 "DODIRS=$(SUBDIRS)"
eb02fd64 119
6a3958b2 120stage4:
3c81fef5 121 $(MAKE) subdir_do DO=stage4 "DODIRS=$(SUBDIRS)"
eb02fd64 122
a01bf1fb
RP
123against=stage2
124
125comparison:; $(MAKE) subdir_do DO=comparison against=$(against) "DODIRS=$(SUBDIRS)"
126
3c81fef5
RP
127de-stage1:; $(MAKE) subdir_do DO=de-stage1 "DODIRS=$(SUBDIRS)"
128de-stage2:; $(MAKE) subdir_do DO=de-stage2 "DODIRS=$(SUBDIRS)"
129de-stage3:; $(MAKE) subdir_do DO=de-stage3 "DODIRS=$(SUBDIRS)"
130de-stage4:; $(MAKE) subdir_do DO=de-stage4 "DODIRS=$(SUBDIRS)"
6a3958b2
RP
131
132clean:
133 rm -rf *.a TEMP errs core *.o *~ \#* TAGS *.E
3c81fef5 134 $(MAKE) subdir_do DO=clean "DODIRS=$(SUBDIRS) $(OTHERS)"
6a3958b2 135
2645fb0c 136install: install-dirs install-fixed-includes
3c81fef5 137 $(MAKE) subdir_do DO=install "DODIRS=$(SUBDIRS) $(OTHERS)"
eb02fd64 138
abc52b80
JG
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.
2645fb0c
RP
142install-dirs: force
143 - mkdir $(destdir)
7dbcd409
RP
144 - mkdir $(destdir)/H-$(host_alias)
145 - mkdir $(destdir)/H-$(host_alias)/T-$(target_alias)
146 - mkdir $(destdir)/H-$(host_alias)/T-$(target_alias)/bin
147 - mkdir $(destdir)/H-$(host_alias)/T-$(target_alias)/lib
148 - mkdir $(destdir)/H-independent
149 - mkdir $(destdir)/H-independent/include
150 - mkdir $(destdir)/H-independent/doc
151 - mkdir $(destdir)/H-independent/man
152 - mkdir $(destdir)/H-independent/man/man1
153 - mkdir $(destdir)/H-independent/man/man2
154 - mkdir $(destdir)/H-independent/man/man3
155 - mkdir $(destdir)/H-independent/man/man4
156 - mkdir $(destdir)/H-independent/man/man5
157 - mkdir $(destdir)/H-independent/man/man6
158 - mkdir $(destdir)/H-independent/man/man7
159 - mkdir $(destdir)/H-independent/man/man8
2bc9434c 160 if [ -d $(unsubdir)/gcc`if [ -d $(unsubdir)/gcc.$(target) ] ; \
5710dc37 161 then echo .$(target) ; fi`$(subdir) ] ; then \
2bc9434c 162 (cd $(unsubdir)/gcc`if [ -d $(unsubdir)/gcc.$(target) ] ; \
5710dc37
RP
163 then echo .$(target) ; fi`$(subdir) ; \
164 $(MAKE) install-dir) ; \
abc52b80 165 else true; \
5710dc37 166 fi
2645fb0c
RP
167
168install-fixed-includes: force
2bc9434c 169 if [ -d $(unsubdir)/gcc`if [ -d $(unsubdir)/gcc.$(target) ] ; \
5710dc37 170 then echo .$(target) ; fi`$(subdir) ] ; then \
2bc9434c 171 (cd $(unsubdir)/gcc`if [ -d $(unsubdir)/gcc.$(target) ] ; \
5710dc37
RP
172 then echo .$(target) ; fi`$(subdir) ; \
173 $(MAKE) install-fixed-includes) ; \
abc52b80 174 else true; \
5710dc37 175 fi
a7058e26 176
eb02fd64
RP
177etags tags: TAGS
178
179TAGS: FORCE
180 etags `$(MAKE) ls`
181
182ls:
183 @echo Makefile
184 @for i in $(SUBDIRS); \
185 do \
186 (cd $$i; \
187 pwd=`pwd`; \
188 wd=`basename $$pwd`; \
189 for j in `$(MAKE) ls`; \
190 do \
191 echo $$wd/$$j; \
192 done) \
193 done
194
3c81fef5 195force:
eb02fd64
RP
196
197# with the gnu make, this is done automatically.
198
f1eb48b6 199Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
a26878d1 200 $(SHELL) ./config.status
eb02fd64 201
11954bf1
JG
202#
203# Build GDB distributions that contain BFD, Include, Libiberty, Readline, etc
204
3c8735af 205DEVO_SUPPORT= README README.configure Makefile.in configure configure.in \
abc52b80
JG
206 config.sub config
207GDB_SUPPORT_DIRS= bfd include libiberty readline
208GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS) texinfo/fsf/texinfo.tex
11954bf1 209
abc52b80 210setup-dirs: force_update
11954bf1
JG
211 ./configure -template=./configure
212 ./configure sun4
213 make clean
214 ./configure -rm sun4
905bb120 215 chmod og=u `find $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
abc52b80
JG
216
217bfd.ilrt.tar.Z: setup-dirs
11954bf1 218 rm -f bfd.ilrt.tar.Z
abc52b80 219 tar cf - $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) \
11954bf1
JG
220 | compress -v >bfd.ilrt.tar.Z
221
abc52b80
JG
222gdb.tar.Z: setup-dirs
223 (cd gdb; $(MAKE) -f Makefile.in make-proto-gdb.dir)
224 $(MAKE) $(MFLAGS) -f Makefile.in make-gdb.tar.Z
225
226make-gdb.tar.Z: $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS) gdb texinfo/fsf/texinfo.tex
227 rm -rf proto-toplev; mkdir proto-toplev
228 ln -s ../gdb/proto-gdb.dir proto-toplev/gdb
229 (cd proto-toplev; for i in $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS); do \
230 ln -s ../$$i . ; \
231 done)
232 mkdir proto-toplev/texinfo
233 mkdir proto-toplev/texinfo/fsf
234 ln -s ../../../texinfo/fsf/texinfo.tex proto-toplev/texinfo/fsf/
905bb120 235 chmod og=u `find proto-toplev -print`
abc52b80
JG
236 (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
237 echo "==> Making gdb-$$VER.tar.Z"; \
238 ln -s proto-toplev gdb-$$VER; \
239 tar cfh - gdb-$$VER \
240 | compress -v >gdb-$$VER.tar.Z)
241
11954bf1
JG
242force_update:
243
eb02fd64
RP
244#
245# $Log$
7dbcd409
RP
246# Revision 1.41 1991/10/10 06:36:30 rich
247# New installed binary layout.
248#
249# Revision 1.40 1991/10/09 00:11:14 rich
2bc9434c
RP
250# Getting BISON right.
251#
252# Revision 1.39 1991/10/02 10:03:15 rich
253# Some $(srcdir)'s become $(unsubdir)'s in order to support +objdir.
254#
255# Revision 1.38 1991/10/02 07:21:55 rich
f1eb48b6
RP
256# no more configure on which to depend
257#
258# Revision 1.37 1991/10/01 13:41:00 gnu
090811c1
JG
259# Avoid 'v' flag on archive updates, since it just wastes space in the log.
260#
261# Revision 1.36 1991/10/01 03:45:39 rich
a26878d1
RP
262# Exploit the new executable config.status
263#
264# Revision 1.35 1991/09/25 04:34:40 rich
905bb120
RP
265# Pass command names with absolute paths. Easier than keeping relative
266# paths right when dealing with sub/sub/directories.
267#
268# Revision 1.34 1991/09/20 09:08:56 gnu
269# Set file permissions on all files when building a distribution.
270#
271# Revision 1.33 1991/09/20 08:41:45 gnu
abc52b80
JG
272# New rules for building distributions. Normal distribution
273# is built by doing `make -f Makefile.in gdb.tar.Z' in the devo dir.
274#
275# Revision 1.32 1991/09/19 20:56:05 steve
276# More changes for 68k and 386 coff support. (Sorry about the previous
277# log).
278#
279# Revision 1.31 1991/09/03 13:28:38 gnu
280# Add "else true" clauses for really dumb sh's such as Ultrix.
281#
282# Revision 1.30 1991/08/26 06:37:57 rich
283# Correcting configurations and installs.
284#
285# Revision 1.29 1991/08/26 04:45:57 rich
5710dc37
RP
286# Correcting install target when gcc not present.
287#
288# Revision 1.28 1991/08/25 23:40:22 rich
3c8735af
RP
289# rcs enters the soup.
290#
291# Revision 1.27 1991/08/23 07:15:56 gnu
292# Make README stick...
293#
294# Revision 1.26 1991/08/22 09:20:07 gnu
295# Build a top-level README for devo.
296#
297# Revision 1.25 1991/08/22 07:15:49 rich
4dfe09da
RP
298# Three part names, etc.
299#
300# Revision 1.24 1991/08/20 01:57:31 rich
301# Another try at passing gnulib's location.
302#
303# Revision 1.23 1991/08/16 21:47:41 rich
304# Pass on BISON as bison only if bison is here.
305#
306# Revision 1.22 1991/08/07 19:15:26 rich
307# +forcesubdirs -> +subdirs
308#
309# Revision 1.21 1991/07/31 18:07:59 gnu
310# Set file permissions the same for everyone before making tar file.
311#
312# Revision 1.20 1991/07/31 02:47:14 gnu
11954bf1
JG
313# Add bfd.ilrt.tar.Z "make" rules.
314#
315# Revision 1.19 1991/07/27 07:46:34 rich
2645fb0c
RP
316# Changes to accomodate using the freshly built bison in place.
317#
318# Revision 1.18 1991/07/16 00:01:40 gnu
319# Add back gdb and readline.
320#
321# Revision 1.17 1991/06/18 15:30:55 rich
322# added install-dirs target.
323#
324# Revision 1.16 1991/06/14 13:35:40 rich
a7058e26
RP
325# install fixed include files on install.
326#
327# Revision 1.15 1991/06/09 20:27:01 rich
a01bf1fb
RP
328# added support for binary comparisons.
329#
330# Revision 1.14 1991/05/31 12:34:55 gnu
6849cb71
JG
331# Avoid error stop from Make if a directory doesn't exist during subdir_do.
332#
333# Revision 1.13 1991/05/27 23:03:20 rich
2770ad8b
RP
334# Put gcc/gstdarg.h where gas can find it; gas/stdarg.h.
335#
336# Revision 1.12 1991/05/19 00:36:44 rich
3c81fef5
RP
337# Added gdb.
338#
339# Revision 1.11 1991/05/03 21:30:41 gnu
592ecfb2
JG
340# Rename getopt to libiberty.
341#
342# Revision 1.10 1991/04/24 16:50:53 rich
6a3958b2
RP
343# Three staging checkpoint.
344#
345# Revision 1.9 1991/04/17 01:34:36 rich
2b34da49
RP
346# Added getopt for binutils, fixed problem with host dependancies in
347# configure.template.
348#
349# Revision 1.8 1991/04/15 23:43:45 rich
0df06ca0
RP
350# Now handles multiple hosts and targets.
351#
352# Revision 1.7 1991/04/13 13:06:16 tiemann
bb335cf4
MT
353# Don't depend `install' on `all'. Actually, the way things work, all
354# depends on things being incrementally installed, and install depends
355# on everything happening in a topological fashion.
356#
357# This will need to be worked on further, but for now it's ok.
358#
359# Revision 1.6 1991/04/13 10:04:14 rich
360# Now can build gas for a29k on a29k.
361#
362# Revision 1.5 1991/04/13 07:40:41 rich
f149eb99
RP
363# Fixed an ordering bug. Now everything is built, and then installed.
364#
365# Revision 1.4 1991/04/13 02:11:09 rich
ec342d7d
RP
366# Config cut 3. We now almost install a29k.
367#
368# Revision 1.3 1991/04/11 02:41:53 rich
131a3881 369# Cut 2 config. Subdirs.
eb02fd64
RP
370#
371#
372#
373
374# end of Makefile.in
This page took 0.047764 seconds and 4 git commands to generate.