]>
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 | # | |
c5f94070 | 19 | # Last Mod Thu Nov 14 03:17:05 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\\`)\` |
a3a063a9 | 43 | SUBDIRS = libiberty glob 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 | 56 | all: $(ALL) |
c5f94070 RP |
57 | all-info: force |
58 | $(MAKE) subdir_do DO=all-info "DODIRS=$(SUBDIRS)" | |
59 | ||
60 | install-info: dir.info install-info-dirs force | |
61 | $(MAKE) subdir_do DO=install-info "DODIRS=$(SUBDIRS)" | |
62 | $(MAKE) install-dir.info | |
a0f47eb7 SC |
63 | |
64 | all.normal: | |
3c81fef5 | 65 | $(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS) $(OTHERS)" |
6a3958b2 | 66 | |
c5f94070 RP |
67 | ./fixed-includes: |
68 | if [ -d ./fixed-includes ] ; then rm -rf ./fixed-includes ; else true ; fi | |
69 | mkdir ./fixed-includes | |
70 | $(srcdir)/gcc/fixincludes `pwd`/fixed-includes | |
71 | ||
a0f47eb7 SC |
72 | # this is a bad hack. |
73 | all.xclib: all.normal | |
74 | if [ -d clib ] ; then \ | |
75 | (cd clib ; $(MAKE)) ; \ | |
76 | fi | |
77 | ||
3c81fef5 | 78 | subdir_do: force |
a01bf1fb | 79 | for i in $(DODIRS); do \ |
2c55824f RP |
80 | if [ -f $(unsubdir)/$$i/localenv ] ; then \ |
81 | if (cd $(unsubdir)/$$i$(subdir); \ | |
a0f47eb7 SC |
82 | $(MAKE) \ |
83 | "against=$(against)" \ | |
b772d75e RP |
84 | "BISON=$(BISON)" \ |
85 | "MAKEINFO=$(MAKEINFO)" \ | |
86 | $(DO)) ; then true ; \ | |
a0f47eb7 | 87 | else exit 1 ; fi ; \ |
2c55824f RP |
88 | else if [ -d $(unsubdir)/$$i ] ; then \ |
89 | if (cd $(unsubdir)/$$i$(subdir); \ | |
a01bf1fb RP |
90 | $(MAKE) \ |
91 | "against=$(against)" \ | |
92 | "AR=$(AR)" \ | |
abc52b80 | 93 | "CC=$(CC)" \ |
a01bf1fb | 94 | "AR_FLAGS=$(AR_FLAGS)" \ |
2645fb0c | 95 | "RANLIB=$(RANLIB)" \ |
905bb120 RP |
96 | "LOADLIBES=$(LOADLIBES)" \ |
97 | "LDFLAGS=$(LDFLAGS)" \ | |
b772d75e RP |
98 | "BISON=$(BISON)" \ |
99 | "MAKEINFO=$(MAKEINFO)" \ | |
100 | $(DO)) ; then true ; \ | |
a01bf1fb RP |
101 | else exit 1 ; fi ; \ |
102 | else true ; fi ; \ | |
a0f47eb7 | 103 | fi ; \ |
a01bf1fb | 104 | done |
eb02fd64 | 105 | |
c5f94070 RP |
106 | bootstrap: ./fixed-includes |
107 | $(MAKE) all all-info | |
2b34da49 | 108 | $(MAKE) stage1 |
6a3958b2 RP |
109 | $(MAKE) pass "stagepass=stage1" |
110 | $(MAKE) stage2 | |
111 | $(MAKE) pass "stagepass=stage2" | |
a01bf1fb | 112 | $(MAKE) comparison |
6a3958b2 | 113 | |
c5f94070 | 114 | bootstrap2: ./fixed-includes |
6a3958b2 RP |
115 | $(MAKE) pass "stagepass=stage1" |
116 | $(MAKE) stage2 | |
117 | $(MAKE) pass "stagepass=stage2" | |
a01bf1fb | 118 | $(MAKE) comparison |
6a3958b2 | 119 | |
c5f94070 | 120 | bootstrap3: ./fixed-includes |
6a3958b2 | 121 | $(MAKE) pass "stagepass=stage2" |
a01bf1fb | 122 | $(MAKE) comparison |
6a3958b2 | 123 | |
c5f94070 | 124 | pass: ./fixed-includes |
517d18b2 | 125 | cp $(srcdir)/gcc/gstdarg.h $(unsubdir)/gas$(subdir)/stdarg.h |
c5f94070 | 126 | $(MAKE) subdir_do "DO=all all-info" "DODIRS=$(SUBDIRS)" \ |
2c55824f | 127 | "CC=`pwd`/$(unsubdir)/gcc$(subdir)/$(stagepass)/gcc \ |
c5f94070 | 128 | -O $(GCCVERBOSE) -I`pwd`/fixed-includes \ |
2c55824f RP |
129 | -B`pwd`/$(unsubdir)/gcc$(subdir)/$(stagepass)/ \ |
130 | -B`pwd`/$(unsubdir)/gas$(subdir)/$(stagepass)/ \ | |
131 | -B`pwd`/$(unsubdir)/ld$(subdir)/$(stagepass)/" \ | |
a297b8ce | 132 | "AR=`pwd`/$(unsubdir)/binutils$(subdir)/$(stagepass)/ar" \ |
30189626 | 133 | "LD=`pwd`/$(unsubdir)/gcc$(subdir)/$(stagepass)/gcc $(GCCVERBOSE)" \ |
2c55824f RP |
134 | "RANLIB=`pwd`/$(unsubdir)/binutils$(subdir)/$(stagepass)/ranlib" \ |
135 | "LOADLIBES=`pwd`/$(unsubdir)/gnulib$(subdir)/$(stagepass)/gnulib.a /lib/libc.a" \ | |
6a3958b2 | 136 | "LDFLAGS=-nostdlib /lib/crt0.o \ |
2c55824f RP |
137 | -L`pwd`/$(unsubdir)/gnulib$(subdir)/$(stagepass)/ \ |
138 | -B`pwd`/$(unsubdir)/ld$(subdir)/$(stagepass)/" | |
2b34da49 | 139 | |
eb02fd64 | 140 | |
c5f94070 | 141 | stage1: ./fixed-includes |
3c81fef5 | 142 | $(MAKE) subdir_do DO=stage1 "DODIRS=$(SUBDIRS)" |
eb02fd64 | 143 | |
c5f94070 | 144 | stage2: ./fixed-includes |
3c81fef5 | 145 | $(MAKE) subdir_do DO=stage2 "DODIRS=$(SUBDIRS)" |
eb02fd64 | 146 | |
c5f94070 | 147 | stage3: ./fixed-includes |
3c81fef5 | 148 | $(MAKE) subdir_do DO=stage3 "DODIRS=$(SUBDIRS)" |
eb02fd64 | 149 | |
c5f94070 | 150 | stage4: ./fixed-includes |
3c81fef5 | 151 | $(MAKE) subdir_do DO=stage4 "DODIRS=$(SUBDIRS)" |
eb02fd64 | 152 | |
a01bf1fb RP |
153 | against=stage2 |
154 | ||
155 | comparison:; $(MAKE) subdir_do DO=comparison against=$(against) "DODIRS=$(SUBDIRS)" | |
156 | ||
3c81fef5 RP |
157 | de-stage1:; $(MAKE) subdir_do DO=de-stage1 "DODIRS=$(SUBDIRS)" |
158 | de-stage2:; $(MAKE) subdir_do DO=de-stage2 "DODIRS=$(SUBDIRS)" | |
159 | de-stage3:; $(MAKE) subdir_do DO=de-stage3 "DODIRS=$(SUBDIRS)" | |
160 | de-stage4:; $(MAKE) subdir_do DO=de-stage4 "DODIRS=$(SUBDIRS)" | |
6a3958b2 RP |
161 | |
162 | clean: | |
163 | rm -rf *.a TEMP errs core *.o *~ \#* TAGS *.E | |
3c81fef5 | 164 | $(MAKE) subdir_do DO=clean "DODIRS=$(SUBDIRS) $(OTHERS)" |
6a3958b2 | 165 | |
4c27527f RP |
166 | install: install-no-fixincludes $(INSTALL_FIXED_INCLUDES) |
167 | ||
168 | install-no-fixincludes: install-dirs $(INSTALL_HEADERS) | |
3c81fef5 | 169 | $(MAKE) subdir_do DO=install "DODIRS=$(SUBDIRS) $(OTHERS)" |
eb02fd64 | 170 | |
abc52b80 JG |
171 | # The "else true" stuff is for Ultrix; the shell returns the exit code |
172 | # of the "if" command, if no commands are run in the "then" or "else" part, | |
173 | # causing Make to quit. | |
4c27527f RP |
174 | |
175 | MAKEDIRS= \ | |
176 | $(ddestdir) \ | |
177 | $(ddestdir)/bin \ | |
178 | $(ddestdir)/include \ | |
179 | $(ddestdir)/lib \ | |
180 | $(ddestdir)/lib/emacs \ | |
181 | $(idestdir) \ | |
4c27527f | 182 | $(idestdir)/lib \ |
4c27527f RP |
183 | $(idestdir)/doc \ |
184 | $(idestdir)/man \ | |
185 | $(idestdir)/man/man1 \ | |
0cc03f79 | 186 | $(idestdir)/man/man5 |
4c27527f | 187 | |
a297b8ce | 188 | install-dirs: force |
4c27527f | 189 | for i in $(MAKEDIRS) ; do \ |
cd49a4dc | 190 | echo Making $$i... ; \ |
4c27527f RP |
191 | if [ -d $$i ] ; then true ; else mkdir $$i ; fi ; \ |
192 | done | |
0ec776a5 | 193 | |
c5f94070 RP |
194 | MAKEINFODIRS= \ |
195 | $(idestdir) \ | |
196 | $(idestdir)/info | |
197 | ||
198 | install-info-dirs: force | |
199 | for i in $(MAKEINFODIRS) ; do \ | |
200 | echo Making $$i... ; \ | |
201 | if [ -d $$i ] ; then true ; else mkdir $$i ; fi ; \ | |
202 | done | |
203 | ||
0ec776a5 | 204 | install-headers: |
2c55824f RP |
205 | if [ -d $(unsubdir)/gcc$(subdir) ] ; then \ |
206 | (cd $(unsubdir)/gcc$(subdir) ; \ | |
5710dc37 | 207 | $(MAKE) install-dir) ; \ |
abc52b80 | 208 | else true; \ |
5710dc37 | 209 | fi |
2645fb0c RP |
210 | |
211 | install-fixed-includes: force | |
2c55824f RP |
212 | if [ -d $(unsubdir)/gcc$(subdir) ] ; then \ |
213 | (cd $(unsubdir)/gcc$(subdir) ; \ | |
5710dc37 | 214 | $(MAKE) install-fixed-includes) ; \ |
abc52b80 | 215 | else true; \ |
5710dc37 | 216 | fi |
a7058e26 | 217 | |
c5f94070 RP |
218 | install-dir.info-in-place: force |
219 | rdir=`cd $(srcdir)/texinfo ; pwd` \ | |
220 | && cd $(idestdir)/info \ | |
221 | && ($${rdir}/gen-info-dir `pwd`) > dir | |
222 | ||
6b7e5998 | 223 | dir.info: force |
c5f94070 | 224 | $(srcdir)/texinfo/gen-info-dir . > dir.info.new |
6b7e5998 RP |
225 | mv -f dir.info.new dir.info |
226 | ||
eb02fd64 RP |
227 | etags tags: TAGS |
228 | ||
229 | TAGS: FORCE | |
230 | etags `$(MAKE) ls` | |
231 | ||
232 | ls: | |
233 | @echo Makefile | |
234 | @for i in $(SUBDIRS); \ | |
235 | do \ | |
236 | (cd $$i; \ | |
237 | pwd=`pwd`; \ | |
238 | wd=`basename $$pwd`; \ | |
239 | for j in `$(MAKE) ls`; \ | |
240 | do \ | |
241 | echo $$wd/$$j; \ | |
242 | done) \ | |
243 | done | |
244 | ||
3c81fef5 | 245 | force: |
eb02fd64 RP |
246 | |
247 | # with the gnu make, this is done automatically. | |
248 | ||
f1eb48b6 | 249 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) |
a26878d1 | 250 | $(SHELL) ./config.status |
eb02fd64 | 251 | |
11954bf1 JG |
252 | # |
253 | # Build GDB distributions that contain BFD, Include, Libiberty, Readline, etc | |
254 | ||
aaee1265 | 255 | DEVO_SUPPORT= README DOC.configure Makefile.in configure configure.in \ |
abc52b80 | 256 | config.sub config |
a3a063a9 | 257 | GDB_SUPPORT_DIRS= bfd include libiberty readline glob |
abc52b80 | 258 | GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS) texinfo/fsf/texinfo.tex |
11954bf1 | 259 | |
abc52b80 | 260 | setup-dirs: force_update |
11954bf1 JG |
261 | ./configure sun4 |
262 | make clean | |
263 | ./configure -rm sun4 | |
905bb120 | 264 | chmod og=u `find $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print` |
abc52b80 JG |
265 | |
266 | bfd.ilrt.tar.Z: setup-dirs | |
11954bf1 | 267 | rm -f bfd.ilrt.tar.Z |
abc52b80 | 268 | tar cf - $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) \ |
11954bf1 JG |
269 | | compress -v >bfd.ilrt.tar.Z |
270 | ||
abc52b80 JG |
271 | gdb.tar.Z: setup-dirs |
272 | (cd gdb; $(MAKE) -f Makefile.in make-proto-gdb.dir) | |
273 | $(MAKE) $(MFLAGS) -f Makefile.in make-gdb.tar.Z | |
274 | ||
275 | make-gdb.tar.Z: $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS) gdb texinfo/fsf/texinfo.tex | |
276 | rm -rf proto-toplev; mkdir proto-toplev | |
277 | ln -s ../gdb/proto-gdb.dir proto-toplev/gdb | |
278 | (cd proto-toplev; for i in $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS); do \ | |
279 | ln -s ../$$i . ; \ | |
280 | done) | |
a3a063a9 JG |
281 | # Take out texinfo from configurable dirs |
282 | rm proto-toplev/configure.in | |
283 | sed '/^configdirs=/s/texinfo //' <configure.in >proto-toplev/configure.in | |
abc52b80 JG |
284 | mkdir proto-toplev/texinfo |
285 | mkdir proto-toplev/texinfo/fsf | |
286 | ln -s ../../../texinfo/fsf/texinfo.tex proto-toplev/texinfo/fsf/ | |
905bb120 | 287 | chmod og=u `find proto-toplev -print` |
abc52b80 JG |
288 | (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \ |
289 | echo "==> Making gdb-$$VER.tar.Z"; \ | |
290 | ln -s proto-toplev gdb-$$VER; \ | |
291 | tar cfh - gdb-$$VER \ | |
292 | | compress -v >gdb-$$VER.tar.Z) | |
293 | ||
11954bf1 JG |
294 | force_update: |
295 | ||
0ec776a5 SC |
296 | nothing: |
297 | ||
eb02fd64 | 298 | # end of Makefile.in |