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 # (Default to avoid splitting info files by setting the threshold high.)
35 MAKEINFOFLAGS = --split-size=5000000
37 # pwd command to use. Allow user to override default by setting PWDCMD in
38 # the environment to account for automounters. The make variable must not
39 # be called PWDCMD, otherwise the value set here is passed to make
40 # subprocesses and overrides the setting from the user's environment.
44 # Support for building net releases
46 # Files in devo used in any net release.
47 DEVO_SUPPORT= README Makefile.in configure configure.ac \
48 config.guess config.sub config move-if-change \
49 COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
50 mkinstalldirs ltmain.sh missing ylwrap \
51 libtool.m4 ltsugar.m4 ltversion.m4 ltoptions.m4 \
52 Makefile.def Makefile.tpl src-release config.rpath \
53 ChangeLog MAINTAINERS README-maintainer-mode \
54 lt~obsolete.m4 ltgcc.m4 depcomp mkdep compile \
57 # Files in devo/etc used in any net release.
58 ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
59 make-stds.texi standards.info* configure.texi configure.info* \
60 ChangeLog configbuild.* configdev.* fdl.texi texi2pod.pl gnu-oids.texi
63 # When you use `make setup-dirs' or `make taz' you should always redefine
65 SUPPORT_FILES = list-of-support-files-for-tool-in-question
67 # NOTE: No double quotes in the below. It is used within shell script
69 VER = ` if grep 'AM_INIT_AUTOMAKE.*BFD_VERSION' $(TOOL)/configure.in >/dev/null 2>&1; then \
70 bfd/configure --version | sed -n -e '1s,.* ,,p'; \
71 elif grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
72 sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
73 elif test -f $(TOOL)/common/create-version.sh; then \
74 $(TOOL)/common/create-version.sh $(TOOL) \
75 'dummy-host' 'dummy-target' \
77 cat VER.tmp | grep 'version\[\]' | sed 's/.*"\([^"]*\)".*/\1/' | sed 's/-cvs$$//'; \
79 elif test -f $(TOOL)/version.in; then \
80 head -1 $(TOOL)/version.in; \
81 elif grep VERSION $(TOOL)/Makefile.in > /dev/null 2>&1; then \
82 sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \
89 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
90 $(MAKE) -f $(SELF) do-proto-toplev \
91 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
92 MD5PROG="$(MD5PROG)" \
93 SUPPORT_FILES="$(SUPPORT_FILES)"
94 $(MAKE) -f $(SELF) do-md5sum \
95 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
96 MD5PROG="$(MD5PROG)" \
97 SUPPORT_FILES="$(SUPPORT_FILES)"
98 $(MAKE) -f $(SELF) do-tar \
99 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
100 MD5PROG="$(MD5PROG)" \
101 SUPPORT_FILES="$(SUPPORT_FILES)"
102 $(MAKE) -f $(SELF) do-bz2 \
103 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
104 MD5PROG="$(MD5PROG)" \
105 SUPPORT_FILES="$(SUPPORT_FILES)"
108 gdb-tar: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
109 $(MAKE) -f $(SELF) do-proto-toplev \
110 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
111 MD5PROG="$(MD5PROG)" \
112 SUPPORT_FILES="$(SUPPORT_FILES)"
113 $(MAKE) -f $(SELF) do-md5sum \
114 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
115 MD5PROG="$(MD5PROG)" \
116 SUPPORT_FILES="$(SUPPORT_FILES)"
117 $(MAKE) -f $(SELF) do-djunpack \
118 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
119 MD5PROG="$(MD5PROG)" \
120 SUPPORT_FILES="$(SUPPORT_FILES)"
121 $(MAKE) -f $(SELF) do-tar \
122 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
123 MD5PROG="$(MD5PROG)" \
124 SUPPORT_FILES="$(SUPPORT_FILES)"
127 gdb-taz: gdb-tar $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
128 $(MAKE) -f $(SELF) gdb-tar \
129 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
130 MD5PROG="$(MD5PROG)" \
131 SUPPORT_FILES="$(SUPPORT_FILES)"
132 $(MAKE) -f $(SELF) do-bz2 \
133 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
134 MD5PROG="$(MD5PROG)" \
135 SUPPORT_FILES="$(SUPPORT_FILES)"
137 .PHONY: do-proto-toplev
138 do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
139 echo "==> Making $(PACKAGE)-$(VER)/"
140 # Take out texinfo from a few places.
141 sed -e '/^all\.normal: /s/\all-texinfo //' \
142 -e '/^ install-texinfo /d' \
144 mv -f tmp Makefile.in
146 ./configure i686-pc-linux-gnu
147 $(MAKE) configure-host configure-target \
148 ALL_GCC="" ALL_GCC_C="" ALL_GCC_CXX="" \
149 CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
150 # Make links, and run "make diststuff" or "make info" when needed.
151 rm -rf proto-toplev ; mkdir proto-toplev
152 set -e ; dirs="$(DEVO_SUPPORT) $(SUPPORT_FILES) $(TOOL)" ; \
153 for d in $$dirs ; do \
154 if [ -d $$d ]; then \
155 if [ ! -f $$d/Makefile ] ; then true ; \
156 elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \
157 (cd $$d ; $(MAKE) MAKEINFOFLAGS="$(MAKEINFOFLAGS)" \
158 diststuff ) || exit 1 ; \
159 elif grep '^info:' $$d/Makefile >/dev/null ; then \
160 (cd $$d ; $(MAKE) MAKEINFOFLAGS="$(MAKEINFOFLAGS)" \
163 if [ -d $$d/proto-$$d.dir ]; then \
164 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
166 ln -s ../$$d proto-toplev/$$d ; \
168 else ln -s ../$$d proto-toplev/$$d ; fi ; \
170 cd etc && $(MAKE) MAKEINFOFLAGS="$(MAKEINFOFLAGS)" info
172 # Kludge for pr gdb/857. intl/Makefile.in lacks a couple
173 # of files in the distclean rule. Zack W is planning to make
174 # the gcc version of intl/ the master version and then push
175 # that version to src soon. See:
176 # http://sources.redhat.com/ml/binutils/2003-07/msg00032.html
177 # After the src version of intl/ is upgraded, we can look at
178 # moving this logic into intl/Makefile.in distclean rule
179 # if it is still needed. -- chastain 2003-09-12
180 rm -f intl/config.cache
181 rm -f intl/config.status
185 mkdir proto-toplev/etc
186 (cd proto-toplev/etc; \
187 for i in $(ETC_SUPPORT); do \
188 ln -s ../../etc/$$i . ; \
191 # Take out texinfo from configurable dirs
192 rm proto-toplev/configure.ac
193 sed -e '/^host_tools=/s/texinfo //' \
194 <configure.ac >proto-toplev/configure.ac
196 mkdir proto-toplev/texinfo
197 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
198 if test -r texinfo/util/tex3patch ; then \
199 mkdir proto-toplev/texinfo/util && \
200 ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
202 chmod -R og=u . || chmod og=u `find . -print`
204 # Create .gmo files from .po files.
205 for f in `find . -name '*.po' -type f -print`; do \
206 msgfmt -o `echo $$f | sed -e 's/\.po$$/.gmo/'` $$f ; \
209 -rm -f $(PACKAGE)-$(VER)
210 ln -s proto-toplev $(PACKAGE)-$(VER)
212 CVS_NAMES= \( -name CVS -o -name '.cvsignore' \)
216 echo "==> Making $(PACKAGE)-$(VER).tar"
217 -rm -f $(PACKAGE)-$(VER).tar
218 find $(PACKAGE)-$(VER) -follow $(CVS_NAMES) -prune \
220 | tar cTfh - $(PACKAGE)-$(VER).tar
224 echo "==> Bzipping $(PACKAGE)-$(VER).tar.bz2"
225 -rm -f $(PACKAGE)-$(VER).tar.bz2
226 $(BZIPPROG) -v -9 $(PACKAGE)-$(VER).tar
230 echo "==> Adding md5 checksum to top-level directory"
231 cd proto-toplev && find * -follow $(CVS_NAMES) -prune \
233 | xargs $(MD5PROG) > ../md5.new
234 -rm -f proto-toplev/md5.sum
235 mv md5.new proto-toplev/md5.sum
239 echo "==> Adding updated djunpack.bat to top-level directory"
240 echo - 's /gdb-[0-9\.]*/$(PACKAGE)-'"$(VER)"'/'
241 sed < djunpack.bat > djunpack.new \
242 -e 's/gdb-[0-9][0-9\.]*/$(PACKAGE)-'"$(VER)"'/'
243 -rm -f proto-toplev/djunpack.bat
244 mv djunpack.new proto-toplev/djunpack.bat
246 TEXINFO_SUPPORT= texinfo/texinfo.tex
247 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
250 GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms mkdep
251 gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
252 $(MAKE) -f $(SELF) taz TOOL=gas \
253 MD5PROG="$(MD5PROG)" \
254 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
256 # The FSF "binutils" release includes gprof and ld.
257 .PHONY: binutils.tar.bz2
258 BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld elfcpp gold gprof intl setup.com makefile.vms cpu
259 binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
260 $(MAKE) -f $(SELF) taz TOOL=binutils \
261 MD5PROG="$(MD5PROG)" \
262 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)"
264 .PHONY: gas+binutils.tar.bz2
265 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
266 gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
267 $(MAKE) -f $(SELF) taz TOOL=gas \
268 MD5PROG="$(MD5PROG)" \
269 SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
271 GNATS_SUPPORT_DIRS=include libiberty send-pr
272 gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
273 $(MAKE) -f $(SELF) taz TOOL=gnats \
274 MD5PROG="$(MD5PROG)" \
275 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
278 GDB_SUPPORT_DIRS= bfd include libiberty opcodes readline sim intl libdecnumber cpu
279 gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
280 $(MAKE) -f $(SELF) gdb-taz TOOL=gdb \
281 MD5PROG="$(MD5PROG)" \
282 SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
284 gdb.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
285 $(MAKE) -f $(SELF) gdb-tar TOOL=gdb \
286 MD5PROG="$(MD5PROG)" \
287 SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
289 .PHONY: insight.tar.bz2
290 INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl libgui
291 insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
292 $(MAKE) -f $(SELF) gdb-taz TOOL=gdb PACKAGE=insight \
293 MD5PROG="$(MD5PROG)" \
294 SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
296 insight.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
297 $(MAKE) -f $(SELF) gdb-tar TOOL=gdb PACKAGE=insight \
298 MD5PROG="$(MD5PROG)" \
299 SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"