1 # Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
2 # 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation
4 # This file is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 # This Makefile contains release scripts for gdb, binutils, and other
20 # packages which live in src. It used to be part of the top level Makefile,
21 # but that turned out to be very messy and hard to maintain.
23 # This stuff really ought to be cleaned up and turned into something other
24 # than a Makefile. As it is it's heavily recursive.
26 # This is the name of this script (!). Needed due to horrible recursion.
34 # pwd command to use. Allow user to override default by setting PWDCMD in
35 # the environment to account for automounters. The make variable must not
36 # be called PWDCMD, otherwise the value set here is passed to make
37 # subprocesses and overrides the setting from the user's environment.
41 # Support for building net releases
43 # Files in devo used in any net release.
44 # ChangeLog omitted because it may refer to files which are not in this
45 # distribution (perhaps it would be better to include it anyway).
46 DEVO_SUPPORT= README Makefile.in configure configure.in \
47 config.guess config.sub config move-if-change \
48 COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
49 mkinstalldirs ltconfig ltmain.sh missing ylwrap \
50 libtool.m4 gettext.m4 ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh \
51 Makefile.def Makefile.tpl src-release
53 # Files in devo/etc used in any net release.
54 # ChangeLog omitted because it may refer to files which are not in this
55 # distribution (perhaps it would be better to include it anyway).
56 ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
57 make-stds.texi standards.info* configure.texi configure.info* \
58 configbuild.* configdev.* fdl.texi texi2pod.pl
61 # When you use `make setup-dirs' or `make taz' you should always redefine
63 SUPPORT_FILES = list-of-support-files-for-tool-in-question
65 # NOTE: No double quotes in the below. It is used within shell script
67 VER = ` if grep 'AM_INIT_AUTOMAKE.*BFD_VERSION' $(TOOL)/configure.in >/dev/null 2>&1; then \
68 sed < bfd/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
69 elif grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
70 sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
71 elif test -f $(TOOL)/version.in; then \
72 head -1 $(TOOL)/version.in; \
73 elif grep VERSION $(TOOL)/Makefile.in > /dev/null 2>&1; then \
74 sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \
81 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
82 $(MAKE) -f $(SELF) do-proto-toplev \
83 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
84 MD5PROG="$(MD5PROG)" \
85 SUPPORT_FILES="$(SUPPORT_FILES)"
86 $(MAKE) -f $(SELF) do-md5sum \
87 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
88 MD5PROG="$(MD5PROG)" \
89 SUPPORT_FILES="$(SUPPORT_FILES)"
90 $(MAKE) -f $(SELF) do-tar \
91 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
92 MD5PROG="$(MD5PROG)" \
93 SUPPORT_FILES="$(SUPPORT_FILES)"
94 $(MAKE) -f $(SELF) do-bz2 \
95 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
96 MD5PROG="$(MD5PROG)" \
97 SUPPORT_FILES="$(SUPPORT_FILES)"
100 gdb-tar: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
101 $(MAKE) -f $(SELF) do-proto-toplev \
102 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
103 MD5PROG="$(MD5PROG)" \
104 SUPPORT_FILES="$(SUPPORT_FILES)"
105 $(MAKE) -f $(SELF) do-md5sum \
106 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
107 MD5PROG="$(MD5PROG)" \
108 SUPPORT_FILES="$(SUPPORT_FILES)"
109 $(MAKE) -f $(SELF) do-djunpack \
110 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
111 MD5PROG="$(MD5PROG)" \
112 SUPPORT_FILES="$(SUPPORT_FILES)"
113 $(MAKE) -f $(SELF) do-tar \
114 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
115 MD5PROG="$(MD5PROG)" \
116 SUPPORT_FILES="$(SUPPORT_FILES)"
119 gdb-taz: gdb-tar $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
120 $(MAKE) -f $(SELF) gdb-tar \
121 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
122 MD5PROG="$(MD5PROG)" \
123 SUPPORT_FILES="$(SUPPORT_FILES)"
124 $(MAKE) -f $(SELF) do-bz2 \
125 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
126 MD5PROG="$(MD5PROG)" \
127 SUPPORT_FILES="$(SUPPORT_FILES)"
129 .PHONY: do-proto-toplev
130 do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
131 echo "==> Making $(PACKAGE)-$(VER)/"
132 # Take out texinfo from a few places.
133 sed -e '/^all\.normal: /s/\all-texinfo //' \
134 -e '/^ install-texinfo /d' \
136 mv -f tmp Makefile.in
138 ./configure i686-pc-linux-gnu
139 $(MAKE) configure-host configure-target \
140 ALL_GCC="" ALL_GCC_C="" ALL_GCC_CXX="" \
141 CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
142 # Make links, and run "make diststuff" or "make info" when needed.
143 rm -rf proto-toplev ; mkdir proto-toplev
144 set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
145 for d in $$dirs ; do \
146 if [ -d $$d ]; then \
147 if [ ! -f $$d/Makefile ] ; then true ; \
148 elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \
149 (cd $$d ; $(MAKE) diststuff ) || exit 1 ; \
150 elif grep '^info:' $$d/Makefile >/dev/null ; then \
151 (cd $$d ; $(MAKE) info ) || exit 1 ; \
153 if [ -d $$d/proto-$$d.dir ]; then \
154 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
156 ln -s ../$$d proto-toplev/$$d ; \
158 else ln -s ../$$d proto-toplev/$$d ; fi ; \
160 cd etc && $(MAKE) info
162 # Kludge for pr gdb/708. 'configure' configures in
163 # dejagnu/example/calc, but 'make distclean' does not clean in
164 # dejagnu/example. Someday somebody might fix this in dejagnu,
165 # and then import a new dejagnu into sourceware. Right now, a
166 # couple of 'rm' commands will get the gdb snapshots working
167 # again. -- chastain 2003-08-15
168 rm -f dejagnu/example/calc/config.status
169 rm -f dejagnu/example/calc/config.log
170 # Kludge for pr gdb/857. intl/Makefile.in lacks a couple
171 # of files in the distclean rule. Zack W is planning to make
172 # the gcc version of intl/ the master version and then push
173 # that version to src soon. See:
174 # http://sources.redhat.com/ml/binutils/2003-07/msg00032.html
175 # After the src version of intl/ is upgraded, we can look at
176 # moving this logic into intl/Makefile.in distclean rule
177 # if it is still needed. -- chastain 2003-09-12
178 rm -f intl/config.cache
179 rm -f intl/config.status
183 mkdir proto-toplev/etc
184 (cd proto-toplev/etc; \
185 for i in $(ETC_SUPPORT); do \
186 ln -s ../../etc/$$i . ; \
189 # Take out texinfo from configurable dirs
190 rm proto-toplev/configure.in
191 sed -e '/^host_tools=/s/texinfo //' \
192 <configure.in >proto-toplev/configure.in
194 mkdir proto-toplev/texinfo
195 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
196 if test -r texinfo/util/tex3patch ; then \
197 mkdir proto-toplev/texinfo/util && \
198 ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
200 chmod -R og=u . || chmod og=u `find . -print`
202 # Create .gmo files from .po files.
203 for f in `find . -name '*.po' -type f -print`; do \
204 msgfmt -o `echo $$f | sed -e 's/\.po$$/.gmo/'` $$f ; \
207 -rm -f $(PACKAGE)-$(VER)
208 ln -s proto-toplev $(PACKAGE)-$(VER)
210 CVS_NAMES= \( -name CVS -o -name '.cvsignore' \)
214 echo "==> Making $(PACKAGE)-$(VER).tar"
215 -rm -f $(PACKAGE)-$(VER).tar
216 find $(PACKAGE)-$(VER) -follow $(CVS_NAMES) -prune \
218 | tar cTfh - $(PACKAGE)-$(VER).tar
222 echo "==> Bzipping $(PACKAGE)-$(VER).tar.bz2"
223 -rm -f $(PACKAGE)-$(VER).tar.bz2
224 $(BZIPPROG) -v -9 $(PACKAGE)-$(VER).tar
228 echo "==> Adding md5 checksum to top-level directory"
229 cd proto-toplev && find * -follow $(CVS_NAMES) -prune \
231 | xargs $(MD5PROG) > ../md5.new
232 -rm -f proto-toplev/md5.sum
233 mv md5.new proto-toplev/md5.sum
237 echo "==> Adding updated djunpack.bat to top-level directory"
238 echo - 's /gdb-[0-9\.]*/$(PACKAGE)-'"$(VER)"'/'
239 sed < djunpack.bat > djunpack.new \
240 -e 's/gdb-[0-9][0-9\.]*/$(PACKAGE)-'"$(VER)"'/'
241 -rm -f proto-toplev/djunpack.bat
242 mv djunpack.new proto-toplev/djunpack.bat
244 TEXINFO_SUPPORT= texinfo/texinfo.tex
245 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
248 GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms mkdep
249 gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
250 $(MAKE) -f $(SELF) taz TOOL=gas \
251 MD5PROG="$(MD5PROG)" \
252 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
254 # The FSF "binutils" release includes gprof and ld.
255 .PHONY: binutils.tar.bz2
256 BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms mkdep cpu
257 binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
258 $(MAKE) -f $(SELF) taz TOOL=binutils \
259 MD5PROG="$(MD5PROG)" \
260 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)"
262 .PHONY: gas+binutils.tar.bz2
263 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
264 gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
265 $(MAKE) -f $(SELF) taz TOOL=gas \
266 MD5PROG="$(MD5PROG)" \
267 SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
269 GNATS_SUPPORT_DIRS=include libiberty send-pr
270 gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
271 $(MAKE) -f $(SELF) taz TOOL=gnats \
272 MD5PROG="$(MD5PROG)" \
273 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
276 GDB_SUPPORT_DIRS= bfd include libiberty opcodes readline sim
277 gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
278 $(MAKE) -f $(SELF) gdb-taz TOOL=gdb \
279 MD5PROG="$(MD5PROG)" \
280 SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
282 gdb.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
283 $(MAKE) -f $(SELF) gdb-tar TOOL=gdb \
284 MD5PROG="$(MD5PROG)" \
285 SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
287 DEJAGNU_SUPPORT_DIRS= tcl expect libiberty
288 .PHONY: dejagnu.tar.bz2
289 dejagnu.tar.bz2: $(DIST_SUPPORT) $(DEJAGNU_SUPPORT_DIRS) dejagnu
290 $(MAKE) -f $(SELF) gdb-taz TOOL=dejagnu \
291 MD5PROG="$(MD5PROG)" \
292 SUPPORT_FILES="$(DEJAGNU_SUPPORT_DIRS)"
294 dejagnu.tar: $(DIST_SUPPORT) $(DEJAGNU_SUPPORT_DIRS) dejagnu
295 $(MAKE) -f $(SELF) gdb-tar TOOL=dejagnu \
296 MD5PROG="$(MD5PROG)" \
297 SUPPORT_FILES="$(DEJAGNU_SUPPORT_DIRS)"
299 .PHONY: gdb+dejagnu.tar.bz2
300 GDBD_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl expect dejagnu
301 gdb+dejagnu.tar.bz2: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb
302 $(MAKE) -f $(SELF) gdb-taz TOOL=gdb PACKAGE=gdb+dejagnu \
303 MD5PROG="$(MD5PROG)" \
304 SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)"
305 .PHONY: gdb+dejagnu.tar
306 gdb+dejagnu.tar: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb
307 $(MAKE) -f $(SELF) gdb-tar TOOL=gdb PACKAGE=gdb+dejagnu \
308 MD5PROG="$(MD5PROG)" \
309 SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)"
311 .PHONY: insight.tar.bz2
312 INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl libgui
313 insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
314 $(MAKE) -f $(SELF) gdb-taz TOOL=gdb PACKAGE=insight \
315 MD5PROG="$(MD5PROG)" \
316 SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
318 insight.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
319 $(MAKE) -f $(SELF) gdb-tar TOOL=gdb PACKAGE=insight \
320 MD5PROG="$(MD5PROG)" \
321 SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
323 .PHONY: insight+dejagnu.tar.bz2
324 INSIGHTD_SUPPORT_DIRS= $(INSIGHT_SUPPORT_DIRS) expect dejagnu
325 insight+dejagnu.tar.bz2: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb
326 $(MAKE) -f $(SELF) gdb-taz TOOL=gdb PACKAGE="insight+dejagnu" \
327 MD5PROG="$(MD5PROG)" \
328 SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)"
329 .PHONY: insight+dejagnu.tar
330 insight+dejagnu.tar: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb
331 $(MAKE) -f $(SELF) gdb-tar TOOL=gdb PACKAGE="insight+dejagnu" \
332 MD5PROG="$(MD5PROG)" \
333 SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)"