blob: f012d9df88a3ff0345d369c6c77e84480533097c [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
16# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17#
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
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.
38PWD = $${PWDCMD-pwd}
39
40#
41# Support for building net releases
42
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).
46DEVO_SUPPORT= README Makefile.in configure configure.in \
47config.guess config.if config.sub config move-if-change \
Nathanael Nerode748503c2002-10-01 22:34:1648COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
49mkinstalldirs ltconfig ltmain.sh missing ylwrap \
Daniel Jacobowitza26d7082003-05-02 17:29:4850libtool.m4 gettext.m4 ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh \
51Makefile.def Makefile.tpl src-release
Nathanael Nerode748503c2002-10-01 22:34:1652
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).
56ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
57make-stds.texi standards.info* configure.texi configure.info* \
Daniel Jacobowitz53dd8da2003-01-02 00:50:5758configbuild.* configdev.* fdl.texi texi2pod.pl
Nathanael Nerode748503c2002-10-01 22:34:1659
60
61# When you use `make setup-dirs' or `make taz' you should always redefine
62# this macro.
63SUPPORT_FILES = list-of-support-files-for-tool-in-question
64
65# NOTE: No double quotes in the below. It is used within shell script
66# as VER="$(VER)"
67VER = ` 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'; \
69elif grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
70 sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
71elif test -f $(TOOL)/version.in; then \
72 head -1 $(TOOL)/version.in; \
73elif grep VERSION $(TOOL)/Makefile.in > /dev/null 2>&1; then \
74 sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \
75else \
76 echo VERSION; \
77fi`
78PACKAGE = $(TOOL)
79
80.PHONY: taz
81taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
82$(MAKE) -f $(SELF) do-proto-toplev \
83TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
84MD5PROG="$(MD5PROG)" \
85SUPPORT_FILES="$(SUPPORT_FILES)"
86$(MAKE) -f $(SELF) do-md5sum \
87TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
88MD5PROG="$(MD5PROG)" \
89SUPPORT_FILES="$(SUPPORT_FILES)"
90$(MAKE) -f $(SELF) do-tar \
91TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
92MD5PROG="$(MD5PROG)" \
93SUPPORT_FILES="$(SUPPORT_FILES)"
94$(MAKE) -f $(SELF) do-bz2 \
95TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
96MD5PROG="$(MD5PROG)" \
97SUPPORT_FILES="$(SUPPORT_FILES)"
98
99.PHONY: gdb-tar
100gdb-tar: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
101$(MAKE) -f $(SELF) do-proto-toplev \
102TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
103MD5PROG="$(MD5PROG)" \
104SUPPORT_FILES="$(SUPPORT_FILES)"
105$(MAKE) -f $(SELF) do-md5sum \
106TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
107MD5PROG="$(MD5PROG)" \
108SUPPORT_FILES="$(SUPPORT_FILES)"
109$(MAKE) -f $(SELF) do-djunpack \
110TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
111MD5PROG="$(MD5PROG)" \
112SUPPORT_FILES="$(SUPPORT_FILES)"
113$(MAKE) -f $(SELF) do-tar \
114TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
115MD5PROG="$(MD5PROG)" \
116SUPPORT_FILES="$(SUPPORT_FILES)"
117
118.PHONY: gdb-taz
119gdb-taz: gdb-tar $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
120$(MAKE) -f $(SELF) gdb-tar \
121TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
122MD5PROG="$(MD5PROG)" \
123SUPPORT_FILES="$(SUPPORT_FILES)"
124$(MAKE) -f $(SELF) do-bz2 \
125TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
126MD5PROG="$(MD5PROG)" \
127SUPPORT_FILES="$(SUPPORT_FILES)"
128
129.PHONY: do-proto-toplev
130do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
131echo "==> Making $(PACKAGE)-$(VER)/"
132# Take out texinfo from a few places.
133sed -e '/^all\.normal: /s/\all-texinfo //' \
134 -e '/^ install-texinfo /d' \
135<Makefile.in >tmp
136mv -f tmp Makefile.in
137#
Andrew Cagney72bbedd2004-01-15 23:24:29138./configure i686-pc-linux-gnu
Nathanael Nerodeb4fa0932002-12-05 22:43:12139$(MAKE) configure-host configure-target \
Nathanael Nerode748503c2002-10-01 22:34:16140 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.
143rm -rf proto-toplev ; mkdir proto-toplev
144set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
145for 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 ; \
152 fi ; \
153 if [ -d $$d/proto-$$d.dir ]; then \
154 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
155 else \
156 ln -s ../$$d proto-toplev/$$d ; \
157 fi ; \
158 else ln -s ../$$d proto-toplev/$$d ; fi ; \
159done
160cd etc && $(MAKE) info
161$(MAKE) distclean
Michael Chastainca506da2003-08-16 16:54:26162# 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
168rm -f dejagnu/example/calc/config.status
169rm -f dejagnu/example/calc/config.log
Michael Chastaind9a35682003-09-14 23:16:45170# 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
178rm -f intl/config.cache
179rm -f intl/config.status
180rm -f intl/config.h
181rm -f intl/stamp-h
Nathanael Nerode748503c2002-10-01 22:34:16182#
183mkdir proto-toplev/etc
184(cd proto-toplev/etc; \
185 for i in $(ETC_SUPPORT); do \
186ln -s ../../etc/$$i . ; \
187 done)
188#
189# Take out texinfo from configurable dirs
190rm proto-toplev/configure.in
191sed -e '/^host_tools=/s/texinfo //' \
192 <configure.in >proto-toplev/configure.in
193#
194mkdir proto-toplev/texinfo
195ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
196if test -r texinfo/util/tex3patch ; then \
197 mkdir proto-toplev/texinfo/util && \
198 ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
199else true; fi
200chmod -R og=u . || chmod og=u `find . -print`
201#
202# Create .gmo files from .po files.
203for f in `find . -name '*.po' -type f -print`; do \
204 msgfmt -o `echo $$f | sed -e 's/\.po$$/.gmo/'` $$f ; \
205done
206#
207-rm -f $(PACKAGE)-$(VER)
208ln -s proto-toplev $(PACKAGE)-$(VER)
209
Andrew Cagney05582642004-02-28 21:52:04210CVS_NAMES= \( -name CVS -o -name '.cvsignore' \)
211
Nathanael Nerode748503c2002-10-01 22:34:16212.PHONY: do-tar
213do-tar:
214echo "==> Making $(PACKAGE)-$(VER).tar"
215-rm -f $(PACKAGE)-$(VER).tar
Andrew Cagney05582642004-02-28 21:52:04216find $(PACKAGE)-$(VER) -follow $(CVS_NAMES) -prune \
217-o -type f -print \
Nathanael Nerode748503c2002-10-01 22:34:16218| tar cTfh - $(PACKAGE)-$(VER).tar
219
220.PHONY: do-bz2
221do-bz2:
222echo "==> Bzipping $(PACKAGE)-$(VER).tar.bz2"
223-rm -f $(PACKAGE)-$(VER).tar.bz2
224$(BZIPPROG) -v -9 $(PACKAGE)-$(VER).tar
225
226.PHONY: do-md5sum
227do-md5sum:
228echo "==> Adding md5 checksum to top-level directory"
Andrew Cagney05582642004-02-28 21:52:04229cd proto-toplev && find * -follow $(CVS_NAMES) -prune \
230-o -type f -print \
Nathanael Nerode748503c2002-10-01 22:34:16231| xargs $(MD5PROG) > ../md5.sum
232mv md5.sum proto-toplev
233
234.PHONY: do-djunpack
235do-djunpack:
236echo "==> Adding updated djunpack.bat to top-level directory"
Andrew Cagney710068b2003-09-14 18:12:21237echo - 's /gdb-[0-9\.]*/$(PACKAGE)-'"$(VER)"'/'
Nathanael Nerode748503c2002-10-01 22:34:16238sed < djunpack.bat > djunpack.new \
Andrew Cagney710068b2003-09-14 18:12:21239-e 's/gdb-[0-9][0-9\.]*/$(PACKAGE)-'"$(VER)"'/'
Nathanael Nerode748503c2002-10-01 22:34:16240mv djunpack.new djunpack.bat
241-rm -f proto-toplev/djunpack.bat
242ln -s ../djunpack.bat proto-toplev/djunpack.bat
243
244TEXINFO_SUPPORT= texinfo/texinfo.tex
245DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
246
247.PHONY: gas.tar.bz2
248GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms mkdep
249gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
250$(MAKE) -f $(SELF) taz TOOL=gas \
251MD5PROG="$(MD5PROG)" \
252SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
253
254# The FSF "binutils" release includes gprof and ld.
255.PHONY: binutils.tar.bz2
Nathanael Nerode7aa673e2002-10-01 22:58:14256BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms mkdep cpu
Nathanael Nerode748503c2002-10-01 22:34:16257binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
258$(MAKE) -f $(SELF) taz TOOL=binutils \
259MD5PROG="$(MD5PROG)" \
260SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)"
261
262.PHONY: gas+binutils.tar.bz2
263GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
264gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
265$(MAKE) -f $(SELF) taz TOOL=gas \
266MD5PROG="$(MD5PROG)" \
267SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
268
269GNATS_SUPPORT_DIRS=include libiberty send-pr
270gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
271$(MAKE) -f $(SELF) taz TOOL=gnats \
272MD5PROG="$(MD5PROG)" \
273SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
274
275.PHONY: gdb.tar.bz2
Nathanael Nerodead681c82004-08-12 22:43:07276GDB_SUPPORT_DIRS= bfd include libiberty opcodes readline sim utils intl
Nathanael Nerode748503c2002-10-01 22:34:16277gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
278$(MAKE) -f $(SELF) gdb-taz TOOL=gdb \
279MD5PROG="$(MD5PROG)" \
280SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
281.PHONY: gdb.tar
282gdb.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
283$(MAKE) -f $(SELF) gdb-tar TOOL=gdb \
284MD5PROG="$(MD5PROG)" \
285SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
286
287DEJAGNU_SUPPORT_DIRS= tcl expect libiberty
288.PHONY: dejagnu.tar.bz2
289dejagnu.tar.bz2: $(DIST_SUPPORT) $(DEJAGNU_SUPPORT_DIRS) dejagnu
Andrew Cagney710068b2003-09-14 18:12:21290$(MAKE) -f $(SELF) gdb-taz TOOL=dejagnu \
291MD5PROG="$(MD5PROG)" \
292SUPPORT_FILES="$(DEJAGNU_SUPPORT_DIRS)"
293.PHONY: dejagnu.tar
294dejagnu.tar: $(DIST_SUPPORT) $(DEJAGNU_SUPPORT_DIRS) dejagnu
295$(MAKE) -f $(SELF) gdb-tar TOOL=dejagnu \
Nathanael Nerode748503c2002-10-01 22:34:16296MD5PROG="$(MD5PROG)" \
297SUPPORT_FILES="$(DEJAGNU_SUPPORT_DIRS)"
298
299.PHONY: gdb+dejagnu.tar.bz2
300GDBD_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl expect dejagnu
301gdb+dejagnu.tar.bz2: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb
302$(MAKE) -f $(SELF) gdb-taz TOOL=gdb PACKAGE=gdb+dejagnu \
303MD5PROG="$(MD5PROG)" \
304SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)"
305.PHONY: gdb+dejagnu.tar
306gdb+dejagnu.tar: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb
307$(MAKE) -f $(SELF) gdb-tar TOOL=gdb PACKAGE=gdb+dejagnu \
308MD5PROG="$(MD5PROG)" \
309SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)"
310
311.PHONY: insight.tar.bz2
Nathanael Nerode675c6962004-08-12 22:59:53312INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl libgui
Nathanael Nerode748503c2002-10-01 22:34:16313insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
314$(MAKE) -f $(SELF) gdb-taz TOOL=gdb PACKAGE=insight \
315MD5PROG="$(MD5PROG)" \
316SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
317.PHONY: insight.tar
318insight.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
319$(MAKE) -f $(SELF) gdb-tar TOOL=gdb PACKAGE=insight \
320MD5PROG="$(MD5PROG)" \
321SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
322
323.PHONY: insight+dejagnu.tar.bz2
324INSIGHTD_SUPPORT_DIRS= $(INSIGHT_SUPPORT_DIRS) expect dejagnu
325insight+dejagnu.tar.bz2: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb
326$(MAKE) -f $(SELF) gdb-taz TOOL=gdb PACKAGE="insight+dejagnu" \
327MD5PROG="$(MD5PROG)" \
328SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)"
329.PHONY: insight+dejagnu.tar
330insight+dejagnu.tar: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb
331$(MAKE) -f $(SELF) gdb-tar TOOL=gdb PACKAGE="insight+dejagnu" \
332MD5PROG="$(MD5PROG)" \
333SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)"
334
Nathanael Nerode748503c2002-10-01 22:34:16335.NOEXPORT:
336MAKEOVERRIDES=