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 idestdir
= $(ddestdir
)
29 # Distribution version
32 DIST_NAME
=binutils-beta-
${VERSION}
34 version
=`$(unsubdir)/../gcc$(subdir)/gcc -dumpversion`
36 bindir = $(prefix)/bin
37 mandir = $(idestdir
)/man
39 # Where to find texinfo.tex to format docn with TeX
40 TEXIDIR
= $(srcdir)/..
/texinfo
/fsf
42 MANPAGES
= ar.1 nm
.1 objdump
.1 ranlib
.1 size
.1 strip.1
45 #INSTALL_PROGRAM = $(INSTALL)
46 #INSTALL_FILE = $(INSTALL)
49 # these two are almost the same program
53 # copy and strip should be the same program
57 # These should all be the same program too.
62 PROGS
= $(SIZE_PROG
) $(COPY_PROG
) $(OBJDUMP_PROG
) $(NM_PROG
) $(AR_PROG
) $(STRIP_PROG
) $(RANLIB_PROG
)
63 STAGESTUFF
= $(PROGS
) *.o
65 BASEDIR
= $(srcdir)/..
66 LIBDIR
= $(unsubdir
)/..
/bfd
$(subdir
)
69 #### host and target dependant Makefile fragments come in here.
72 INCDIR
= $(BASEDIR
)/include
74 CFLAGS
= $(MINUS_G
) -I.
-I
$(srcdir) -I
$(INCDIR
) $(HDEFINES
) $(TDEFINES
)
76 # When adding .o files, to make VPATH work in Sun Make, you have to
77 # also add a foo.o: foo.c line at the bottom of the file.
78 DISASMS
= m68k-pinsn.o i960-pinsn.o sparc-pinsn.o am29k-pinsn.o
82 # Hopefully all these may be flushed once we get configuration down pat.
84 # alloca only needed for systems which don't have it and when cc != gcc.
87 # nm tries to malloc enough space for the string table. The old GNU malloc
88 # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might
89 # fail unnecessarily. I've also seen some Unix malloc's fail, even when
90 # there is enough memory. So use the new GNU malloc.
93 # Use the GNU getopt unless you have problems with it.
94 # The IRIS version could probably benefit from being assembled with
95 # libmalloc rather than the ordinary malloc.
96 LIBIBERTY
= $(unsubdir
)/..
/libiberty
$(subdir
)/libiberty.a
98 # Code shared by all the binutils.
99 BULIBS
= bucomm.o version.o filemode.o
101 ADDL_LIBS
= $(MALLOC
) $(BULIBS
) $(BFD
) $(LIBIBERTY
)
103 BFD
= $(LIBDIR
)/libbfd.a
107 all: $(ADDL_LIBS
) $(PROGS
)
110 #$(BFD):$(LIBDIR)/../common/*.c
111 # (cd $(LIBDIR); make)
113 $(SIZE_PROG
): $(ADDL_LIBS
) size.o
$(BFD
)
114 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(SIZE_PROG
) size.o
$(ADDL_LIBS
) $(LOADLIBES
)
116 $(COPY_PROG
): $(ADDL_LIBS
) copy.o
$(BFD
)
117 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(COPY_PROG
) copy.o
$(ADDL_LIBS
) $(LOADLIBES
)
119 $(NM_PROG
): $(ADDL_LIBS
) nm.o
$(BFD
)
120 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(NM_PROG
) nm.o
$(ADDL_LIBS
) $(LOADLIBES
)
122 $(OBJDUMP_PROG
): $(ADDL_LIBS
) size.o objdump.o
$(DISASMS
) $(BFD
)
123 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(OBJDUMP_PROG
) objdump.o
$(DISASMS
) $(ADDL_LIBS
) $(LOADLIBES
)
125 $(AR_PROG
): $(ADDL_LIBS
) ar.o not-ranlib.o
$(BFD
)
126 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(AR_PROG
) ar.o not-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
128 $(RANLIB_PROG
): $(ADDL_LIBS
) ar.o is-ranlib.o
$(BFD
)
129 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(RANLIB_PROG
) ar.o is-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
131 # This rule creates a single binary that switches between ar and ranlib
132 # by looking at argv[0]. Use this kludge to save some disk space.
133 # However, you have to install things by hand.
134 # (That is after 'make install', replace the installed ranlib by a link to ar.)
136 # Alternatively, you can install ranlib.sh as ranlib.
138 ar_with_ranlib
: $(ADDL_LIBS
) ar.o maybe-ranlib.o
$(BFD
)
139 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(AR_PROG
) ar.o maybe-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
140 -rm -f
$(RANLIB_PROG
)
141 -ln
$(AR_PROG
) $(RANLIB_PROG
)
143 $(STRIP_PROG
): $(COPY_PROG
)
145 -ln
$(COPY_PROG
) $(STRIP_PROG
)
149 - mv
-f
$(STAGESTUFF
) stage1
153 - mv
-f
$(STAGESTUFF
) stage2
157 - mv
-f
$(STAGESTUFF
) stage3
162 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
165 - (cd stage1
; mv
-f
* ..
)
169 - (cd stage2
; mv
-f
* ..
)
173 - (cd stage3
; mv
-f
* ..
)
176 ######################################################################
177 # DOCUMENTATION TARGETS
179 binutils.
dvi: binutils.texinfo
180 TEXINPUTS
=${TEXIDIR}:.
:$$TEXINPUTS tex binutils.texinfo
182 TEXINPUTS
=${TEXIDIR}:.
:$$TEXINPUTS tex binutils.texinfo
184 # info file for online browsing
185 binutils.
info: binutils.texinfo
186 makeinfo binutils.texinfo
188 # different targets for -ms, -mm, -me
189 # (we don't use a variable because we don't trust all makes to handle
190 # a var in the target name right).
192 binutils.ms
: binutils.texinfo
193 sed
-e
'/\\input texinfo/d' \
194 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
196 texi2roff
-ms
>binutils.ms
199 binutils.mm
: binutils.texinfo
200 sed
-e
'/\\input texinfo/d' \
201 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
203 texi2roff
-mm
>binutils.mm
206 binutils.me
: binutils.texinfo
207 sed
-e
'/\\input texinfo/d' \
208 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
210 texi2roff
-me
>binutils.me
213 ######################################################################
216 -rm -f
*.o
*~ \
#* core $(STAGESTUFF) TAGS binutils.?? binutils.???
221 etags
$(INCDIR
)/*.h
$(BFDSRC
)/*.
[hc
] *.
[hc
]
224 -rm -f
$(STAGESTUFF
) TAGS
227 for i in
$(PROGS
) ; do \
228 cp
$$i $(bindir)/$$i.new
; \
229 mv
-f
$(bindir)/$$i.new
$(bindir)/$$i ; \
231 for i in
$(MANPAGES
) ; do \
232 cp
$(srcdir)/$$i $(mandir)/man1
/$$i.new
; \
233 mv
-f
$(mandir)/man1
/$$i.new
$(mandir)/man1
/$$i ; \
236 dist: $(DIST_NAME
).
tar.Z
239 cd ..
/..
; rm -f
$(DIST_NAME
); ln
-s devo
$(DIST_NAME
)
240 make binutils.mm
-f Makefile.in
241 cd ..
/ld; make
ld.mm
-f Makefile.in
242 cd ..
/..
; tar chf
- $(DIST_NAME
) | compress
>$(DIST_NAME
).
tar.Z
243 rm -rf ..
/..
/$(DIST_NAME
)
245 # These get around a bug in Sun Make in SunOS 4.1.1
247 am29k-pinsn.o
: am29k-pinsn.c
251 cplus-dem.o
:cplus-dem.c
252 filemode.o
:filemode.c
256 i960-pinsn.o
: i960-pinsn.c
257 is-ranlib.o
:is-ranlib.c
258 m68k-pinsn.o
: m68k-pinsn.c
259 maybe-ranlib.o
:maybe-ranlib.c
261 not-ranlib.o
:not-ranlib.c
264 sparc-pinsn.o
: sparc-pinsn.c
268 #-----------------------------------------------------------------------------
269 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
271 # 'VERSION' file must be present and contain a string of the form "x.y"
272 #-----------------------------------------------------------------------------
276 echo
"char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
279 # Dummy target to force execution of dependent targets.
283 # Target to uncomment host-specific lines in this makefile. Such lines must
284 # have the following string beginning in column 1: #__<hostname>__#
285 # Original Makefile is backed up as 'Makefile.old'.
287 # Invoke with: make make HOST=xxx
290 -@if
test $(HOST
)x
= x
; then \
291 echo
'\aSpecify "make make HOST=???"'; \
294 grep
-s
"^#The next line was generated by 'make make'" Makefile
; \
295 if
test $$?
= 0 ; then \
296 echo
"\aMakefile has already been processed with 'make make'";\
299 mv
-f Makefile Makefile.old
; \
300 echo
"#The next line was generated by 'make make'" >Makefile
; \
301 echo
"HOST=$(HOST)" >>Makefile
; \
303 sed
"s/^#__$(HOST)__#//" < Makefile.old
>>Makefile
305 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
306 $(SHELL
) .
/config.status
308 ### Local Variables: ***
309 ### mode:fundamental ***
310 ### page-delimiter: "^#\f" ***