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