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
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
)
59 BISON
= `if [ -f ../byacc/byacc ] ; then echo ../byacc/byacc ; else echo byacc ; fi`
60 # Comment these out if using lex.
62 LEX
= `if [ -f ../flex/flex ] ; then echo ../flex/flex -S../flex/flex.skel ; else echo flex ; fi`
64 # Distribution version
67 DIST_NAME
=binutils-
${VERSION}
69 version
=`./../gcc/gcc -dumpversion`
71 # Where to find texinfo.tex to format docn with TeX
72 TEXIDIR
= $(srcdir)/..
/texinfo
/fsf
74 MANPAGES
= ar nm objdump ranlib size
strip
77 # these two are almost the same program
81 # copy and strip should be the same program
85 # These should all be the same program too.
90 PROGS
= $(SIZE_PROG
) $(OBJDUMP_PROG
) $(NM_PROG
) $(AR_PROG
) $(STRIP_PROG
) $(RANLIB_PROG
)
91 STAGESTUFF
= $(PROGS
) *.o
93 BASEDIR
= $(srcdir)/..
95 OPCODEDIR
= .
/..
/opcodes
97 #### host and target dependant Makefile fragments come in here.
100 INCDIR
= $(BASEDIR
)/include
103 $(CC
) -c
$(CFLAGS
) -I.
-I
$(srcdir) -I
$(INCDIR
) $(HDEFINES
) $(TDEFINES
) $<
105 # When adding .o files, to make VPATH work in Sun Make, you have to
106 # also add a foo.o: foo.c line at the bottom of the file.
107 DISASMS
= m68k-pinsn.o i960-pinsn.o i386-pinsn.o sparc-pinsn.o am29k-pinsn.o
110 ## Random definitions
111 # Hopefully all these may be flushed once we get configuration down pat.
113 # alloca only needed for systems which don't have it and when cc != gcc.
116 # nm tries to malloc enough space for the string table. The old GNU malloc
117 # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might
118 # fail unnecessarily. I've also seen some Unix malloc's fail, even when
119 # there is enough memory. So use the new GNU malloc.
122 # Use the GNU getopt unless you have problems with it.
123 # The IRIS version could probably benefit from being assembled with
124 # libmalloc rather than the ordinary malloc.
125 LIBIBERTY
= .
/..
/libiberty
/libiberty.a
127 # Code shared by all the binutils.
128 BULIBS
= bucomm.o version.o filemode.o
130 ADDL_LIBS
= $(MALLOC
) $(BULIBS
) $(BFD
) $(LIBIBERTY
)
132 BFD
= $(LIBDIR
)/libbfd.a
133 OPCODES
= $(OPCODEDIR
)/libopcodes.a
137 all: $(ADDL_LIBS
) $(PROGS
)
140 /bin
/sh
$(srcdir)/sanity.sh .
143 /bin
/sh
$(srcdir)/sanity.sh
$(bindir)
147 #$(BFD):$(LIBDIR)/../common/*.c
148 # (cd $(LIBDIR); make)
150 $(SIZE_PROG
): $(ADDL_LIBS
) size.o
$(BFD
)
151 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(SIZE_PROG
) size.o
$(ADDL_LIBS
) $(LOADLIBES
)
153 $(COPY_PROG
): $(ADDL_LIBS
) copy.o not-strip.o
$(BFD
)
154 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(COPY_PROG
) copy.o not-strip.o
$(ADDL_LIBS
) $(LOADLIBES
)
156 $(STRIP_PROG
): $(ADDL_LIBS
) copy.o is-strip.o
$(BFD
)
157 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(STRIP_PROG
) copy.o is-strip.o
$(ADDL_LIBS
) $(LOADLIBES
)
159 $(NM_PROG
): $(ADDL_LIBS
) nm.o
$(BFD
)
160 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(NM_PROG
) nm.o
$(ADDL_LIBS
) $(LOADLIBES
)
162 $(OBJDUMP_PROG
): $(ADDL_LIBS
) size.o objdump.o
$(DISASMS
) $(BFD
) $(OPCODES
)
163 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(OBJDUMP_PROG
) objdump.o
$(DISASMS
) $(ADDL_LIBS
) $(OPCODES
) $(LOADLIBES
)
166 $(BISON
) $(BISONFLAGS
) $(srcdir)/arparse.y
167 -mv y.tab.c arparse.c
168 -mv y.tab.h arparse.h
172 $(LEX
) $(LEX_OPTIONS
) $(srcdir)/arlex.l
175 $(AR_PROG
): $(ADDL_LIBS
) ar.o arparse.o arlex.o not-ranlib.o
$(BFD
) arsup.o
176 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(AR_PROG
) ar.o arparse.o arlex.o arsup.o not-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
178 $(RANLIB_PROG
): $(ADDL_LIBS
) ar.o is-ranlib.o arparse.o arlex.o arsup.o
$(BFD
)
179 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(RANLIB_PROG
) ar.o arparse.o arlex.o arsup.o is-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
181 # This rule creates a single binary that switches between ar and ranlib
182 # by looking at argv[0]. Use this kludge to save some disk space.
183 # However, you have to install things by hand.
184 # (That is after 'make install', replace the installed ranlib by a link to ar.)
186 # Alternatively, you can install ranlib.sh as ranlib.
188 ar_with_ranlib
: $(ADDL_LIBS
) ar.o maybe-ranlib.o
$(BFD
)
189 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(AR_PROG
) ar.o maybe-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
190 -rm -f
$(RANLIB_PROG
)
191 -ln
$(AR_PROG
) $(RANLIB_PROG
)
193 # copy and strip in one binary that uses argv[0] to decide its action.
195 copy_with_strip
: $(ADDL_LIBS
) copy.o maybe-strip.o
$(BFD
)
196 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(COPY_PROG
) copy.o maybe-strip.o
$(ADDL_LIBS
) $(LOADLIBES
)
198 -ln
$(COPY_PROG
) $(STRIP_PROG
)
202 - mv
-f
$(STAGESTUFF
) stage1
206 - mv
-f
$(STAGESTUFF
) stage2
210 - mv
-f
$(STAGESTUFF
) stage3
215 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
218 - (cd stage1
; mv
-f
* ..
)
222 - (cd stage2
; mv
-f
* ..
)
226 - (cd stage3
; mv
-f
* ..
)
229 ######################################################################
230 # DOCUMENTATION TARGETS
232 binutils.
dvi: $(srcdir)/binutils.texi
233 TEXINPUTS
=${TEXIDIR}:.
:$$TEXINPUTS tex $(srcdir)/binutils.texi
235 TEXINPUTS
=${TEXIDIR}:.
:$$TEXINPUTS tex $(srcdir)/binutils.texi
237 # info file for online browsing
238 binutils.
info: $(srcdir)/binutils.texi
239 $(MAKEINFO
) -o binutils.
info $(srcdir)/binutils.texi
241 # different targets for -ms, -mm, -me
242 # Try to use a recent texi2roff. v2 was put on prep in jan91.
243 # If you want an index, see texi2roff doc for postprocessing
244 # and add -i to texi2roff invocations below.
245 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
246 # correspondint -e lines when later texi2roff's are current)
247 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
248 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
249 # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
250 # + @alphaenumerate is ridiculously new, turned into @enumerate
253 binutils.ms
: $(srcdir)/binutils.texi
254 sed
-e
'/\\input texinfo/d' \
255 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
256 -e
'/^@ifinfo/,/^@end ifinfo/d' \
260 -e
's/^@alphaenumerate/@enumerate/g' \
261 -e
's/^@end alphaenumerate/@end enumerate/g' \
262 $(srcdir)/binutils.texi | \
264 sed
-e
's/---/\\(em/g' \
268 # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
269 # try leaving them in
270 binutils.mm
: $(srcdir)/binutils.texi
271 sed
-e
'/\\input texinfo/d' \
272 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
273 -e
'/^@ifinfo/,/^@end ifinfo/d' \
278 -e
's/^@alphaenumerate/@enumerate/g' \
279 -e
's/^@end alphaenumerate/@end enumerate/g' \
280 $(srcdir)/binutils.texi | \
282 sed
-e
's/---/\\(em/g' \
286 binutils.me
: $(srcdir)/binutils.texi
287 sed
-e
'/\\input texinfo/d' \
288 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
289 -e
'/^@ifinfo/,/^@end ifinfo/d' \
293 -e
's/^@alphaenumerate/@enumerate/g' \
294 -e
's/^@end alphaenumerate/@end enumerate/g' \
295 $(srcdir)/binutils.texi | \
297 sed
-e
's/---/\\(em/g' \
301 ######################################################################
304 -rm -f
*.o
*~ \
#* core $(STAGESTUFF) TAGS binutils.?? binutils.???
309 etags
$(INCDIR
)/*.h
$(BFDSRC
)/*.
[hc
] *.
[hc
]
312 -rm -f
$(STAGESTUFF
) TAGS
315 -parent
=`echo $(bindir)|sed -e 's@/[^/]*$$@@'`; \
316 if
[ -d
$$parent ] ; then true
; else mkdir
$$parent ; fi
317 -if
[ -d
$(bindir) ] ; then true
; else mkdir
$(bindir) ; fi
318 for i in
$(PROGS
) ; do \
319 $(INSTALL_PROGRAM
) $$i $(bindir)/`t='$(program_transform_name)'; echo $$i | sed -e "" $$t` ; \
321 -parent
=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \
322 if
[ -d
$$parent ] ; then true
; else mkdir
$$parent ; fi
323 -if
[ -d
$(man1dir) ] ; then true
; else mkdir
$(man1dir) ; fi
324 for i in
$(MANPAGES
) ; do \
325 $(INSTALL_DATA
) $(srcdir)/$$i.1 $(man1dir)/`t='$(program_transform_name)'; echo $$i | sed -e "" $$t`.1 ; \
329 -parent
=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \
330 if
[ -d
$$parent ] ; then true
; else mkdir
$$parent ; fi
331 -if
[ -d
$(infodir) ] ; then true
; else mkdir
$(infodir) ; fi
332 for i in
*.
info* ; do \
333 $(INSTALL_DATA
) $$i $(infodir)/$$i ; \
339 dist: $(DIST_NAME
).
tar.Z
342 cd ..
/..
; rm -f
$(DIST_NAME
); ln
-s devo
$(DIST_NAME
)
343 make arparse.c arlex.c binutils.mm
-f Makefile.in
344 cd ..
/ld; make ldgram.c ldgram.h ldlex.c
ld.mm
-f Makefile.in
345 cd ..
/..
; tar chf
- $(DIST_NAME
) | compress
>$(DIST_NAME
).
tar.Z
346 rm -rf ..
/..
/$(DIST_NAME
)
348 # These get around a bug in Sun Make in SunOS 4.1.1
350 am29k-pinsn.o
: am29k-pinsn.c
355 filemode.o
:filemode.c
359 i960-pinsn.o
: i960-pinsn.c
360 is-ranlib.o
:is-ranlib.c
361 is-strip.o
:is-strip.c
362 m68k-pinsn.o
: m68k-pinsn.c
363 maybe-ranlib.o
:maybe-ranlib.c
364 maybe-strip.o
:maybe-strip.c
366 not-ranlib.o
:not-ranlib.c
367 not-strip.o
:not-strip.c
370 sparc-pinsn.o
: sparc-pinsn.c
371 i386-pinsn.o
: i386-pinsn.c
373 version.o
: $(srcdir)/version.c
374 $(CC
) $(CFLAGS
) -I.
-I
$(srcdir) -I
$(INCDIR
) $(HDEFINES
) $(TDEFINES
) -DVERSION
='"$(VERSION)"' -c
$(srcdir)/version.c
376 #-----------------------------------------------------------------------------
377 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
379 # 'VERSION' file must be present and contain a string of the form "x.y"
380 #-----------------------------------------------------------------------------
384 echo
"char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
387 # Dummy target to force execution of dependent targets.
391 # Target to uncomment host-specific lines in this makefile. Such lines must
392 # have the following string beginning in column 1: #__<hostname>__#
393 # Original Makefile is backed up as 'Makefile.old'.
395 # Invoke with: make make HOST=xxx
398 -@if
test $(HOST
)x
= x
; then \
399 echo
'\aSpecify "make make HOST=???"'; \
402 grep
-s
"^#The next line was generated by 'make make'" Makefile
; \
403 if
test $$?
= 0 ; then \
404 echo
"\aMakefile has already been processed with 'make make'";\
407 mv
-f Makefile Makefile.old
; \
408 echo
"#The next line was generated by 'make make'" >Makefile
; \
409 echo
"HOST=$(HOST)" >>Makefile
; \
411 sed
"s/^#__$(HOST)__#//" < Makefile.old
>>Makefile
413 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
414 $(SHELL
) .
/config.status
416 ### Local Variables: ***
417 ### mode:fundamental ***
418 ### page-delimiter: "^#\f" ***