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