Commit | Line | Data |
---|---|---|
d8474a9b | 1 | # Makefile for GNU binary-file utilities |
4f15fb27 | 2 | # Copyright (C) 1992, 1993 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 |
f50af42b | 73 | VERSION=2.2 |
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 |
b7a11ec2 RP |
80 | TEXIDIR = $(srcdir)/../texinfo/fsf |
81 | ||
4f15fb27 | 82 | MANPAGES= ar nm objdump ranlib size strings strip c++filt objcopy |
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 | ||
105 | PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRINGS_PROG) $(STRIP_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) $(NLMCONV_PROG) | |
a01bf1fb | 106 | STAGESTUFF = $(PROGS) *.o |
8d5d0e11 | 107 | # Files that can be generated, but should be in the distribution. |
f50af42b | 108 | DISTSTUFF=arparse.c arlex.c |
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 | ||
d8e89b6b | 118 | .c.o: |
bba04d93 | 119 | $(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CFLAGS) $< |
99a42820 | 120 | |
99a42820 RP |
121 | #\f |
122 | ## Random definitions | |
123 | # Hopefully all these may be flushed once we get configuration down pat. | |
124 | ||
125 | # alloca only needed for systems which don't have it and when cc != gcc. | |
126 | # ALLOCA = alloca.o | |
127 | ||
128 | # nm tries to malloc enough space for the string table. The old GNU malloc | |
129 | # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might | |
130 | # fail unnecessarily. I've also seen some Unix malloc's fail, even when | |
131 | # there is enough memory. So use the new GNU malloc. | |
132 | # MALLOC = gmalloc.o | |
133 | ||
134 | # Use the GNU getopt unless you have problems with it. | |
135 | # The IRIS version could probably benefit from being assembled with | |
136 | # libmalloc rather than the ordinary malloc. | |
bba04d93 | 137 | LIBIBERTY = ../libiberty/libiberty.a |
99a42820 RP |
138 | |
139 | # Code shared by all the binutils. | |
a10d26a1 | 140 | BULIBS = bucomm.o version.o filemode.o |
99a42820 | 141 | |
5a070355 | 142 | ADDL_LIBS = $(MALLOC) $(BULIBS) $(BFD) $(LIBIBERTY) |
99a42820 | 143 | |
bba04d93 DM |
144 | BFD = ../bfd/libbfd.a |
145 | OPCODES = ../opcodes/libopcodes.a | |
f6dddd4e | 146 | |
df14d957 | 147 | RUNTEST = runtest |
f6dddd4e PB |
148 | RUNTESTFLAGS = |
149 | FLAGS_TO_PASS = \ | |
4447efa2 ILT |
150 | "CC=$(CC)" \ |
151 | "CFLAGS=$(CFLAGS)" \ | |
df14d957 | 152 | "RUNTEST=$(RUNTEST)" \ |
f6dddd4e PB |
153 | "RUNTESTFLAGS=$(RUNTESTFLAGS) \ |
154 | SIZE=`if [ -f $$rootme/$(SIZE_PROG) ] ; then echo $$rootme/$(SIZE_PROG) ; else echo $(SIZE_PROG); fi` \ | |
df14d957 | 155 | OBJCOPY=`if [ -f $$rootme/$(OBJCOPY_PROG) ] ; then echo $$rootme/$(OBJCOPY_PROG) ; else echo $(OBJCOPY_PROG); fi` \ |
f6dddd4e PB |
156 | NM=`if [ -f $$rootme/$(NM_PROG) ] ; then echo $$rootme/$(NM_PROG) ; else echo $(NM_PROG); fi` \ |
157 | AR=`if [ -f $$rootme/$(AR_PROG) ] ; then echo $$rootme/$(AR_PROG) ; else echo $(AR_PROG); fi` \ | |
158 | OBJDUMP=`if [ -f $$rootme/$(OBJDUMP_PROG) ] ; then echo $$rootme/$(OBJDUMP_PROG) ; else echo $(OBJDUMP_PROG); fi` \ | |
4f15fb27 | 159 | STRINGS=`if [ -f $$rootme/$(STRINGS_PROG) ] ; then echo $$rootme/$(STRINGS_PROG) ; else echo $(STRINGS_PROG); fi` \ |
f6dddd4e PB |
160 | STRIP=`if [ -f $$rootme/$(STRIP_PROG) ] ; then echo $$rootme/$(STRIP_PROG) ; else echo $(STRIP_PROG); fi` \ |
161 | RANLIB=`if [ -f $$rootme/$(RANLIB_PROG) ] ; then echo $$rootme/$(RANLIB_PROG) ; else echo $(RANLIB_PROG); fi` \ | |
162 | DEMANGLE=`if [ -f $$rootme/$(DEMANGLER_PROG) ] ; then echo $$rootme/$(DEMANGLER_PROG) ; else echo $(DEMANGLER_PROG); fi`" | |
163 | ||
99a42820 RP |
164 | #\f |
165 | ## The rules | |
166 | ||
f6dddd4e | 167 | all: $(ADDL_LIBS) $(PROGS) |
4f8b1219 MW |
168 | |
169 | testsuite: | |
238aa238 DZ |
170 | if [ -f testsuite/Makefile.in ]; then \ |
171 | (rootme=`pwd`/ ; export rootme ; \ | |
172 | rootsrc=`cd $(srcdir); pwd`/ ; export rootsrc ; \ | |
173 | cd testsuite; $(MAKE) FLAGS_TO_PASS=$(FLAGS_TO_PASS)); \ | |
3048fb38 | 174 | else true ; fi |
c83497f5 | 175 | |
f6dddd4e PB |
176 | check: force |
177 | rootme=`pwd`; export rootme; cd testsuite ; \ | |
178 | $(MAKE) check $(FLAGS_TO_PASS) | |
179 | # /bin/sh $(srcdir)/sanity.sh . | |
d8e89b6b | 180 | |
f7ed13c7 | 181 | installcheck: |
7d6cc102 RP |
182 | /bin/sh $(srcdir)/sanity.sh $(bindir) |
183 | ||
d8e89b6b | 184 | info: binutils.info |
a10d26a1 | 185 | |
c921e2aa FF |
186 | dvi: binutils.dvi |
187 | ||
a10d26a1 | 188 | $(SIZE_PROG): $(ADDL_LIBS) size.o $(BFD) |
bba04d93 | 189 | $(CC) $(LDFLAGS) -o $(SIZE_PROG) size.o $(ADDL_LIBS) $(EXTRALIBS) |
99a42820 | 190 | |
df14d957 | 191 | $(OBJCOPY_PROG): $(ADDL_LIBS) objcopy.o not-strip.o $(BFD) |
bba04d93 | 192 | $(CC) $(LDFLAGS) -o $(OBJCOPY_PROG) objcopy.o not-strip.o $(ADDL_LIBS) $(EXTRALIBS) |
d8e89b6b | 193 | |
4f15fb27 | 194 | $(STRINGS_PROG): $(ADDL_LIBS) strings.o $(BFD) |
bba04d93 | 195 | $(CC) $(LDFLAGS) -o $(STRINGS_PROG) strings.o $(ADDL_LIBS) $(EXTRALIBS) |
4f15fb27 | 196 | |
df14d957 | 197 | $(STRIP_PROG): $(ADDL_LIBS) objcopy.o is-strip.o $(BFD) |
bba04d93 | 198 | $(CC) $(LDFLAGS) -o $(STRIP_PROG) objcopy.o is-strip.o $(ADDL_LIBS) $(EXTRALIBS) |
99a42820 | 199 | |
d6a4c375 DM |
200 | $(NM_PROG): $(ADDL_LIBS) nm.o demangle.o $(BFD) |
201 | $(CC) $(LDFLAGS) -o $(NM_PROG) nm.o demangle.o $(ADDL_LIBS) $(EXTRALIBS) | |
99a42820 | 202 | |
29078b29 | 203 | $(OBJDUMP_PROG): $(ADDL_LIBS) objdump.o $(BFD) $(OPCODES) |
bba04d93 DM |
204 | $(CC) $(LDFLAGS) -o $(OBJDUMP_PROG) objdump.o $(OPCODES) $(ADDL_LIBS) $(EXTRALIBS) |
205 | ||
206 | objdump.o: objdump.c | |
207 | $(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(ARCHDEFS) $(CFLAGS) $(srcdir)/objdump.c | |
99a42820 | 208 | |
f50af42b KR |
209 | underscore.c: |
210 | echo "int xxy_us_dummy;" >dummy.c | |
211 | $(CC) -c dummy.c | |
212 | echo '/*WARNING: This file is automatically generated!*/' >underscore.c | |
d34c55c6 | 213 | if [ "`$(NM) dummy.o | grep _xxy_us_dummy ; true`" != "" ]; then \ |
f50af42b KR |
214 | echo "int prepends_underscore = 1;" >>underscore.c; \ |
215 | else \ | |
216 | echo "int prepends_underscore = 0;" >>underscore.c; \ | |
217 | fi | |
218 | -rm -f dummy.c dummy.o | |
219 | ||
bba04d93 DM |
220 | version.o: version.c |
221 | $(CC) $(INCLUDES) $(HDEFINES) $(TDEFINES) -DVERSION='"$(VERSION)"' $(CFLAGS) -c $(srcdir)/version.c | |
222 | ||
d6a4c375 DM |
223 | demangle.o: $(BASEDIR)/libiberty/cplus-dem.c |
224 | $(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CFLAGS) $(BASEDIR)/libiberty/cplus-dem.c | |
225 | mv cplus-dem.o demangle.o | |
226 | ||
227 | # For parallel compiling, depend on demangle.o so that one gets done first. | |
228 | cplus-dem.o: $(BASEDIR)/libiberty/cplus-dem.c $(INCDIR)/getopt.h demangle.o | |
bba04d93 | 229 | $(CC) -c -DMAIN $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CFLAGS) $(BASEDIR)/libiberty/cplus-dem.c |
f50af42b | 230 | |
29078b29 | 231 | $(DEMANGLER_PROG): cplus-dem.o $(LIBIBERTY) underscore.o version.o |
bba04d93 | 232 | $(CC) $(LDFLAGS) -o $(DEMANGLER_PROG) cplus-dem.o $(LIBIBERTY) $(EXTRALIBS) underscore.o version.o |
c921e2aa | 233 | |
bba04d93 | 234 | arparse.c: arparse.y |
9752f9fd ME |
235 | $(BISON) $(BISONFLAGS) $(srcdir)/arparse.y |
236 | -mv y.tab.c arparse.c | |
237 | -mv y.tab.h arparse.h | |
d8e89b6b | 238 | |
9752f9fd ME |
239 | arlex.c: arlex.l |
240 | $(LEX) $(LEX_OPTIONS) $(srcdir)/arlex.l | |
241 | mv lex.yy.c arlex.c | |
d8e89b6b RP |
242 | |
243 | $(AR_PROG): $(ADDL_LIBS) ar.o arparse.o arlex.o not-ranlib.o $(BFD) arsup.o | |
bba04d93 | 244 | $(CC) $(LDFLAGS) -o $(AR_PROG) ar.o arparse.o arlex.o arsup.o not-ranlib.o $(ADDL_LIBS) $(EXTRALIBS) |
d8e89b6b RP |
245 | |
246 | $(RANLIB_PROG): $(ADDL_LIBS) ar.o is-ranlib.o arparse.o arlex.o arsup.o $(BFD) | |
bba04d93 | 247 | $(CC) $(LDFLAGS) -o $(RANLIB_PROG) ar.o arparse.o arlex.o arsup.o is-ranlib.o $(ADDL_LIBS) $(EXTRALIBS) |
06a97fbd PB |
248 | |
249 | # This rule creates a single binary that switches between ar and ranlib | |
250 | # by looking at argv[0]. Use this kludge to save some disk space. | |
251 | # However, you have to install things by hand. | |
252 | # (That is after 'make install', replace the installed ranlib by a link to ar.) | |
253 | ||
254 | # Alternatively, you can install ranlib.sh as ranlib. | |
255 | ||
256 | ar_with_ranlib: $(ADDL_LIBS) ar.o maybe-ranlib.o $(BFD) | |
bba04d93 | 257 | $(CC) $(LDFLAGS) -o $(AR_PROG) ar.o maybe-ranlib.o $(ADDL_LIBS) $(EXTRALIBS) |
a10d26a1 RP |
258 | -rm -f $(RANLIB_PROG) |
259 | -ln $(AR_PROG) $(RANLIB_PROG) | |
99a42820 | 260 | |
df14d957 | 261 | # objcopy and strip in one binary that uses argv[0] to decide its action. |
d8e89b6b | 262 | |
df14d957 | 263 | objcopy_with_strip: $(ADDL_LIBS) objcopy.o maybe-strip.o $(BFD) |
bba04d93 | 264 | $(CC) $(LDFLAGS) -o $(OBJCOPY_PROG) objcopy.o maybe-strip.o $(ADDL_LIBS) $(EXTRALIBS) |
a10d26a1 | 265 | -rm -f $(STRIP_PROG) |
df14d957 | 266 | -ln $(OBJCOPY_PROG) $(STRIP_PROG) |
99a42820 | 267 | |
29078b29 | 268 | nlmheader.c: nlmheader.y |
bba04d93 | 269 | $(BISON) $(srcdir)/nlmheader.y |
29078b29 | 270 | rm -f nlmheader.c |
bba04d93 | 271 | -mv y.tab.c nlmheader.c |
29078b29 ILT |
272 | |
273 | $(NLMCONV_PROG): nlmconv.o nlmheader.o $(ADDL_LIBS) $(BFD) | |
bba04d93 DM |
274 | $(CC) $(LDFLAGS) -o $@ nlmconv.o nlmheader.o $(ADDL_LIBS) $(EXTRALIBS) |
275 | ||
276 | # This list of dependencies was generated by doing a make with gcc -MM | |
277 | # saving the output in a file and removing the gcc commands | |
278 | # changing "../../devo/binutils/../bfd" to "$(BFDDIR)" | |
279 | # removing "../../devo/binutils/" | |
280 | # changing "../include" to "$(INCDIR)" | |
281 | ||
282 | bucomm.o: bucomm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
283 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
284 | $(INCDIR)/fopen-same.h | |
285 | filemode.o: filemode.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
286 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
287 | $(INCDIR)/fopen-same.h | |
288 | size.o: size.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
289 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
290 | $(INCDIR)/fopen-same.h $(INCDIR)/getopt.h | |
291 | objdump.o: objdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
292 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
293 | $(INCDIR)/fopen-same.h $(INCDIR)/getopt.h \ | |
294 | $(INCDIR)/dis-asm.h $(INCDIR)/aout/aout64.h \ | |
295 | $(INCDIR)/elf/internal.h $(INCDIR)/aout/stab.def | |
296 | nm.o: nm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
297 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
298 | $(INCDIR)/fopen-same.h bucomm.h $(INCDIR)/getopt.h \ | |
299 | $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ | |
d6a4c375 | 300 | $(INCDIR)/aout/ranlib.h $(INCDIR)/demangle.h |
bba04d93 DM |
301 | ar.o: ar.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ |
302 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
303 | $(INCDIR)/fopen-same.h bucomm.h $(INCDIR)/aout/ar.h \ | |
304 | $(BFDDIR)/libbfd.h arsup.h | |
305 | arparse.o: arparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
306 | $(INCDIR)/obstack.h arsup.h | |
307 | arlex.o: arlex.c ./arparse.h | |
308 | not-ranlib.o: not-ranlib.c | |
309 | arsup.o: arsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
310 | $(INCDIR)/obstack.h arsup.h bucomm.h | |
311 | strings.o: strings.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
312 | $(INCDIR)/obstack.h bucomm.h | |
313 | objcopy.o: objcopy.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
314 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
315 | $(INCDIR)/fopen-same.h bucomm.h | |
316 | is-strip.o: is-strip.c | |
317 | is-ranlib.o: is-ranlib.c | |
318 | not-strip.o: not-strip.c | |
319 | nlmheader.o: nlmheader.c nlmconv.h $(INCDIR)/nlm/common.h \ | |
320 | $(INCDIR)/nlm/internal.h | |
321 | nlmconv.o: nlmconv.c nlmconv.h $(INCDIR)/nlm/common.h \ | |
322 | $(INCDIR)/nlm/internal.h $(BFDDIR)/libnlm.h | |
29078b29 | 323 | |
6a3958b2 RP |
324 | stage1: force |
325 | - mkdir stage1 | |
a01bf1fb | 326 | - mv -f $(STAGESTUFF) stage1 |
6a3958b2 RP |
327 | |
328 | stage2: force | |
329 | - mkdir stage2 | |
a01bf1fb | 330 | - mv -f $(STAGESTUFF) stage2 |
6a3958b2 RP |
331 | |
332 | stage3: force | |
333 | - mkdir stage3 | |
a01bf1fb RP |
334 | - mv -f $(STAGESTUFF) stage3 |
335 | ||
336 | against=stage2 | |
337 | ||
338 | comparison: force | |
339 | for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done | |
6a3958b2 RP |
340 | |
341 | de-stage1: force | |
342 | - (cd stage1 ; mv -f * ..) | |
343 | - rmdir stage1 | |
344 | ||
345 | de-stage2: force | |
346 | - (cd stage2 ; mv -f * ..) | |
347 | - rmdir stage2 | |
348 | ||
349 | de-stage3: force | |
350 | - (cd stage3 ; mv -f * ..) | |
351 | - rmdir stage3 | |
352 | ||
6b583720 RP |
353 | ###################################################################### |
354 | # DOCUMENTATION TARGETS | |
355 | # TeX output | |
2226a090 | 356 | binutils.dvi: $(srcdir)/binutils.texi |
c921e2aa | 357 | $(TEXI2DVI) $(srcdir)/binutils.texi |
b7a11ec2 | 358 | |
6b583720 | 359 | # info file for online browsing |
2226a090 | 360 | binutils.info: $(srcdir)/binutils.texi |
6141fd50 | 361 | $(MAKEINFO) -o binutils.info $(srcdir)/binutils.texi |
b7a11ec2 | 362 | |
0c10ff03 | 363 | # different targets for -ms, -mm, -me |
c83497f5 RP |
364 | # Try to use a recent texi2roff. v2 was put on prep in jan91. |
365 | # If you want an index, see texi2roff doc for postprocessing | |
366 | # and add -i to texi2roff invocations below. | |
367 | # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete | |
368 | # correspondint -e lines when later texi2roff's are current) | |
369 | # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs. | |
370 | # + @c's deleted explicitly because texi2roff sees texinfo commands in them | |
371 | # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank | |
372 | # + @alphaenumerate is ridiculously new, turned into @enumerate | |
373 | ||
0c10ff03 | 374 | # roff output (-ms) |
2226a090 | 375 | binutils.ms: $(srcdir)/binutils.texi |
6b583720 RP |
376 | sed -e '/\\input texinfo/d' \ |
377 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
c83497f5 RP |
378 | -e '/^@ifinfo/,/^@end ifinfo/d' \ |
379 | -e '/^@c/d' \ | |
2226a090 | 380 | -e 's/{.*,,/{/' \ |
c83497f5 RP |
381 | -e 's/@ / /g' \ |
382 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
383 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
2226a090 | 384 | $(srcdir)/binutils.texi | \ |
d8e89b6b | 385 | $(TEXI2ROFF) -ms | \ |
c83497f5 RP |
386 | sed -e 's/---/\\(em/g' \ |
387 | >binutils.ms | |
6b583720 | 388 | |
0c10ff03 | 389 | # roff output (-mm) |
c83497f5 RP |
390 | # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer, |
391 | # try leaving them in | |
2226a090 | 392 | binutils.mm: $(srcdir)/binutils.texi |
0c10ff03 RP |
393 | sed -e '/\\input texinfo/d' \ |
394 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
c83497f5 RP |
395 | -e '/^@ifinfo/,/^@end ifinfo/d' \ |
396 | -e '/^@c/d' \ | |
2226a090 RP |
397 | -e 's/{.*,,/{/' \ |
398 | -e '/@noindent/d' \ | |
c83497f5 RP |
399 | -e 's/@ / /g' \ |
400 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
401 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
2226a090 | 402 | $(srcdir)/binutils.texi | \ |
d8e89b6b | 403 | $(TEXI2ROFF) -mm | \ |
2226a090 RP |
404 | sed -e 's/---/\\(em/g' \ |
405 | >binutils.mm | |
0c10ff03 RP |
406 | |
407 | # roff output (-me) | |
2226a090 | 408 | binutils.me: $(srcdir)/binutils.texi |
0c10ff03 RP |
409 | sed -e '/\\input texinfo/d' \ |
410 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
c83497f5 RP |
411 | -e '/^@ifinfo/,/^@end ifinfo/d' \ |
412 | -e '/^@c/d' \ | |
2226a090 | 413 | -e 's/{.*,,/{/' \ |
c83497f5 RP |
414 | -e 's/@ / /g' \ |
415 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
416 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
2226a090 | 417 | $(srcdir)/binutils.texi | \ |
d8e89b6b | 418 | $(TEXI2ROFF) -me | \ |
c83497f5 RP |
419 | sed -e 's/---/\\(em/g' \ |
420 | >binutils.me | |
0c10ff03 RP |
421 | |
422 | ||
6b583720 RP |
423 | ###################################################################### |
424 | ||
8d5d0e11 | 425 | mostlyclean: |
3f97524f | 426 | -rm -f *.o *~ \#* core binutils.?? binutils.??? |
8d5d0e11 | 427 | clean: mostlyclean |
f50af42b | 428 | -rm -f $(PROGS) underscore.c |
8d5d0e11 | 429 | distclean: clean |
eeece52d | 430 | -rm -f Makefile config.status sysdep.h |
8d5d0e11 PB |
431 | realclean: distclean |
432 | -rm -f $(DISTSTUFF) TAGS | |
99a42820 RP |
433 | |
434 | etags tags: TAGS | |
435 | ||
6a3958b2 | 436 | TAGS: force |
bba04d93 | 437 | etags $(INCDIR)/*.h $(srcdir)/*.[hc] |
99a42820 | 438 | |
c83497f5 | 439 | install: all |
238aa238 DZ |
440 | for i in $(PROGS) ; do \ |
441 | $(INSTALL_XFORM) $$i $(bindir)/$$i ; \ | |
99a42820 | 442 | done |
238aa238 DZ |
443 | for i in $(MANPAGES) ; do \ |
444 | $(INSTALL_XFORM1) $(srcdir)/$$i.1 $(man1dir)/$$i.1 ; \ | |
de53632c | 445 | done |
3f97524f DZ |
446 | -if [ -d $(tooldir) ]; then \ |
447 | if [ -d $(tooldir)/bin ] ; then true ; else mkdir $(tooldir)/bin ; fi; \ | |
4f15fb27 | 448 | for i in nm strings strip ar ranlib; do \ |
3f97524f DZ |
449 | rm -f $(tooldir)/bin/$$i; \ |
450 | ln $(bindir)/`t='$(program_transform_name)'; echo $$i | sed -e "" $$t` $(tooldir)/bin/$$i \ | |
451 | || $(INSTALL_PROGRAM) $$i $(tooldir)/bin/$$i; \ | |
452 | done; \ | |
453 | else true; fi | |
c83497f5 | 454 | |
d8e89b6b | 455 | install-info: info |
de53632c | 456 | for i in *.info* ; do \ |
d8e89b6b | 457 | $(INSTALL_DATA) $$i $(infodir)/$$i ; \ |
84396dcf | 458 | done |
99a42820 | 459 | |
d8e89b6b RP |
460 | clean-info: |
461 | -rm -rf *.info* | |
462 | ||
e2fe2df4 | 463 | # Making a dist: |
ee948e4e PB |
464 | # cvs rtag binutils-x-yy ld+utils |
465 | # cvs co -r binutils-x-yy ld+utils | |
e2fe2df4 PB |
466 | # Sanitize |
467 | # cd {HERE}; make dist [-f Makefile.in] | |
468 | ||
f50af42b | 469 | dist: $(DIST_NAME).tar.z |
8539db10 | 470 | |
8d5d0e11 PB |
471 | diststuff: $(DISTSTUFF) |
472 | ||
f50af42b | 473 | $(DIST_NAME).tar.z: |
b27d2046 | 474 | cd ../..; rm -f $(DIST_NAME); ln -s devo $(DIST_NAME) |
8d5d0e11 PB |
475 | make diststuff -f Makefile.in |
476 | cd ../ld; make diststuff -f Makefile.in | |
3f97524f | 477 | cd ../gprof; make diststuff -f Makefile.in |
7f7b0a77 | 478 | cd ../texinfo; mv texinfo.tex ..; rm -rf *; mv ../texinfo.tex . |
2e8adbd7 PB |
479 | # Take out texinfo from configurable dirs |
480 | mv ../configure.in tmp; \ | |
481 | sed -e '/^host_tools=/s/texinfo //' <tmp >../configure.in; rm tmp | |
482 | cd ..; chmod og=u `find . -print` | |
f50af42b | 483 | cd ../..; tar chf - $(DIST_NAME) | gzip >$(DIST_NAME).tar.z |
b27d2046 | 484 | rm -rf ../../$(DIST_NAME) |
8539db10 | 485 | |
99a42820 RP |
486 | #----------------------------------------------------------------------------- |
487 | # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT | |
488 | # | |
489 | # 'VERSION' file must be present and contain a string of the form "x.y" | |
490 | #----------------------------------------------------------------------------- | |
491 | ||
492 | ver960.c: FORCE | |
493 | rm -f ver960.c | |
494 | echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c | |
495 | ||
496 | ||
497 | # Dummy target to force execution of dependent targets. | |
498 | # | |
6a3958b2 | 499 | force: |
99a42820 RP |
500 | |
501 | # Target to uncomment host-specific lines in this makefile. Such lines must | |
502 | # have the following string beginning in column 1: #__<hostname>__# | |
503 | # Original Makefile is backed up as 'Makefile.old'. | |
504 | # | |
505 | # Invoke with: make make HOST=xxx | |
506 | # | |
507 | make: | |
508 | -@if test $(HOST)x = x ; then \ | |
509 | echo '\aSpecify "make make HOST=???"'; \ | |
510 | exit 1; \ | |
511 | fi ; \ | |
512 | grep -s "^#The next line was generated by 'make make'" Makefile; \ | |
513 | if test $$? = 0 ; then \ | |
514 | echo "\aMakefile has already been processed with 'make make'";\ | |
515 | exit 1; \ | |
516 | fi ; \ | |
517 | mv -f Makefile Makefile.old; \ | |
518 | echo "#The next line was generated by 'make make'" >Makefile ; \ | |
519 | echo "HOST=$(HOST)" >>Makefile ; \ | |
520 | echo >>Makefile ; \ | |
521 | sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile | |
522 | ||
f1eb48b6 | 523 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) |
a26878d1 | 524 | $(SHELL) ./config.status |
99a42820 RP |
525 | |
526 | ### Local Variables: *** | |
527 | ### mode:fundamental *** | |
528 | ### page-delimiter: "^#\f" *** | |
529 | ### End: *** | |
530 | ### end of file |