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