Does't pass env variables down if localenv file is in target dir.
[deliverable/binutils-gdb.git] / Makefile.in
1 #
2 # Makefile for directory with subdirs to build.
3 # Copyright (C) 1990, 1991 Cygnus Support
4 #
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 #
19 # Last Mod Tue Oct 22 22:40:07 PDT 1991, by rich@cygnus.com
20 #
21 # $Id$
22
23 srcdir = .
24 destdir = /usr/local
25
26 SHELL=/bin/sh
27
28 RANLIB = ranlib
29 AR = ar
30 AR_FLAGS = cq
31
32 BISON = `if [ -d $(unsubdir)/../bison ] ; \
33 then echo \`pwd\`/$(unsubdir)/../bison$(subdir)/bison -L \`pwd\`/$(unsubdir)/../bison/ ; \
34 else echo yacc ; fi`
35
36 SUBDIRS = libiberty readline bfd gdb binutils ld gas gcc gnulib
37 OTHERS =
38
39 ALL = all.normal
40
41 #### host and target specific makefile fragments come in here.
42 ###
43
44 all: $(ALL)
45
46 all.normal:
47 $(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS) $(OTHERS)"
48
49 # this is a bad hack.
50 all.xclib: all.normal
51 if [ -d clib ] ; then \
52 (cd clib ; $(MAKE)) ; \
53 fi
54
55 subdir_do: force
56 for i in $(DODIRS); do \
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 \
65 if (cd $(unsubdir)/$$i`if [ -d $(unsubdir)/$$i.$(target) ] ; \
66 then echo .$(target) ; fi`$(subdir); \
67 $(MAKE) \
68 "against=$(against)" \
69 "AR=$(AR)" \
70 "CC=$(CC)" \
71 "AR_FLAGS=$(AR_FLAGS)" \
72 "RANLIB=$(RANLIB)" \
73 "LOADLIBES=$(LOADLIBES)" \
74 "LDFLAGS=$(LDFLAGS)" \
75 "BISON=$(BISON)" $(DO)) ; then true ; \
76 else exit 1 ; fi ; \
77 else true ; fi ; \
78 fi ; \
79 done
80
81
82
83 bootstrap:
84 $(MAKE) all
85 $(MAKE) stage1
86 $(MAKE) pass "stagepass=stage1"
87 $(MAKE) stage2
88 $(MAKE) pass "stagepass=stage2"
89 $(MAKE) comparison
90
91 bootstrap2:
92 $(MAKE) pass "stagepass=stage1"
93 $(MAKE) stage2
94 $(MAKE) pass "stagepass=stage2"
95 $(MAKE) comparison
96
97 bootstrap3:
98 $(MAKE) pass "stagepass=stage2"
99 $(MAKE) comparison
100
101 pass:
102 cp $(unsubdir)/gcc`if [ -d $(unsubdir)/gcc.$(target) ] ; \
103 then echo .$(target) ; fi`/gstdarg.h $(unsubdir)/gas/stdarg.h
104 $(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS)" \
105 "CC=`pwd`/$(unsubdir)/gcc`if [ -d $(unsubdir)/gcc.$(target) ] ; \
106 then echo .$(target) ; fi`$(subdir)/$(stagepass)/gcc \
107 -O \
108 -B`pwd`/$(unsubdir)/gcc`if [ -d $(unsubdir)/gcc.$(target) ] ; \
109 then echo .$(target) ; fi`$(subdir)/$(stagepass)/ \
110 -B`pwd`/$(unsubdir)/gas`if [ -d $(unsubdir)/gas.$(target) ] ; \
111 then echo .$(target) ; fi`$(subdir)/$(stagepass)/ \
112 -B`pwd`/$(unsubdir)/ld`if [ -d $(unsubdir)/ld.$(target) ] ; \
113 then echo .$(target) ; fi`$(subdir)/$(stagepass)/" \
114 "AR=`pwd`/$(unsubdir)/binutils`if [ -d $(unsubdir)/binutils.$(target) ] ; \
115 then echo .$(target) ; fi`$(subdir)/$(stagepass)/ar" \
116 "RANLIB=`pwd`/$(unsubdir)/binutils`if [ -d $(unsubdir)/binutils.$(target) ] ; \
117 then echo .$(target) ; fi`$(subdir)/$(stagepass)/ranlib" \
118 "LOADLIBES=`pwd`/$(unsubdir)/gnulib`if [ -d $(unsubdir)/binutils.$(target) ] ; \
119 then echo .$(target) ; fi`$(subdir)/$(stagepass)/gnulib.a /lib/libc.a" \
120 "LDFLAGS=-nostdlib /lib/crt0.o \
121 -L`pwd`/$(unsubdir)/gnulib`if [ -d $(unsubdir)/gnulib.$(target) ] ; \
122 then echo .$(target) ; fi`$(subdir)/$(stagepass)/ \
123 -B`pwd`/$(unsubdir)/ld`if [ -d $(unsubdir)/ld.$(target) ] ; \
124 then echo .$(target) ; fi`$(subdir)/$(stagepass)/"
125
126
127 stage1:
128 $(MAKE) subdir_do DO=stage1 "DODIRS=$(SUBDIRS)"
129
130 stage2:
131 $(MAKE) subdir_do DO=stage2 "DODIRS=$(SUBDIRS)"
132
133 stage3:
134 $(MAKE) subdir_do DO=stage3 "DODIRS=$(SUBDIRS)"
135
136 stage4:
137 $(MAKE) subdir_do DO=stage4 "DODIRS=$(SUBDIRS)"
138
139 against=stage2
140
141 comparison:; $(MAKE) subdir_do DO=comparison against=$(against) "DODIRS=$(SUBDIRS)"
142
143 de-stage1:; $(MAKE) subdir_do DO=de-stage1 "DODIRS=$(SUBDIRS)"
144 de-stage2:; $(MAKE) subdir_do DO=de-stage2 "DODIRS=$(SUBDIRS)"
145 de-stage3:; $(MAKE) subdir_do DO=de-stage3 "DODIRS=$(SUBDIRS)"
146 de-stage4:; $(MAKE) subdir_do DO=de-stage4 "DODIRS=$(SUBDIRS)"
147
148 clean:
149 rm -rf *.a TEMP errs core *.o *~ \#* TAGS *.E
150 $(MAKE) subdir_do DO=clean "DODIRS=$(SUBDIRS) $(OTHERS)"
151
152 install: install-dirs install-fixed-includes
153 $(MAKE) subdir_do DO=install "DODIRS=$(SUBDIRS) $(OTHERS)"
154
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.
158 install-dirs: force
159 - mkdir $(destdir)
160 - mkdir $(destdir)/H-$(host_alias)
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
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
179 if [ -d $(unsubdir)/gcc`if [ -d $(unsubdir)/gcc.$(target) ] ; \
180 then echo .$(target) ; fi`$(subdir) ] ; then \
181 (cd $(unsubdir)/gcc`if [ -d $(unsubdir)/gcc.$(target) ] ; \
182 then echo .$(target) ; fi`$(subdir) ; \
183 $(MAKE) install-dir) ; \
184 else true; \
185 fi
186
187 install-fixed-includes: force
188 if [ -d $(unsubdir)/gcc`if [ -d $(unsubdir)/gcc.$(target) ] ; \
189 then echo .$(target) ; fi`$(subdir) ] ; then \
190 (cd $(unsubdir)/gcc`if [ -d $(unsubdir)/gcc.$(target) ] ; \
191 then echo .$(target) ; fi`$(subdir) ; \
192 $(MAKE) install-fixed-includes) ; \
193 else true; \
194 fi
195
196 etags tags: TAGS
197
198 TAGS: FORCE
199 etags `$(MAKE) ls`
200
201 ls:
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
214 force:
215
216 # with the gnu make, this is done automatically.
217
218 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
219 $(SHELL) ./config.status
220
221 #
222 # Build GDB distributions that contain BFD, Include, Libiberty, Readline, etc
223
224 DEVO_SUPPORT= README README.configure Makefile.in configure configure.in \
225 config.sub config
226 GDB_SUPPORT_DIRS= bfd include libiberty readline
227 GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS) texinfo/fsf/texinfo.tex
228
229 setup-dirs: force_update
230 ./configure sun4
231 make clean
232 ./configure -rm sun4
233 chmod og=u `find $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
234
235 bfd.ilrt.tar.Z: setup-dirs
236 rm -f bfd.ilrt.tar.Z
237 tar cf - $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) \
238 | compress -v >bfd.ilrt.tar.Z
239
240 gdb.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
244 make-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/
253 chmod og=u `find proto-toplev -print`
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
260 force_update:
261
262 # end of Makefile.in
This page took 0.034643 seconds and 5 git commands to generate.