Add support for 386 disassembly
[deliverable/binutils-gdb.git] / binutils / Makefile.in
1 # Makefile for GNU binary-file utilities
2 # Copyright (C) 1989-1992 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 #$Id$
21
22 srcdir = .
23
24 prefix = /usr/local
25
26 program_prefix =
27 exec_prefix = $(prefix)
28 bindir = $(exec_prefix)/bin
29 libdir = $(exec_prefix)/lib
30 tooldir = $(libdir)
31
32 datadir = $(prefix)/lib
33 mandir = $(prefix)/man
34 man1dir = $(mandir)/man1
35 man2dir = $(mandir)/man2
36 man3dir = $(mandir)/man3
37 man4dir = $(mandir)/man4
38 man5dir = $(mandir)/man5
39 man6dir = $(mandir)/man6
40 man7dir = $(mandir)/man7
41 man8dir = $(mandir)/man8
42 man9dir = $(mandir)/man9
43 infodir = $(prefix)/info
44 includedir = $(prefix)/include
45 docdir = $(datadir)/doc
46
47 SHELL = /bin/sh
48
49 INSTALL = install -c
50 INSTALL_PROGRAM = $(INSTALL)
51 INSTALL_DATA = $(INSTALL)
52
53 AR = ar
54 AR_FLAGS = qv
55 CFLAGS = -g
56 BISON = bison -y
57 FLEX = flex
58 MAKEINFO = makeinfo
59 RANLIB = ranlib
60 BISONFLAGS = -tvd
61 TEXI2ROFF=texi2roff
62
63 # Distribution version
64 VERSION=1.96
65 # Distribution name
66 DIST_NAME=binutils-${VERSION}
67
68 version=`./../gcc/gcc -dumpversion`
69
70 # Where to find texinfo.tex to format docn with TeX
71 TEXIDIR = $(srcdir)/../texinfo/fsf
72
73 MANPAGES= ar.1 nm.1 objdump.1 ranlib.1 size.1 strip.1
74
75 #CC=gcc -Wall
76 # these two are almost the same program
77 AR_PROG=ar
78 RANLIB_PROG=ranlib
79
80 # copy and strip should be the same program
81 COPY_PROG=copy
82 STRIP_PROG=strip
83
84 # These should all be the same program too.
85 SIZE_PROG=size
86 NM_PROG=nm
87 OBJDUMP_PROG=objdump
88
89 PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRIP_PROG) $(RANLIB_PROG)
90 STAGESTUFF = $(PROGS) *.o
91
92 BASEDIR = $(srcdir)/..
93 LIBDIR = ./../bfd
94
95 #### host and target dependant Makefile fragments come in here.
96 ###
97
98 INCDIR = $(BASEDIR)/include
99
100 .c.o:
101 $(CC) -c $(CFLAGS) -I. -I$(srcdir) -I$(INCDIR) $(HDEFINES) $(TDEFINES) $<
102
103 # When adding .o files, to make VPATH work in Sun Make, you have to
104 # also add a foo.o: foo.c line at the bottom of the file.
105 DISASMS = m68k-pinsn.o i960-pinsn.o i386-pinsn.o sparc-pinsn.o am29k-pinsn.o
106
107 #\f
108 ## Random definitions
109 # Hopefully all these may be flushed once we get configuration down pat.
110
111 # alloca only needed for systems which don't have it and when cc != gcc.
112 # ALLOCA = alloca.o
113
114 # nm tries to malloc enough space for the string table. The old GNU malloc
115 # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might
116 # fail unnecessarily. I've also seen some Unix malloc's fail, even when
117 # there is enough memory. So use the new GNU malloc.
118 # MALLOC = gmalloc.o
119
120 # Use the GNU getopt unless you have problems with it.
121 # The IRIS version could probably benefit from being assembled with
122 # libmalloc rather than the ordinary malloc.
123 LIBIBERTY = ./../libiberty/libiberty.a
124
125 # Code shared by all the binutils.
126 BULIBS = bucomm.o version.o filemode.o
127
128 ADDL_LIBS = $(MALLOC) $(BULIBS) $(BFD) $(LIBIBERTY)
129
130 BFD = $(LIBDIR)/libbfd.a
131 #\f
132 ## The rules
133
134 all: $(ADDL_LIBS) $(PROGS)
135
136 check:
137
138 info: binutils.info
139
140 #$(BFD):$(LIBDIR)/../common/*.c
141 # (cd $(LIBDIR); make)
142
143 $(SIZE_PROG): $(ADDL_LIBS) size.o $(BFD)
144 $(CC) $(LDFLAGS) $(CFLAGS) -o $(SIZE_PROG) size.o $(ADDL_LIBS) $(LOADLIBES)
145
146 $(COPY_PROG): $(ADDL_LIBS) copy.o not-strip.o $(BFD)
147 $(CC) $(LDFLAGS) $(CFLAGS) -o $(COPY_PROG) copy.o not-strip.o $(ADDL_LIBS) $(LOADLIBES)
148
149 $(STRIP_PROG): $(ADDL_LIBS) copy.o is-strip.o $(BFD)
150 $(CC) $(LDFLAGS) $(CFLAGS) -o $(STRIP_PROG) copy.o is-strip.o $(ADDL_LIBS) $(LOADLIBES)
151
152 $(NM_PROG): $(ADDL_LIBS) nm.o $(BFD)
153 $(CC) $(LDFLAGS) $(CFLAGS) -o $(NM_PROG) nm.o $(ADDL_LIBS) $(LOADLIBES)
154
155 $(OBJDUMP_PROG): $(ADDL_LIBS) size.o objdump.o $(DISASMS) $(BFD)
156 $(CC) $(LDFLAGS) $(CFLAGS) -o $(OBJDUMP_PROG) objdump.o $(DISASMS) $(ADDL_LIBS) $(LOADLIBES)
157
158 arparse.c:arparse.y
159 $(BISON) $(BISONFLAGS) $(VPATH)/arparse.y
160 mv y.tab.c arparse.c
161 mv y.tab.h arparse.h
162
163
164 arlex.c:arlex.l
165 $(FLEX) -I -Cem -t $(VPATH)/arlex.l >arlex.c
166
167 $(AR_PROG): $(ADDL_LIBS) ar.o arparse.o arlex.o not-ranlib.o $(BFD) arsup.o
168 $(CC) $(LDFLAGS) $(CFLAGS) -o $(AR_PROG) ar.o arparse.o arlex.o arsup.o not-ranlib.o $(ADDL_LIBS) $(LOADLIBES)
169
170 $(RANLIB_PROG): $(ADDL_LIBS) ar.o is-ranlib.o arparse.o arlex.o arsup.o $(BFD)
171 $(CC) $(LDFLAGS) $(CFLAGS) -o $(RANLIB_PROG) ar.o arparse.o arlex.o arsup.o is-ranlib.o $(ADDL_LIBS) $(LOADLIBES)
172
173 # This rule creates a single binary that switches between ar and ranlib
174 # by looking at argv[0]. Use this kludge to save some disk space.
175 # However, you have to install things by hand.
176 # (That is after 'make install', replace the installed ranlib by a link to ar.)
177
178 # Alternatively, you can install ranlib.sh as ranlib.
179
180 ar_with_ranlib: $(ADDL_LIBS) ar.o maybe-ranlib.o $(BFD)
181 $(CC) $(LDFLAGS) $(CFLAGS) -o $(AR_PROG) ar.o maybe-ranlib.o $(ADDL_LIBS) $(LOADLIBES)
182 -rm -f $(RANLIB_PROG)
183 -ln $(AR_PROG) $(RANLIB_PROG)
184
185 # copy and strip in one binary that uses argv[0] to decide its action.
186
187 copy_with_strip: $(ADDL_LIBS) copy.o maybe-strip.o $(BFD)
188 $(CC) $(LDFLAGS) $(CFLAGS) -o $(COPY_PROG) copy.o maybe-strip.o $(ADDL_LIBS) $(LOADLIBES)
189 -rm -f $(STRIP_PROG)
190 -ln $(COPY_PROG) $(STRIP_PROG)
191
192 stage1: force
193 - mkdir stage1
194 - mv -f $(STAGESTUFF) stage1
195
196 stage2: force
197 - mkdir stage2
198 - mv -f $(STAGESTUFF) stage2
199
200 stage3: force
201 - mkdir stage3
202 - mv -f $(STAGESTUFF) stage3
203
204 against=stage2
205
206 comparison: force
207 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
208
209 de-stage1: force
210 - (cd stage1 ; mv -f * ..)
211 - rmdir stage1
212
213 de-stage2: force
214 - (cd stage2 ; mv -f * ..)
215 - rmdir stage2
216
217 de-stage3: force
218 - (cd stage3 ; mv -f * ..)
219 - rmdir stage3
220
221 ######################################################################
222 # DOCUMENTATION TARGETS
223 # TeX output
224 binutils.dvi: $(srcdir)/binutils.texi
225 TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex $(srcdir)/binutils.texi
226 texindex binutils.??
227 TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex $(srcdir)/binutils.texi
228
229 # info file for online browsing
230 binutils.info: $(srcdir)/binutils.texi
231 $(MAKEINFO) -o binutils.info $(srcdir)/binutils.texi
232
233 # different targets for -ms, -mm, -me
234 # Try to use a recent texi2roff. v2 was put on prep in jan91.
235 # If you want an index, see texi2roff doc for postprocessing
236 # and add -i to texi2roff invocations below.
237 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
238 # correspondint -e lines when later texi2roff's are current)
239 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
240 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
241 # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
242 # + @alphaenumerate is ridiculously new, turned into @enumerate
243
244 # roff output (-ms)
245 binutils.ms: $(srcdir)/binutils.texi
246 sed -e '/\\input texinfo/d' \
247 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
248 -e '/^@ifinfo/,/^@end ifinfo/d' \
249 -e '/^@c/d' \
250 -e 's/{.*,,/{/' \
251 -e 's/@ / /g' \
252 -e 's/^@alphaenumerate/@enumerate/g' \
253 -e 's/^@end alphaenumerate/@end enumerate/g' \
254 $(srcdir)/binutils.texi | \
255 $(TEXI2ROFF) -ms | \
256 sed -e 's/---/\\(em/g' \
257 >binutils.ms
258
259 # roff output (-mm)
260 # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
261 # try leaving them in
262 binutils.mm: $(srcdir)/binutils.texi
263 sed -e '/\\input texinfo/d' \
264 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
265 -e '/^@ifinfo/,/^@end ifinfo/d' \
266 -e '/^@c/d' \
267 -e 's/{.*,,/{/' \
268 -e '/@noindent/d' \
269 -e 's/@ / /g' \
270 -e 's/^@alphaenumerate/@enumerate/g' \
271 -e 's/^@end alphaenumerate/@end enumerate/g' \
272 $(srcdir)/binutils.texi | \
273 $(TEXI2ROFF) -mm | \
274 sed -e 's/---/\\(em/g' \
275 >binutils.mm
276
277 # roff output (-me)
278 binutils.me: $(srcdir)/binutils.texi
279 sed -e '/\\input texinfo/d' \
280 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
281 -e '/^@ifinfo/,/^@end ifinfo/d' \
282 -e '/^@c/d' \
283 -e 's/{.*,,/{/' \
284 -e 's/@ / /g' \
285 -e 's/^@alphaenumerate/@enumerate/g' \
286 -e 's/^@end alphaenumerate/@end enumerate/g' \
287 $(srcdir)/binutils.texi | \
288 $(TEXI2ROFF) -me | \
289 sed -e 's/---/\\(em/g' \
290 >binutils.me
291
292
293 ######################################################################
294
295 clean:
296 -rm -f *.o *~ \#* core $(STAGESTUFF) TAGS binutils.?? binutils.???
297
298 etags tags: TAGS
299
300 TAGS: force
301 etags $(INCDIR)/*.h $(BFDSRC)/*.[hc] *.[hc]
302
303 realclean: clean
304 -rm -f $(STAGESTUFF) TAGS
305
306 install: all
307 for i in $(PROGS) ; do \
308 $(INSTALL_PROGRAM) $$i $(bindir)/$(program_prefix)$$i ; \
309 done
310 for i in $(MANPAGES) ; do \
311 $(INSTALL_DATA) $(srcdir)/$$i $(man1dir)/$(program_prefix)$$i ; \
312 done
313
314 install-info: info
315 for i in *.info* ; do \
316 $(INSTALL_DATA) $$i $(infodir)/$$i ; \
317 done
318
319 clean-info:
320 -rm -rf *.info*
321
322 dist: $(DIST_NAME).tar.Z
323
324 $(DIST_NAME).tar.Z:
325 cd ../..; rm -f $(DIST_NAME); ln -s devo $(DIST_NAME)
326 make binutils.mm -f Makefile.in
327 cd ../ld; make ld.mm -f Makefile.in
328 cd ../..; tar chf - $(DIST_NAME) | compress >$(DIST_NAME).tar.Z
329 rm -rf ../../$(DIST_NAME)
330
331 # These get around a bug in Sun Make in SunOS 4.1.1
332 alloca.o:alloca.c
333 am29k-pinsn.o: am29k-pinsn.c
334 ar.o: ar.c
335 bucomm.o: bucomm.c
336 copy.o: copy.c
337 cplus-dem.o:cplus-dem.c
338 filemode.o:filemode.c
339 getopt.o:getopt.c
340 getopt1.o:getopt1.c
341 gmalloc.o:gmalloc.c
342 i960-pinsn.o: i960-pinsn.c
343 is-ranlib.o:is-ranlib.c
344 is-strip.o:is-strip.c
345 m68k-pinsn.o: m68k-pinsn.c
346 maybe-ranlib.o:maybe-ranlib.c
347 maybe-strip.o:maybe-strip.c
348 nm.o: nm.c
349 not-ranlib.o:not-ranlib.c
350 not-strip.o:not-strip.c
351 objdump.o: objdump.c
352 size.o: size.c
353 sparc-pinsn.o: sparc-pinsn.c
354 i386-pinsn.o: i386-pinsn.c
355 strip.o:strip.c
356 version.o: $(srcdir)/version.c
357 $(CC) $(CFLAGS) -I. -I$(srcdir) -I$(INCDIR) $(HDEFINES) $(TDEFINES) -DVERSION='"$(VERSION)"' -c $(srcdir)/version.c
358
359 #-----------------------------------------------------------------------------
360 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
361 #
362 # 'VERSION' file must be present and contain a string of the form "x.y"
363 #-----------------------------------------------------------------------------
364
365 ver960.c: FORCE
366 rm -f ver960.c
367 echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
368
369
370 # Dummy target to force execution of dependent targets.
371 #
372 force:
373
374 # Target to uncomment host-specific lines in this makefile. Such lines must
375 # have the following string beginning in column 1: #__<hostname>__#
376 # Original Makefile is backed up as 'Makefile.old'.
377 #
378 # Invoke with: make make HOST=xxx
379 #
380 make:
381 -@if test $(HOST)x = x ; then \
382 echo '\aSpecify "make make HOST=???"'; \
383 exit 1; \
384 fi ; \
385 grep -s "^#The next line was generated by 'make make'" Makefile; \
386 if test $$? = 0 ; then \
387 echo "\aMakefile has already been processed with 'make make'";\
388 exit 1; \
389 fi ; \
390 mv -f Makefile Makefile.old; \
391 echo "#The next line was generated by 'make make'" >Makefile ; \
392 echo "HOST=$(HOST)" >>Makefile ; \
393 echo >>Makefile ; \
394 sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile
395
396 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
397 $(SHELL) ./config.status
398
399 ### Local Variables: ***
400 ### mode:fundamental ***
401 ### page-delimiter: "^#\f" ***
402 ### End: ***
403 ### end of file
This page took 0.037797 seconds and 4 git commands to generate.