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