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