]>
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 | # | |
905bb120 | 19 | # Last Mod Tue Sep 24 21:25:57 PDT 1991, by [email protected] |
eb02fd64 | 20 | # |
f149eb99 RP |
21 | # $Id$ |
22 | ||
eb02fd64 | 23 | srcdir = . |
ec342d7d | 24 | destdir = /usr/local |
eb02fd64 | 25 | |
3c8735af RP |
26 | SHELL=/bin/sh |
27 | ||
ec342d7d RP |
28 | #CC = gcc -b$(target) # -B$(srcdir)/../gas/Host-$(host)/Target-$(target)/ |
29 | #CFLAGS = -g -nostdinc -nostdlib -I- -I/usr/local/lib/gcc/$(target)/1.92/include -I$(srcdir) -I$(srcdir)/../include -I$(OSINCLUDE) | |
eb02fd64 | 30 | |
eb02fd64 | 31 | RANLIB = ranlib |
ec342d7d RP |
32 | AR = ar |
33 | AR_FLAGS = cqv | |
4dfe09da | 34 | BISONPATH = |
eb02fd64 | 35 | |
4dfe09da | 36 | BISON = `if [ -d $(srcdir)/../bison\`if [ -d $(srcdir)/bison.$(target) ] ; then echo .$(target) ; fi\`$(subdir) ] ; then echo $(srcdir)/../bison\`if [ -d $(srcdir)/bison.$(target) ] ; then echo .$(target) ; fi\`$(subdir)/bison -L $(srcdir)/../bison\`if [ -d $(srcdir)/bison.$(target) ] ; then echo .$(target) ; fi\`/; else echo yacc ; fi` |
2645fb0c RP |
37 | |
38 | SUBDIRS = libiberty readline bfd gdb binutils ld gas gcc gnulib | |
6a3958b2 RP |
39 | OTHERS = |
40 | ||
eb02fd64 | 41 | #### host and target specific makefile fragments come in here. |
ec342d7d | 42 | ### |
eb02fd64 | 43 | |
6a3958b2 | 44 | all: |
3c81fef5 | 45 | $(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS) $(OTHERS)" |
6a3958b2 | 46 | |
3c81fef5 | 47 | subdir_do: force |
a01bf1fb RP |
48 | for i in $(DODIRS); do \ |
49 | if [ -d $(srcdir)/$$i -o -d $(srcdir)/$$i.$(target) ] ; then \ | |
50 | if (cd $(srcdir)/$$i`if [ -d $(srcdir)/$$i.$(target) ] ; \ | |
51 | then echo .$(target) ; fi`$(subdir); \ | |
52 | $(MAKE) \ | |
53 | "against=$(against)" \ | |
54 | "AR=$(AR)" \ | |
abc52b80 | 55 | "CC=$(CC)" \ |
a01bf1fb | 56 | "AR_FLAGS=$(AR_FLAGS)" \ |
2645fb0c | 57 | "RANLIB=$(RANLIB)" \ |
905bb120 RP |
58 | "LOADLIBES=$(LOADLIBES)" \ |
59 | "LDFLAGS=$(LDFLAGS)" \ | |
2645fb0c | 60 | "BISON=$(BISON)" $(DO)) ; then true ; \ |
a01bf1fb RP |
61 | else exit 1 ; fi ; \ |
62 | else true ; fi ; \ | |
63 | done | |
eb02fd64 | 64 | |
2b34da49 RP |
65 | bootstrap: |
66 | $(MAKE) all | |
67 | $(MAKE) stage1 | |
6a3958b2 RP |
68 | $(MAKE) pass "stagepass=stage1" |
69 | $(MAKE) stage2 | |
70 | $(MAKE) pass "stagepass=stage2" | |
a01bf1fb | 71 | $(MAKE) comparison |
6a3958b2 RP |
72 | |
73 | bootstrap2: | |
74 | $(MAKE) pass "stagepass=stage1" | |
75 | $(MAKE) stage2 | |
76 | $(MAKE) pass "stagepass=stage2" | |
a01bf1fb | 77 | $(MAKE) comparison |
6a3958b2 RP |
78 | |
79 | bootstrap3: | |
80 | $(MAKE) pass "stagepass=stage2" | |
a01bf1fb | 81 | $(MAKE) comparison |
6a3958b2 RP |
82 | |
83 | pass: | |
2770ad8b RP |
84 | cp $(srcdir)/gcc`if [ -d $(srcdir)/gcc.$(target) ] ; \ |
85 | then echo .$(target) ; fi`/gstdarg.h $(srcdir)/gas/stdarg.h | |
3c81fef5 | 86 | $(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS)" \ |
905bb120 RP |
87 | "CC=`pwd`/$(srcdir)/gcc`if [ -d $(srcdir)/gcc.$(target) ] ; \ |
88 | then echo .$(target) ; fi`$(subdir)/$(stagepass)/gcc \ | |
89 | -O \ | |
90 | -B`pwd`/$(srcdir)/gcc`if [ -d $(srcdir)/gcc.$(target) ] ; \ | |
6a3958b2 | 91 | then echo .$(target) ; fi`$(subdir)/$(stagepass)/ \ |
905bb120 RP |
92 | -B`pwd`/$(srcdir)/gas`if [ -d $(srcdir)/gas.$(target) ] ; \ |
93 | then echo .$(target) ; fi`$(subdir)/$(stagepass)/ \ | |
94 | -B`pwd`/$(srcdir)/ld`if [ -d $(srcdir)/ld.$(target) ] ; \ | |
6a3958b2 | 95 | then echo .$(target) ; fi`$(subdir)/$(stagepass)/" \ |
905bb120 | 96 | "AR=`pwd`/$(srcdir)/binutils`if [ -d $(srcdir)/binutils.$(target) ] ; \ |
6a3958b2 | 97 | then echo .$(target) ; fi`$(subdir)/$(stagepass)/ar" \ |
905bb120 | 98 | "RANLIB=`pwd`/$(srcdir)/binutils`if [ -d $(srcdir)/binutils.$(target) ] ; \ |
6a3958b2 | 99 | then echo .$(target) ; fi`$(subdir)/$(stagepass)/ranlib" \ |
905bb120 | 100 | "LOADLIBES=`pwd`/$(srcdir)/gnulib`if [ -d $(srcdir)/binutils.$(target) ] ; \ |
6a3958b2 RP |
101 | then echo .$(target) ; fi`$(subdir)/$(stagepass)/gnulib.a /lib/libc.a" \ |
102 | "LDFLAGS=-nostdlib /lib/crt0.o \ | |
905bb120 | 103 | -L`pwd`/$(srcdir)/gnulib`if [ -d $(srcdir)/gnulib.$(target) ] ; \ |
4dfe09da | 104 | then echo .$(target) ; fi`$(subdir)/$(stagepass)/ \ |
905bb120 | 105 | -B`pwd`/$(srcdir)/ld`if [ -d $(srcdir)/ld.$(target) ] ; \ |
6a3958b2 | 106 | then echo .$(target) ; fi`$(subdir)/$(stagepass)/" |
2b34da49 | 107 | |
eb02fd64 | 108 | |
6a3958b2 | 109 | stage1: |
3c81fef5 | 110 | $(MAKE) subdir_do DO=stage1 "DODIRS=$(SUBDIRS)" |
eb02fd64 | 111 | |
6a3958b2 | 112 | stage2: |
3c81fef5 | 113 | $(MAKE) subdir_do DO=stage2 "DODIRS=$(SUBDIRS)" |
eb02fd64 | 114 | |
6a3958b2 | 115 | stage3: |
3c81fef5 | 116 | $(MAKE) subdir_do DO=stage3 "DODIRS=$(SUBDIRS)" |
eb02fd64 | 117 | |
6a3958b2 | 118 | stage4: |
3c81fef5 | 119 | $(MAKE) subdir_do DO=stage4 "DODIRS=$(SUBDIRS)" |
eb02fd64 | 120 | |
a01bf1fb RP |
121 | against=stage2 |
122 | ||
123 | comparison:; $(MAKE) subdir_do DO=comparison against=$(against) "DODIRS=$(SUBDIRS)" | |
124 | ||
3c81fef5 RP |
125 | de-stage1:; $(MAKE) subdir_do DO=de-stage1 "DODIRS=$(SUBDIRS)" |
126 | de-stage2:; $(MAKE) subdir_do DO=de-stage2 "DODIRS=$(SUBDIRS)" | |
127 | de-stage3:; $(MAKE) subdir_do DO=de-stage3 "DODIRS=$(SUBDIRS)" | |
128 | de-stage4:; $(MAKE) subdir_do DO=de-stage4 "DODIRS=$(SUBDIRS)" | |
6a3958b2 RP |
129 | |
130 | clean: | |
131 | rm -rf *.a TEMP errs core *.o *~ \#* TAGS *.E | |
3c81fef5 | 132 | $(MAKE) subdir_do DO=clean "DODIRS=$(SUBDIRS) $(OTHERS)" |
6a3958b2 | 133 | |
2645fb0c | 134 | install: install-dirs install-fixed-includes |
3c81fef5 | 135 | $(MAKE) subdir_do DO=install "DODIRS=$(SUBDIRS) $(OTHERS)" |
eb02fd64 | 136 | |
abc52b80 JG |
137 | # The "else true" stuff is for Ultrix; the shell returns the exit code |
138 | # of the "if" command, if no commands are run in the "then" or "else" part, | |
139 | # causing Make to quit. | |
2645fb0c RP |
140 | install-dirs: force |
141 | - mkdir $(destdir) | |
142 | - mkdir $(destdir)/bin | |
143 | - mkdir $(destdir)/lib | |
144 | - mkdir $(destdir)/include | |
abc52b80 | 145 | - mkdir $(destdir)/doc |
2645fb0c RP |
146 | - mkdir $(destdir)/man |
147 | - mkdir $(destdir)/man/man1 | |
abc52b80 JG |
148 | - mkdir $(destdir)/man/man2 |
149 | - mkdir $(destdir)/man/man3 | |
150 | - mkdir $(destdir)/man/man4 | |
151 | - mkdir $(destdir)/man/man5 | |
152 | - mkdir $(destdir)/man/man6 | |
153 | - mkdir $(destdir)/man/man7 | |
154 | - mkdir $(destdir)/man/man8 | |
5710dc37 RP |
155 | if [ -d $(srcdir)/gcc`if [ -d $(srcdir)/gcc.$(target) ] ; \ |
156 | then echo .$(target) ; fi`$(subdir) ] ; then \ | |
157 | (cd $(srcdir)/gcc`if [ -d $(srcdir)/gcc.$(target) ] ; \ | |
158 | then echo .$(target) ; fi`$(subdir) ; \ | |
159 | $(MAKE) install-dir) ; \ | |
abc52b80 | 160 | else true; \ |
5710dc37 | 161 | fi |
2645fb0c RP |
162 | |
163 | install-fixed-includes: force | |
5710dc37 RP |
164 | if [ -d $(srcdir)/gcc`if [ -d $(srcdir)/gcc.$(target) ] ; \ |
165 | then echo .$(target) ; fi`$(subdir) ] ; then \ | |
166 | (cd $(srcdir)/gcc`if [ -d $(srcdir)/gcc.$(target) ] ; \ | |
167 | then echo .$(target) ; fi`$(subdir) ; \ | |
168 | $(MAKE) install-fixed-includes) ; \ | |
abc52b80 | 169 | else true; \ |
5710dc37 | 170 | fi |
a7058e26 | 171 | |
eb02fd64 RP |
172 | etags tags: TAGS |
173 | ||
174 | TAGS: FORCE | |
175 | etags `$(MAKE) ls` | |
176 | ||
177 | ls: | |
178 | @echo Makefile | |
179 | @for i in $(SUBDIRS); \ | |
180 | do \ | |
181 | (cd $$i; \ | |
182 | pwd=`pwd`; \ | |
183 | wd=`basename $$pwd`; \ | |
184 | for j in `$(MAKE) ls`; \ | |
185 | do \ | |
186 | echo $$wd/$$j; \ | |
187 | done) \ | |
188 | done | |
189 | ||
3c81fef5 | 190 | force: |
eb02fd64 RP |
191 | |
192 | # with the gnu make, this is done automatically. | |
193 | ||
194 | Makefile: $(srcdir)/Makefile.in $(srcdir)/configure | |
131a3881 | 195 | (cd $(srcdir) ; \ |
f149eb99 | 196 | ./configure +destdir=$(destdir) +norecurse \ |
4dfe09da | 197 | `if [ "$(srcdir)" != "." ] ; then echo +subdirs; fi` \ |
0df06ca0 | 198 | $(host) +target=$(target)) |
eb02fd64 | 199 | |
11954bf1 JG |
200 | # |
201 | # Build GDB distributions that contain BFD, Include, Libiberty, Readline, etc | |
202 | ||
3c8735af | 203 | DEVO_SUPPORT= README README.configure Makefile.in configure configure.in \ |
abc52b80 JG |
204 | config.sub config |
205 | GDB_SUPPORT_DIRS= bfd include libiberty readline | |
206 | GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS) texinfo/fsf/texinfo.tex | |
11954bf1 | 207 | |
abc52b80 | 208 | setup-dirs: force_update |
11954bf1 JG |
209 | ./configure -template=./configure |
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 RP |
242 | # |
243 | # $Log$ | |
905bb120 RP |
244 | # Revision 1.35 1991/09/25 04:34:40 rich |
245 | # Pass command names with absolute paths. Easier than keeping relative | |
246 | # paths right when dealing with sub/sub/directories. | |
247 | # | |
248 | # Revision 1.34 1991/09/20 09:08:56 gnu | |
249 | # Set file permissions on all files when building a distribution. | |
250 | # | |
251 | # Revision 1.33 1991/09/20 08:41:45 gnu | |
abc52b80 JG |
252 | # New rules for building distributions. Normal distribution |
253 | # is built by doing `make -f Makefile.in gdb.tar.Z' in the devo dir. | |
254 | # | |
255 | # Revision 1.32 1991/09/19 20:56:05 steve | |
256 | # More changes for 68k and 386 coff support. (Sorry about the previous | |
257 | # log). | |
258 | # | |
259 | # Revision 1.31 1991/09/03 13:28:38 gnu | |
260 | # Add "else true" clauses for really dumb sh's such as Ultrix. | |
261 | # | |
262 | # Revision 1.30 1991/08/26 06:37:57 rich | |
263 | # Correcting configurations and installs. | |
264 | # | |
265 | # Revision 1.29 1991/08/26 04:45:57 rich | |
5710dc37 RP |
266 | # Correcting install target when gcc not present. |
267 | # | |
268 | # Revision 1.28 1991/08/25 23:40:22 rich | |
3c8735af RP |
269 | # rcs enters the soup. |
270 | # | |
271 | # Revision 1.27 1991/08/23 07:15:56 gnu | |
272 | # Make README stick... | |
273 | # | |
274 | # Revision 1.26 1991/08/22 09:20:07 gnu | |
275 | # Build a top-level README for devo. | |
276 | # | |
277 | # Revision 1.25 1991/08/22 07:15:49 rich | |
4dfe09da RP |
278 | # Three part names, etc. |
279 | # | |
280 | # Revision 1.24 1991/08/20 01:57:31 rich | |
281 | # Another try at passing gnulib's location. | |
282 | # | |
283 | # Revision 1.23 1991/08/16 21:47:41 rich | |
284 | # Pass on BISON as bison only if bison is here. | |
285 | # | |
286 | # Revision 1.22 1991/08/07 19:15:26 rich | |
287 | # +forcesubdirs -> +subdirs | |
288 | # | |
289 | # Revision 1.21 1991/07/31 18:07:59 gnu | |
290 | # Set file permissions the same for everyone before making tar file. | |
291 | # | |
292 | # Revision 1.20 1991/07/31 02:47:14 gnu | |
11954bf1 JG |
293 | # Add bfd.ilrt.tar.Z "make" rules. |
294 | # | |
295 | # Revision 1.19 1991/07/27 07:46:34 rich | |
2645fb0c RP |
296 | # Changes to accomodate using the freshly built bison in place. |
297 | # | |
298 | # Revision 1.18 1991/07/16 00:01:40 gnu | |
299 | # Add back gdb and readline. | |
300 | # | |
301 | # Revision 1.17 1991/06/18 15:30:55 rich | |
302 | # added install-dirs target. | |
303 | # | |
304 | # Revision 1.16 1991/06/14 13:35:40 rich | |
a7058e26 RP |
305 | # install fixed include files on install. |
306 | # | |
307 | # Revision 1.15 1991/06/09 20:27:01 rich | |
a01bf1fb RP |
308 | # added support for binary comparisons. |
309 | # | |
310 | # Revision 1.14 1991/05/31 12:34:55 gnu | |
6849cb71 JG |
311 | # Avoid error stop from Make if a directory doesn't exist during subdir_do. |
312 | # | |
313 | # Revision 1.13 1991/05/27 23:03:20 rich | |
2770ad8b RP |
314 | # Put gcc/gstdarg.h where gas can find it; gas/stdarg.h. |
315 | # | |
316 | # Revision 1.12 1991/05/19 00:36:44 rich | |
3c81fef5 RP |
317 | # Added gdb. |
318 | # | |
319 | # Revision 1.11 1991/05/03 21:30:41 gnu | |
592ecfb2 JG |
320 | # Rename getopt to libiberty. |
321 | # | |
322 | # Revision 1.10 1991/04/24 16:50:53 rich | |
6a3958b2 RP |
323 | # Three staging checkpoint. |
324 | # | |
325 | # Revision 1.9 1991/04/17 01:34:36 rich | |
2b34da49 RP |
326 | # Added getopt for binutils, fixed problem with host dependancies in |
327 | # configure.template. | |
328 | # | |
329 | # Revision 1.8 1991/04/15 23:43:45 rich | |
0df06ca0 RP |
330 | # Now handles multiple hosts and targets. |
331 | # | |
332 | # Revision 1.7 1991/04/13 13:06:16 tiemann | |
bb335cf4 MT |
333 | # Don't depend `install' on `all'. Actually, the way things work, all |
334 | # depends on things being incrementally installed, and install depends | |
335 | # on everything happening in a topological fashion. | |
336 | # | |
337 | # This will need to be worked on further, but for now it's ok. | |
338 | # | |
339 | # Revision 1.6 1991/04/13 10:04:14 rich | |
340 | # Now can build gas for a29k on a29k. | |
341 | # | |
342 | # Revision 1.5 1991/04/13 07:40:41 rich | |
f149eb99 RP |
343 | # Fixed an ordering bug. Now everything is built, and then installed. |
344 | # | |
345 | # Revision 1.4 1991/04/13 02:11:09 rich | |
ec342d7d RP |
346 | # Config cut 3. We now almost install a29k. |
347 | # | |
348 | # Revision 1.3 1991/04/11 02:41:53 rich | |
131a3881 | 349 | # Cut 2 config. Subdirs. |
eb02fd64 RP |
350 | # |
351 | # | |
352 | # | |
353 | ||
354 | # end of Makefile.in |