blob: cba438492415794ebe2c147612700fbc22e1106d [file] [log] [blame]
Nathanael Nerode748503c2002-10-01 22:34:161# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
Andrew Cagney72bbedd2004-01-15 23:24:292# 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation
Nathanael Nerode748503c2002-10-01 22:34:163#
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.
8#
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.
13#
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
Kelley Cook6e4d0bc2005-07-16 02:41:3416# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Nathanael Nerode748503c2002-10-01 22:34:1617#
18
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.
22
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.
25
26# This is the name of this script (!). Needed due to horrible recursion.
27SELF = src-release
28
29SHELL = /bin/sh
30
31BZIPPROG = bzip2
32MD5PROG = md5sum
33
Daniel Jacobowitz25aae7f2006-05-17 19:09:5234# (Default to avoid splitting info files by setting the threshold high.)
35MAKEINFOFLAGS = --split-size=5000000
36
Nathanael Nerode748503c2002-10-01 22:34:1637# 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.
41PWD = $${PWDCMD-pwd}
42
43#
44# Support for building net releases
45
46# Files in devo used in any net release.
Daniel Jacobowitzc6b750e2007-02-09 15:15:3847DEVO_SUPPORT= README Makefile.in configure configure.ac \
Richard Sandiford73fb70682004-12-03 10:30:1348config.guess config.sub config move-if-change \
Nathanael Nerode748503c2002-10-01 22:34:1649COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
Steve Ellcey37ad9512007-05-24 17:33:4250mkinstalldirs ltmain.sh missing ylwrap \
Daniel Jacobowitz184d8132007-06-22 15:48:0851libtool.m4 ltsugar.m4 ltversion.m4 ltoptions.m4 \
Daniel Jacobowitzd6f99442007-08-12 19:05:4252Makefile.def Makefile.tpl src-release config.rpath \
Daniel Jacobowitz03c2f9e2008-05-16 12:34:3853ChangeLog MAINTAINERS README-maintainer-mode \
54lt~obsolete.m4 ltgcc.m4 depcomp mkdep compile \
Daniel Jacobowitzd6f99442007-08-12 19:05:4255COPYING3 COPYING3.LIB
Nathanael Nerode748503c2002-10-01 22:34:1656
57# Files in devo/etc used in any net release.
Nathanael Nerode748503c2002-10-01 22:34:1658ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
59make-stds.texi standards.info* configure.texi configure.info* \
Tristan Gingoldac7bcd22010-12-10 09:10:4960ChangeLog configbuild.* configdev.* fdl.texi texi2pod.pl gnu-oids.texi
Nathanael Nerode748503c2002-10-01 22:34:1661
62
63# When you use `make setup-dirs' or `make taz' you should always redefine
64# this macro.
65SUPPORT_FILES = list-of-support-files-for-tool-in-question
66
67# NOTE: No double quotes in the below. It is used within shell script
68# as VER="$(VER)"
69VER = ` if grep 'AM_INIT_AUTOMAKE.*BFD_VERSION' $(TOOL)/configure.in >/dev/null 2>&1; then \
70 sed < bfd/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
71elif grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
72 sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
73elif test -f $(TOOL)/version.in; then \
74 head -1 $(TOOL)/version.in; \
75elif grep VERSION $(TOOL)/Makefile.in > /dev/null 2>&1; then \
76 sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \
77else \
78 echo VERSION; \
79fi`
80PACKAGE = $(TOOL)
81
82.PHONY: taz
83taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
84$(MAKE) -f $(SELF) do-proto-toplev \
85TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
86MD5PROG="$(MD5PROG)" \
87SUPPORT_FILES="$(SUPPORT_FILES)"
88$(MAKE) -f $(SELF) do-md5sum \
89TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
90MD5PROG="$(MD5PROG)" \
91SUPPORT_FILES="$(SUPPORT_FILES)"
92$(MAKE) -f $(SELF) do-tar \
93TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
94MD5PROG="$(MD5PROG)" \
95SUPPORT_FILES="$(SUPPORT_FILES)"
96$(MAKE) -f $(SELF) do-bz2 \
97TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
98MD5PROG="$(MD5PROG)" \
99SUPPORT_FILES="$(SUPPORT_FILES)"
100
101.PHONY: gdb-tar
102gdb-tar: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
103$(MAKE) -f $(SELF) do-proto-toplev \
104TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
105MD5PROG="$(MD5PROG)" \
106SUPPORT_FILES="$(SUPPORT_FILES)"
107$(MAKE) -f $(SELF) do-md5sum \
108TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
109MD5PROG="$(MD5PROG)" \
110SUPPORT_FILES="$(SUPPORT_FILES)"
111$(MAKE) -f $(SELF) do-djunpack \
112TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
113MD5PROG="$(MD5PROG)" \
114SUPPORT_FILES="$(SUPPORT_FILES)"
115$(MAKE) -f $(SELF) do-tar \
116TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
117MD5PROG="$(MD5PROG)" \
118SUPPORT_FILES="$(SUPPORT_FILES)"
119
120.PHONY: gdb-taz
121gdb-taz: gdb-tar $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
122$(MAKE) -f $(SELF) gdb-tar \
123TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
124MD5PROG="$(MD5PROG)" \
125SUPPORT_FILES="$(SUPPORT_FILES)"
126$(MAKE) -f $(SELF) do-bz2 \
127TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
128MD5PROG="$(MD5PROG)" \
129SUPPORT_FILES="$(SUPPORT_FILES)"
130
131.PHONY: do-proto-toplev
132do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
133echo "==> Making $(PACKAGE)-$(VER)/"
134# Take out texinfo from a few places.
135sed -e '/^all\.normal: /s/\all-texinfo //' \
136 -e '/^ install-texinfo /d' \
137<Makefile.in >tmp
138mv -f tmp Makefile.in
139#
Andrew Cagney72bbedd2004-01-15 23:24:29140./configure i686-pc-linux-gnu
Nathanael Nerodeb4fa0932002-12-05 22:43:12141$(MAKE) configure-host configure-target \
Nathanael Nerode748503c2002-10-01 22:34:16142 ALL_GCC="" ALL_GCC_C="" ALL_GCC_CXX="" \
143 CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
144# Make links, and run "make diststuff" or "make info" when needed.
145rm -rf proto-toplev ; mkdir proto-toplev
Daniel Jacobowitz91506732007-04-09 15:36:44146set -e ; dirs="$(DEVO_SUPPORT) $(SUPPORT_FILES) $(TOOL)" ; \
Nathanael Nerode748503c2002-10-01 22:34:16147for d in $$dirs ; do \
148 if [ -d $$d ]; then \
149 if [ ! -f $$d/Makefile ] ; then true ; \
150 elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \
Daniel Jacobowitz25aae7f2006-05-17 19:09:52151(cd $$d ; $(MAKE) MAKEINFOFLAGS="$(MAKEINFOFLAGS)" \
152 diststuff ) || exit 1 ; \
Nathanael Nerode748503c2002-10-01 22:34:16153 elif grep '^info:' $$d/Makefile >/dev/null ; then \
Daniel Jacobowitz25aae7f2006-05-17 19:09:52154(cd $$d ; $(MAKE) MAKEINFOFLAGS="$(MAKEINFOFLAGS)" \
155 info ) || exit 1 ; \
Nathanael Nerode748503c2002-10-01 22:34:16156 fi ; \
157 if [ -d $$d/proto-$$d.dir ]; then \
158 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
159 else \
160 ln -s ../$$d proto-toplev/$$d ; \
161 fi ; \
162 else ln -s ../$$d proto-toplev/$$d ; fi ; \
163done
Daniel Jacobowitz25aae7f2006-05-17 19:09:52164cd etc && $(MAKE) MAKEINFOFLAGS="$(MAKEINFOFLAGS)" info
Nathanael Nerode748503c2002-10-01 22:34:16165$(MAKE) distclean
Michael Chastaind9a35682003-09-14 23:16:45166# Kludge for pr gdb/857. intl/Makefile.in lacks a couple
167# of files in the distclean rule. Zack W is planning to make
168# the gcc version of intl/ the master version and then push
169# that version to src soon. See:
170# http://sources.redhat.com/ml/binutils/2003-07/msg00032.html
171# After the src version of intl/ is upgraded, we can look at
172# moving this logic into intl/Makefile.in distclean rule
173# if it is still needed. -- chastain 2003-09-12
174rm -f intl/config.cache
175rm -f intl/config.status
176rm -f intl/config.h
177rm -f intl/stamp-h
Nathanael Nerode748503c2002-10-01 22:34:16178#
179mkdir proto-toplev/etc
180(cd proto-toplev/etc; \
181 for i in $(ETC_SUPPORT); do \
182ln -s ../../etc/$$i . ; \
183 done)
184#
185# Take out texinfo from configurable dirs
Daniel Jacobowitzc6b750e2007-02-09 15:15:38186rm proto-toplev/configure.ac
Nathanael Nerode748503c2002-10-01 22:34:16187sed -e '/^host_tools=/s/texinfo //' \
Daniel Jacobowitzc6b750e2007-02-09 15:15:38188 <configure.ac >proto-toplev/configure.ac
Nathanael Nerode748503c2002-10-01 22:34:16189#
190mkdir proto-toplev/texinfo
191ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
192if test -r texinfo/util/tex3patch ; then \
193 mkdir proto-toplev/texinfo/util && \
194 ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
195else true; fi
196chmod -R og=u . || chmod og=u `find . -print`
197#
198# Create .gmo files from .po files.
199for f in `find . -name '*.po' -type f -print`; do \
200 msgfmt -o `echo $$f | sed -e 's/\.po$$/.gmo/'` $$f ; \
201done
202#
203-rm -f $(PACKAGE)-$(VER)
204ln -s proto-toplev $(PACKAGE)-$(VER)
205
Andrew Cagney05582642004-02-28 21:52:04206CVS_NAMES= \( -name CVS -o -name '.cvsignore' \)
207
Nathanael Nerode748503c2002-10-01 22:34:16208.PHONY: do-tar
209do-tar:
210echo "==> Making $(PACKAGE)-$(VER).tar"
211-rm -f $(PACKAGE)-$(VER).tar
Andrew Cagney05582642004-02-28 21:52:04212find $(PACKAGE)-$(VER) -follow $(CVS_NAMES) -prune \
213-o -type f -print \
Nathanael Nerode748503c2002-10-01 22:34:16214| tar cTfh - $(PACKAGE)-$(VER).tar
215
216.PHONY: do-bz2
217do-bz2:
218echo "==> Bzipping $(PACKAGE)-$(VER).tar.bz2"
219-rm -f $(PACKAGE)-$(VER).tar.bz2
220$(BZIPPROG) -v -9 $(PACKAGE)-$(VER).tar
221
222.PHONY: do-md5sum
223do-md5sum:
224echo "==> Adding md5 checksum to top-level directory"
Andrew Cagney05582642004-02-28 21:52:04225cd proto-toplev && find * -follow $(CVS_NAMES) -prune \
226-o -type f -print \
Andrew Cagney1c0f67c2004-10-19 18:52:04227| xargs $(MD5PROG) > ../md5.new
228-rm -f proto-toplev/md5.sum
229mv md5.new proto-toplev/md5.sum
Nathanael Nerode748503c2002-10-01 22:34:16230
231.PHONY: do-djunpack
232do-djunpack:
233echo "==> Adding updated djunpack.bat to top-level directory"
Andrew Cagney710068b2003-09-14 18:12:21234echo - 's /gdb-[0-9\.]*/$(PACKAGE)-'"$(VER)"'/'
Nathanael Nerode748503c2002-10-01 22:34:16235sed < djunpack.bat > djunpack.new \
Andrew Cagney710068b2003-09-14 18:12:21236-e 's/gdb-[0-9][0-9\.]*/$(PACKAGE)-'"$(VER)"'/'
Nathanael Nerode748503c2002-10-01 22:34:16237-rm -f proto-toplev/djunpack.bat
Andrew Cagney1c0f67c2004-10-19 18:52:04238mv djunpack.new proto-toplev/djunpack.bat
Nathanael Nerode748503c2002-10-01 22:34:16239
240TEXINFO_SUPPORT= texinfo/texinfo.tex
241DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
242
243.PHONY: gas.tar.bz2
244GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms mkdep
245gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
246$(MAKE) -f $(SELF) taz TOOL=gas \
247MD5PROG="$(MD5PROG)" \
248SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
249
250# The FSF "binutils" release includes gprof and ld.
251.PHONY: binutils.tar.bz2
Ian Lance Taylor662c6702008-06-18 23:20:43252BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld elfcpp gold gprof intl setup.com makefile.vms cpu
Nathanael Nerode748503c2002-10-01 22:34:16253binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
254$(MAKE) -f $(SELF) taz TOOL=binutils \
255MD5PROG="$(MD5PROG)" \
256SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)"
257
258.PHONY: gas+binutils.tar.bz2
259GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
260gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
261$(MAKE) -f $(SELF) taz TOOL=gas \
262MD5PROG="$(MD5PROG)" \
263SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
264
265GNATS_SUPPORT_DIRS=include libiberty send-pr
266gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
267$(MAKE) -f $(SELF) taz TOOL=gnats \
268MD5PROG="$(MD5PROG)" \
269SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
270
271.PHONY: gdb.tar.bz2
Joel Brobecker860144e2011-08-19 15:48:36272GDB_SUPPORT_DIRS= bfd include libiberty opcodes readline sim intl libdecnumber cpu
Nathanael Nerode748503c2002-10-01 22:34:16273gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
274$(MAKE) -f $(SELF) gdb-taz TOOL=gdb \
275MD5PROG="$(MD5PROG)" \
276SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
277.PHONY: gdb.tar
278gdb.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
279$(MAKE) -f $(SELF) gdb-tar TOOL=gdb \
280MD5PROG="$(MD5PROG)" \
281SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
282
Nathanael Nerode748503c2002-10-01 22:34:16283.PHONY: insight.tar.bz2
Nathanael Nerode675c6962004-08-12 22:59:53284INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl libgui
Nathanael Nerode748503c2002-10-01 22:34:16285insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
286$(MAKE) -f $(SELF) gdb-taz TOOL=gdb PACKAGE=insight \
287MD5PROG="$(MD5PROG)" \
288SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
289.PHONY: insight.tar
290insight.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
291$(MAKE) -f $(SELF) gdb-tar TOOL=gdb PACKAGE=insight \
292MD5PROG="$(MD5PROG)" \
293SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
294
Nathanael Nerode748503c2002-10-01 22:34:16295.NOEXPORT:
296MAKEOVERRIDES=