Initial revision
[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#
a297b8ce 19# Last Mod Wed Nov 6 20:56:58 PST 1991, by rich@rtl.cygnus.com
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
a297b8ce 144install: install-dirs $(INSTALL_FIXED_INCLUDES) $(INSTALL_HEADERS)
3c81fef5 145 $(MAKE) subdir_do DO=install "DODIRS=$(SUBDIRS) $(OTHERS)"
eb02fd64 146
abc52b80
JG
147# The "else true" stuff is for Ultrix; the shell returns the exit code
148# of the "if" command, if no commands are run in the "then" or "else" part,
149# causing Make to quit.
a297b8ce 150install-dirs: force
28f3b094 151 - mkdir $(ddestdir)
a297b8ce 152 - mkdir $(ddestdir)/bin
28f3b094
RP
153 - mkdir $(ddestdir)/include
154 - mkdir $(ddestdir)/lib
155 - mkdir $(ddestdir)/lib/emacs
28f3b094 156 - mkdir $(idestdir)
a297b8ce
RP
157 - mkdir $(idestdir)/bin
158 - mkdir $(idestdir)/lib
159 - mkdir $(idestdir)/include
28f3b094
RP
160 - mkdir $(idestdir)/doc
161 - mkdir $(idestdir)/man
162 - mkdir $(idestdir)/man/man1
163 - mkdir $(idestdir)/man/man2
164 - mkdir $(idestdir)/man/man3
165 - mkdir $(idestdir)/man/man4
166 - mkdir $(idestdir)/man/man5
167 - mkdir $(idestdir)/man/man6
168 - mkdir $(idestdir)/man/man7
169 - mkdir $(idestdir)/man/man8
0ec776a5
SC
170
171install-headers:
2c55824f
RP
172 if [ -d $(unsubdir)/gcc$(subdir) ] ; then \
173 (cd $(unsubdir)/gcc$(subdir) ; \
5710dc37 174 $(MAKE) install-dir) ; \
abc52b80 175 else true; \
5710dc37 176 fi
2645fb0c
RP
177
178install-fixed-includes: force
2c55824f
RP
179 if [ -d $(unsubdir)/gcc$(subdir) ] ; then \
180 (cd $(unsubdir)/gcc$(subdir) ; \
5710dc37 181 $(MAKE) install-fixed-includes) ; \
abc52b80 182 else true; \
5710dc37 183 fi
a7058e26 184
eb02fd64
RP
185etags tags: TAGS
186
187TAGS: FORCE
188 etags `$(MAKE) ls`
189
190ls:
191 @echo Makefile
192 @for i in $(SUBDIRS); \
193 do \
194 (cd $$i; \
195 pwd=`pwd`; \
196 wd=`basename $$pwd`; \
197 for j in `$(MAKE) ls`; \
198 do \
199 echo $$wd/$$j; \
200 done) \
201 done
202
3c81fef5 203force:
eb02fd64
RP
204
205# with the gnu make, this is done automatically.
206
f1eb48b6 207Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
a26878d1 208 $(SHELL) ./config.status
eb02fd64 209
11954bf1
JG
210#
211# Build GDB distributions that contain BFD, Include, Libiberty, Readline, etc
212
3c8735af 213DEVO_SUPPORT= README README.configure Makefile.in configure configure.in \
abc52b80
JG
214 config.sub config
215GDB_SUPPORT_DIRS= bfd include libiberty readline
216GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS) texinfo/fsf/texinfo.tex
11954bf1 217
abc52b80 218setup-dirs: force_update
11954bf1
JG
219 ./configure sun4
220 make clean
221 ./configure -rm sun4
905bb120 222 chmod og=u `find $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
abc52b80
JG
223
224bfd.ilrt.tar.Z: setup-dirs
11954bf1 225 rm -f bfd.ilrt.tar.Z
abc52b80 226 tar cf - $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) \
11954bf1
JG
227 | compress -v >bfd.ilrt.tar.Z
228
abc52b80
JG
229gdb.tar.Z: setup-dirs
230 (cd gdb; $(MAKE) -f Makefile.in make-proto-gdb.dir)
231 $(MAKE) $(MFLAGS) -f Makefile.in make-gdb.tar.Z
232
233make-gdb.tar.Z: $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS) gdb texinfo/fsf/texinfo.tex
234 rm -rf proto-toplev; mkdir proto-toplev
235 ln -s ../gdb/proto-gdb.dir proto-toplev/gdb
236 (cd proto-toplev; for i in $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS); do \
237 ln -s ../$$i . ; \
238 done)
239 mkdir proto-toplev/texinfo
240 mkdir proto-toplev/texinfo/fsf
241 ln -s ../../../texinfo/fsf/texinfo.tex proto-toplev/texinfo/fsf/
905bb120 242 chmod og=u `find proto-toplev -print`
abc52b80
JG
243 (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
244 echo "==> Making gdb-$$VER.tar.Z"; \
245 ln -s proto-toplev gdb-$$VER; \
246 tar cfh - gdb-$$VER \
247 | compress -v >gdb-$$VER.tar.Z)
248
11954bf1
JG
249force_update:
250
0ec776a5
SC
251nothing:
252
eb02fd64 253# end of Makefile.in
This page took 0.058146 seconds and 4 git commands to generate.