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