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