]>
Commit | Line | Data |
---|---|---|
d8474a9b | 1 | # Makefile for GNU binary-file utilities |
37853673 | 2 | # Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. |
d8474a9b PB |
3 | |
4 | # This file is part of GNU binutils. | |
5 | ||
6 | # This program is free software; you can redistribute it and/or modify | |
7 | # it under the terms of the GNU General Public License as published by | |
8 | # the Free Software Foundation; either version 2 of the License, or | |
9 | # (at your option) any later version. | |
10 | # | |
11 | # This program is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | # GNU General Public License for more details. | |
15 | # | |
16 | # You should have received a copy of the GNU General Public License | |
17 | # along with this program; if not, write to the Free Software | |
18 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
99a42820 | 19 | |
a10d26a1 | 20 | srcdir = . |
84396dcf | 21 | |
d8e89b6b RP |
22 | prefix = /usr/local |
23 | ||
3790af1d | 24 | program_transform_name = |
d8e89b6b RP |
25 | exec_prefix = $(prefix) |
26 | bindir = $(exec_prefix)/bin | |
27 | libdir = $(exec_prefix)/lib | |
f6dddd4e | 28 | tooldir = $(exec_prefix)/$(target_alias) |
d8e89b6b RP |
29 | |
30 | datadir = $(prefix)/lib | |
31 | mandir = $(prefix)/man | |
32 | man1dir = $(mandir)/man1 | |
33 | man2dir = $(mandir)/man2 | |
34 | man3dir = $(mandir)/man3 | |
35 | man4dir = $(mandir)/man4 | |
36 | man5dir = $(mandir)/man5 | |
37 | man6dir = $(mandir)/man6 | |
38 | man7dir = $(mandir)/man7 | |
39 | man8dir = $(mandir)/man8 | |
40 | man9dir = $(mandir)/man9 | |
41 | infodir = $(prefix)/info | |
42 | includedir = $(prefix)/include | |
43 | docdir = $(datadir)/doc | |
84396dcf RP |
44 | |
45 | SHELL = /bin/sh | |
d8e89b6b | 46 | |
5ebaf24b | 47 | INSTALL = `cd $(srcdir)/..;pwd`/install.sh -c |
d8e89b6b RP |
48 | INSTALL_PROGRAM = $(INSTALL) |
49 | INSTALL_DATA = $(INSTALL) | |
29078b29 | 50 | INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)' |
238aa238 | 51 | INSTALL_XFORM1 = $(INSTALL_XFORM) -b=.1 |
d8e89b6b RP |
52 | |
53 | AR = ar | |
54 | AR_FLAGS = qv | |
55 | CFLAGS = -g | |
d8e89b6b | 56 | MAKEINFO = makeinfo |
c921e2aa | 57 | TEXI2DVI = texi2dvi |
d8e89b6b | 58 | RANLIB = ranlib |
9752f9fd | 59 | BISONFLAGS = -d |
c83497f5 | 60 | TEXI2ROFF=texi2roff |
29078b29 | 61 | MAKEOVERRIDES= |
b5132a6b | 62 | |
f50af42b KR |
63 | NM_FOR_TARGET = nm |
64 | NM = $(NM_FOR_TARGET) | |
8d5d0e11 PB |
65 | SYMLINK = ln -s |
66 | ||
9752f9fd | 67 | BISON = `if [ -f ../byacc/byacc ] ; then echo ../byacc/byacc ; else echo byacc ; fi` |
45212e5e PB |
68 | # Comment these out if using lex. |
69 | LEX_OPTIONS = -I -Cem | |
e2fe2df4 | 70 | LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi` |
45212e5e | 71 | |
8539db10 | 72 | # Distribution version |
94333f27 | 73 | VERSION=cygnus-2.3.1 |
8539db10 | 74 | # Distribution name |
d8e89b6b | 75 | DIST_NAME=binutils-${VERSION} |
8539db10 | 76 | |
d8e89b6b | 77 | version=`./../gcc/gcc -dumpversion` |
b5132a6b | 78 | |
6b583720 | 79 | # Where to find texinfo.tex to format docn with TeX |
94333f27 | 80 | TEXIDIR = $(srcdir)/../texinfo |
b7a11ec2 | 81 | |
37853673 | 82 | MANPAGES= ar nm objdump ranlib size strings strip c++filt objcopy nlmconv |
84396dcf | 83 | |
a10d26a1 | 84 | #CC=gcc -Wall |
06a97fbd | 85 | # these two are almost the same program |
a10d26a1 RP |
86 | AR_PROG=ar |
87 | RANLIB_PROG=ranlib | |
99a42820 | 88 | |
df14d957 ILT |
89 | # objcopy and strip should be the same program |
90 | OBJCOPY_PROG=objcopy | |
a10d26a1 | 91 | STRIP_PROG=strip |
99a42820 | 92 | |
4f15fb27 DM |
93 | STRINGS_PROG=strings |
94 | ||
99a42820 | 95 | # These should all be the same program too. |
a10d26a1 RP |
96 | SIZE_PROG=size |
97 | NM_PROG=nm | |
98 | OBJDUMP_PROG=objdump | |
99a42820 | 99 | |
c921e2aa | 100 | # This is the demangler, as a standalone program. |
df14d957 | 101 | DEMANGLER_PROG=c++filt |
c921e2aa | 102 | |
29078b29 ILT |
103 | NLMCONV_PROG=nlmconv |
104 | ||
a6762b10 | 105 | PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRINGS_PROG) $(STRIP_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) $(BUILD_NLMCONV) |
a01bf1fb | 106 | STAGESTUFF = $(PROGS) *.o |
8d5d0e11 | 107 | # Files that can be generated, but should be in the distribution. |
94333f27 | 108 | DISTSTUFF=arparse.c arlex.c nlmheader.c info |
99a42820 | 109 | |
40773f7f | 110 | BASEDIR = $(srcdir)/.. |
bba04d93 DM |
111 | BFDDIR = $(BASEDIR)/bfd |
112 | INCDIR = $(BASEDIR)/include | |
113 | INCLUDES = -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) | |
a10d26a1 | 114 | |
a10d26a1 RP |
115 | #### host and target dependant Makefile fragments come in here. |
116 | ### | |
117 | ||
37853673 SS |
118 | ALL_CFLAGS = $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CFLAGS) |
119 | ||
d8e89b6b | 120 | .c.o: |
37853673 | 121 | $(CC) -c $(ALL_CFLAGS) $< |
99a42820 | 122 | |
99a42820 RP |
123 | #\f |
124 | ## Random definitions | |
125 | # Hopefully all these may be flushed once we get configuration down pat. | |
126 | ||
127 | # alloca only needed for systems which don't have it and when cc != gcc. | |
128 | # ALLOCA = alloca.o | |
129 | ||
130 | # nm tries to malloc enough space for the string table. The old GNU malloc | |
131 | # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might | |
132 | # fail unnecessarily. I've also seen some Unix malloc's fail, even when | |
133 | # there is enough memory. So use the new GNU malloc. | |
134 | # MALLOC = gmalloc.o | |
37853673 SS |
135 | # Use this if the system malloc is good enough. |
136 | MALLOC = | |
99a42820 RP |
137 | |
138 | # Use the GNU getopt unless you have problems with it. | |
139 | # The IRIS version could probably benefit from being assembled with | |
140 | # libmalloc rather than the ordinary malloc. | |
bba04d93 | 141 | LIBIBERTY = ../libiberty/libiberty.a |
99a42820 RP |
142 | |
143 | # Code shared by all the binutils. | |
a10d26a1 | 144 | BULIBS = bucomm.o version.o filemode.o |
99a42820 | 145 | |
5a070355 | 146 | ADDL_LIBS = $(MALLOC) $(BULIBS) $(BFD) $(LIBIBERTY) |
99a42820 | 147 | |
bba04d93 DM |
148 | BFD = ../bfd/libbfd.a |
149 | OPCODES = ../opcodes/libopcodes.a | |
f6dddd4e | 150 | |
df14d957 | 151 | RUNTEST = runtest |
03372cf4 | 152 | RUNTESTFLAGS = |
f6dddd4e | 153 | FLAGS_TO_PASS = \ |
4447efa2 ILT |
154 | "CC=$(CC)" \ |
155 | "CFLAGS=$(CFLAGS)" \ | |
df14d957 | 156 | "RUNTEST=$(RUNTEST)" \ |
03372cf4 | 157 | "RUNTESTFLAGS=$(RUNTESTFLAGS) \ |
f6dddd4e | 158 | SIZE=`if [ -f $$rootme/$(SIZE_PROG) ] ; then echo $$rootme/$(SIZE_PROG) ; else echo $(SIZE_PROG); fi` \ |
df14d957 | 159 | OBJCOPY=`if [ -f $$rootme/$(OBJCOPY_PROG) ] ; then echo $$rootme/$(OBJCOPY_PROG) ; else echo $(OBJCOPY_PROG); fi` \ |
f6dddd4e PB |
160 | NM=`if [ -f $$rootme/$(NM_PROG) ] ; then echo $$rootme/$(NM_PROG) ; else echo $(NM_PROG); fi` \ |
161 | AR=`if [ -f $$rootme/$(AR_PROG) ] ; then echo $$rootme/$(AR_PROG) ; else echo $(AR_PROG); fi` \ | |
162 | OBJDUMP=`if [ -f $$rootme/$(OBJDUMP_PROG) ] ; then echo $$rootme/$(OBJDUMP_PROG) ; else echo $(OBJDUMP_PROG); fi` \ | |
4f15fb27 | 163 | STRINGS=`if [ -f $$rootme/$(STRINGS_PROG) ] ; then echo $$rootme/$(STRINGS_PROG) ; else echo $(STRINGS_PROG); fi` \ |
f6dddd4e PB |
164 | STRIP=`if [ -f $$rootme/$(STRIP_PROG) ] ; then echo $$rootme/$(STRIP_PROG) ; else echo $(STRIP_PROG); fi` \ |
165 | RANLIB=`if [ -f $$rootme/$(RANLIB_PROG) ] ; then echo $$rootme/$(RANLIB_PROG) ; else echo $(RANLIB_PROG); fi` \ | |
166 | DEMANGLE=`if [ -f $$rootme/$(DEMANGLER_PROG) ] ; then echo $$rootme/$(DEMANGLER_PROG) ; else echo $(DEMANGLER_PROG); fi`" | |
167 | ||
99a42820 RP |
168 | #\f |
169 | ## The rules | |
170 | ||
f6dddd4e | 171 | all: $(ADDL_LIBS) $(PROGS) |
4f8b1219 MW |
172 | |
173 | testsuite: | |
238aa238 DZ |
174 | if [ -f testsuite/Makefile.in ]; then \ |
175 | (rootme=`pwd`/ ; export rootme ; \ | |
176 | rootsrc=`cd $(srcdir); pwd`/ ; export rootsrc ; \ | |
177 | cd testsuite; $(MAKE) FLAGS_TO_PASS=$(FLAGS_TO_PASS)); \ | |
3048fb38 | 178 | else true ; fi |
c83497f5 | 179 | |
f6dddd4e PB |
180 | check: force |
181 | rootme=`pwd`; export rootme; cd testsuite ; \ | |
182 | $(MAKE) check $(FLAGS_TO_PASS) | |
183 | # /bin/sh $(srcdir)/sanity.sh . | |
d8e89b6b | 184 | |
f7ed13c7 | 185 | installcheck: |
7d6cc102 RP |
186 | /bin/sh $(srcdir)/sanity.sh $(bindir) |
187 | ||
d8e89b6b | 188 | info: binutils.info |
a10d26a1 | 189 | |
c921e2aa FF |
190 | dvi: binutils.dvi |
191 | ||
a10d26a1 | 192 | $(SIZE_PROG): $(ADDL_LIBS) size.o $(BFD) |
94333f27 | 193 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(SIZE_PROG) size.o $(ADDL_LIBS) $(EXTRALIBS) |
99a42820 | 194 | |
df14d957 | 195 | $(OBJCOPY_PROG): $(ADDL_LIBS) objcopy.o not-strip.o $(BFD) |
94333f27 | 196 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(OBJCOPY_PROG) objcopy.o not-strip.o $(ADDL_LIBS) $(EXTRALIBS) |
d8e89b6b | 197 | |
4f15fb27 | 198 | $(STRINGS_PROG): $(ADDL_LIBS) strings.o $(BFD) |
94333f27 | 199 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(STRINGS_PROG) strings.o $(ADDL_LIBS) $(EXTRALIBS) |
4f15fb27 | 200 | |
df14d957 | 201 | $(STRIP_PROG): $(ADDL_LIBS) objcopy.o is-strip.o $(BFD) |
94333f27 | 202 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(STRIP_PROG) objcopy.o is-strip.o $(ADDL_LIBS) $(EXTRALIBS) |
99a42820 | 203 | |
d6a4c375 | 204 | $(NM_PROG): $(ADDL_LIBS) nm.o demangle.o $(BFD) |
94333f27 | 205 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(NM_PROG) nm.o demangle.o $(ADDL_LIBS) $(EXTRALIBS) |
99a42820 | 206 | |
29078b29 | 207 | $(OBJDUMP_PROG): $(ADDL_LIBS) objdump.o $(BFD) $(OPCODES) |
94333f27 | 208 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(OBJDUMP_PROG) objdump.o $(OPCODES) $(ADDL_LIBS) $(EXTRALIBS) |
bba04d93 | 209 | |
f993f087 | 210 | objdump.o: objdump.c config.status |
bba04d93 | 211 | $(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(ARCHDEFS) $(CFLAGS) $(srcdir)/objdump.c |
99a42820 | 212 | |
f50af42b KR |
213 | underscore.c: |
214 | echo "int xxy_us_dummy;" >dummy.c | |
215 | $(CC) -c dummy.c | |
f993f087 | 216 | rm -f underscore.c |
f50af42b | 217 | echo '/*WARNING: This file is automatically generated!*/' >underscore.c |
d34c55c6 | 218 | if [ "`$(NM) dummy.o | grep _xxy_us_dummy ; true`" != "" ]; then \ |
f50af42b KR |
219 | echo "int prepends_underscore = 1;" >>underscore.c; \ |
220 | else \ | |
221 | echo "int prepends_underscore = 0;" >>underscore.c; \ | |
222 | fi | |
223 | -rm -f dummy.c dummy.o | |
224 | ||
bba04d93 DM |
225 | version.o: version.c |
226 | $(CC) $(INCLUDES) $(HDEFINES) $(TDEFINES) -DVERSION='"$(VERSION)"' $(CFLAGS) -c $(srcdir)/version.c | |
227 | ||
d6a4c375 DM |
228 | demangle.o: $(BASEDIR)/libiberty/cplus-dem.c |
229 | $(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CFLAGS) $(BASEDIR)/libiberty/cplus-dem.c | |
230 | mv cplus-dem.o demangle.o | |
231 | ||
232 | # For parallel compiling, depend on demangle.o so that one gets done first. | |
233 | cplus-dem.o: $(BASEDIR)/libiberty/cplus-dem.c $(INCDIR)/getopt.h demangle.o | |
bba04d93 | 234 | $(CC) -c -DMAIN $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CFLAGS) $(BASEDIR)/libiberty/cplus-dem.c |
f50af42b | 235 | |
29078b29 | 236 | $(DEMANGLER_PROG): cplus-dem.o $(LIBIBERTY) underscore.o version.o |
94333f27 | 237 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(DEMANGLER_PROG) cplus-dem.o $(LIBIBERTY) $(EXTRALIBS) underscore.o version.o |
c921e2aa | 238 | |
37853673 | 239 | arparse.h arparse.c: arparse.y |
9752f9fd ME |
240 | $(BISON) $(BISONFLAGS) $(srcdir)/arparse.y |
241 | -mv y.tab.c arparse.c | |
242 | -mv y.tab.h arparse.h | |
d8e89b6b | 243 | |
9752f9fd ME |
244 | arlex.c: arlex.l |
245 | $(LEX) $(LEX_OPTIONS) $(srcdir)/arlex.l | |
246 | mv lex.yy.c arlex.c | |
d8e89b6b RP |
247 | |
248 | $(AR_PROG): $(ADDL_LIBS) ar.o arparse.o arlex.o not-ranlib.o $(BFD) arsup.o | |
94333f27 | 249 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(AR_PROG) ar.o arparse.o arlex.o arsup.o not-ranlib.o $(ADDL_LIBS) $(EXTRALIBS) |
d8e89b6b RP |
250 | |
251 | $(RANLIB_PROG): $(ADDL_LIBS) ar.o is-ranlib.o arparse.o arlex.o arsup.o $(BFD) | |
94333f27 | 252 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(RANLIB_PROG) ar.o arparse.o arlex.o arsup.o is-ranlib.o $(ADDL_LIBS) $(EXTRALIBS) |
06a97fbd PB |
253 | |
254 | # This rule creates a single binary that switches between ar and ranlib | |
255 | # by looking at argv[0]. Use this kludge to save some disk space. | |
256 | # However, you have to install things by hand. | |
257 | # (That is after 'make install', replace the installed ranlib by a link to ar.) | |
258 | ||
259 | # Alternatively, you can install ranlib.sh as ranlib. | |
260 | ||
261 | ar_with_ranlib: $(ADDL_LIBS) ar.o maybe-ranlib.o $(BFD) | |
94333f27 | 262 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(AR_PROG) ar.o maybe-ranlib.o $(ADDL_LIBS) $(EXTRALIBS) |
a10d26a1 RP |
263 | -rm -f $(RANLIB_PROG) |
264 | -ln $(AR_PROG) $(RANLIB_PROG) | |
99a42820 | 265 | |
df14d957 | 266 | # objcopy and strip in one binary that uses argv[0] to decide its action. |
d8e89b6b | 267 | |
df14d957 | 268 | objcopy_with_strip: $(ADDL_LIBS) objcopy.o maybe-strip.o $(BFD) |
94333f27 | 269 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(OBJCOPY_PROG) objcopy.o maybe-strip.o $(ADDL_LIBS) $(EXTRALIBS) |
a10d26a1 | 270 | -rm -f $(STRIP_PROG) |
df14d957 | 271 | -ln $(OBJCOPY_PROG) $(STRIP_PROG) |
99a42820 | 272 | |
29078b29 | 273 | nlmheader.c: nlmheader.y |
bba04d93 | 274 | $(BISON) $(srcdir)/nlmheader.y |
29078b29 | 275 | rm -f nlmheader.c |
bba04d93 | 276 | -mv y.tab.c nlmheader.c |
29078b29 | 277 | |
37853673 SS |
278 | nlmconv.o: nlmconv.c |
279 | ldname=`t='$(program_transform_name)'; echo ld | sed -e "" $$t`; \ | |
280 | $(CC) -c -DLD_NAME="\"$${ldname}\"" $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CFLAGS) $(srcdir)/nlmconv.c | |
281 | ||
29078b29 | 282 | $(NLMCONV_PROG): nlmconv.o nlmheader.o $(ADDL_LIBS) $(BFD) |
94333f27 | 283 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ nlmconv.o nlmheader.o $(ADDL_LIBS) $(EXTRALIBS) |
bba04d93 DM |
284 | |
285 | # This list of dependencies was generated by doing a make with gcc -MM | |
286 | # saving the output in a file and removing the gcc commands | |
287 | # changing "../../devo/binutils/../bfd" to "$(BFDDIR)" | |
288 | # removing "../../devo/binutils/" | |
289 | # changing "../include" to "$(INCDIR)" | |
290 | ||
291 | bucomm.o: bucomm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
292 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
37853673 | 293 | $(INCDIR)/fopen-same.h bucomm.h |
bba04d93 DM |
294 | filemode.o: filemode.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ |
295 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
296 | $(INCDIR)/fopen-same.h | |
297 | size.o: size.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
298 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
299 | $(INCDIR)/fopen-same.h $(INCDIR)/getopt.h | |
300 | objdump.o: objdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
301 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
302 | $(INCDIR)/fopen-same.h $(INCDIR)/getopt.h \ | |
303 | $(INCDIR)/dis-asm.h $(INCDIR)/aout/aout64.h \ | |
304 | $(INCDIR)/elf/internal.h $(INCDIR)/aout/stab.def | |
305 | nm.o: nm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
306 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
307 | $(INCDIR)/fopen-same.h bucomm.h $(INCDIR)/getopt.h \ | |
308 | $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ | |
d6a4c375 | 309 | $(INCDIR)/aout/ranlib.h $(INCDIR)/demangle.h |
bba04d93 DM |
310 | ar.o: ar.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ |
311 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
312 | $(INCDIR)/fopen-same.h bucomm.h $(INCDIR)/aout/ar.h \ | |
313 | $(BFDDIR)/libbfd.h arsup.h | |
314 | arparse.o: arparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
315 | $(INCDIR)/obstack.h arsup.h | |
316 | arlex.o: arlex.c ./arparse.h | |
317 | not-ranlib.o: not-ranlib.c | |
318 | arsup.o: arsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
319 | $(INCDIR)/obstack.h arsup.h bucomm.h | |
320 | strings.o: strings.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
321 | $(INCDIR)/obstack.h bucomm.h | |
322 | objcopy.o: objcopy.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
323 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
324 | $(INCDIR)/fopen-same.h bucomm.h | |
325 | is-strip.o: is-strip.c | |
326 | is-ranlib.o: is-ranlib.c | |
327 | not-strip.o: not-strip.c | |
328 | nlmheader.o: nlmheader.c nlmconv.h $(INCDIR)/nlm/common.h \ | |
329 | $(INCDIR)/nlm/internal.h | |
37853673 SS |
330 | nlmconv.o: $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ |
331 | $(BFDDIR)/libnlm.h bucomm.h | |
29078b29 | 332 | |
6a3958b2 RP |
333 | stage1: force |
334 | - mkdir stage1 | |
a01bf1fb | 335 | - mv -f $(STAGESTUFF) stage1 |
6a3958b2 RP |
336 | |
337 | stage2: force | |
338 | - mkdir stage2 | |
a01bf1fb | 339 | - mv -f $(STAGESTUFF) stage2 |
6a3958b2 RP |
340 | |
341 | stage3: force | |
342 | - mkdir stage3 | |
a01bf1fb RP |
343 | - mv -f $(STAGESTUFF) stage3 |
344 | ||
345 | against=stage2 | |
346 | ||
347 | comparison: force | |
348 | for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done | |
6a3958b2 RP |
349 | |
350 | de-stage1: force | |
351 | - (cd stage1 ; mv -f * ..) | |
352 | - rmdir stage1 | |
353 | ||
354 | de-stage2: force | |
355 | - (cd stage2 ; mv -f * ..) | |
356 | - rmdir stage2 | |
357 | ||
358 | de-stage3: force | |
359 | - (cd stage3 ; mv -f * ..) | |
360 | - rmdir stage3 | |
361 | ||
6b583720 RP |
362 | ###################################################################### |
363 | # DOCUMENTATION TARGETS | |
364 | # TeX output | |
2226a090 | 365 | binutils.dvi: $(srcdir)/binutils.texi |
94333f27 | 366 | TEXINPUTS=$(TEXIDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/binutils.texi |
b7a11ec2 | 367 | |
6b583720 | 368 | # info file for online browsing |
2226a090 | 369 | binutils.info: $(srcdir)/binutils.texi |
6141fd50 | 370 | $(MAKEINFO) -o binutils.info $(srcdir)/binutils.texi |
b7a11ec2 | 371 | |
0c10ff03 | 372 | # different targets for -ms, -mm, -me |
c83497f5 RP |
373 | # Try to use a recent texi2roff. v2 was put on prep in jan91. |
374 | # If you want an index, see texi2roff doc for postprocessing | |
375 | # and add -i to texi2roff invocations below. | |
376 | # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete | |
94333f27 | 377 | # corresponding -e lines when later texi2roff's are current) |
c83497f5 RP |
378 | # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs. |
379 | # + @c's deleted explicitly because texi2roff sees texinfo commands in them | |
380 | # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank | |
381 | # + @alphaenumerate is ridiculously new, turned into @enumerate | |
382 | ||
0c10ff03 | 383 | # roff output (-ms) |
2226a090 | 384 | binutils.ms: $(srcdir)/binutils.texi |
6b583720 RP |
385 | sed -e '/\\input texinfo/d' \ |
386 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
c83497f5 RP |
387 | -e '/^@ifinfo/,/^@end ifinfo/d' \ |
388 | -e '/^@c/d' \ | |
2226a090 | 389 | -e 's/{.*,,/{/' \ |
c83497f5 RP |
390 | -e 's/@ / /g' \ |
391 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
392 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
2226a090 | 393 | $(srcdir)/binutils.texi | \ |
d8e89b6b | 394 | $(TEXI2ROFF) -ms | \ |
c83497f5 RP |
395 | sed -e 's/---/\\(em/g' \ |
396 | >binutils.ms | |
6b583720 | 397 | |
0c10ff03 | 398 | # roff output (-mm) |
c83497f5 RP |
399 | # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer, |
400 | # try leaving them in | |
2226a090 | 401 | binutils.mm: $(srcdir)/binutils.texi |
0c10ff03 RP |
402 | sed -e '/\\input texinfo/d' \ |
403 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
c83497f5 RP |
404 | -e '/^@ifinfo/,/^@end ifinfo/d' \ |
405 | -e '/^@c/d' \ | |
2226a090 RP |
406 | -e 's/{.*,,/{/' \ |
407 | -e '/@noindent/d' \ | |
c83497f5 RP |
408 | -e 's/@ / /g' \ |
409 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
410 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
2226a090 | 411 | $(srcdir)/binutils.texi | \ |
d8e89b6b | 412 | $(TEXI2ROFF) -mm | \ |
2226a090 RP |
413 | sed -e 's/---/\\(em/g' \ |
414 | >binutils.mm | |
0c10ff03 RP |
415 | |
416 | # roff output (-me) | |
2226a090 | 417 | binutils.me: $(srcdir)/binutils.texi |
0c10ff03 RP |
418 | sed -e '/\\input texinfo/d' \ |
419 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
c83497f5 RP |
420 | -e '/^@ifinfo/,/^@end ifinfo/d' \ |
421 | -e '/^@c/d' \ | |
2226a090 | 422 | -e 's/{.*,,/{/' \ |
c83497f5 RP |
423 | -e 's/@ / /g' \ |
424 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
425 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
2226a090 | 426 | $(srcdir)/binutils.texi | \ |
d8e89b6b | 427 | $(TEXI2ROFF) -me | \ |
c83497f5 RP |
428 | sed -e 's/---/\\(em/g' \ |
429 | >binutils.me | |
0c10ff03 RP |
430 | |
431 | ||
6b583720 RP |
432 | ###################################################################### |
433 | ||
8d5d0e11 | 434 | mostlyclean: |
3f97524f | 435 | -rm -f *.o *~ \#* core binutils.?? binutils.??? |
8d5d0e11 | 436 | clean: mostlyclean |
94333f27 ILT |
437 | @if [ -d testsuite ] ; then \ |
438 | cd testsuite ; $(MAKE) $(FLAGS_TO_PASS) clean ; \ | |
439 | else true; fi | |
f50af42b | 440 | -rm -f $(PROGS) underscore.c |
94333f27 ILT |
441 | distclean: |
442 | @if [ -d testsuite ] ; then \ | |
443 | cd testsuite ; $(MAKE) $(FLAGS_TO_PASS) distclean ; \ | |
444 | else true; fi | |
445 | -rm -f Makefile config.status sysdep.h *.o *~ \#* core \ | |
446 | binutils.?? binutils.??s binutils.aux binutils.log binutils.toc | |
447 | realclean: clean distclean | |
8d5d0e11 | 448 | -rm -f $(DISTSTUFF) TAGS |
99a42820 RP |
449 | |
450 | etags tags: TAGS | |
451 | ||
6a3958b2 | 452 | TAGS: force |
bba04d93 | 453 | etags $(INCDIR)/*.h $(srcdir)/*.[hc] |
99a42820 | 454 | |
c83497f5 | 455 | install: all |
238aa238 DZ |
456 | for i in $(PROGS) ; do \ |
457 | $(INSTALL_XFORM) $$i $(bindir)/$$i ; \ | |
99a42820 | 458 | done |
238aa238 DZ |
459 | for i in $(MANPAGES) ; do \ |
460 | $(INSTALL_XFORM1) $(srcdir)/$$i.1 $(man1dir)/$$i.1 ; \ | |
de53632c | 461 | done |
3f97524f DZ |
462 | -if [ -d $(tooldir) ]; then \ |
463 | if [ -d $(tooldir)/bin ] ; then true ; else mkdir $(tooldir)/bin ; fi; \ | |
94333f27 | 464 | for i in nm strip ar ranlib; do \ |
3f97524f DZ |
465 | rm -f $(tooldir)/bin/$$i; \ |
466 | ln $(bindir)/`t='$(program_transform_name)'; echo $$i | sed -e "" $$t` $(tooldir)/bin/$$i \ | |
467 | || $(INSTALL_PROGRAM) $$i $(tooldir)/bin/$$i; \ | |
468 | done; \ | |
469 | else true; fi | |
c83497f5 | 470 | |
94333f27 ILT |
471 | # Use binutils.info as the target so that VPATH will DTRT. |
472 | # (Use "$<*" in case the output is multiple files, though.) | |
473 | install-info: binutils.info | |
474 | for i in $<* ; do \ | |
d8e89b6b | 475 | $(INSTALL_DATA) $$i $(infodir)/$$i ; \ |
84396dcf | 476 | done |
99a42820 | 477 | |
d8e89b6b RP |
478 | clean-info: |
479 | -rm -rf *.info* | |
480 | ||
e2fe2df4 | 481 | # Making a dist: |
ee948e4e PB |
482 | # cvs rtag binutils-x-yy ld+utils |
483 | # cvs co -r binutils-x-yy ld+utils | |
e2fe2df4 PB |
484 | # Sanitize |
485 | # cd {HERE}; make dist [-f Makefile.in] | |
486 | ||
f50af42b | 487 | dist: $(DIST_NAME).tar.z |
8539db10 | 488 | |
8d5d0e11 PB |
489 | diststuff: $(DISTSTUFF) |
490 | ||
f50af42b | 491 | $(DIST_NAME).tar.z: |
b27d2046 | 492 | cd ../..; rm -f $(DIST_NAME); ln -s devo $(DIST_NAME) |
8d5d0e11 PB |
493 | make diststuff -f Makefile.in |
494 | cd ../ld; make diststuff -f Makefile.in | |
3f97524f | 495 | cd ../gprof; make diststuff -f Makefile.in |
7f7b0a77 | 496 | cd ../texinfo; mv texinfo.tex ..; rm -rf *; mv ../texinfo.tex . |
2e8adbd7 PB |
497 | # Take out texinfo from configurable dirs |
498 | mv ../configure.in tmp; \ | |
499 | sed -e '/^host_tools=/s/texinfo //' <tmp >../configure.in; rm tmp | |
500 | cd ..; chmod og=u `find . -print` | |
f50af42b | 501 | cd ../..; tar chf - $(DIST_NAME) | gzip >$(DIST_NAME).tar.z |
b27d2046 | 502 | rm -rf ../../$(DIST_NAME) |
8539db10 | 503 | |
99a42820 RP |
504 | #----------------------------------------------------------------------------- |
505 | # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT | |
506 | # | |
507 | # 'VERSION' file must be present and contain a string of the form "x.y" | |
508 | #----------------------------------------------------------------------------- | |
509 | ||
510 | ver960.c: FORCE | |
511 | rm -f ver960.c | |
512 | echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c | |
513 | ||
514 | ||
515 | # Dummy target to force execution of dependent targets. | |
516 | # | |
6a3958b2 | 517 | force: |
99a42820 RP |
518 | |
519 | # Target to uncomment host-specific lines in this makefile. Such lines must | |
520 | # have the following string beginning in column 1: #__<hostname>__# | |
521 | # Original Makefile is backed up as 'Makefile.old'. | |
522 | # | |
523 | # Invoke with: make make HOST=xxx | |
524 | # | |
525 | make: | |
526 | -@if test $(HOST)x = x ; then \ | |
527 | echo '\aSpecify "make make HOST=???"'; \ | |
528 | exit 1; \ | |
529 | fi ; \ | |
530 | grep -s "^#The next line was generated by 'make make'" Makefile; \ | |
531 | if test $$? = 0 ; then \ | |
532 | echo "\aMakefile has already been processed with 'make make'";\ | |
533 | exit 1; \ | |
534 | fi ; \ | |
535 | mv -f Makefile Makefile.old; \ | |
536 | echo "#The next line was generated by 'make make'" >Makefile ; \ | |
537 | echo "HOST=$(HOST)" >>Makefile ; \ | |
538 | echo >>Makefile ; \ | |
539 | sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile | |
540 | ||
f1eb48b6 | 541 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) |
a26878d1 | 542 | $(SHELL) ./config.status |
99a42820 RP |
543 | |
544 | ### Local Variables: *** | |
545 | ### mode:fundamental *** | |
546 | ### page-delimiter: "^#\f" *** | |
547 | ### End: *** | |
548 | ### end of file |