| 1 | # 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. |
| 27 | SELF = src-release |
| 28 | |
| 29 | SHELL = /bin/sh |
| 30 | |
| 31 | BZIPPROG = bzip2 |
| 32 | MD5PROG = md5sum |
| 33 | |
| 34 | # (Default to avoid splitting info files by setting the threshold high.) |
| 35 | MAKEINFOFLAGS = --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. |
| 41 | PWD = $${PWDCMD-pwd} |
| 42 | |
| 43 | # |
| 44 | # Support for building net releases |
| 45 | |
| 46 | # Files in devo used in any net release. |
| 47 | DEVO_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. |
| 58 | ETC_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. |
| 65 | SUPPORT_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)" |
| 69 | VER = ` if grep 'AM_INIT_AUTOMAKE.*BFD_VERSION' $(TOOL)/configure.in >/dev/null 2>&1; then \ |
| 70 | bfd/configure --version | sed -n -e '1s,.* ,,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)/common/create-version.sh; then \ |
| 74 | $(TOOL)/common/create-version.sh $(TOOL) \ |
| 75 | 'dummy-host' 'dummy-target' \ |
| 76 | VER.tmp; \ |
| 77 | cat VER.tmp | grep 'version\[\]' | sed 's/.*"\([^"]*\)".*/\1/' | sed 's/-cvs$$//'; \ |
| 78 | rm -f VER.tmp; \ |
| 79 | elif test -f $(TOOL)/version.in; then \ |
| 80 | head -1 $(TOOL)/version.in; \ |
| 81 | elif grep VERSION $(TOOL)/Makefile.in > /dev/null 2>&1; then \ |
| 82 | sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \ |
| 83 | else \ |
| 84 | echo VERSION; \ |
| 85 | fi` |
| 86 | PACKAGE = $(TOOL) |
| 87 | |
| 88 | .PHONY: taz |
| 89 | taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex |
| 90 | $(MAKE) -f $(SELF) do-proto-toplev \ |
| 91 | TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ |
| 92 | MD5PROG="$(MD5PROG)" \ |
| 93 | SUPPORT_FILES="$(SUPPORT_FILES)" |
| 94 | $(MAKE) -f $(SELF) do-md5sum \ |
| 95 | TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ |
| 96 | MD5PROG="$(MD5PROG)" \ |
| 97 | SUPPORT_FILES="$(SUPPORT_FILES)" |
| 98 | $(MAKE) -f $(SELF) do-tar \ |
| 99 | TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ |
| 100 | MD5PROG="$(MD5PROG)" \ |
| 101 | SUPPORT_FILES="$(SUPPORT_FILES)" |
| 102 | $(MAKE) -f $(SELF) do-bz2 \ |
| 103 | TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ |
| 104 | MD5PROG="$(MD5PROG)" \ |
| 105 | SUPPORT_FILES="$(SUPPORT_FILES)" |
| 106 | |
| 107 | .PHONY: gdb-tar |
| 108 | gdb-tar: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex |
| 109 | $(MAKE) -f $(SELF) do-proto-toplev \ |
| 110 | TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ |
| 111 | MD5PROG="$(MD5PROG)" \ |
| 112 | SUPPORT_FILES="$(SUPPORT_FILES)" |
| 113 | $(MAKE) -f $(SELF) do-md5sum \ |
| 114 | TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ |
| 115 | MD5PROG="$(MD5PROG)" \ |
| 116 | SUPPORT_FILES="$(SUPPORT_FILES)" |
| 117 | $(MAKE) -f $(SELF) do-djunpack \ |
| 118 | TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ |
| 119 | MD5PROG="$(MD5PROG)" \ |
| 120 | SUPPORT_FILES="$(SUPPORT_FILES)" |
| 121 | $(MAKE) -f $(SELF) do-tar \ |
| 122 | TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ |
| 123 | MD5PROG="$(MD5PROG)" \ |
| 124 | SUPPORT_FILES="$(SUPPORT_FILES)" |
| 125 | |
| 126 | .PHONY: gdb-taz |
| 127 | gdb-taz: gdb-tar $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex |
| 128 | $(MAKE) -f $(SELF) gdb-tar \ |
| 129 | TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ |
| 130 | MD5PROG="$(MD5PROG)" \ |
| 131 | SUPPORT_FILES="$(SUPPORT_FILES)" |
| 132 | $(MAKE) -f $(SELF) do-bz2 \ |
| 133 | TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ |
| 134 | MD5PROG="$(MD5PROG)" \ |
| 135 | SUPPORT_FILES="$(SUPPORT_FILES)" |
| 136 | |
| 137 | .PHONY: do-proto-toplev |
| 138 | do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex |
| 139 | echo "==> Making $(PACKAGE)-$(VER)/" |
| 140 | # Take out texinfo from a few places. |
| 141 | sed -e '/^all\.normal: /s/\all-texinfo //' \ |
| 142 | -e '/^ install-texinfo /d' \ |
| 143 | <Makefile.in >tmp |
| 144 | mv -f tmp Makefile.in |
| 145 | # |
| 146 | ./configure i686-pc-linux-gnu |
| 147 | $(MAKE) configure-host configure-target \ |
| 148 | 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. |
| 151 | rm -rf proto-toplev ; mkdir proto-toplev |
| 152 | set -e ; dirs="$(DEVO_SUPPORT) $(SUPPORT_FILES) $(TOOL)" ; \ |
| 153 | for 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 \ |
| 157 | (cd $$d ; $(MAKE) MAKEINFOFLAGS="$(MAKEINFOFLAGS)" \ |
| 158 | diststuff ) || exit 1 ; \ |
| 159 | elif grep '^info:' $$d/Makefile >/dev/null ; then \ |
| 160 | (cd $$d ; $(MAKE) MAKEINFOFLAGS="$(MAKEINFOFLAGS)" \ |
| 161 | info ) || exit 1 ; \ |
| 162 | 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 \ |
| 169 | if (echo x$$d | grep / >/dev/null); then \ |
| 170 | mkdir -p proto-toplev/`dirname $$d` ; \ |
| 171 | x=`dirname $$d` ; \ |
| 172 | ln -s ../`echo $$x/ | sed -e 's,[^/]*/,../,g'`$$d proto-toplev/$$d ; \ |
| 173 | else \ |
| 174 | ln -s ../$$d proto-toplev/$$d ; \ |
| 175 | fi ; \ |
| 176 | fi ; \ |
| 177 | done |
| 178 | cd etc && $(MAKE) MAKEINFOFLAGS="$(MAKEINFOFLAGS)" info |
| 179 | $(MAKE) distclean |
| 180 | # Kludge for pr gdb/857. intl/Makefile.in lacks a couple |
| 181 | # of files in the distclean rule. Zack W is planning to make |
| 182 | # the gcc version of intl/ the master version and then push |
| 183 | # that version to src soon. See: |
| 184 | # http://sources.redhat.com/ml/binutils/2003-07/msg00032.html |
| 185 | # After the src version of intl/ is upgraded, we can look at |
| 186 | # moving this logic into intl/Makefile.in distclean rule |
| 187 | # if it is still needed. -- chastain 2003-09-12 |
| 188 | rm -f intl/config.cache |
| 189 | rm -f intl/config.status |
| 190 | rm -f intl/config.h |
| 191 | rm -f intl/stamp-h |
| 192 | # |
| 193 | mkdir proto-toplev/etc |
| 194 | (cd proto-toplev/etc; \ |
| 195 | for i in $(ETC_SUPPORT); do \ |
| 196 | ln -s ../../etc/$$i . ; \ |
| 197 | done) |
| 198 | # |
| 199 | # Take out texinfo from configurable dirs |
| 200 | rm proto-toplev/configure.ac |
| 201 | sed -e '/^host_tools=/s/texinfo //' \ |
| 202 | <configure.ac >proto-toplev/configure.ac |
| 203 | # |
| 204 | mkdir proto-toplev/texinfo |
| 205 | ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/ |
| 206 | if test -r texinfo/util/tex3patch ; then \ |
| 207 | mkdir proto-toplev/texinfo/util && \ |
| 208 | ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \ |
| 209 | else true; fi |
| 210 | chmod -R og=u . || chmod og=u `find . -print` |
| 211 | # |
| 212 | # Create .gmo files from .po files. |
| 213 | for f in `find . -name '*.po' -type f -print`; do \ |
| 214 | msgfmt -o `echo $$f | sed -e 's/\.po$$/.gmo/'` $$f ; \ |
| 215 | done |
| 216 | # |
| 217 | -rm -f $(PACKAGE)-$(VER) |
| 218 | ln -s proto-toplev $(PACKAGE)-$(VER) |
| 219 | |
| 220 | CVS_NAMES= \( -name CVS -o -name '.cvsignore' \) |
| 221 | |
| 222 | .PHONY: do-tar |
| 223 | do-tar: |
| 224 | echo "==> Making $(PACKAGE)-$(VER).tar" |
| 225 | -rm -f $(PACKAGE)-$(VER).tar |
| 226 | find $(PACKAGE)-$(VER) -follow $(CVS_NAMES) -prune \ |
| 227 | -o -type f -print \ |
| 228 | | tar cTfh - $(PACKAGE)-$(VER).tar |
| 229 | |
| 230 | .PHONY: do-bz2 |
| 231 | do-bz2: |
| 232 | echo "==> Bzipping $(PACKAGE)-$(VER).tar.bz2" |
| 233 | -rm -f $(PACKAGE)-$(VER).tar.bz2 |
| 234 | $(BZIPPROG) -v -9 $(PACKAGE)-$(VER).tar |
| 235 | |
| 236 | .PHONY: do-md5sum |
| 237 | do-md5sum: |
| 238 | echo "==> Adding md5 checksum to top-level directory" |
| 239 | cd proto-toplev && find * -follow $(CVS_NAMES) -prune \ |
| 240 | -o -type f -print \ |
| 241 | | xargs $(MD5PROG) > ../md5.new |
| 242 | -rm -f proto-toplev/md5.sum |
| 243 | mv md5.new proto-toplev/md5.sum |
| 244 | |
| 245 | .PHONY: do-djunpack |
| 246 | do-djunpack: |
| 247 | echo "==> Adding updated djunpack.bat to top-level directory" |
| 248 | echo - 's /gdb-[0-9\.]*/$(PACKAGE)-'"$(VER)"'/' |
| 249 | sed < djunpack.bat > djunpack.new \ |
| 250 | -e 's/gdb-[0-9][0-9\.]*/$(PACKAGE)-'"$(VER)"'/' |
| 251 | -rm -f proto-toplev/djunpack.bat |
| 252 | mv djunpack.new proto-toplev/djunpack.bat |
| 253 | |
| 254 | TEXINFO_SUPPORT= texinfo/texinfo.tex |
| 255 | DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT) |
| 256 | |
| 257 | .PHONY: gas.tar.bz2 |
| 258 | GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms mkdep |
| 259 | gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas |
| 260 | $(MAKE) -f $(SELF) taz TOOL=gas \ |
| 261 | MD5PROG="$(MD5PROG)" \ |
| 262 | SUPPORT_FILES="$(GAS_SUPPORT_DIRS)" |
| 263 | |
| 264 | # The FSF "binutils" release includes gprof and ld. |
| 265 | .PHONY: binutils.tar.bz2 |
| 266 | BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld elfcpp gold gprof intl setup.com makefile.vms cpu |
| 267 | binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils |
| 268 | $(MAKE) -f $(SELF) taz TOOL=binutils \ |
| 269 | MD5PROG="$(MD5PROG)" \ |
| 270 | SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)" |
| 271 | |
| 272 | .PHONY: gas+binutils.tar.bz2 |
| 273 | GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof |
| 274 | gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas |
| 275 | $(MAKE) -f $(SELF) taz TOOL=gas \ |
| 276 | MD5PROG="$(MD5PROG)" \ |
| 277 | SUPPORT_FILES="$(GASB_SUPPORT_DIRS)" |
| 278 | |
| 279 | GNATS_SUPPORT_DIRS=include libiberty send-pr |
| 280 | gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats |
| 281 | $(MAKE) -f $(SELF) taz TOOL=gnats \ |
| 282 | MD5PROG="$(MD5PROG)" \ |
| 283 | SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)" |
| 284 | |
| 285 | .PHONY: gdb.tar.bz2 |
| 286 | GDB_SUPPORT_DIRS= bfd include libiberty opcodes readline sim intl libdecnumber cpu |
| 287 | gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb |
| 288 | $(MAKE) -f $(SELF) gdb-taz TOOL=gdb \ |
| 289 | MD5PROG="$(MD5PROG)" \ |
| 290 | SUPPORT_FILES="$(GDB_SUPPORT_DIRS)" |
| 291 | .PHONY: gdb.tar |
| 292 | gdb.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb |
| 293 | $(MAKE) -f $(SELF) gdb-tar TOOL=gdb \ |
| 294 | MD5PROG="$(MD5PROG)" \ |
| 295 | SUPPORT_FILES="$(GDB_SUPPORT_DIRS)" |
| 296 | |
| 297 | # Corresponding to the CVS "sim" module. |
| 298 | .PHONY: sim.tar.bz2 |
| 299 | SIM_SUPPORT_DIRS= bfd opcodes libiberty include intl gdb/version.in makefile.vms |
| 300 | sim.tar.bz2: $(DIST_SUPPORT) $(SIM_SUPPORT_DIRS) sim |
| 301 | $(MAKE) -f $(SELF) taz TOOL=sim \ |
| 302 | MD5PROG="$(MD5PROG)" \ |
| 303 | SUPPORT_FILES="$(SIM_SUPPORT_DIRS)" |
| 304 | |
| 305 | .PHONY: insight.tar.bz2 |
| 306 | INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl libgui |
| 307 | insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb |
| 308 | $(MAKE) -f $(SELF) gdb-taz TOOL=gdb PACKAGE=insight \ |
| 309 | MD5PROG="$(MD5PROG)" \ |
| 310 | SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)" |
| 311 | .PHONY: insight.tar |
| 312 | insight.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb |
| 313 | $(MAKE) -f $(SELF) gdb-tar TOOL=gdb PACKAGE=insight \ |
| 314 | MD5PROG="$(MD5PROG)" \ |
| 315 | SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)" |
| 316 | |
| 317 | .NOEXPORT: |
| 318 | MAKEOVERRIDES= |