blob: 8b3144284afc7288a6cdec0eda2dc3b6de8d3176 [file] [log] [blame]
Egor Pasko67b59fb2010-05-18 12:26:511# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
2# 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation
3#
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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# (Default to avoid splitting info files by setting the threshold high.)
35MAKEINFOFLAGS = --split-size=5000000
36
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.
41PWD = $${PWDCMD-pwd}
42
43#
44# Support for building net releases
45
46# Files in devo used in any net release.
47# ChangeLog omitted because it may refer to files which are not in this
48# distribution (perhaps it would be better to include it anyway).
49DEVO_SUPPORT= README Makefile.in configure configure.ac \
50config.guess config.sub config move-if-change \
51COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
52mkinstalldirs ltmain.sh missing ylwrap \
53libtool.m4 ltsugar.m4 ltversion.m4 ltoptions.m4 \
54Makefile.def Makefile.tpl src-release config.rpath \
55COPYING3 COPYING3.LIB
56
57# Files in devo/etc used in any net release.
58# ChangeLog omitted because it may refer to files which are not in this
59# distribution (perhaps it would be better to include it anyway).
60ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
61make-stds.texi standards.info* configure.texi configure.info* \
62configbuild.* configdev.* fdl.texi texi2pod.pl
63
64
65# When you use `make setup-dirs' or `make taz' you should always redefine
66# this macro.
67SUPPORT_FILES = list-of-support-files-for-tool-in-question
68
69# NOTE: No double quotes in the below. It is used within shell script
70# as VER="$(VER)"
71VER = ` if grep 'AM_INIT_AUTOMAKE.*BFD_VERSION' $(TOOL)/configure.in >/dev/null 2>&1; then \
72 sed < bfd/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
73elif grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
74 sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
75elif test -f $(TOOL)/version.in; then \
76 head -1 $(TOOL)/version.in; \
77elif grep VERSION $(TOOL)/Makefile.in > /dev/null 2>&1; then \
78 sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \
79else \
80 echo VERSION; \
81fi`
82PACKAGE = $(TOOL)
83
84.PHONY: taz
85taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
86$(MAKE) -f $(SELF) do-proto-toplev \
87TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
88MD5PROG="$(MD5PROG)" \
89SUPPORT_FILES="$(SUPPORT_FILES)"
90$(MAKE) -f $(SELF) do-md5sum \
91TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
92MD5PROG="$(MD5PROG)" \
93SUPPORT_FILES="$(SUPPORT_FILES)"
94$(MAKE) -f $(SELF) do-tar \
95TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
96MD5PROG="$(MD5PROG)" \
97SUPPORT_FILES="$(SUPPORT_FILES)"
98$(MAKE) -f $(SELF) do-bz2 \
99TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
100MD5PROG="$(MD5PROG)" \
101SUPPORT_FILES="$(SUPPORT_FILES)"
102
103.PHONY: gdb-tar
104gdb-tar: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
105$(MAKE) -f $(SELF) do-proto-toplev \
106TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
107MD5PROG="$(MD5PROG)" \
108SUPPORT_FILES="$(SUPPORT_FILES)"
109$(MAKE) -f $(SELF) do-md5sum \
110TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
111MD5PROG="$(MD5PROG)" \
112SUPPORT_FILES="$(SUPPORT_FILES)"
113$(MAKE) -f $(SELF) do-djunpack \
114TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
115MD5PROG="$(MD5PROG)" \
116SUPPORT_FILES="$(SUPPORT_FILES)"
117$(MAKE) -f $(SELF) do-tar \
118TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
119MD5PROG="$(MD5PROG)" \
120SUPPORT_FILES="$(SUPPORT_FILES)"
121
122.PHONY: gdb-taz
123gdb-taz: gdb-tar $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
124$(MAKE) -f $(SELF) gdb-tar \
125TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
126MD5PROG="$(MD5PROG)" \
127SUPPORT_FILES="$(SUPPORT_FILES)"
128$(MAKE) -f $(SELF) do-bz2 \
129TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
130MD5PROG="$(MD5PROG)" \
131SUPPORT_FILES="$(SUPPORT_FILES)"
132
133.PHONY: do-proto-toplev
134do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
135echo "==> Making $(PACKAGE)-$(VER)/"
136# Take out texinfo from a few places.
137sed -e '/^all\.normal: /s/\all-texinfo //' \
138 -e '/^ install-texinfo /d' \
139<Makefile.in >tmp
140mv -f tmp Makefile.in
141#
142./configure i686-pc-linux-gnu
143$(MAKE) configure-host configure-target \
144 ALL_GCC="" ALL_GCC_C="" ALL_GCC_CXX="" \
145 CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
146# Make links, and run "make diststuff" or "make info" when needed.
147rm -rf proto-toplev ; mkdir proto-toplev
148set -e ; dirs="$(DEVO_SUPPORT) $(SUPPORT_FILES) $(TOOL)" ; \
149for d in $$dirs ; do \
150 if [ -d $$d ]; then \
151 if [ ! -f $$d/Makefile ] ; then true ; \
152 elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \
153(cd $$d ; $(MAKE) MAKEINFOFLAGS="$(MAKEINFOFLAGS)" \
154 diststuff ) || exit 1 ; \
155 elif grep '^info:' $$d/Makefile >/dev/null ; then \
156(cd $$d ; $(MAKE) MAKEINFOFLAGS="$(MAKEINFOFLAGS)" \
157 info ) || exit 1 ; \
158 fi ; \
159 if [ -d $$d/proto-$$d.dir ]; then \
160 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
161 else \
162 ln -s ../$$d proto-toplev/$$d ; \
163 fi ; \
164 else ln -s ../$$d proto-toplev/$$d ; fi ; \
165done
166cd etc && $(MAKE) MAKEINFOFLAGS="$(MAKEINFOFLAGS)" info
167$(MAKE) distclean
168# Kludge for pr gdb/857. intl/Makefile.in lacks a couple
169# of files in the distclean rule. Zack W is planning to make
170# the gcc version of intl/ the master version and then push
171# that version to src soon. See:
172# http://sources.redhat.com/ml/binutils/2003-07/msg00032.html
173# After the src version of intl/ is upgraded, we can look at
174# moving this logic into intl/Makefile.in distclean rule
175# if it is still needed. -- chastain 2003-09-12
176rm -f intl/config.cache
177rm -f intl/config.status
178rm -f intl/config.h
179rm -f intl/stamp-h
180#
181mkdir proto-toplev/etc
182(cd proto-toplev/etc; \
183 for i in $(ETC_SUPPORT); do \
184ln -s ../../etc/$$i . ; \
185 done)
186#
187# Take out texinfo from configurable dirs
188rm proto-toplev/configure.ac
189sed -e '/^host_tools=/s/texinfo //' \
190 <configure.ac >proto-toplev/configure.ac
191#
192mkdir proto-toplev/texinfo
193ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
194if test -r texinfo/util/tex3patch ; then \
195 mkdir proto-toplev/texinfo/util && \
196 ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
197else true; fi
198chmod -R og=u . || chmod og=u `find . -print`
199#
200# Create .gmo files from .po files.
201for f in `find . -name '*.po' -type f -print`; do \
202 msgfmt -o `echo $$f | sed -e 's/\.po$$/.gmo/'` $$f ; \
203done
204#
205-rm -f $(PACKAGE)-$(VER)
206ln -s proto-toplev $(PACKAGE)-$(VER)
207
208CVS_NAMES= \( -name CVS -o -name '.cvsignore' \)
209
210.PHONY: do-tar
211do-tar:
212echo "==> Making $(PACKAGE)-$(VER).tar"
213-rm -f $(PACKAGE)-$(VER).tar
214find $(PACKAGE)-$(VER) -follow $(CVS_NAMES) -prune \
215-o -type f -print \
216| tar cTfh - $(PACKAGE)-$(VER).tar
217
218.PHONY: do-bz2
219do-bz2:
220echo "==> Bzipping $(PACKAGE)-$(VER).tar.bz2"
221-rm -f $(PACKAGE)-$(VER).tar.bz2
222$(BZIPPROG) -v -9 $(PACKAGE)-$(VER).tar
223
224.PHONY: do-md5sum
225do-md5sum:
226echo "==> Adding md5 checksum to top-level directory"
227cd proto-toplev && find * -follow $(CVS_NAMES) -prune \
228-o -type f -print \
229| xargs $(MD5PROG) > ../md5.new
230-rm -f proto-toplev/md5.sum
231mv md5.new proto-toplev/md5.sum
232
233.PHONY: do-djunpack
234do-djunpack:
235echo "==> Adding updated djunpack.bat to top-level directory"
236echo - 's /gdb-[0-9\.]*/$(PACKAGE)-'"$(VER)"'/'
237sed < djunpack.bat > djunpack.new \
238-e 's/gdb-[0-9][0-9\.]*/$(PACKAGE)-'"$(VER)"'/'
239-rm -f proto-toplev/djunpack.bat
240mv djunpack.new proto-toplev/djunpack.bat
241
242TEXINFO_SUPPORT= texinfo/texinfo.tex
243DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
244
245.PHONY: gas.tar.bz2
246GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms mkdep
247gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
248$(MAKE) -f $(SELF) taz TOOL=gas \
249MD5PROG="$(MD5PROG)" \
250SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
251
252# The FSF "binutils" release includes gprof and ld.
253.PHONY: binutils.tar.bz2
254BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms mkdep cpu
255binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
256$(MAKE) -f $(SELF) taz TOOL=binutils \
257MD5PROG="$(MD5PROG)" \
258SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)"
259
260.PHONY: gas+binutils.tar.bz2
261GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
262gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
263$(MAKE) -f $(SELF) taz TOOL=gas \
264MD5PROG="$(MD5PROG)" \
265SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
266
267GNATS_SUPPORT_DIRS=include libiberty send-pr
268gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
269$(MAKE) -f $(SELF) taz TOOL=gnats \
270MD5PROG="$(MD5PROG)" \
271SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
272
273.PHONY: gdb.tar.bz2
274GDB_SUPPORT_DIRS= bfd include libiberty opcodes readline sim intl libdecnumber
275gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
276$(MAKE) -f $(SELF) gdb-taz TOOL=gdb \
277MD5PROG="$(MD5PROG)" \
278SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
279.PHONY: gdb.tar
280gdb.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
281$(MAKE) -f $(SELF) gdb-tar TOOL=gdb \
282MD5PROG="$(MD5PROG)" \
283SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
284
285.PHONY: insight.tar.bz2
286INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl libgui
287insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
288$(MAKE) -f $(SELF) gdb-taz TOOL=gdb PACKAGE=insight \
289MD5PROG="$(MD5PROG)" \
290SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
291.PHONY: insight.tar
292insight.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
293$(MAKE) -f $(SELF) gdb-tar TOOL=gdb PACKAGE=insight \
294MD5PROG="$(MD5PROG)" \
295SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
296
297.NOEXPORT:
298MAKEOVERRIDES=