add texinfo; mkdir foo/info; echo when mkdir'ing
[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 Nov 12 00:21:50 PST 1991, by rich@sendai
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 -L \`pwd\`/$(unsubdir)/../bison$(subdir)/ ; \
36 else echo yacc ; fi`
37
38 #\`(cd $(srcdir)/bison ; \\`pwd\\`)\`
39 SUBDIRS = libiberty readline bfd gdb binutils ld gas gcc gnulib clib
40 OTHERS =
41
42 ALL = all.normal
43 INSTALL_HEADERS = install-headers
44 INSTALL_FIXED_INCLUDES = install-fixed-includes
45
46 ### for debugging
47 #GCCVERBOSE=-v
48
49 #### host and target specific makefile fragments come in here.
50 ###
51
52 all: $(ALL)
53
54 all.normal:
55 $(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS) $(OTHERS)"
56
57 # this is a bad hack.
58 all.xclib: all.normal
59 if [ -d clib ] ; then \
60 (cd clib ; $(MAKE)) ; \
61 fi
62
63 subdir_do: force
64 for i in $(DODIRS); do \
65 if [ -f $(unsubdir)/$$i/localenv ] ; then \
66 if (cd $(unsubdir)/$$i$(subdir); \
67 $(MAKE) \
68 "against=$(against)" \
69 "BISON=$(BISON)" $(DO)) ; then true ; \
70 else exit 1 ; fi ; \
71 else if [ -d $(unsubdir)/$$i ] ; then \
72 if (cd $(unsubdir)/$$i$(subdir); \
73 $(MAKE) \
74 "against=$(against)" \
75 "AR=$(AR)" \
76 "CC=$(CC)" \
77 "AR_FLAGS=$(AR_FLAGS)" \
78 "RANLIB=$(RANLIB)" \
79 "LOADLIBES=$(LOADLIBES)" \
80 "LDFLAGS=$(LDFLAGS)" \
81 "BISON=$(BISON)" $(DO)) ; then true ; \
82 else exit 1 ; fi ; \
83 else true ; fi ; \
84 fi ; \
85 done
86
87
88
89 bootstrap:
90 $(MAKE) all
91 $(MAKE) stage1
92 $(MAKE) pass "stagepass=stage1"
93 $(MAKE) stage2
94 $(MAKE) pass "stagepass=stage2"
95 $(MAKE) comparison
96
97 bootstrap2:
98 $(MAKE) pass "stagepass=stage1"
99 $(MAKE) stage2
100 $(MAKE) pass "stagepass=stage2"
101 $(MAKE) comparison
102
103 bootstrap3:
104 $(MAKE) pass "stagepass=stage2"
105 $(MAKE) comparison
106
107 pass:
108 cp $(srcdir)/gcc/gstdarg.h $(unsubdir)/gas$(subdir)/stdarg.h
109 $(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS)" \
110 "CC=`pwd`/$(unsubdir)/gcc$(subdir)/$(stagepass)/gcc \
111 -O $(GCCVERBOSE) \
112 -B`pwd`/$(unsubdir)/gcc$(subdir)/$(stagepass)/ \
113 -B`pwd`/$(unsubdir)/gas$(subdir)/$(stagepass)/ \
114 -B`pwd`/$(unsubdir)/ld$(subdir)/$(stagepass)/" \
115 "AR=`pwd`/$(unsubdir)/binutils$(subdir)/$(stagepass)/ar" \
116 "LD=`pwd`/$(unsubdir)/ld$(subdir)/$(stagepass)/ld $(GCCVERBOSE)" \
117 "RANLIB=`pwd`/$(unsubdir)/binutils$(subdir)/$(stagepass)/ranlib" \
118 "LOADLIBES=`pwd`/$(unsubdir)/gnulib$(subdir)/$(stagepass)/gnulib.a /lib/libc.a" \
119 "LDFLAGS=-nostdlib /lib/crt0.o \
120 -L`pwd`/$(unsubdir)/gnulib$(subdir)/$(stagepass)/ \
121 -B`pwd`/$(unsubdir)/ld$(subdir)/$(stagepass)/"
122
123
124 stage1:
125 $(MAKE) subdir_do DO=stage1 "DODIRS=$(SUBDIRS)"
126
127 stage2:
128 $(MAKE) subdir_do DO=stage2 "DODIRS=$(SUBDIRS)"
129
130 stage3:
131 $(MAKE) subdir_do DO=stage3 "DODIRS=$(SUBDIRS)"
132
133 stage4:
134 $(MAKE) subdir_do DO=stage4 "DODIRS=$(SUBDIRS)"
135
136 against=stage2
137
138 comparison:; $(MAKE) subdir_do DO=comparison against=$(against) "DODIRS=$(SUBDIRS)"
139
140 de-stage1:; $(MAKE) subdir_do DO=de-stage1 "DODIRS=$(SUBDIRS)"
141 de-stage2:; $(MAKE) subdir_do DO=de-stage2 "DODIRS=$(SUBDIRS)"
142 de-stage3:; $(MAKE) subdir_do DO=de-stage3 "DODIRS=$(SUBDIRS)"
143 de-stage4:; $(MAKE) subdir_do DO=de-stage4 "DODIRS=$(SUBDIRS)"
144
145 clean:
146 rm -rf *.a TEMP errs core *.o *~ \#* TAGS *.E
147 $(MAKE) subdir_do DO=clean "DODIRS=$(SUBDIRS) $(OTHERS)"
148
149 install: install-no-fixincludes $(INSTALL_FIXED_INCLUDES)
150
151 install-no-fixincludes: install-dirs $(INSTALL_HEADERS)
152 $(MAKE) subdir_do DO=install "DODIRS=$(SUBDIRS) $(OTHERS)"
153
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.
157
158 MAKEDIRS= \
159 $(ddestdir) \
160 $(ddestdir)/bin \
161 $(ddestdir)/include \
162 $(ddestdir)/lib \
163 $(ddestdir)/lib/emacs \
164 $(idestdir) \
165 $(idestdir)/lib \
166 $(idestdir)/info \
167 $(idestdir)/doc \
168 $(idestdir)/man \
169 $(idestdir)/man/man1 \
170 $(idestdir)/man/man5
171
172 install-dirs: force
173 for i in $(MAKEDIRS) ; do \
174 echo Making $$i... ; \
175 if [ -d $$i ] ; then true ; else mkdir $$i ; fi ; \
176 done
177
178 install-headers:
179 if [ -d $(unsubdir)/gcc$(subdir) ] ; then \
180 (cd $(unsubdir)/gcc$(subdir) ; \
181 $(MAKE) install-dir) ; \
182 else true; \
183 fi
184
185 install-fixed-includes: force
186 if [ -d $(unsubdir)/gcc$(subdir) ] ; then \
187 (cd $(unsubdir)/gcc$(subdir) ; \
188 $(MAKE) install-fixed-includes) ; \
189 else true; \
190 fi
191
192 etags tags: TAGS
193
194 TAGS: FORCE
195 etags `$(MAKE) ls`
196
197 ls:
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
210 force:
211
212 # with the gnu make, this is done automatically.
213
214 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
215 $(SHELL) ./config.status
216
217 #
218 # Build GDB distributions that contain BFD, Include, Libiberty, Readline, etc
219
220 DEVO_SUPPORT= README README.configure Makefile.in configure configure.in \
221 config.sub config
222 GDB_SUPPORT_DIRS= bfd include libiberty readline
223 GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS) texinfo/fsf/texinfo.tex
224
225 setup-dirs: force_update
226 ./configure sun4
227 make clean
228 ./configure -rm sun4
229 chmod og=u `find $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
230
231 bfd.ilrt.tar.Z: setup-dirs
232 rm -f bfd.ilrt.tar.Z
233 tar cf - $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) \
234 | compress -v >bfd.ilrt.tar.Z
235
236 gdb.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
240 make-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/
249 chmod og=u `find proto-toplev -print`
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
256 force_update:
257
258 nothing:
259
260 # end of Makefile.in
This page took 0.049204 seconds and 5 git commands to generate.