1 # Makefile for GNU binary-file utilities
2 # Copyright (C) 1989-1992 Free Software Foundation, Inc.
4 # This file is part of GNU binutils.
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.
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.
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.
24 program_transform_name
=
25 exec_prefix = $(prefix)
26 bindir = $(exec_prefix)/bin
27 libdir = $(exec_prefix)/lib
28 tooldir
= $(libdir)/$(target_alias
)
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
48 INSTALL_PROGRAM
= $(INSTALL
)
49 INSTALL_DATA
= $(INSTALL
)
61 BISON
= `if [ -f ../byacc/byacc ] ; then echo ../byacc/byacc ; else echo byacc ; fi`
62 # Comment these out if using lex.
64 LEX
= `if [ -f ../flex/flex ] ; then echo ../flex/flex -S../flex/flex.skel ; else echo flex ; fi`
66 # Distribution version
69 DIST_NAME
=binutils-
${VERSION}
71 version
=`./../gcc/gcc -dumpversion`
73 # Where to find texinfo.tex to format docn with TeX
74 TEXIDIR
= $(srcdir)/..
/texinfo
/fsf
76 MANPAGES
= ar nm objdump ranlib size
strip
79 # these two are almost the same program
83 # copy and strip should be the same program
87 # These should all be the same program too.
92 PROGS
= $(SIZE_PROG
) $(OBJDUMP_PROG
) $(NM_PROG
) $(AR_PROG
) $(STRIP_PROG
) $(RANLIB_PROG
)
93 STAGESTUFF
= $(PROGS
) *.o
94 # Files that can be generated, but should be in the distribution.
95 DISTSTUFF
=arparse.c arlex.c binutils.mm
97 BASEDIR
= $(srcdir)/..
99 OPCODEDIR
= .
/..
/opcodes
101 #### host and target dependant Makefile fragments come in here.
104 INCLUDES
= -I.
-I
$(srcdir) -I
$(BASEDIR
)/include -I
$(BASEDIR
)/bfd
107 $(CC
) -c
$(CFLAGS
) $(INCLUDES
) $(HDEFINES
) $(TDEFINES
) $<
109 # When adding .o files, to make VPATH work in Sun Make, you have to
110 # also add a foo.o: foo.c line at the bottom of the file.
111 DISASMS
= m68k-pinsn.o i960-pinsn.o i386-pinsn.o sparc-pinsn.o am29k-pinsn.o
114 ## Random definitions
115 # Hopefully all these may be flushed once we get configuration down pat.
117 # alloca only needed for systems which don't have it and when cc != gcc.
120 # nm tries to malloc enough space for the string table. The old GNU malloc
121 # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might
122 # fail unnecessarily. I've also seen some Unix malloc's fail, even when
123 # there is enough memory. So use the new GNU malloc.
126 # Use the GNU getopt unless you have problems with it.
127 # The IRIS version could probably benefit from being assembled with
128 # libmalloc rather than the ordinary malloc.
129 LIBIBERTY
= .
/..
/libiberty
/libiberty.a
131 # Code shared by all the binutils.
132 BULIBS
= bucomm.o version.o filemode.o
134 ADDL_LIBS
= $(MALLOC
) $(BULIBS
) $(BFD
) $(LIBIBERTY
)
136 BFD
= $(LIBDIR
)/libbfd.a
137 OPCODES
= $(OPCODEDIR
)/libopcodes.a
141 all: $(ADDL_LIBS
) $(PROGS
)
144 /bin
/sh
$(srcdir)/sanity.sh .
147 /bin
/sh
$(srcdir)/sanity.sh
$(bindir)
151 #$(BFD):$(LIBDIR)/../common/*.c
152 # (cd $(LIBDIR); make)
154 $(SIZE_PROG
): $(ADDL_LIBS
) size.o
$(BFD
)
155 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(SIZE_PROG
) size.o
$(ADDL_LIBS
) $(LOADLIBES
)
157 $(COPY_PROG
): $(ADDL_LIBS
) copy.o not-strip.o
$(BFD
)
158 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(COPY_PROG
) copy.o not-strip.o
$(ADDL_LIBS
) $(LOADLIBES
)
160 $(STRIP_PROG
): $(ADDL_LIBS
) copy.o is-strip.o
$(BFD
)
161 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(STRIP_PROG
) copy.o is-strip.o
$(ADDL_LIBS
) $(LOADLIBES
)
163 $(NM_PROG
): $(ADDL_LIBS
) nm.o
$(BFD
)
164 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(NM_PROG
) nm.o
$(ADDL_LIBS
) $(LOADLIBES
)
166 $(OBJDUMP_PROG
): $(ADDL_LIBS
) size.o objdump.o
$(DISASMS
) $(BFD
) $(OPCODES
)
167 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(OBJDUMP_PROG
) objdump.o
$(DISASMS
) $(ADDL_LIBS
) $(OPCODES
) $(LOADLIBES
)
170 $(BISON
) $(BISONFLAGS
) $(srcdir)/arparse.y
171 -mv y.tab.c arparse.c
172 -mv y.tab.h arparse.h
176 $(LEX
) $(LEX_OPTIONS
) $(srcdir)/arlex.l
179 $(AR_PROG
): $(ADDL_LIBS
) ar.o arparse.o arlex.o not-ranlib.o
$(BFD
) arsup.o
180 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(AR_PROG
) ar.o arparse.o arlex.o arsup.o not-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
182 $(RANLIB_PROG
): $(ADDL_LIBS
) ar.o is-ranlib.o arparse.o arlex.o arsup.o
$(BFD
)
183 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(RANLIB_PROG
) ar.o arparse.o arlex.o arsup.o is-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
185 # This rule creates a single binary that switches between ar and ranlib
186 # by looking at argv[0]. Use this kludge to save some disk space.
187 # However, you have to install things by hand.
188 # (That is after 'make install', replace the installed ranlib by a link to ar.)
190 # Alternatively, you can install ranlib.sh as ranlib.
192 ar_with_ranlib
: $(ADDL_LIBS
) ar.o maybe-ranlib.o
$(BFD
)
193 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(AR_PROG
) ar.o maybe-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
194 -rm -f
$(RANLIB_PROG
)
195 -ln
$(AR_PROG
) $(RANLIB_PROG
)
197 # copy and strip in one binary that uses argv[0] to decide its action.
199 copy_with_strip
: $(ADDL_LIBS
) copy.o maybe-strip.o
$(BFD
)
200 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(COPY_PROG
) copy.o maybe-strip.o
$(ADDL_LIBS
) $(LOADLIBES
)
202 -ln
$(COPY_PROG
) $(STRIP_PROG
)
206 - mv
-f
$(STAGESTUFF
) stage1
210 - mv
-f
$(STAGESTUFF
) stage2
214 - mv
-f
$(STAGESTUFF
) stage3
219 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
222 - (cd stage1
; mv
-f
* ..
)
226 - (cd stage2
; mv
-f
* ..
)
230 - (cd stage3
; mv
-f
* ..
)
233 ######################################################################
234 # DOCUMENTATION TARGETS
236 binutils.
dvi: $(srcdir)/binutils.texi
237 TEXINPUTS
=${TEXIDIR}:.
:$$TEXINPUTS tex $(srcdir)/binutils.texi
239 TEXINPUTS
=${TEXIDIR}:.
:$$TEXINPUTS tex $(srcdir)/binutils.texi
241 # info file for online browsing
242 binutils.
info: $(srcdir)/binutils.texi
243 $(MAKEINFO
) -o binutils.
info $(srcdir)/binutils.texi
245 # different targets for -ms, -mm, -me
246 # Try to use a recent texi2roff. v2 was put on prep in jan91.
247 # If you want an index, see texi2roff doc for postprocessing
248 # and add -i to texi2roff invocations below.
249 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
250 # correspondint -e lines when later texi2roff's are current)
251 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
252 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
253 # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
254 # + @alphaenumerate is ridiculously new, turned into @enumerate
257 binutils.ms
: $(srcdir)/binutils.texi
258 sed
-e
'/\\input texinfo/d' \
259 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
260 -e
'/^@ifinfo/,/^@end ifinfo/d' \
264 -e
's/^@alphaenumerate/@enumerate/g' \
265 -e
's/^@end alphaenumerate/@end enumerate/g' \
266 $(srcdir)/binutils.texi | \
268 sed
-e
's/---/\\(em/g' \
272 # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
273 # try leaving them in
274 binutils.mm
: $(srcdir)/binutils.texi
275 sed
-e
'/\\input texinfo/d' \
276 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
277 -e
'/^@ifinfo/,/^@end ifinfo/d' \
282 -e
's/^@alphaenumerate/@enumerate/g' \
283 -e
's/^@end alphaenumerate/@end enumerate/g' \
284 $(srcdir)/binutils.texi | \
286 sed
-e
's/---/\\(em/g' \
290 binutils.me
: $(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' \
297 -e
's/^@alphaenumerate/@enumerate/g' \
298 -e
's/^@end alphaenumerate/@end enumerate/g' \
299 $(srcdir)/binutils.texi | \
301 sed
-e
's/---/\\(em/g' \
305 ######################################################################
308 -rm -f
*.o
*~ \
#* core binutils.?? binutils.???
312 -rm -f Makefile config.status
314 -rm -f
$(DISTSTUFF
) TAGS
319 etags
$(INCDIR
)/*.h
$(BFDSRC
)/*.
[hc
] *.
[hc
]
322 -parent
=`echo $(bindir)|sed -e 's@/[^/]*$$@@'`; \
323 if
[ -d
$$parent ] ; then true
; else mkdir
$$parent ; fi
324 -if
[ -d
$(bindir) ] ; then true
; else mkdir
$(bindir) ; fi
325 -for i in
$(PROGS
) ; do \
326 $(INSTALL_PROGRAM
) $$i $(bindir)/`t='$(program_transform_name)'; echo $$i | sed -e "" $$t` ; \
328 -parent
=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \
329 if
[ -d
$$parent ] ; then true
; else mkdir
$$parent ; fi
330 -if
[ -d
$(man1dir) ] ; then true
; else mkdir
$(man1dir) ; fi
331 -for i in
$(MANPAGES
) ; do \
332 $(INSTALL_DATA
) $(srcdir)/$$i.1 $(man1dir)/`t='$(program_transform_name)'; echo $$i | sed -e "" $$t`.1 ; \
334 -if
[ -d
$(tooldir
) ]; then \
335 if
[ -d
$(tooldir
)/bin
] ; then true
; else mkdir
$(tooldir
)/bin
; fi
; \
336 for i in nm
strip ; do \
337 rm -f
$(tooldir
)/bin
/$$i; \
338 ln
$(bindir)/`t='$(program_transform_name)'; echo $$i | sed -e "" $$t` $(tooldir
)/bin
/$$i \
339 ||
$(INSTALL_PROGRAM
) $$i $(tooldir
)/bin
/$$i; \
344 -parent
=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \
345 if
[ -d
$$parent ] ; then true
; else mkdir
$$parent ; fi
346 -if
[ -d
$(infodir) ] ; then true
; else mkdir
$(infodir) ; fi
347 for i in
*.
info* ; do \
348 $(INSTALL_DATA
) $$i $(infodir)/$$i ; \
354 dist: $(DIST_NAME
).
tar.Z
356 diststuff
: $(DISTSTUFF
)
359 cd ..
/..
; rm -f
$(DIST_NAME
); ln
-s devo
$(DIST_NAME
)
360 make diststuff
-f Makefile.in
361 cd ..
/ld; make diststuff
-f Makefile.in
362 cd ..
/gprof
; make diststuff
-f Makefile.in
363 cd ..
/..
; tar chf
- $(DIST_NAME
) | compress
>$(DIST_NAME
).
tar.Z
364 rm -rf ..
/..
/$(DIST_NAME
)
366 # These get around a bug in Sun Make in SunOS 4.1.1
368 am29k-pinsn.o
: am29k-pinsn.c
373 filemode.o
:filemode.c
377 i960-pinsn.o
: i960-pinsn.c
378 is-ranlib.o
:is-ranlib.c
379 is-strip.o
:is-strip.c
380 m68k-pinsn.o
: m68k-pinsn.c
381 maybe-ranlib.o
:maybe-ranlib.c
382 maybe-strip.o
:maybe-strip.c
384 not-ranlib.o
:not-ranlib.c
385 not-strip.o
:not-strip.c
388 sparc-pinsn.o
: sparc-pinsn.c
389 i386-pinsn.o
: i386-pinsn.c
391 version.o
: $(srcdir)/version.c
392 $(CC
) $(CFLAGS
) $(INCLUDES
) $(HDEFINES
) $(TDEFINES
) -DVERSION
='"$(VERSION)"' -c
$(srcdir)/version.c
394 #-----------------------------------------------------------------------------
395 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
397 # 'VERSION' file must be present and contain a string of the form "x.y"
398 #-----------------------------------------------------------------------------
402 echo
"char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
405 # Dummy target to force execution of dependent targets.
409 # Target to uncomment host-specific lines in this makefile. Such lines must
410 # have the following string beginning in column 1: #__<hostname>__#
411 # Original Makefile is backed up as 'Makefile.old'.
413 # Invoke with: make make HOST=xxx
416 -@if
test $(HOST
)x
= x
; then \
417 echo
'\aSpecify "make make HOST=???"'; \
420 grep
-s
"^#The next line was generated by 'make make'" Makefile
; \
421 if
test $$?
= 0 ; then \
422 echo
"\aMakefile has already been processed with 'make make'";\
425 mv
-f Makefile Makefile.old
; \
426 echo
"#The next line was generated by 'make make'" >Makefile
; \
427 echo
"HOST=$(HOST)" >>Makefile
; \
429 sed
"s/^#__$(HOST)__#//" < Makefile.old
>>Makefile
431 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
432 $(SHELL
) .
/config.status
434 ### Local Variables: ***
435 ### mode:fundamental ***
436 ### page-delimiter: "^#\f" ***