• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1HELLOopyright (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 th@@ 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.
47DEVO_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 \
55	COPYING3 COPYING3.LIB
56
57# Files in devo/etc used in any net release.
58ETC_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
61
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'; \
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)/version.in; then \
74	  head -1 $(TOOL)/version.in; \
75	elif grep VERSION $(TOOL)/Makefile.in > /dev/null 2>&1; then \
76	  sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \
77	else \
78	  echo VERSION; \
79	fi`
80PACKAGE = $(TOOL)
81
82.PHONY: taz
83taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
84	$(MAKE) -f $(SELF) do-proto-toplev \
85		TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
86		MD5PROG="$(MD5PROG)" \
87		SUPPORT_FILES="$(SUPPORT_FILES)"
88	$(MAKE) -f $(SELF) do-md5sum \
89		TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
90		MD5PROG="$(MD5PROG)" \
91		SUPPORT_FILES="$(SUPPORT_FILES)"
92	$(MAKE) -f $(SELF) do-tar \
93		TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
94		MD5PROG="$(MD5PROG)" \
95		SUPPORT_FILES="$(SUPPORT_FILES)"
96	$(MAKE) -f $(SELF) do-bz2 \
97		TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
98		MD5PROG="$(MD5PROG)" \
99		SUPPORT_FILES="$(SUPPORT_FILES)"
100
101.PHONY: gdb-tar
102gdb-tar: $(DEVO_SUPPORT)OH(SUPPORT_FILES) texinfo/texinfo.tex
103	$(MAKE) -f $(SELF) do-proto-toplev \
104		TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
105		MD5PROG="$(MD5PROG)" \
106		SUPPORT_FILES="$(SUPPORT_FILES)"
107	$(MAKE) -f $(SELF) do-md5sum \
108		TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
109		MD5PROG="$(MD5PROG)" \
110		SUPPORT_FILES="$(SUPPORT_FILES)"
111	$(MAKE) -f $(SELF) do-djunpack \
112		TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
113		MD5PROG="$(MD5PROG)" \
114		SUPPORT_FILES="$(SUPPORT_FILES)"
115	$(MAKE) -f $(SELF) do-tar \
116		TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
117		MD5PROG="$(MD5PROG)" \
118		SUPPORT_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 \
123		TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
124		MD5PROG="$(MD5PROG)" \
125		SUPPORT_FILES="$(SUPPORT_FILES)"
126	$(MAKE) -f $(SELF) do-bz2 \
127		TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
128		MD5PROG="$(MD5PROG)" \
129		SUPPORT_FILES="$(SUPPORT_FILES)"
130
131.PHONY: do-proto-toplev
132do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
133	echo "==> Making $(PACKAGE)-$(VER)/"
134	# Take out texinfo from a few places.
135	sed -e '/^all\.normal: /s/\all-texinfo //' \
136	    -e '/^	install-texinfo /d' \
137	<Makefile.in >tmp
138	mv -f tmp Makefile.in
139	#
140	./configure i686-pc-linux-gnu
141	$(MAKE) configure-host configure-target \
142	    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.
145	rm -rf proto-toplev ; mkdir proto-toplev
146	set -e ; dirs="$(DEVO_SUPPORT) $(SUPPORT_FILES) $(TOOL)" ; \
147	for 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 \
151		(cd $$d ; $(MAKE) MAKEINFOFLAGS="$(MAKEINFOFLAGS)" \
152			  diststuff ) || exit 1 ; \
153	    elif grep '^info:' $$d/Makefile >/dev/null ; then \
154		(cd $$d ; $(MAKE) MAKEINFOFLAGS="$(MAKEINFOFLAGS)" \
155			  info ) || exit 1 ; \
156	    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 ; \
163	done
164	cd etc && $(MAKE) MAKEINFOFLAGS="$(MAKEINFOFLAGS)" info
165	$(MAKE) distclean
166	# 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
174	rm -f intl/config.cache
175	rm -f intl/config.status
176	rm -f intl/config.h
177	rm -f intl/stamp-h
178	#
179	mkdir proto-toplev/etc
180	(cd proto-toplev/etc; \
181	 for i in $(ETC_SUPPORT); do \
182		ln -s ../../etc/$$i . ; \
183	 done)
184	#
185	# Take out texinfo from configurable dirs
186	rm proto-toplev/configure.ac
187	sed -e '/^host_tools=/s/texinfo //' \
188	    <configure.ac >proto-toplev/configure.ac
189	#
190	mkdir proto-toplev/texinfo
191	ln -s ../../texinfo/texinfo.tex		proto-toplev/texinfo/
192	if test -r texinfo/util/tex3patch ; then \
193	  mkdir proto-toplev/texinfo/util && \
194	  ln -s ../../../texinfo/util/tex3patch	proto-toplev/texinfo/util ; \
195	else true; fi
196	chmod -R og=u . || chmod og=u `find . -print`
197	#
198	# Create .gmo files from .po files.
199	for f in `find . -name '*.po' -type f -print`; do \
200	     msgfmt -o `echo $$f | sed -e 's/\.po$$/.gmo/'` $$f ; \
201	done
202	#
203	-rm -f $(PACKAGE)-$(VER)
204	ln -s proto-toplev $(PACKAGE)-$(VER)
205
206CVS_NAMES= \( -name CVS -o -name '.cvsignore' \)
207
208.PHONY: do-tar
209do-tar:
210	echo "==> Making $(PACKAGE)-$(VER).tar"
211	-rm -f $(PACKAGE)-$(VER).tar
212	find $(PACKAGE)-$(VER) -follow $(CVS_NAMES) -prune \
213			-o -type f -print \
214		| tar cTfh - $(PACKAGE)-$(VER).tar
215
216.PHONY: do-bz2
217do-bz2:
218	echo "==> 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:
224	echo "==> Adding md5 checksum to top-level directory"
225	cd proto-toplev && find * -follow $(CVS_NAMES) -prune \
226			-o -type f -print \
227		| xargs $(MD5PROG) > ../md5.new
228	-rm -f proto-toplev/md5.sum
229	mv md5.new proto-toplev/md5.sum
230
231.PHONY: do-djunpack
232do-djunpack:
233	echo "==> Adding updated djunpack.bat to top-level directory"
234	echo - 's /gdb-[0-9\.]*/$(PACKAGE)-'"$(VER)"'/'
235	sed < djunpack.bat > djunpack.new \
236		-e 's/gdb-[0-9][0-9\.]*/$(PACKAGE)-'"$(VER)"'/'
237	-rm -f proto-toplev/djunpack.bat
238	mv djunpack.new proto-toplev/djunpack.bat
239
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 \
247		MD5PROG="$(MD5PROG)" \
248		SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
249
250# The FSF "binutils" release includes gprof and ld.
251.PHONY: binutils.tar.bz2
252BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld elfcpp gold gprof intl setup.com makefile.vms cpu
253binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
254	$(MAKE) -f $(SELF) taz TOOL=binutils \
255		MD5PROG="$(MD5PROG)" \
256		SUPPORT_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 \
262		MD5PROG="$(MD5PROG)" \
263		SUPPORT_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 \
268		MD5PROG="$(MD5PROG)" \
269		SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
270
271.PHONY: gdb.tar.bz2
272GDB_SUPPORT_DIRS= bfd include libiberty opcodes readline sim intl libdecnumber
273gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
274	$(MAKE) -f $(SELF) gdb-taz TOOL=gdb \
275		MD5PROG="$(MD5PROG)" \
276		SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
277.PHONY: gdb.tar
278gdb.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
279	$(MAKE) -f $(SELF) gdb-tar TOOL=gdb \
280		MD5PROG="$(MD5PROG)" \
281		SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
282
283.PHONY: insight.tar.bz2
284INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl libgui
285insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
286	$(MAKE) -f $(SELF) gdb-taz TOOL=gdb PACKAGE=insight \
287		MD5PROG="$(MD5PROG)" \
288		SUPPORT_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 \
292		MD5PROG="$(MD5PROG)" \
293		SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
294
295.NOEXPORT:
296MAKEOVERRIDES=
297