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