]>
Commit | Line | Data |
---|---|---|
748503c8 | 1 | # Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, |
72bbedde | 2 | # 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation |
748503c8 NN |
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 | |
6e4d0bcb | 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
748503c8 NN |
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. | |
27 | SELF = src-release | |
28 | ||
29 | SHELL = /bin/sh | |
30 | ||
31 | BZIPPROG = bzip2 | |
32 | MD5PROG = 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. | |
38 | PWD = $${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). | |
46 | DEVO_SUPPORT= README Makefile.in configure configure.in \ | |
73fb7068 | 47 | config.guess config.sub config move-if-change \ |
748503c8 NN |
48 | COPYING COPYING.LIB install-sh config-ml.in symlink-tree \ |
49 | mkinstalldirs ltconfig ltmain.sh missing ylwrap \ | |
a26d7085 DJ |
50 | libtool.m4 gettext.m4 ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh \ |
51 | Makefile.def Makefile.tpl src-release | |
748503c8 NN |
52 | |
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). | |
56 | ETC_SUPPORT= Makefile.in configure configure.in standards.texi \ | |
57 | make-stds.texi standards.info* configure.texi configure.info* \ | |
53dd8dab | 58 | configbuild.* configdev.* fdl.texi texi2pod.pl |
748503c8 NN |
59 | |
60 | ||
61 | # When you use `make setup-dirs' or `make taz' you should always redefine | |
62 | # this macro. | |
63 | SUPPORT_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)" | |
67 | VER = ` 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'; \ | |
69 | elif grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \ | |
70 | sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \ | |
71 | elif test -f $(TOOL)/version.in; then \ | |
72 | head -1 $(TOOL)/version.in; \ | |
73 | elif grep VERSION $(TOOL)/Makefile.in > /dev/null 2>&1; then \ | |
74 | sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \ | |
75 | else \ | |
76 | echo VERSION; \ | |
77 | fi` | |
78 | PACKAGE = $(TOOL) | |
79 | ||
80 | .PHONY: taz | |
81 | taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex | |
82 | $(MAKE) -f $(SELF) do-proto-toplev \ | |
83 | TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ | |
84 | MD5PROG="$(MD5PROG)" \ | |
85 | SUPPORT_FILES="$(SUPPORT_FILES)" | |
86 | $(MAKE) -f $(SELF) do-md5sum \ | |
87 | TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ | |
88 | MD5PROG="$(MD5PROG)" \ | |
89 | SUPPORT_FILES="$(SUPPORT_FILES)" | |
90 | $(MAKE) -f $(SELF) do-tar \ | |
91 | TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ | |
92 | MD5PROG="$(MD5PROG)" \ | |
93 | SUPPORT_FILES="$(SUPPORT_FILES)" | |
94 | $(MAKE) -f $(SELF) do-bz2 \ | |
95 | TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ | |
96 | MD5PROG="$(MD5PROG)" \ | |
97 | SUPPORT_FILES="$(SUPPORT_FILES)" | |
98 | ||
99 | .PHONY: gdb-tar | |
100 | gdb-tar: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex | |
101 | $(MAKE) -f $(SELF) do-proto-toplev \ | |
102 | TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ | |
103 | MD5PROG="$(MD5PROG)" \ | |
104 | SUPPORT_FILES="$(SUPPORT_FILES)" | |
105 | $(MAKE) -f $(SELF) do-md5sum \ | |
106 | TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ | |
107 | MD5PROG="$(MD5PROG)" \ | |
108 | SUPPORT_FILES="$(SUPPORT_FILES)" | |
109 | $(MAKE) -f $(SELF) do-djunpack \ | |
110 | TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ | |
111 | MD5PROG="$(MD5PROG)" \ | |
112 | SUPPORT_FILES="$(SUPPORT_FILES)" | |
113 | $(MAKE) -f $(SELF) do-tar \ | |
114 | TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ | |
115 | MD5PROG="$(MD5PROG)" \ | |
116 | SUPPORT_FILES="$(SUPPORT_FILES)" | |
117 | ||
118 | .PHONY: gdb-taz | |
119 | gdb-taz: gdb-tar $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex | |
120 | $(MAKE) -f $(SELF) gdb-tar \ | |
121 | TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ | |
122 | MD5PROG="$(MD5PROG)" \ | |
123 | SUPPORT_FILES="$(SUPPORT_FILES)" | |
124 | $(MAKE) -f $(SELF) do-bz2 \ | |
125 | TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ | |
126 | MD5PROG="$(MD5PROG)" \ | |
127 | SUPPORT_FILES="$(SUPPORT_FILES)" | |
128 | ||
129 | .PHONY: do-proto-toplev | |
130 | do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex | |
131 | echo "==> Making $(PACKAGE)-$(VER)/" | |
132 | # Take out texinfo from a few places. | |
133 | sed -e '/^all\.normal: /s/\all-texinfo //' \ | |
134 | -e '/^ install-texinfo /d' \ | |
135 | <Makefile.in >tmp | |
136 | mv -f tmp Makefile.in | |
137 | # | |
72bbedde | 138 | ./configure i686-pc-linux-gnu |
b4fa093e | 139 | $(MAKE) configure-host configure-target \ |
748503c8 NN |
140 | 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. | |
143 | rm -rf proto-toplev ; mkdir proto-toplev | |
144 | set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \ | |
145 | for 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 ; \ | |
159 | done | |
160 | cd etc && $(MAKE) info | |
161 | $(MAKE) distclean | |
d9a35680 MC |
162 | # Kludge for pr gdb/857. intl/Makefile.in lacks a couple |
163 | # of files in the distclean rule. Zack W is planning to make | |
164 | # the gcc version of intl/ the master version and then push | |
165 | # that version to src soon. See: | |
166 | # http://sources.redhat.com/ml/binutils/2003-07/msg00032.html | |
167 | # After the src version of intl/ is upgraded, we can look at | |
168 | # moving this logic into intl/Makefile.in distclean rule | |
169 | # if it is still needed. -- chastain 2003-09-12 | |
170 | rm -f intl/config.cache | |
171 | rm -f intl/config.status | |
172 | rm -f intl/config.h | |
173 | rm -f intl/stamp-h | |
748503c8 NN |
174 | # |
175 | mkdir proto-toplev/etc | |
176 | (cd proto-toplev/etc; \ | |
177 | for i in $(ETC_SUPPORT); do \ | |
178 | ln -s ../../etc/$$i . ; \ | |
179 | done) | |
180 | # | |
181 | # Take out texinfo from configurable dirs | |
182 | rm proto-toplev/configure.in | |
183 | sed -e '/^host_tools=/s/texinfo //' \ | |
184 | <configure.in >proto-toplev/configure.in | |
185 | # | |
186 | mkdir proto-toplev/texinfo | |
187 | ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/ | |
188 | if test -r texinfo/util/tex3patch ; then \ | |
189 | mkdir proto-toplev/texinfo/util && \ | |
190 | ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \ | |
191 | else true; fi | |
192 | chmod -R og=u . || chmod og=u `find . -print` | |
193 | # | |
194 | # Create .gmo files from .po files. | |
195 | for f in `find . -name '*.po' -type f -print`; do \ | |
196 | msgfmt -o `echo $$f | sed -e 's/\.po$$/.gmo/'` $$f ; \ | |
197 | done | |
198 | # | |
199 | -rm -f $(PACKAGE)-$(VER) | |
200 | ln -s proto-toplev $(PACKAGE)-$(VER) | |
201 | ||
0558264b AC |
202 | CVS_NAMES= \( -name CVS -o -name '.cvsignore' \) |
203 | ||
748503c8 NN |
204 | .PHONY: do-tar |
205 | do-tar: | |
206 | echo "==> Making $(PACKAGE)-$(VER).tar" | |
207 | -rm -f $(PACKAGE)-$(VER).tar | |
0558264b AC |
208 | find $(PACKAGE)-$(VER) -follow $(CVS_NAMES) -prune \ |
209 | -o -type f -print \ | |
748503c8 NN |
210 | | tar cTfh - $(PACKAGE)-$(VER).tar |
211 | ||
212 | .PHONY: do-bz2 | |
213 | do-bz2: | |
214 | echo "==> Bzipping $(PACKAGE)-$(VER).tar.bz2" | |
215 | -rm -f $(PACKAGE)-$(VER).tar.bz2 | |
216 | $(BZIPPROG) -v -9 $(PACKAGE)-$(VER).tar | |
217 | ||
218 | .PHONY: do-md5sum | |
219 | do-md5sum: | |
220 | echo "==> Adding md5 checksum to top-level directory" | |
0558264b AC |
221 | cd proto-toplev && find * -follow $(CVS_NAMES) -prune \ |
222 | -o -type f -print \ | |
1c0f67c1 AC |
223 | | xargs $(MD5PROG) > ../md5.new |
224 | -rm -f proto-toplev/md5.sum | |
225 | mv md5.new proto-toplev/md5.sum | |
748503c8 NN |
226 | |
227 | .PHONY: do-djunpack | |
228 | do-djunpack: | |
229 | echo "==> Adding updated djunpack.bat to top-level directory" | |
710068b9 | 230 | echo - 's /gdb-[0-9\.]*/$(PACKAGE)-'"$(VER)"'/' |
748503c8 | 231 | sed < djunpack.bat > djunpack.new \ |
710068b9 | 232 | -e 's/gdb-[0-9][0-9\.]*/$(PACKAGE)-'"$(VER)"'/' |
748503c8 | 233 | -rm -f proto-toplev/djunpack.bat |
1c0f67c1 | 234 | mv djunpack.new proto-toplev/djunpack.bat |
748503c8 NN |
235 | |
236 | TEXINFO_SUPPORT= texinfo/texinfo.tex | |
237 | DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT) | |
238 | ||
239 | .PHONY: gas.tar.bz2 | |
240 | GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms mkdep | |
241 | gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas | |
242 | $(MAKE) -f $(SELF) taz TOOL=gas \ | |
243 | MD5PROG="$(MD5PROG)" \ | |
244 | SUPPORT_FILES="$(GAS_SUPPORT_DIRS)" | |
245 | ||
246 | # The FSF "binutils" release includes gprof and ld. | |
247 | .PHONY: binutils.tar.bz2 | |
7aa673ed | 248 | BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms mkdep cpu |
748503c8 NN |
249 | binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils |
250 | $(MAKE) -f $(SELF) taz TOOL=binutils \ | |
251 | MD5PROG="$(MD5PROG)" \ | |
252 | SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)" | |
253 | ||
254 | .PHONY: gas+binutils.tar.bz2 | |
255 | GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof | |
256 | gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas | |
257 | $(MAKE) -f $(SELF) taz TOOL=gas \ | |
258 | MD5PROG="$(MD5PROG)" \ | |
259 | SUPPORT_FILES="$(GASB_SUPPORT_DIRS)" | |
260 | ||
261 | GNATS_SUPPORT_DIRS=include libiberty send-pr | |
262 | gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats | |
263 | $(MAKE) -f $(SELF) taz TOOL=gnats \ | |
264 | MD5PROG="$(MD5PROG)" \ | |
265 | SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)" | |
266 | ||
267 | .PHONY: gdb.tar.bz2 | |
a9cfce9c | 268 | GDB_SUPPORT_DIRS= bfd include libiberty opcodes readline sim |
748503c8 NN |
269 | gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb |
270 | $(MAKE) -f $(SELF) gdb-taz TOOL=gdb \ | |
271 | MD5PROG="$(MD5PROG)" \ | |
272 | SUPPORT_FILES="$(GDB_SUPPORT_DIRS)" | |
273 | .PHONY: gdb.tar | |
274 | gdb.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb | |
275 | $(MAKE) -f $(SELF) gdb-tar TOOL=gdb \ | |
276 | MD5PROG="$(MD5PROG)" \ | |
277 | SUPPORT_FILES="$(GDB_SUPPORT_DIRS)" | |
278 | ||
748503c8 | 279 | .PHONY: insight.tar.bz2 |
675c6968 | 280 | INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl libgui |
748503c8 NN |
281 | insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb |
282 | $(MAKE) -f $(SELF) gdb-taz TOOL=gdb PACKAGE=insight \ | |
283 | MD5PROG="$(MD5PROG)" \ | |
284 | SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)" | |
285 | .PHONY: insight.tar | |
286 | insight.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb | |
287 | $(MAKE) -f $(SELF) gdb-tar TOOL=gdb PACKAGE=insight \ | |
288 | MD5PROG="$(MD5PROG)" \ | |
289 | SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)" | |
290 | ||
748503c8 NN |
291 | .NOEXPORT: |
292 | MAKEOVERRIDES= |