(enum bfd_reloc_code_real): Put simple power-to-two relocs together, and add
[deliverable/binutils-gdb.git] / binutils / Makefile.in
1 # Makefile for GNU binary-file utilities
2 # Copyright (C) 1992, 1993 Free Software Foundation, Inc.
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.
19
20 srcdir = .
21
22 prefix = /usr/local
23
24 program_transform_name =
25 exec_prefix = $(prefix)
26 bindir = $(exec_prefix)/bin
27 libdir = $(exec_prefix)/lib
28 tooldir = $(exec_prefix)/$(target_alias)
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
44
45 SHELL = /bin/sh
46
47 INSTALL = `cd $(srcdir)/..;pwd`/install.sh -c
48 INSTALL_PROGRAM = $(INSTALL)
49 INSTALL_DATA = $(INSTALL)
50 INSTALL_XFORM = $(INSTALL) -t='$(program_tranform_name)'
51 INSTALL_XFORM1 = $(INSTALL_XFORM) -b=.1
52
53 AR = ar
54 AR_FLAGS = qv
55 CFLAGS = -g
56 MAKEINFO = makeinfo
57 TEXI2DVI = texi2dvi
58 RANLIB = ranlib
59 BISONFLAGS = -d
60 TEXI2ROFF=texi2roff
61
62 NM_FOR_TARGET = nm
63 NM = $(NM_FOR_TARGET)
64 SYMLINK = ln -s
65
66 BISON = `if [ -f ../byacc/byacc ] ; then echo ../byacc/byacc ; else echo byacc ; fi`
67 # Comment these out if using lex.
68 LEX_OPTIONS = -I -Cem
69 LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
70
71 # Distribution version
72 VERSION=2.2
73 # Distribution name
74 DIST_NAME=binutils-${VERSION}
75
76 version=`./../gcc/gcc -dumpversion`
77
78 # Where to find texinfo.tex to format docn with TeX
79 TEXIDIR = $(srcdir)/../texinfo/fsf
80
81 MANPAGES= ar nm objdump ranlib size strings strip c++filt objcopy
82
83 #CC=gcc -Wall
84 # these two are almost the same program
85 AR_PROG=ar
86 RANLIB_PROG=ranlib
87
88 # objcopy and strip should be the same program
89 OBJCOPY_PROG=objcopy
90 STRIP_PROG=strip
91
92 STRINGS_PROG=strings
93
94 # These should all be the same program too.
95 SIZE_PROG=size
96 NM_PROG=nm
97 OBJDUMP_PROG=objdump
98
99 # This is the demangler, as a standalone program.
100 DEMANGLER_PROG=c++filt
101
102 PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRINGS_PROG) $(STRIP_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG)
103 STAGESTUFF = $(PROGS) *.o
104 # Files that can be generated, but should be in the distribution.
105 DISTSTUFF=arparse.c arlex.c
106
107 BASEDIR = $(srcdir)/..
108 LIBDIR = ./../bfd
109 OPCODEDIR = ./../opcodes
110
111 #### host and target dependant Makefile fragments come in here.
112 ###
113
114 INCLUDES = -I. -I$(srcdir) -I../bfd -I$(BASEDIR)/include -I$(BASEDIR)/bfd
115
116 .c.o:
117 $(CC) -c $(CFLAGS) $(INCLUDES) $(HDEFINES) $(TDEFINES) $<
118
119 #\f
120 ## Random definitions
121 # Hopefully all these may be flushed once we get configuration down pat.
122
123 # alloca only needed for systems which don't have it and when cc != gcc.
124 # ALLOCA = alloca.o
125
126 # nm tries to malloc enough space for the string table. The old GNU malloc
127 # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might
128 # fail unnecessarily. I've also seen some Unix malloc's fail, even when
129 # there is enough memory. So use the new GNU malloc.
130 # MALLOC = gmalloc.o
131
132 # Use the GNU getopt unless you have problems with it.
133 # The IRIS version could probably benefit from being assembled with
134 # libmalloc rather than the ordinary malloc.
135 LIBIBERTY_SRC_DIR = $(srcdir)/../libiberty
136 LIBIBERTY_BIN_DIR = ./../libiberty
137 LIBIBERTY = $(LIBIBERTY_BIN_DIR)/libiberty.a
138
139 # Code shared by all the binutils.
140 BULIBS = bucomm.o version.o filemode.o
141
142 ADDL_LIBS = $(MALLOC) $(BULIBS) $(BFD) $(LIBIBERTY)
143
144 BFD = $(LIBDIR)/libbfd.a
145 OPCODES = $(OPCODEDIR)/libopcodes.a
146
147 RUNTEST = runtest
148 RUNTESTFLAGS =
149 FLAGS_TO_PASS = \
150 "CC=$(CC)" \
151 "CFLAGS=$(CFLAGS)" \
152 "RUNTEST=$(RUNTEST)" \
153 "RUNTESTFLAGS=$(RUNTESTFLAGS) \
154 SIZE=`if [ -f $$rootme/$(SIZE_PROG) ] ; then echo $$rootme/$(SIZE_PROG) ; else echo $(SIZE_PROG); fi` \
155 OBJCOPY=`if [ -f $$rootme/$(OBJCOPY_PROG) ] ; then echo $$rootme/$(OBJCOPY_PROG) ; else echo $(OBJCOPY_PROG); fi` \
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` \
159 STRINGS=`if [ -f $$rootme/$(STRINGS_PROG) ] ; then echo $$rootme/$(STRINGS_PROG) ; else echo $(STRINGS_PROG); fi` \
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
164 #\f
165 ## The rules
166
167 all: $(ADDL_LIBS) $(PROGS)
168
169 testsuite:
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)); \
174 else true ; fi
175
176 check: force
177 rootme=`pwd`; export rootme; cd testsuite ; \
178 $(MAKE) check $(FLAGS_TO_PASS)
179 # /bin/sh $(srcdir)/sanity.sh .
180
181 installcheck:
182 /bin/sh $(srcdir)/sanity.sh $(bindir)
183
184 info: binutils.info
185
186 dvi: binutils.dvi
187
188 #$(BFD):$(LIBDIR)/../common/*.c
189 # (cd $(LIBDIR); make)
190
191 $(SIZE_PROG): $(ADDL_LIBS) size.o $(BFD)
192 $(CC) $(LDFLAGS) $(CFLAGS) -o $(SIZE_PROG) size.o $(ADDL_LIBS) $(EXTRALIBS)
193
194 $(OBJCOPY_PROG): $(ADDL_LIBS) objcopy.o not-strip.o $(BFD)
195 $(CC) $(LDFLAGS) $(CFLAGS) -o $(OBJCOPY_PROG) objcopy.o not-strip.o $(ADDL_LIBS) $(EXTRALIBS)
196
197 $(STRINGS_PROG): $(ADDL_LIBS) strings.o $(BFD)
198 $(CC) $(LDFLAGS) $(CFLAGS) -o $(STRINGS_PROG) strings.o $(ADDL_LIBS) $(EXTRALIBS)
199
200 $(STRIP_PROG): $(ADDL_LIBS) objcopy.o is-strip.o $(BFD)
201 $(CC) $(LDFLAGS) $(CFLAGS) -o $(STRIP_PROG) objcopy.o is-strip.o $(ADDL_LIBS) $(EXTRALIBS)
202
203 $(NM_PROG): $(ADDL_LIBS) nm.o $(BFD)
204 $(CC) $(LDFLAGS) $(CFLAGS) -o $(NM_PROG) nm.o $(ADDL_LIBS) $(EXTRALIBS)
205
206 $(OBJDUMP_PROG): $(ADDL_LIBS) size.o objdump.o $(BFD) $(OPCODES)
207 $(CC) $(LDFLAGS) $(CFLAGS) -o $(OBJDUMP_PROG) objdump.o $(OPCODES) $(ADDL_LIBS) $(EXTRALIBS)
208
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
213 if [ "`$(NM) dummy.o | grep _xxy_us_dummy ; true`" != "" ]; then \
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
220 cplus-dem.o: $(LIBIBERTY_SRC_DIR)/cplus-dem.c
221 $(CC) -c -DMAIN $(CFLAGS) $(INCLUDES) $(HDEFINES) $(TDEFINES) $(LIBIBERTY_SRC_DIR)/cplus-dem.c
222
223 $(DEMANGLER_PROG): cplus-dem.o $(LIBIBERTY) underscore.o
224 $(CC) $(LDFLAGS) $(CFLAGS) -o $(DEMANGLER_PROG) cplus-dem.o $(LIBIBERTY) $(EXTRALIBS) underscore.o
225
226 arparse.c:arparse.y
227 $(BISON) $(BISONFLAGS) $(srcdir)/arparse.y
228 -mv y.tab.c arparse.c
229 -mv y.tab.h arparse.h
230
231
232 arlex.c: arlex.l
233 $(LEX) $(LEX_OPTIONS) $(srcdir)/arlex.l
234 mv lex.yy.c arlex.c
235
236 $(AR_PROG): $(ADDL_LIBS) ar.o arparse.o arlex.o not-ranlib.o $(BFD) arsup.o
237 $(CC) $(LDFLAGS) $(CFLAGS) -o $(AR_PROG) ar.o arparse.o arlex.o arsup.o not-ranlib.o $(ADDL_LIBS) $(EXTRALIBS)
238
239 $(RANLIB_PROG): $(ADDL_LIBS) ar.o is-ranlib.o arparse.o arlex.o arsup.o $(BFD)
240 $(CC) $(LDFLAGS) $(CFLAGS) -o $(RANLIB_PROG) ar.o arparse.o arlex.o arsup.o is-ranlib.o $(ADDL_LIBS) $(EXTRALIBS)
241
242 # This rule creates a single binary that switches between ar and ranlib
243 # by looking at argv[0]. Use this kludge to save some disk space.
244 # However, you have to install things by hand.
245 # (That is after 'make install', replace the installed ranlib by a link to ar.)
246
247 # Alternatively, you can install ranlib.sh as ranlib.
248
249 ar_with_ranlib: $(ADDL_LIBS) ar.o maybe-ranlib.o $(BFD)
250 $(CC) $(LDFLAGS) $(CFLAGS) -o $(AR_PROG) ar.o maybe-ranlib.o $(ADDL_LIBS) $(EXTRALIBS)
251 -rm -f $(RANLIB_PROG)
252 -ln $(AR_PROG) $(RANLIB_PROG)
253
254 # objcopy and strip in one binary that uses argv[0] to decide its action.
255
256 objcopy_with_strip: $(ADDL_LIBS) objcopy.o maybe-strip.o $(BFD)
257 $(CC) $(LDFLAGS) $(CFLAGS) -o $(OBJCOPY_PROG) objcopy.o maybe-strip.o $(ADDL_LIBS) $(EXTRALIBS)
258 -rm -f $(STRIP_PROG)
259 -ln $(OBJCOPY_PROG) $(STRIP_PROG)
260
261 stage1: force
262 - mkdir stage1
263 - mv -f $(STAGESTUFF) stage1
264
265 stage2: force
266 - mkdir stage2
267 - mv -f $(STAGESTUFF) stage2
268
269 stage3: force
270 - mkdir stage3
271 - mv -f $(STAGESTUFF) stage3
272
273 against=stage2
274
275 comparison: force
276 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
277
278 de-stage1: force
279 - (cd stage1 ; mv -f * ..)
280 - rmdir stage1
281
282 de-stage2: force
283 - (cd stage2 ; mv -f * ..)
284 - rmdir stage2
285
286 de-stage3: force
287 - (cd stage3 ; mv -f * ..)
288 - rmdir stage3
289
290 ######################################################################
291 # DOCUMENTATION TARGETS
292 # TeX output
293 binutils.dvi: $(srcdir)/binutils.texi
294 $(TEXI2DVI) $(srcdir)/binutils.texi
295
296 # info file for online browsing
297 binutils.info: $(srcdir)/binutils.texi
298 $(MAKEINFO) -o binutils.info $(srcdir)/binutils.texi
299
300 # different targets for -ms, -mm, -me
301 # Try to use a recent texi2roff. v2 was put on prep in jan91.
302 # If you want an index, see texi2roff doc for postprocessing
303 # and add -i to texi2roff invocations below.
304 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
305 # correspondint -e lines when later texi2roff's are current)
306 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
307 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
308 # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
309 # + @alphaenumerate is ridiculously new, turned into @enumerate
310
311 # roff output (-ms)
312 binutils.ms: $(srcdir)/binutils.texi
313 sed -e '/\\input texinfo/d' \
314 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
315 -e '/^@ifinfo/,/^@end ifinfo/d' \
316 -e '/^@c/d' \
317 -e 's/{.*,,/{/' \
318 -e 's/@ / /g' \
319 -e 's/^@alphaenumerate/@enumerate/g' \
320 -e 's/^@end alphaenumerate/@end enumerate/g' \
321 $(srcdir)/binutils.texi | \
322 $(TEXI2ROFF) -ms | \
323 sed -e 's/---/\\(em/g' \
324 >binutils.ms
325
326 # roff output (-mm)
327 # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
328 # try leaving them in
329 binutils.mm: $(srcdir)/binutils.texi
330 sed -e '/\\input texinfo/d' \
331 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
332 -e '/^@ifinfo/,/^@end ifinfo/d' \
333 -e '/^@c/d' \
334 -e 's/{.*,,/{/' \
335 -e '/@noindent/d' \
336 -e 's/@ / /g' \
337 -e 's/^@alphaenumerate/@enumerate/g' \
338 -e 's/^@end alphaenumerate/@end enumerate/g' \
339 $(srcdir)/binutils.texi | \
340 $(TEXI2ROFF) -mm | \
341 sed -e 's/---/\\(em/g' \
342 >binutils.mm
343
344 # roff output (-me)
345 binutils.me: $(srcdir)/binutils.texi
346 sed -e '/\\input texinfo/d' \
347 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
348 -e '/^@ifinfo/,/^@end ifinfo/d' \
349 -e '/^@c/d' \
350 -e 's/{.*,,/{/' \
351 -e 's/@ / /g' \
352 -e 's/^@alphaenumerate/@enumerate/g' \
353 -e 's/^@end alphaenumerate/@end enumerate/g' \
354 $(srcdir)/binutils.texi | \
355 $(TEXI2ROFF) -me | \
356 sed -e 's/---/\\(em/g' \
357 >binutils.me
358
359
360 ######################################################################
361
362 mostlyclean:
363 -rm -f *.o *~ \#* core binutils.?? binutils.???
364 clean: mostlyclean
365 -rm -f $(PROGS) underscore.c
366 distclean: clean
367 -rm -f Makefile config.status sysdep.h
368 realclean: distclean
369 -rm -f $(DISTSTUFF) TAGS
370
371 etags tags: TAGS
372
373 TAGS: force
374 etags $(INCDIR)/*.h $(BFDSRC)/*.[hc] *.[hc]
375
376 install: all
377 for i in $(PROGS) ; do \
378 $(INSTALL_XFORM) $$i $(bindir)/$$i ; \
379 done
380 for i in $(MANPAGES) ; do \
381 $(INSTALL_XFORM1) $(srcdir)/$$i.1 $(man1dir)/$$i.1 ; \
382 done
383 -if [ -d $(tooldir) ]; then \
384 if [ -d $(tooldir)/bin ] ; then true ; else mkdir $(tooldir)/bin ; fi; \
385 for i in nm strings strip ar ranlib; do \
386 rm -f $(tooldir)/bin/$$i; \
387 ln $(bindir)/`t='$(program_transform_name)'; echo $$i | sed -e "" $$t` $(tooldir)/bin/$$i \
388 || $(INSTALL_PROGRAM) $$i $(tooldir)/bin/$$i; \
389 done; \
390 else true; fi
391
392 install-info: info
393 for i in *.info* ; do \
394 $(INSTALL_DATA) $$i $(infodir)/$$i ; \
395 done
396
397 clean-info:
398 -rm -rf *.info*
399
400 # Making a dist:
401 # cvs rtag binutils-x-yy ld+utils
402 # cvs co -r binutils-x-yy ld+utils
403 # Sanitize
404 # cd {HERE}; make dist [-f Makefile.in]
405
406 dist: $(DIST_NAME).tar.z
407
408 diststuff: $(DISTSTUFF)
409
410 $(DIST_NAME).tar.z:
411 cd ../..; rm -f $(DIST_NAME); ln -s devo $(DIST_NAME)
412 make diststuff -f Makefile.in
413 cd ../ld; make diststuff -f Makefile.in
414 cd ../gprof; make diststuff -f Makefile.in
415 cd ../texinfo; mv texinfo.tex ..; rm -rf *; mv ../texinfo.tex .
416 # Take out texinfo from configurable dirs
417 mv ../configure.in tmp; \
418 sed -e '/^host_tools=/s/texinfo //' <tmp >../configure.in; rm tmp
419 cd ..; chmod og=u `find . -print`
420 cd ../..; tar chf - $(DIST_NAME) | gzip >$(DIST_NAME).tar.z
421 rm -rf ../../$(DIST_NAME)
422
423 # These get around a bug in Sun Make in SunOS 4.1.1
424 alloca.o:alloca.c
425 ar.o: ar.c
426 arsup.o: arsup.c
427 bucomm.o: bucomm.c
428 objcopy.o: objcopy.c
429 filemode.o:filemode.c
430 getopt.o:getopt.c
431 getopt1.o:getopt1.c
432 gmalloc.o:gmalloc.c
433 is-ranlib.o:is-ranlib.c
434 is-strip.o:is-strip.c
435 maybe-ranlib.o:maybe-ranlib.c
436 maybe-strip.o:maybe-strip.c
437 nm.o: nm.c
438 not-ranlib.o:not-ranlib.c
439 not-strip.o:not-strip.c
440 objdump.o: objdump.c
441 size.o: size.c
442 strings.o:strings.c
443 strip.o:strip.c
444 version.o: $(srcdir)/version.c
445 $(CC) $(CFLAGS) $(INCLUDES) $(HDEFINES) $(TDEFINES) -DVERSION='"$(VERSION)"' -c $(srcdir)/version.c
446
447 #-----------------------------------------------------------------------------
448 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
449 #
450 # 'VERSION' file must be present and contain a string of the form "x.y"
451 #-----------------------------------------------------------------------------
452
453 ver960.c: FORCE
454 rm -f ver960.c
455 echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
456
457
458 # Dummy target to force execution of dependent targets.
459 #
460 force:
461
462 # Target to uncomment host-specific lines in this makefile. Such lines must
463 # have the following string beginning in column 1: #__<hostname>__#
464 # Original Makefile is backed up as 'Makefile.old'.
465 #
466 # Invoke with: make make HOST=xxx
467 #
468 make:
469 -@if test $(HOST)x = x ; then \
470 echo '\aSpecify "make make HOST=???"'; \
471 exit 1; \
472 fi ; \
473 grep -s "^#The next line was generated by 'make make'" Makefile; \
474 if test $$? = 0 ; then \
475 echo "\aMakefile has already been processed with 'make make'";\
476 exit 1; \
477 fi ; \
478 mv -f Makefile Makefile.old; \
479 echo "#The next line was generated by 'make make'" >Makefile ; \
480 echo "HOST=$(HOST)" >>Makefile ; \
481 echo >>Makefile ; \
482 sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile
483
484 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
485 $(SHELL) ./config.status
486
487 ### Local Variables: ***
488 ### mode:fundamental ***
489 ### page-delimiter: "^#\f" ***
490 ### End: ***
491 ### end of file
This page took 0.039743 seconds and 4 git commands to generate.