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