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