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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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/857. intl/Makefile.in lacks a couple
163 # of files in the distclean rule. Zack W is planning to make
164 # the gcc version of intl/ the master version and then push
165 # that version to src soon. See:
166 # http://sources.redhat.com/ml/binutils/2003-07/msg00032.html
167 # After the src version of intl/ is upgraded, we can look at
168 # moving this logic into intl/Makefile.in distclean rule
169 # if it is still needed. -- chastain 2003-09-12
170 rm -f intl/config.cache
171 rm -f intl/config.status
175 mkdir proto-toplev/etc
176 (cd proto-toplev/etc; \
177 for i in $(ETC_SUPPORT); do \
178 ln -s ../../etc/$$i . ; \
181 # Take out texinfo from configurable dirs
182 rm proto-toplev/configure.in
183 sed -e '/^host_tools=/s/texinfo //' \
184 <configure.in >proto-toplev/configure.in
186 mkdir proto-toplev/texinfo
187 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
188 if test -r texinfo/util/tex3patch ; then \
189 mkdir proto-toplev/texinfo/util && \
190 ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
192 chmod -R og=u . || chmod og=u `find . -print`
194 # Create .gmo files from .po files.
195 for f in `find . -name '*.po' -type f -print`; do \
196 msgfmt -o `echo $$f | sed -e 's/\.po$$/.gmo/'` $$f ; \
199 -rm -f $(PACKAGE)-$(VER)
200 ln -s proto-toplev $(PACKAGE)-$(VER)
202 CVS_NAMES= \( -name CVS -o -name '.cvsignore' \)
206 echo "==> Making $(PACKAGE)-$(VER).tar"
207 -rm -f $(PACKAGE)-$(VER).tar
208 find $(PACKAGE)-$(VER) -follow $(CVS_NAMES) -prune \
210 | tar cTfh - $(PACKAGE)-$(VER).tar
214 echo "==> Bzipping $(PACKAGE)-$(VER).tar.bz2"
215 -rm -f $(PACKAGE)-$(VER).tar.bz2
216 $(BZIPPROG) -v -9 $(PACKAGE)-$(VER).tar
220 echo "==> Adding md5 checksum to top-level directory"
221 cd proto-toplev && find * -follow $(CVS_NAMES) -prune \
223 | xargs $(MD5PROG) > ../md5.new
224 -rm -f proto-toplev/md5.sum
225 mv md5.new proto-toplev/md5.sum
229 echo "==> Adding updated djunpack.bat to top-level directory"
230 echo - 's /gdb-[0-9\.]*/$(PACKAGE)-'"$(VER)"'/'
231 sed < djunpack.bat > djunpack.new \
232 -e 's/gdb-[0-9][0-9\.]*/$(PACKAGE)-'"$(VER)"'/'
233 -rm -f proto-toplev/djunpack.bat
234 mv djunpack.new proto-toplev/djunpack.bat
236 TEXINFO_SUPPORT= texinfo/texinfo.tex
237 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
240 GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms mkdep
241 gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
242 $(MAKE) -f $(SELF) taz TOOL=gas \
243 MD5PROG="$(MD5PROG)" \
244 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
246 # The FSF "binutils" release includes gprof and ld.
247 .PHONY: binutils.tar.bz2
248 BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms mkdep cpu
249 binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
250 $(MAKE) -f $(SELF) taz TOOL=binutils \
251 MD5PROG="$(MD5PROG)" \
252 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)"
254 .PHONY: gas+binutils.tar.bz2
255 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
256 gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
257 $(MAKE) -f $(SELF) taz TOOL=gas \
258 MD5PROG="$(MD5PROG)" \
259 SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
261 GNATS_SUPPORT_DIRS=include libiberty send-pr
262 gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
263 $(MAKE) -f $(SELF) taz TOOL=gnats \
264 MD5PROG="$(MD5PROG)" \
265 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
268 GDB_SUPPORT_DIRS= bfd include libiberty opcodes readline sim
269 gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
270 $(MAKE) -f $(SELF) gdb-taz TOOL=gdb \
271 MD5PROG="$(MD5PROG)" \
272 SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
274 gdb.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
275 $(MAKE) -f $(SELF) gdb-tar TOOL=gdb \
276 MD5PROG="$(MD5PROG)" \
277 SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
279 .PHONY: insight.tar.bz2
280 INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl libgui
281 insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
282 $(MAKE) -f $(SELF) gdb-taz TOOL=gdb PACKAGE=insight \
283 MD5PROG="$(MD5PROG)" \
284 SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
286 insight.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
287 $(MAKE) -f $(SELF) gdb-tar TOOL=gdb PACKAGE=insight \
288 MD5PROG="$(MD5PROG)" \
289 SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"