]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - binutils/Makefile.in
added info dir menu hooks
[thirdparty/binutils-gdb.git] / binutils / Makefile.in
CommitLineData
d8474a9b
PB
1# Makefile for GNU binary-file utilities
2# Copyright (C) 1989-1991 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.
99a42820
RP
19
20#$Id$
21
a10d26a1 22srcdir = .
84396dcf
RP
23
24ddestdir = /usr/local
25idestdir = $(ddestdir)
26
27SHELL = /bin/sh
b5132a6b 28
8539db10 29# Distribution version
b27d2046 30VERSION=1.91
8539db10
PB
31# Distribution name
32DIST_NAME=binutils-beta-${VERSION}
33
06a97fbd 34version=`$(unsubdir)/../gcc$(subdir)/gcc -dumpversion`
84396dcf 35prefix = $(ddestdir)
d8474a9b 36bindir = $(prefix)/bin
84396dcf 37mandir = $(idestdir)/man
b5132a6b 38
6b583720 39# Where to find texinfo.tex to format docn with TeX
b7a11ec2
RP
40TEXIDIR = $(srcdir)/../texinfo/fsf
41
84396dcf
RP
42MANPAGES= ar.1 nm.1 objdump.1 ranlib.1 size.1 strip.1
43
7eff5bcf
JG
44#INSTALL = install -c
45#INSTALL_PROGRAM = $(INSTALL)
46#INSTALL_FILE = $(INSTALL)
a10d26a1 47
a10d26a1 48#CC=gcc -Wall
06a97fbd 49# these two are almost the same program
a10d26a1
RP
50AR_PROG=ar
51RANLIB_PROG=ranlib
99a42820
RP
52
53# copy and strip should be the same program
a10d26a1
RP
54COPY_PROG=copy
55STRIP_PROG=strip
99a42820
RP
56
57# These should all be the same program too.
a10d26a1
RP
58SIZE_PROG=size
59NM_PROG=nm
60OBJDUMP_PROG=objdump
99a42820 61
a10d26a1 62PROGS = $(SIZE_PROG) $(COPY_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRIP_PROG) $(RANLIB_PROG)
a01bf1fb 63STAGESTUFF = $(PROGS) *.o
99a42820 64
40773f7f 65BASEDIR = $(srcdir)/..
06a97fbd 66LIBDIR = $(unsubdir)/../bfd$(subdir)
a10d26a1 67
f79edb02 68MINUS_G = -g
a10d26a1
RP
69#### host and target dependant Makefile fragments come in here.
70###
71
9bba7784 72INCDIR = $(BASEDIR)/include
99a42820 73
f79edb02 74CFLAGS = $(MINUS_G) -I. -I$(srcdir) -I$(INCDIR) $(HDEFINES) $(TDEFINES)
99a42820 75
a26878d1
RP
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.
78DISASMS = m68k-pinsn.o i960-pinsn.o sparc-pinsn.o am29k-pinsn.o
6a3958b2 79
99a42820
RP
80#\f
81## Random definitions
82# Hopefully all these may be flushed once we get configuration down pat.
83
84# alloca only needed for systems which don't have it and when cc != gcc.
85# ALLOCA = alloca.o
86
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.
91# MALLOC = gmalloc.o
92
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.
06a97fbd 96LIBIBERTY = $(unsubdir)/../libiberty$(subdir)/libiberty.a
99a42820
RP
97
98# Code shared by all the binutils.
a10d26a1 99BULIBS = bucomm.o version.o filemode.o
99a42820 100
7a5a3c7b 101ADDL_LIBS = $(MALLOC) $(BULIBS) $(BFD) $(LIBIBERTY)
99a42820
RP
102
103BFD = $(LIBDIR)/libbfd.a
104#\f
105## The rules
106
a10d26a1
RP
107all: $(ADDL_LIBS) $(PROGS)
108
109
110#$(BFD):$(LIBDIR)/../common/*.c
111# (cd $(LIBDIR); make)
99a42820 112
a10d26a1 113$(SIZE_PROG): $(ADDL_LIBS) size.o $(BFD)
6a3958b2 114 $(CC) $(LDFLAGS) $(CFLAGS) -o $(SIZE_PROG) size.o $(ADDL_LIBS) $(LOADLIBES)
99a42820 115
a10d26a1 116$(COPY_PROG): $(ADDL_LIBS) copy.o $(BFD)
6a3958b2 117 $(CC) $(LDFLAGS) $(CFLAGS) -o $(COPY_PROG) copy.o $(ADDL_LIBS) $(LOADLIBES)
99a42820 118
a10d26a1 119$(NM_PROG): $(ADDL_LIBS) nm.o $(BFD)
6a3958b2 120 $(CC) $(LDFLAGS) $(CFLAGS) -o $(NM_PROG) nm.o $(ADDL_LIBS) $(LOADLIBES)
99a42820 121
a10d26a1 122$(OBJDUMP_PROG): $(ADDL_LIBS) size.o objdump.o $(DISASMS) $(BFD)
6a3958b2 123 $(CC) $(LDFLAGS) $(CFLAGS) -o $(OBJDUMP_PROG) objdump.o $(DISASMS) $(ADDL_LIBS) $(LOADLIBES)
99a42820 124
06a97fbd
PB
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)
99a42820 127
06a97fbd 128$(RANLIB_PROG): $(ADDL_LIBS) ar.o is-ranlib.o $(BFD)
8539db10 129 $(CC) $(LDFLAGS) $(CFLAGS) -o $(RANLIB_PROG) ar.o is-ranlib.o $(ADDL_LIBS) $(LOADLIBES)
06a97fbd
PB
130
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.)
135
136# Alternatively, you can install ranlib.sh as ranlib.
137
138ar_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)
a10d26a1
RP
140 -rm -f $(RANLIB_PROG)
141 -ln $(AR_PROG) $(RANLIB_PROG)
99a42820 142
a10d26a1
RP
143$(STRIP_PROG): $(COPY_PROG)
144 -rm -f $(STRIP_PROG)
145 -ln $(COPY_PROG) $(STRIP_PROG)
99a42820 146
6a3958b2
RP
147stage1: force
148 - mkdir stage1
a01bf1fb 149 - mv -f $(STAGESTUFF) stage1
6a3958b2
RP
150
151stage2: force
152 - mkdir stage2
a01bf1fb 153 - mv -f $(STAGESTUFF) stage2
6a3958b2
RP
154
155stage3: force
156 - mkdir stage3
a01bf1fb
RP
157 - mv -f $(STAGESTUFF) stage3
158
159against=stage2
160
161comparison: force
162 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
6a3958b2
RP
163
164de-stage1: force
165 - (cd stage1 ; mv -f * ..)
166 - rmdir stage1
167
168de-stage2: force
169 - (cd stage2 ; mv -f * ..)
170 - rmdir stage2
171
172de-stage3: force
173 - (cd stage3 ; mv -f * ..)
174 - rmdir stage3
175
6b583720
RP
176######################################################################
177# DOCUMENTATION TARGETS
178# TeX output
2226a090
RP
179binutils.dvi: $(srcdir)/binutils.texi
180 TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex $(srcdir)/binutils.texi
b7a11ec2 181 texindex binutils.??
2226a090 182 TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex $(srcdir)/binutils.texi
b7a11ec2 183
6b583720 184# info file for online browsing
2226a090
RP
185binutils.info: $(srcdir)/binutils.texi
186 makeinfo -o binutils.info $(srcdir)/binutils.texi
b7a11ec2 187
0c10ff03 188# different targets for -ms, -mm, -me
6b583720
RP
189# (we don't use a variable because we don't trust all makes to handle
190# a var in the target name right).
0c10ff03 191# roff output (-ms)
2226a090 192binutils.ms: $(srcdir)/binutils.texi
6b583720
RP
193 sed -e '/\\input texinfo/d' \
194 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
2226a090
RP
195 -e 's/{.*,,/{/' \
196 $(srcdir)/binutils.texi | \
6b583720
RP
197 texi2roff -ms >binutils.ms
198
0c10ff03 199# roff output (-mm)
2226a090 200binutils.mm: $(srcdir)/binutils.texi
0c10ff03
RP
201 sed -e '/\\input texinfo/d' \
202 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
2226a090
RP
203 -e 's/{.*,,/{/' \
204 -e '/@noindent/d' \
205 $(srcdir)/binutils.texi | \
206 texi2roff -mm | \
207 sed -e 's/---/\\(em/g' \
208 >binutils.mm
0c10ff03
RP
209
210# roff output (-me)
2226a090 211binutils.me: $(srcdir)/binutils.texi
0c10ff03
RP
212 sed -e '/\\input texinfo/d' \
213 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
2226a090
RP
214 -e 's/{.*,,/{/' \
215 $(srcdir)/binutils.texi | \
0c10ff03
RP
216 texi2roff -me >binutils.me
217
218
6b583720
RP
219######################################################################
220
99a42820 221clean:
b7a11ec2 222 -rm -f *.o *~ \#* core $(STAGESTUFF) TAGS binutils.?? binutils.???
99a42820
RP
223
224etags tags: TAGS
225
6a3958b2 226TAGS: force
99a42820
RP
227 etags $(INCDIR)/*.h $(BFDSRC)/*.[hc] *.[hc]
228
229realclean: clean
a01bf1fb 230 -rm -f $(STAGESTUFF) TAGS
99a42820
RP
231
232install: $(PROGS)
b5132a6b 233 for i in $(PROGS) ; do \
7eff5bcf
JG
234 cp $$i $(bindir)/$$i.new ; \
235 mv -f $(bindir)/$$i.new $(bindir)/$$i ; \
99a42820 236 done
84396dcf
RP
237 for i in $(MANPAGES) ; do \
238 cp $(srcdir)/$$i $(mandir)/man1/$$i.new ; \
239 mv -f $(mandir)/man1/$$i.new $(mandir)/man1/$$i ; \
240 done
99a42820 241
8539db10
PB
242dist: $(DIST_NAME).tar.Z
243
d8474a9b 244$(DIST_NAME).tar.Z:
b27d2046
PB
245 cd ../..; rm -f $(DIST_NAME); ln -s devo $(DIST_NAME)
246 make binutils.mm -f Makefile.in
d8474a9b
PB
247 cd ../ld; make ld.mm -f Makefile.in
248 cd ../..; tar chf - $(DIST_NAME) | compress >$(DIST_NAME).tar.Z
b27d2046 249 rm -rf ../../$(DIST_NAME)
8539db10 250
d7cce023
JG
251# These get around a bug in Sun Make in SunOS 4.1.1
252alloca.o:alloca.c
a26878d1 253am29k-pinsn.o: am29k-pinsn.c
99a42820 254ar.o: ar.c
d7cce023
JG
255bucomm.o: bucomm.c
256copy.o: copy.c
257cplus-dem.o:cplus-dem.c
258filemode.o:filemode.c
a10d26a1
RP
259getopt.o:getopt.c
260getopt1.o:getopt1.c
d7cce023
JG
261gmalloc.o:gmalloc.c
262i960-pinsn.o: i960-pinsn.c
263is-ranlib.o:is-ranlib.c
264m68k-pinsn.o: m68k-pinsn.c
265maybe-ranlib.o:maybe-ranlib.c
266nm.o: nm.c
267not-ranlib.o:not-ranlib.c
268objdump.o: objdump.c
269size.o: size.c
270sparc-pinsn.o: sparc-pinsn.c
271strip.o:strip.c
272version.o: version.c
8539db10 273
99a42820
RP
274#-----------------------------------------------------------------------------
275# 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
276#
277# 'VERSION' file must be present and contain a string of the form "x.y"
278#-----------------------------------------------------------------------------
279
280ver960.c: FORCE
281 rm -f ver960.c
282 echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
283
284
285# Dummy target to force execution of dependent targets.
286#
6a3958b2 287force:
99a42820
RP
288
289# Target to uncomment host-specific lines in this makefile. Such lines must
290# have the following string beginning in column 1: #__<hostname>__#
291# Original Makefile is backed up as 'Makefile.old'.
292#
293# Invoke with: make make HOST=xxx
294#
295make:
296 -@if test $(HOST)x = x ; then \
297 echo '\aSpecify "make make HOST=???"'; \
298 exit 1; \
299 fi ; \
300 grep -s "^#The next line was generated by 'make make'" Makefile; \
301 if test $$? = 0 ; then \
302 echo "\aMakefile has already been processed with 'make make'";\
303 exit 1; \
304 fi ; \
305 mv -f Makefile Makefile.old; \
306 echo "#The next line was generated by 'make make'" >Makefile ; \
307 echo "HOST=$(HOST)" >>Makefile ; \
308 echo >>Makefile ; \
309 sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile
310
f1eb48b6 311Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
a26878d1 312 $(SHELL) ./config.status
99a42820
RP
313
314### Local Variables: ***
315### mode:fundamental ***
316### page-delimiter: "^#\f" ***
317### End: ***
318### end of file