* ar.c (get_pos_bfd): Previous fix was missing a "break".
[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#
cd49a4dc 19# Last Mod Tue Nov 12 00:21:50 PST 1991, by rich@sendai
eb02fd64 20#
f149eb99
RP
21# $Id$
22
eb02fd64 23srcdir = .
28f3b094
RP
24
25idestdir = /usr/local
26ddestdir = $(idestdir)
eb02fd64 27
3c8735af
RP
28SHELL=/bin/sh
29
eb02fd64 30RANLIB = ranlib
ec342d7d 31AR = ar
090811c1 32AR_FLAGS = cq
eb02fd64 33
2bc9434c 34BISON = `if [ -d $(unsubdir)/../bison ] ; \
a5dc1fdb 35 then echo \`pwd\`/$(unsubdir)/../bison$(subdir)/bison -L \`pwd\`/$(unsubdir)/../bison$(subdir)/ ; \
2bc9434c 36 else echo yacc ; fi`
2645fb0c 37
2c55824f 38#\`(cd $(srcdir)/bison ; \\`pwd\\`)\`
9488cc4d 39SUBDIRS = libiberty readline bfd gdb binutils ld gas gcc gnulib clib
6a3958b2
RP
40OTHERS =
41
a0f47eb7 42ALL = all.normal
0ec776a5
SC
43INSTALL_HEADERS = install-headers
44INSTALL_FIXED_INCLUDES = install-fixed-includes
fb660409
RP
45
46### for debugging
47#GCCVERBOSE=-v
48
eb02fd64 49#### host and target specific makefile fragments come in here.
ec342d7d 50###
eb02fd64 51
a0f47eb7
SC
52all: $(ALL)
53
54all.normal:
3c81fef5 55 $(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS) $(OTHERS)"
6a3958b2 56
a0f47eb7
SC
57# this is a bad hack.
58all.xclib: all.normal
59 if [ -d clib ] ; then \
60 (cd clib ; $(MAKE)) ; \
61 fi
62
3c81fef5 63subdir_do: force
a01bf1fb 64 for i in $(DODIRS); do \
2c55824f
RP
65 if [ -f $(unsubdir)/$$i/localenv ] ; then \
66 if (cd $(unsubdir)/$$i$(subdir); \
a0f47eb7
SC
67 $(MAKE) \
68 "against=$(against)" \
69 "BISON=$(BISON)" $(DO)) ; then true ; \
70 else exit 1 ; fi ; \
2c55824f
RP
71 else if [ -d $(unsubdir)/$$i ] ; then \
72 if (cd $(unsubdir)/$$i$(subdir); \
a01bf1fb
RP
73 $(MAKE) \
74 "against=$(against)" \
75 "AR=$(AR)" \
abc52b80 76 "CC=$(CC)" \
a01bf1fb 77 "AR_FLAGS=$(AR_FLAGS)" \
2645fb0c 78 "RANLIB=$(RANLIB)" \
905bb120
RP
79 "LOADLIBES=$(LOADLIBES)" \
80 "LDFLAGS=$(LDFLAGS)" \
2645fb0c 81 "BISON=$(BISON)" $(DO)) ; then true ; \
a01bf1fb
RP
82 else exit 1 ; fi ; \
83 else true ; fi ; \
a0f47eb7 84 fi ; \
a01bf1fb 85 done
eb02fd64 86
a0f47eb7
SC
87
88
2b34da49
RP
89bootstrap:
90 $(MAKE) all
91 $(MAKE) stage1
6a3958b2
RP
92 $(MAKE) pass "stagepass=stage1"
93 $(MAKE) stage2
94 $(MAKE) pass "stagepass=stage2"
a01bf1fb 95 $(MAKE) comparison
6a3958b2
RP
96
97bootstrap2:
98 $(MAKE) pass "stagepass=stage1"
99 $(MAKE) stage2
100 $(MAKE) pass "stagepass=stage2"
a01bf1fb 101 $(MAKE) comparison
6a3958b2
RP
102
103bootstrap3:
104 $(MAKE) pass "stagepass=stage2"
a01bf1fb 105 $(MAKE) comparison
6a3958b2
RP
106
107pass:
517d18b2 108 cp $(srcdir)/gcc/gstdarg.h $(unsubdir)/gas$(subdir)/stdarg.h
3c81fef5 109 $(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS)" \
2c55824f 110 "CC=`pwd`/$(unsubdir)/gcc$(subdir)/$(stagepass)/gcc \
fb660409 111 -O $(GCCVERBOSE) \
2c55824f
RP
112 -B`pwd`/$(unsubdir)/gcc$(subdir)/$(stagepass)/ \
113 -B`pwd`/$(unsubdir)/gas$(subdir)/$(stagepass)/ \
114 -B`pwd`/$(unsubdir)/ld$(subdir)/$(stagepass)/" \
a297b8ce 115 "AR=`pwd`/$(unsubdir)/binutils$(subdir)/$(stagepass)/ar" \
fb660409 116 "LD=`pwd`/$(unsubdir)/ld$(subdir)/$(stagepass)/ld $(GCCVERBOSE)" \
2c55824f
RP
117 "RANLIB=`pwd`/$(unsubdir)/binutils$(subdir)/$(stagepass)/ranlib" \
118 "LOADLIBES=`pwd`/$(unsubdir)/gnulib$(subdir)/$(stagepass)/gnulib.a /lib/libc.a" \
6a3958b2 119 "LDFLAGS=-nostdlib /lib/crt0.o \
2c55824f
RP
120 -L`pwd`/$(unsubdir)/gnulib$(subdir)/$(stagepass)/ \
121 -B`pwd`/$(unsubdir)/ld$(subdir)/$(stagepass)/"
2b34da49 122
eb02fd64 123
6a3958b2 124stage1:
3c81fef5 125 $(MAKE) subdir_do DO=stage1 "DODIRS=$(SUBDIRS)"
eb02fd64 126
6a3958b2 127stage2:
3c81fef5 128 $(MAKE) subdir_do DO=stage2 "DODIRS=$(SUBDIRS)"
eb02fd64 129
6a3958b2 130stage3:
3c81fef5 131 $(MAKE) subdir_do DO=stage3 "DODIRS=$(SUBDIRS)"
eb02fd64 132
6a3958b2 133stage4:
3c81fef5 134 $(MAKE) subdir_do DO=stage4 "DODIRS=$(SUBDIRS)"
eb02fd64 135
a01bf1fb
RP
136against=stage2
137
138comparison:; $(MAKE) subdir_do DO=comparison against=$(against) "DODIRS=$(SUBDIRS)"
139
3c81fef5
RP
140de-stage1:; $(MAKE) subdir_do DO=de-stage1 "DODIRS=$(SUBDIRS)"
141de-stage2:; $(MAKE) subdir_do DO=de-stage2 "DODIRS=$(SUBDIRS)"
142de-stage3:; $(MAKE) subdir_do DO=de-stage3 "DODIRS=$(SUBDIRS)"
143de-stage4:; $(MAKE) subdir_do DO=de-stage4 "DODIRS=$(SUBDIRS)"
6a3958b2
RP
144
145clean:
146 rm -rf *.a TEMP errs core *.o *~ \#* TAGS *.E
3c81fef5 147 $(MAKE) subdir_do DO=clean "DODIRS=$(SUBDIRS) $(OTHERS)"
6a3958b2 148
4c27527f
RP
149install: install-no-fixincludes $(INSTALL_FIXED_INCLUDES)
150
151install-no-fixincludes: install-dirs $(INSTALL_HEADERS)
3c81fef5 152 $(MAKE) subdir_do DO=install "DODIRS=$(SUBDIRS) $(OTHERS)"
eb02fd64 153
abc52b80
JG
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.
4c27527f
RP
157
158MAKEDIRS= \
159 $(ddestdir) \
160 $(ddestdir)/bin \
161 $(ddestdir)/include \
162 $(ddestdir)/lib \
163 $(ddestdir)/lib/emacs \
164 $(idestdir) \
4c27527f 165 $(idestdir)/lib \
cd49a4dc 166 $(idestdir)/info \
4c27527f
RP
167 $(idestdir)/doc \
168 $(idestdir)/man \
169 $(idestdir)/man/man1 \
0cc03f79 170 $(idestdir)/man/man5
4c27527f 171
a297b8ce 172install-dirs: force
4c27527f 173 for i in $(MAKEDIRS) ; do \
cd49a4dc 174 echo Making $$i... ; \
4c27527f
RP
175 if [ -d $$i ] ; then true ; else mkdir $$i ; fi ; \
176 done
0ec776a5
SC
177
178install-headers:
2c55824f
RP
179 if [ -d $(unsubdir)/gcc$(subdir) ] ; then \
180 (cd $(unsubdir)/gcc$(subdir) ; \
5710dc37 181 $(MAKE) install-dir) ; \
abc52b80 182 else true; \
5710dc37 183 fi
2645fb0c
RP
184
185install-fixed-includes: force
2c55824f
RP
186 if [ -d $(unsubdir)/gcc$(subdir) ] ; then \
187 (cd $(unsubdir)/gcc$(subdir) ; \
5710dc37 188 $(MAKE) install-fixed-includes) ; \
abc52b80 189 else true; \
5710dc37 190 fi
a7058e26 191
eb02fd64
RP
192etags tags: TAGS
193
194TAGS: FORCE
195 etags `$(MAKE) ls`
196
197ls:
198 @echo Makefile
199 @for i in $(SUBDIRS); \
200 do \
201 (cd $$i; \
202 pwd=`pwd`; \
203 wd=`basename $$pwd`; \
204 for j in `$(MAKE) ls`; \
205 do \
206 echo $$wd/$$j; \
207 done) \
208 done
209
3c81fef5 210force:
eb02fd64
RP
211
212# with the gnu make, this is done automatically.
213
f1eb48b6 214Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
a26878d1 215 $(SHELL) ./config.status
eb02fd64 216
11954bf1
JG
217#
218# Build GDB distributions that contain BFD, Include, Libiberty, Readline, etc
219
3c8735af 220DEVO_SUPPORT= README README.configure Makefile.in configure configure.in \
abc52b80
JG
221 config.sub config
222GDB_SUPPORT_DIRS= bfd include libiberty readline
223GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS) texinfo/fsf/texinfo.tex
11954bf1 224
abc52b80 225setup-dirs: force_update
11954bf1
JG
226 ./configure sun4
227 make clean
228 ./configure -rm sun4
905bb120 229 chmod og=u `find $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
abc52b80
JG
230
231bfd.ilrt.tar.Z: setup-dirs
11954bf1 232 rm -f bfd.ilrt.tar.Z
abc52b80 233 tar cf - $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) \
11954bf1
JG
234 | compress -v >bfd.ilrt.tar.Z
235
abc52b80
JG
236gdb.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
239
240make-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 \
244 ln -s ../$$i . ; \
245 done)
246 mkdir proto-toplev/texinfo
247 mkdir proto-toplev/texinfo/fsf
248 ln -s ../../../texinfo/fsf/texinfo.tex proto-toplev/texinfo/fsf/
905bb120 249 chmod og=u `find proto-toplev -print`
abc52b80
JG
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)
255
11954bf1
JG
256force_update:
257
0ec776a5
SC
258nothing:
259
eb02fd64 260# end of Makefile.in
This page took 0.048421 seconds and 4 git commands to generate.