blob: c2f4727b35ebd86794e77c7a3b449c22b3176b09 [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 \
Mike Frysinger4f778542013-03-22 23:16:4070 bfd/configure --version | sed -n -e '1s,.* ,,p'; \
Nathanael Nerode748503c2002-10-01 22:34:1671elif grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
72 sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
Joel Brobecker7539e412013-07-22 15:17:2073elif test -f $(TOOL)/common/create-version.sh; then \
74 $(TOOL)/common/create-version.sh $(TOOL) \
75 'dummy-host' 'dummy-target' \
76 VER.tmp; \
Joel Brobeckerf006cab2013-08-17 01:07:5277 cat VER.tmp | grep 'version\[\]' | sed 's/.*"\([^"]*\)".*/\1/' | sed 's/-cvs$$//'; \
Joel Brobecker7539e412013-07-22 15:17:2078 rm -f VER.tmp; \
Nathanael Nerode748503c2002-10-01 22:34:1679elif test -f $(TOOL)/version.in; then \
80 head -1 $(TOOL)/version.in; \
81elif grep VERSION $(TOOL)/Makefile.in > /dev/null 2>&1; then \
82 sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \
83else \
84 echo VERSION; \
85fi`
86PACKAGE = $(TOOL)
87
88.PHONY: taz
89taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
90$(MAKE) -f $(SELF) do-proto-toplev \
91TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
92MD5PROG="$(MD5PROG)" \
93SUPPORT_FILES="$(SUPPORT_FILES)"
94$(MAKE) -f $(SELF) do-md5sum \
95TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
96MD5PROG="$(MD5PROG)" \
97SUPPORT_FILES="$(SUPPORT_FILES)"
98$(MAKE) -f $(SELF) do-tar \
99TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
100MD5PROG="$(MD5PROG)" \
101SUPPORT_FILES="$(SUPPORT_FILES)"
102$(MAKE) -f $(SELF) do-bz2 \
103TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
104MD5PROG="$(MD5PROG)" \
105SUPPORT_FILES="$(SUPPORT_FILES)"
106
107.PHONY: gdb-tar
108gdb-tar: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
109$(MAKE) -f $(SELF) do-proto-toplev \
110TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
111MD5PROG="$(MD5PROG)" \
112SUPPORT_FILES="$(SUPPORT_FILES)"
113$(MAKE) -f $(SELF) do-md5sum \
114TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
115MD5PROG="$(MD5PROG)" \
116SUPPORT_FILES="$(SUPPORT_FILES)"
117$(MAKE) -f $(SELF) do-djunpack \
118TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
119MD5PROG="$(MD5PROG)" \
120SUPPORT_FILES="$(SUPPORT_FILES)"
121$(MAKE) -f $(SELF) do-tar \
122TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
123MD5PROG="$(MD5PROG)" \
124SUPPORT_FILES="$(SUPPORT_FILES)"
125
126.PHONY: gdb-taz
127gdb-taz: gdb-tar $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
128$(MAKE) -f $(SELF) gdb-tar \
129TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
130MD5PROG="$(MD5PROG)" \
131SUPPORT_FILES="$(SUPPORT_FILES)"
132$(MAKE) -f $(SELF) do-bz2 \
133TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
134MD5PROG="$(MD5PROG)" \
135SUPPORT_FILES="$(SUPPORT_FILES)"
136
137.PHONY: do-proto-toplev
138do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
139echo "==> Making $(PACKAGE)-$(VER)/"
140# Take out texinfo from a few places.
141sed -e '/^all\.normal: /s/\all-texinfo //' \
142 -e '/^ install-texinfo /d' \
143<Makefile.in >tmp
144mv -f tmp Makefile.in
145#
Andrew Cagney72bbedd2004-01-15 23:24:29146./configure i686-pc-linux-gnu
Nathanael Nerodeb4fa0932002-12-05 22:43:12147$(MAKE) configure-host configure-target \
Nathanael Nerode748503c2002-10-01 22:34:16148 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.
151rm -rf proto-toplev ; mkdir proto-toplev
Daniel Jacobowitz91506732007-04-09 15:36:44152set -e ; dirs="$(DEVO_SUPPORT) $(SUPPORT_FILES) $(TOOL)" ; \
Nathanael Nerode748503c2002-10-01 22:34:16153for 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 \
Daniel Jacobowitz25aae7f2006-05-17 19:09:52157(cd $$d ; $(MAKE) MAKEINFOFLAGS="$(MAKEINFOFLAGS)" \
158 diststuff ) || exit 1 ; \
Nathanael Nerode748503c2002-10-01 22:34:16159 elif grep '^info:' $$d/Makefile >/dev/null ; then \
Daniel Jacobowitz25aae7f2006-05-17 19:09:52160(cd $$d ; $(MAKE) MAKEINFOFLAGS="$(MAKEINFOFLAGS)" \
161 info ) || exit 1 ; \
Nathanael Nerode748503c2002-10-01 22:34:16162 fi ; \
163 if [ -d $$d/proto-$$d.dir ]; then \
164 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
165 else \
166 ln -s ../$$d proto-toplev/$$d ; \
167 fi ; \
168 else ln -s ../$$d proto-toplev/$$d ; fi ; \
169done
Daniel Jacobowitz25aae7f2006-05-17 19:09:52170cd etc && $(MAKE) MAKEINFOFLAGS="$(MAKEINFOFLAGS)" info
Nathanael Nerode748503c2002-10-01 22:34:16171$(MAKE) distclean
Michael Chastaind9a35682003-09-14 23:16:45172# 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
180rm -f intl/config.cache
181rm -f intl/config.status
182rm -f intl/config.h
183rm -f intl/stamp-h
Nathanael Nerode748503c2002-10-01 22:34:16184#
185mkdir proto-toplev/etc
186(cd proto-toplev/etc; \
187 for i in $(ETC_SUPPORT); do \
188ln -s ../../etc/$$i . ; \
189 done)
190#
191# Take out texinfo from configurable dirs
Daniel Jacobowitzc6b750e2007-02-09 15:15:38192rm proto-toplev/configure.ac
Nathanael Nerode748503c2002-10-01 22:34:16193sed -e '/^host_tools=/s/texinfo //' \
Daniel Jacobowitzc6b750e2007-02-09 15:15:38194 <configure.ac >proto-toplev/configure.ac
Nathanael Nerode748503c2002-10-01 22:34:16195#
196mkdir proto-toplev/texinfo
197ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
198if test -r texinfo/util/tex3patch ; then \
199 mkdir proto-toplev/texinfo/util && \
200 ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
201else true; fi
202chmod -R og=u . || chmod og=u `find . -print`
203#
204# Create .gmo files from .po files.
205for f in `find . -name '*.po' -type f -print`; do \
206 msgfmt -o `echo $$f | sed -e 's/\.po$$/.gmo/'` $$f ; \
207done
208#
209-rm -f $(PACKAGE)-$(VER)
210ln -s proto-toplev $(PACKAGE)-$(VER)
211
Andrew Cagney05582642004-02-28 21:52:04212CVS_NAMES= \( -name CVS -o -name '.cvsignore' \)
213
Nathanael Nerode748503c2002-10-01 22:34:16214.PHONY: do-tar
215do-tar:
216echo "==> Making $(PACKAGE)-$(VER).tar"
217-rm -f $(PACKAGE)-$(VER).tar
Andrew Cagney05582642004-02-28 21:52:04218find $(PACKAGE)-$(VER) -follow $(CVS_NAMES) -prune \
219-o -type f -print \
Nathanael Nerode748503c2002-10-01 22:34:16220| tar cTfh - $(PACKAGE)-$(VER).tar
221
222.PHONY: do-bz2
223do-bz2:
224echo "==> Bzipping $(PACKAGE)-$(VER).tar.bz2"
225-rm -f $(PACKAGE)-$(VER).tar.bz2
226$(BZIPPROG) -v -9 $(PACKAGE)-$(VER).tar
227
228.PHONY: do-md5sum
229do-md5sum:
230echo "==> Adding md5 checksum to top-level directory"
Andrew Cagney05582642004-02-28 21:52:04231cd proto-toplev && find * -follow $(CVS_NAMES) -prune \
232-o -type f -print \
Andrew Cagney1c0f67c2004-10-19 18:52:04233| xargs $(MD5PROG) > ../md5.new
234-rm -f proto-toplev/md5.sum
235mv md5.new proto-toplev/md5.sum
Nathanael Nerode748503c2002-10-01 22:34:16236
237.PHONY: do-djunpack
238do-djunpack:
239echo "==> Adding updated djunpack.bat to top-level directory"
Andrew Cagney710068b2003-09-14 18:12:21240echo - 's /gdb-[0-9\.]*/$(PACKAGE)-'"$(VER)"'/'
Nathanael Nerode748503c2002-10-01 22:34:16241sed < djunpack.bat > djunpack.new \
Andrew Cagney710068b2003-09-14 18:12:21242-e 's/gdb-[0-9][0-9\.]*/$(PACKAGE)-'"$(VER)"'/'
Nathanael Nerode748503c2002-10-01 22:34:16243-rm -f proto-toplev/djunpack.bat
Andrew Cagney1c0f67c2004-10-19 18:52:04244mv djunpack.new proto-toplev/djunpack.bat
Nathanael Nerode748503c2002-10-01 22:34:16245
246TEXINFO_SUPPORT= texinfo/texinfo.tex
247DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
248
249.PHONY: gas.tar.bz2
250GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms mkdep
251gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
252$(MAKE) -f $(SELF) taz TOOL=gas \
253MD5PROG="$(MD5PROG)" \
254SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
255
256# The FSF "binutils" release includes gprof and ld.
257.PHONY: binutils.tar.bz2
Ian Lance Taylor662c6702008-06-18 23:20:43258BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld elfcpp gold gprof intl setup.com makefile.vms cpu
Nathanael Nerode748503c2002-10-01 22:34:16259binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
260$(MAKE) -f $(SELF) taz TOOL=binutils \
261MD5PROG="$(MD5PROG)" \
262SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)"
263
264.PHONY: gas+binutils.tar.bz2
265GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
266gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
267$(MAKE) -f $(SELF) taz TOOL=gas \
268MD5PROG="$(MD5PROG)" \
269SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
270
271GNATS_SUPPORT_DIRS=include libiberty send-pr
272gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
273$(MAKE) -f $(SELF) taz TOOL=gnats \
274MD5PROG="$(MD5PROG)" \
275SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
276
277.PHONY: gdb.tar.bz2
Joel Brobecker860144e2011-08-19 15:48:36278GDB_SUPPORT_DIRS= bfd include libiberty opcodes readline sim intl libdecnumber cpu
Nathanael Nerode748503c2002-10-01 22:34:16279gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
280$(MAKE) -f $(SELF) gdb-taz TOOL=gdb \
281MD5PROG="$(MD5PROG)" \
282SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
283.PHONY: gdb.tar
284gdb.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
285$(MAKE) -f $(SELF) gdb-tar TOOL=gdb \
286MD5PROG="$(MD5PROG)" \
287SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
288
Nathanael Nerode748503c2002-10-01 22:34:16289.PHONY: insight.tar.bz2
Nathanael Nerode675c6962004-08-12 22:59:53290INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl libgui
Nathanael Nerode748503c2002-10-01 22:34:16291insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
292$(MAKE) -f $(SELF) gdb-taz TOOL=gdb PACKAGE=insight \
293MD5PROG="$(MD5PROG)" \
294SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
295.PHONY: insight.tar
296insight.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
297$(MAKE) -f $(SELF) gdb-tar TOOL=gdb PACKAGE=insight \
298MD5PROG="$(MD5PROG)" \
299SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
300
Nathanael Nerode748503c2002-10-01 22:34:16301.NOEXPORT:
302MAKEOVERRIDES=