1 # Makefile for GNU binary-file utilities
2 # Copyright (C) 1989-1991 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.
25 # Distribution version
28 DIST_NAME=binutils-beta-${VERSION}
30 version=`$(unsubdir)/../gcc$(subdir)/gcc -dumpversion`
32 bindir = $(prefix)/bin
34 # Where to find texinfo.tex to format docn with TeX
35 TEXIDIR = $(srcdir)/../texinfo/fsf
38 #INSTALL_PROGRAM = $(INSTALL)
39 #INSTALL_FILE = $(INSTALL)
42 # these two are almost the same program
46 # copy and strip should be the same program
50 # These should all be the same program too.
55 PROGS = $(SIZE_PROG) $(COPY_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRIP_PROG) $(RANLIB_PROG)
56 STAGESTUFF = $(PROGS) *.o
58 BASEDIR = $(unsubdir)/..
59 LIBDIR = $(unsubdir)/../bfd$(subdir)
61 #### host and target dependant Makefile fragments come in here.
64 INCDIR = $(BASEDIR)/include
66 CFLAGS = -g -I. -I$(INCDIR) $(HDEFINES) $(TDEFINES)
68 # When adding .o files, to make VPATH work in Sun Make, you have to
69 # also add a foo.o: foo.c line at the bottom of the file.
70 DISASMS = m68k-pinsn.o i960-pinsn.o sparc-pinsn.o am29k-pinsn.o
74 # Hopefully all these may be flushed once we get configuration down pat.
76 # alloca only needed for systems which don't have it and when cc != gcc.
79 # nm tries to malloc enough space for the string table. The old GNU malloc
80 # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might
81 # fail unnecessarily. I've also seen some Unix malloc's fail, even when
82 # there is enough memory. So use the new GNU malloc.
85 # Use the GNU getopt unless you have problems with it.
86 # The IRIS version could probably benefit from being assembled with
87 # libmalloc rather than the ordinary malloc.
88 LIBIBERTY = $(unsubdir)/../libiberty$(subdir)/libiberty.a
90 # Code shared by all the binutils.
91 BULIBS = bucomm.o version.o filemode.o
93 ADDL_LIBS = $(MALLOC) $(BULIBS) $(BFD) $(LIBIBERTY)
95 BFD = $(LIBDIR)/libbfd.a
99 all: $(ADDL_LIBS) $(PROGS)
102 #$(BFD):$(LIBDIR)/../common/*.c
103 # (cd $(LIBDIR); make)
105 $(SIZE_PROG): $(ADDL_LIBS) size.o $(BFD)
106 $(CC) $(LDFLAGS) $(CFLAGS) -o $(SIZE_PROG) size.o $(ADDL_LIBS) $(LOADLIBES)
108 $(COPY_PROG): $(ADDL_LIBS) copy.o $(BFD)
109 $(CC) $(LDFLAGS) $(CFLAGS) -o $(COPY_PROG) copy.o $(ADDL_LIBS) $(LOADLIBES)
111 $(NM_PROG): $(ADDL_LIBS) nm.o $(BFD)
112 $(CC) $(LDFLAGS) $(CFLAGS) -o $(NM_PROG) nm.o $(ADDL_LIBS) $(LOADLIBES)
114 $(OBJDUMP_PROG): $(ADDL_LIBS) size.o objdump.o $(DISASMS) $(BFD)
115 $(CC) $(LDFLAGS) $(CFLAGS) -o $(OBJDUMP_PROG) objdump.o $(DISASMS) $(ADDL_LIBS) $(LOADLIBES)
117 $(AR_PROG): $(ADDL_LIBS) ar.o not-ranlib.o $(BFD)
118 $(CC) $(LDFLAGS) $(CFLAGS) -o $(AR_PROG) ar.o not-ranlib.o $(ADDL_LIBS) $(LOADLIBES)
120 $(RANLIB_PROG): $(ADDL_LIBS) ar.o is-ranlib.o $(BFD)
121 $(CC) $(LDFLAGS) $(CFLAGS) -o $(RANLIB_PROG) ar.o is-ranlib.o $(ADDL_LIBS) $(LOADLIBES)
123 # This rule creates a single binary that switches between ar and ranlib
124 # by looking at argv[0]. Use this kludge to save some disk space.
125 # However, you have to install things by hand.
126 # (That is after 'make install', replace the installed ranlib by a link to ar.)
128 # Alternatively, you can install ranlib.sh as ranlib.
130 ar_with_ranlib: $(ADDL_LIBS) ar.o maybe-ranlib.o $(BFD)
131 $(CC) $(LDFLAGS) $(CFLAGS) -o $(AR_PROG) ar.o maybe-ranlib.o $(ADDL_LIBS) $(LOADLIBES)
132 -rm -f $(RANLIB_PROG)
133 -ln $(AR_PROG) $(RANLIB_PROG)
135 $(STRIP_PROG): $(COPY_PROG)
137 -ln $(COPY_PROG) $(STRIP_PROG)
141 - mv -f $(STAGESTUFF) stage1
145 - mv -f $(STAGESTUFF) stage2
149 - mv -f $(STAGESTUFF) stage3
154 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
157 - (cd stage1 ; mv -f * ..)
161 - (cd stage2 ; mv -f * ..)
165 - (cd stage3 ; mv -f * ..)
168 ######################################################################
169 # DOCUMENTATION TARGETS
171 binutils.dvi: binutils.texinfo
172 TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex binutils.texinfo
174 TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex binutils.texinfo
176 # info file for online browsing
177 binutils.info: binutils.texinfo
178 makeinfo binutils.texinfo
180 # different targets for -ms, -mm, -me
181 # (we don't use a variable because we don't trust all makes to handle
182 # a var in the target name right).
184 binutils.ms: binutils.texinfo
185 sed -e '/\\input texinfo/d' \
186 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
188 texi2roff -ms >binutils.ms
191 binutils.mm: binutils.texinfo
192 sed -e '/\\input texinfo/d' \
193 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
195 texi2roff -mm >binutils.mm
198 binutils.me: binutils.texinfo
199 sed -e '/\\input texinfo/d' \
200 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
202 texi2roff -me >binutils.me
205 ######################################################################
208 -rm -f *.o *~ \#* core $(STAGESTUFF) TAGS binutils.?? binutils.???
213 etags $(INCDIR)/*.h $(BFDSRC)/*.[hc] *.[hc]
216 -rm -f $(STAGESTUFF) TAGS
219 for i in $(PROGS) ; do \
220 cp $$i $(bindir)/$$i.new ; \
221 mv -f $(bindir)/$$i.new $(bindir)/$$i ; \
224 dist: $(DIST_NAME).tar.Z
227 cd ../..; rm -f $(DISTNAME); ln -s devo $(DIST_NAME)
229 cd binutils; make binutils.mm -f Makefile.in
230 cd ../ld; make ld.mm -f Makefile.in
231 cd ../..; tar chf - $(DIST_NAME) | compress >$(DIST_NAME).tar.Z
233 # These get around a bug in Sun Make in SunOS 4.1.1
235 am29k-pinsn.o: am29k-pinsn.c
239 cplus-dem.o:cplus-dem.c
240 filemode.o:filemode.c
244 i960-pinsn.o: i960-pinsn.c
245 is-ranlib.o:is-ranlib.c
246 m68k-pinsn.o: m68k-pinsn.c
247 maybe-ranlib.o:maybe-ranlib.c
249 not-ranlib.o:not-ranlib.c
252 sparc-pinsn.o: sparc-pinsn.c
256 #-----------------------------------------------------------------------------
257 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
259 # 'VERSION' file must be present and contain a string of the form "x.y"
260 #-----------------------------------------------------------------------------
264 echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
267 # Dummy target to force execution of dependent targets.
271 # Target to uncomment host-specific lines in this makefile. Such lines must
272 # have the following string beginning in column 1: #__<hostname>__#
273 # Original Makefile is backed up as 'Makefile.old'.
275 # Invoke with: make make HOST=xxx
278 -@if test $(HOST)x = x ; then \
279 echo '
\aSpecify "make make HOST=???"'; \
282 grep -s "^#The next line was generated by 'make make'" Makefile; \
283 if test $$? = 0 ; then \
284 echo "
\aMakefile has already been processed with 'make make'";\
287 mv -f Makefile Makefile.old; \
288 echo "#The next line was generated by 'make make'" >Makefile ; \
289 echo "HOST=$(HOST)" >>Makefile ; \
291 sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile
293 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
294 $(SHELL) ./config.status
296 ### Local Variables: ***
297 ### mode:fundamental ***
298 ### page-delimiter: "^#
\f" ***