* Makefile.in: Set VERSION to 2.1.
[deliverable/binutils-gdb.git] / binutils / Makefile.in
CommitLineData
d8474a9b 1# Makefile for GNU binary-file utilities
d8e89b6b 2# Copyright (C) 1989-1992 Free Software Foundation, Inc.
d8474a9b
PB
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 19
a10d26a1 20srcdir = .
84396dcf 21
d8e89b6b
RP
22prefix = /usr/local
23
3790af1d 24program_transform_name =
d8e89b6b
RP
25exec_prefix = $(prefix)
26bindir = $(exec_prefix)/bin
27libdir = $(exec_prefix)/lib
3f97524f 28tooldir = $(libdir)/$(target_alias)
d8e89b6b
RP
29
30datadir = $(prefix)/lib
31mandir = $(prefix)/man
32man1dir = $(mandir)/man1
33man2dir = $(mandir)/man2
34man3dir = $(mandir)/man3
35man4dir = $(mandir)/man4
36man5dir = $(mandir)/man5
37man6dir = $(mandir)/man6
38man7dir = $(mandir)/man7
39man8dir = $(mandir)/man8
40man9dir = $(mandir)/man9
41infodir = $(prefix)/info
42includedir = $(prefix)/include
43docdir = $(datadir)/doc
84396dcf
RP
44
45SHELL = /bin/sh
d8e89b6b
RP
46
47INSTALL = install -c
48INSTALL_PROGRAM = $(INSTALL)
49INSTALL_DATA = $(INSTALL)
50
51AR = ar
52AR_FLAGS = qv
53CFLAGS = -g
d8e89b6b 54MAKEINFO = makeinfo
c921e2aa 55TEXI2DVI = texi2dvi
d8e89b6b 56RANLIB = ranlib
9752f9fd 57BISONFLAGS = -d
c83497f5 58TEXI2ROFF=texi2roff
b5132a6b 59
8d5d0e11
PB
60SYMLINK = ln -s
61
9752f9fd 62BISON = `if [ -f ../byacc/byacc ] ; then echo ../byacc/byacc ; else echo byacc ; fi`
45212e5e
PB
63# Comment these out if using lex.
64LEX_OPTIONS = -I -Cem
e2fe2df4 65LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
45212e5e 66
8539db10 67# Distribution version
eba174ce 68VERSION=2.1
8539db10 69# Distribution name
d8e89b6b 70DIST_NAME=binutils-${VERSION}
8539db10 71
d8e89b6b 72version=`./../gcc/gcc -dumpversion`
b5132a6b 73
6b583720 74# Where to find texinfo.tex to format docn with TeX
b7a11ec2
RP
75TEXIDIR = $(srcdir)/../texinfo/fsf
76
3790af1d 77MANPAGES= ar nm objdump ranlib size strip
84396dcf 78
a10d26a1 79#CC=gcc -Wall
06a97fbd 80# these two are almost the same program
a10d26a1
RP
81AR_PROG=ar
82RANLIB_PROG=ranlib
99a42820
RP
83
84# copy and strip should be the same program
a10d26a1
RP
85COPY_PROG=copy
86STRIP_PROG=strip
99a42820
RP
87
88# These should all be the same program too.
a10d26a1
RP
89SIZE_PROG=size
90NM_PROG=nm
91OBJDUMP_PROG=objdump
99a42820 92
c921e2aa
FF
93# This is the demangler, as a standalone program.
94DEMANGLER_PROG=demangle
95
96PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRIP_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG)
a01bf1fb 97STAGESTUFF = $(PROGS) *.o
8d5d0e11
PB
98# Files that can be generated, but should be in the distribution.
99DISTSTUFF=arparse.c arlex.c binutils.mm
99a42820 100
40773f7f 101BASEDIR = $(srcdir)/..
d8e89b6b 102LIBDIR = ./../bfd
a4ef8601 103OPCODEDIR = ./../opcodes
a10d26a1 104
a10d26a1
RP
105#### host and target dependant Makefile fragments come in here.
106###
107
3f97524f 108INCLUDES = -I. -I$(srcdir) -I$(BASEDIR)/include -I$(BASEDIR)/bfd
99a42820 109
d8e89b6b 110.c.o:
3f97524f 111 $(CC) -c $(CFLAGS) $(INCLUDES) $(HDEFINES) $(TDEFINES) $<
99a42820 112
a26878d1
RP
113# When adding .o files, to make VPATH work in Sun Make, you have to
114# also add a foo.o: foo.c line at the bottom of the file.
60c80016 115DISASMS = m68k-pinsn.o i960-pinsn.o i386-pinsn.o sparc-pinsn.o am29k-pinsn.o
6a3958b2 116
99a42820
RP
117#\f
118## Random definitions
119# Hopefully all these may be flushed once we get configuration down pat.
120
121# alloca only needed for systems which don't have it and when cc != gcc.
122# ALLOCA = alloca.o
123
124# nm tries to malloc enough space for the string table. The old GNU malloc
125# rounds this up to a power of two (e.g. 5M becomes 8M), and so it might
126# fail unnecessarily. I've also seen some Unix malloc's fail, even when
127# there is enough memory. So use the new GNU malloc.
128# MALLOC = gmalloc.o
129
130# Use the GNU getopt unless you have problems with it.
131# The IRIS version could probably benefit from being assembled with
132# libmalloc rather than the ordinary malloc.
c921e2aa
FF
133LIBIBERTY_SRC_DIR = $(srcdir)/../libiberty
134LIBIBERTY_BIN_DIR = ./../libiberty
135LIBIBERTY = $(LIBIBERTY_BIN_DIR)/libiberty.a
99a42820
RP
136
137# Code shared by all the binutils.
a10d26a1 138BULIBS = bucomm.o version.o filemode.o
99a42820 139
7a5a3c7b 140ADDL_LIBS = $(MALLOC) $(BULIBS) $(BFD) $(LIBIBERTY)
99a42820
RP
141
142BFD = $(LIBDIR)/libbfd.a
a4ef8601 143OPCODES = $(OPCODEDIR)/libopcodes.a
99a42820
RP
144#\f
145## The rules
146
4f8b1219
MW
147all: $(ADDL_LIBS) $(PROGS) testsuite
148
149testsuite:
150 echo "testsuite"; \
151 if [ -d testsuite ]; then \
152 (rootme=`pwd`/ ; export rootme ; \
153 rootsrc=`cd $(srcdir); pwd`/ ; export rootsrc ; \
154 cd testsuite; $(MAKE) $(FLAGS_TO_PASS)); \
155 fi; \
156
c83497f5 157
eeece52d 158check: all
dc760829 159 /bin/sh $(srcdir)/sanity.sh .
d8e89b6b 160
7d6cc102
RP
161test-install:
162 /bin/sh $(srcdir)/sanity.sh $(bindir)
163
d8e89b6b 164info: binutils.info
a10d26a1 165
c921e2aa
FF
166dvi: binutils.dvi
167
a10d26a1
RP
168#$(BFD):$(LIBDIR)/../common/*.c
169# (cd $(LIBDIR); make)
99a42820 170
a10d26a1 171$(SIZE_PROG): $(ADDL_LIBS) size.o $(BFD)
6a3958b2 172 $(CC) $(LDFLAGS) $(CFLAGS) -o $(SIZE_PROG) size.o $(ADDL_LIBS) $(LOADLIBES)
99a42820 173
d8e89b6b
RP
174$(COPY_PROG): $(ADDL_LIBS) copy.o not-strip.o $(BFD)
175 $(CC) $(LDFLAGS) $(CFLAGS) -o $(COPY_PROG) copy.o not-strip.o $(ADDL_LIBS) $(LOADLIBES)
176
177$(STRIP_PROG): $(ADDL_LIBS) copy.o is-strip.o $(BFD)
178 $(CC) $(LDFLAGS) $(CFLAGS) -o $(STRIP_PROG) copy.o is-strip.o $(ADDL_LIBS) $(LOADLIBES)
99a42820 179
a10d26a1 180$(NM_PROG): $(ADDL_LIBS) nm.o $(BFD)
6a3958b2 181 $(CC) $(LDFLAGS) $(CFLAGS) -o $(NM_PROG) nm.o $(ADDL_LIBS) $(LOADLIBES)
99a42820 182
a4ef8601 183$(OBJDUMP_PROG): $(ADDL_LIBS) size.o objdump.o $(DISASMS) $(BFD) $(OPCODES)
fd9d7e4a 184 $(CC) $(LDFLAGS) $(CFLAGS) -o $(OBJDUMP_PROG) objdump.o $(DISASMS) $(ADDL_LIBS) $(OPCODES) $(LOADLIBES)
99a42820 185
c921e2aa
FF
186$(DEMANGLER_PROG): $(LIBIBERTY_SRC_DIR)/cplus-dem.c
187 $(CC) $(LDFLAGS) $(CFLAGS) $(INCLUDES) $(HDEFINES) $(TDEFINES) -DMAIN -o $(DEMANGLER_PROG) $(LIBIBERTY_SRC_DIR)/cplus-dem.c $(LIBIBERTY) $(LOADLIBES)
188
d8e89b6b 189arparse.c:arparse.y
9752f9fd
ME
190 $(BISON) $(BISONFLAGS) $(srcdir)/arparse.y
191 -mv y.tab.c arparse.c
192 -mv y.tab.h arparse.h
d8e89b6b 193
99a42820 194
9752f9fd
ME
195arlex.c: arlex.l
196 $(LEX) $(LEX_OPTIONS) $(srcdir)/arlex.l
197 mv lex.yy.c arlex.c
d8e89b6b
RP
198
199$(AR_PROG): $(ADDL_LIBS) ar.o arparse.o arlex.o not-ranlib.o $(BFD) arsup.o
200 $(CC) $(LDFLAGS) $(CFLAGS) -o $(AR_PROG) ar.o arparse.o arlex.o arsup.o not-ranlib.o $(ADDL_LIBS) $(LOADLIBES)
201
202$(RANLIB_PROG): $(ADDL_LIBS) ar.o is-ranlib.o arparse.o arlex.o arsup.o $(BFD)
203 $(CC) $(LDFLAGS) $(CFLAGS) -o $(RANLIB_PROG) ar.o arparse.o arlex.o arsup.o is-ranlib.o $(ADDL_LIBS) $(LOADLIBES)
06a97fbd
PB
204
205# This rule creates a single binary that switches between ar and ranlib
206# by looking at argv[0]. Use this kludge to save some disk space.
207# However, you have to install things by hand.
208# (That is after 'make install', replace the installed ranlib by a link to ar.)
209
210# Alternatively, you can install ranlib.sh as ranlib.
211
212ar_with_ranlib: $(ADDL_LIBS) ar.o maybe-ranlib.o $(BFD)
213 $(CC) $(LDFLAGS) $(CFLAGS) -o $(AR_PROG) ar.o maybe-ranlib.o $(ADDL_LIBS) $(LOADLIBES)
a10d26a1
RP
214 -rm -f $(RANLIB_PROG)
215 -ln $(AR_PROG) $(RANLIB_PROG)
99a42820 216
d8e89b6b
RP
217# copy and strip in one binary that uses argv[0] to decide its action.
218
219copy_with_strip: $(ADDL_LIBS) copy.o maybe-strip.o $(BFD)
220 $(CC) $(LDFLAGS) $(CFLAGS) -o $(COPY_PROG) copy.o maybe-strip.o $(ADDL_LIBS) $(LOADLIBES)
a10d26a1
RP
221 -rm -f $(STRIP_PROG)
222 -ln $(COPY_PROG) $(STRIP_PROG)
99a42820 223
6a3958b2
RP
224stage1: force
225 - mkdir stage1
a01bf1fb 226 - mv -f $(STAGESTUFF) stage1
6a3958b2
RP
227
228stage2: force
229 - mkdir stage2
a01bf1fb 230 - mv -f $(STAGESTUFF) stage2
6a3958b2
RP
231
232stage3: force
233 - mkdir stage3
a01bf1fb
RP
234 - mv -f $(STAGESTUFF) stage3
235
236against=stage2
237
238comparison: force
239 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
6a3958b2
RP
240
241de-stage1: force
242 - (cd stage1 ; mv -f * ..)
243 - rmdir stage1
244
245de-stage2: force
246 - (cd stage2 ; mv -f * ..)
247 - rmdir stage2
248
249de-stage3: force
250 - (cd stage3 ; mv -f * ..)
251 - rmdir stage3
252
6b583720
RP
253######################################################################
254# DOCUMENTATION TARGETS
255# TeX output
2226a090 256binutils.dvi: $(srcdir)/binutils.texi
c921e2aa 257 $(TEXI2DVI) $(srcdir)/binutils.texi
b7a11ec2 258
6b583720 259# info file for online browsing
2226a090 260binutils.info: $(srcdir)/binutils.texi
6141fd50 261 $(MAKEINFO) -o binutils.info $(srcdir)/binutils.texi
b7a11ec2 262
0c10ff03 263# different targets for -ms, -mm, -me
c83497f5
RP
264# Try to use a recent texi2roff. v2 was put on prep in jan91.
265# If you want an index, see texi2roff doc for postprocessing
266# and add -i to texi2roff invocations below.
267# Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
268# correspondint -e lines when later texi2roff's are current)
269# + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
270# + @c's deleted explicitly because texi2roff sees texinfo commands in them
271# + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
272# + @alphaenumerate is ridiculously new, turned into @enumerate
273
0c10ff03 274# roff output (-ms)
2226a090 275binutils.ms: $(srcdir)/binutils.texi
6b583720
RP
276 sed -e '/\\input texinfo/d' \
277 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
c83497f5
RP
278 -e '/^@ifinfo/,/^@end ifinfo/d' \
279 -e '/^@c/d' \
2226a090 280 -e 's/{.*,,/{/' \
c83497f5
RP
281 -e 's/@ / /g' \
282 -e 's/^@alphaenumerate/@enumerate/g' \
283 -e 's/^@end alphaenumerate/@end enumerate/g' \
2226a090 284 $(srcdir)/binutils.texi | \
d8e89b6b 285 $(TEXI2ROFF) -ms | \
c83497f5
RP
286 sed -e 's/---/\\(em/g' \
287 >binutils.ms
6b583720 288
0c10ff03 289# roff output (-mm)
c83497f5
RP
290# '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
291# try leaving them in
2226a090 292binutils.mm: $(srcdir)/binutils.texi
0c10ff03
RP
293 sed -e '/\\input texinfo/d' \
294 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
c83497f5
RP
295 -e '/^@ifinfo/,/^@end ifinfo/d' \
296 -e '/^@c/d' \
2226a090
RP
297 -e 's/{.*,,/{/' \
298 -e '/@noindent/d' \
c83497f5
RP
299 -e 's/@ / /g' \
300 -e 's/^@alphaenumerate/@enumerate/g' \
301 -e 's/^@end alphaenumerate/@end enumerate/g' \
2226a090 302 $(srcdir)/binutils.texi | \
d8e89b6b 303 $(TEXI2ROFF) -mm | \
2226a090
RP
304 sed -e 's/---/\\(em/g' \
305 >binutils.mm
0c10ff03
RP
306
307# roff output (-me)
2226a090 308binutils.me: $(srcdir)/binutils.texi
0c10ff03
RP
309 sed -e '/\\input texinfo/d' \
310 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
c83497f5
RP
311 -e '/^@ifinfo/,/^@end ifinfo/d' \
312 -e '/^@c/d' \
2226a090 313 -e 's/{.*,,/{/' \
c83497f5
RP
314 -e 's/@ / /g' \
315 -e 's/^@alphaenumerate/@enumerate/g' \
316 -e 's/^@end alphaenumerate/@end enumerate/g' \
2226a090 317 $(srcdir)/binutils.texi | \
d8e89b6b 318 $(TEXI2ROFF) -me | \
c83497f5
RP
319 sed -e 's/---/\\(em/g' \
320 >binutils.me
0c10ff03
RP
321
322
6b583720
RP
323######################################################################
324
8d5d0e11 325mostlyclean:
3f97524f 326 -rm -f *.o *~ \#* core binutils.?? binutils.???
8d5d0e11 327clean: mostlyclean
3f97524f 328 -rm -f $(PROGS)
8d5d0e11 329distclean: clean
eeece52d 330 -rm -f Makefile config.status sysdep.h
8d5d0e11
PB
331realclean: distclean
332 -rm -f $(DISTSTUFF) TAGS
99a42820
RP
333
334etags tags: TAGS
335
6a3958b2 336TAGS: force
99a42820
RP
337 etags $(INCDIR)/*.h $(BFDSRC)/*.[hc] *.[hc]
338
c83497f5 339install: all
f478fcf6
ILT
340 -parent=`echo $(bindir)|sed -e 's@/[^/]*$$@@'`; \
341 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
342 -if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; fi
3f97524f 343 -for i in $(PROGS) ; do \
3790af1d 344 $(INSTALL_PROGRAM) $$i $(bindir)/`t='$(program_transform_name)'; echo $$i | sed -e "" $$t` ; \
99a42820 345 done
f478fcf6
ILT
346 -parent=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \
347 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
348 -if [ -d $(man1dir) ] ; then true ; else mkdir $(man1dir) ; fi
3f97524f 349 -for i in $(MANPAGES) ; do \
3790af1d 350 $(INSTALL_DATA) $(srcdir)/$$i.1 $(man1dir)/`t='$(program_transform_name)'; echo $$i | sed -e "" $$t`.1 ; \
de53632c 351 done
3f97524f
DZ
352 -if [ -d $(tooldir) ]; then \
353 if [ -d $(tooldir)/bin ] ; then true ; else mkdir $(tooldir)/bin ; fi; \
354 for i in nm strip ; do \
355 rm -f $(tooldir)/bin/$$i; \
356 ln $(bindir)/`t='$(program_transform_name)'; echo $$i | sed -e "" $$t` $(tooldir)/bin/$$i \
357 || $(INSTALL_PROGRAM) $$i $(tooldir)/bin/$$i; \
358 done; \
359 else true; fi
c83497f5 360
d8e89b6b 361install-info: info
f478fcf6
ILT
362 -parent=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \
363 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
364 -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi
de53632c 365 for i in *.info* ; do \
d8e89b6b 366 $(INSTALL_DATA) $$i $(infodir)/$$i ; \
84396dcf 367 done
99a42820 368
d8e89b6b
RP
369clean-info:
370 -rm -rf *.info*
371
e2fe2df4
PB
372# Making a dist:
373# cvs rtag binutils-x-yy binutils
374# cvs co -r binutils-x-yy binutils
375# Sanitize
376# cd {HERE}; make dist [-f Makefile.in]
377
8539db10
PB
378dist: $(DIST_NAME).tar.Z
379
8d5d0e11
PB
380diststuff: $(DISTSTUFF)
381
d8474a9b 382$(DIST_NAME).tar.Z:
e2fe2df4 383 cd ..; chmod og=u `find . -print`
b27d2046 384 cd ../..; rm -f $(DIST_NAME); ln -s devo $(DIST_NAME)
8d5d0e11
PB
385 make diststuff -f Makefile.in
386 cd ../ld; make diststuff -f Makefile.in
3f97524f 387 cd ../gprof; make diststuff -f Makefile.in
d8474a9b 388 cd ../..; tar chf - $(DIST_NAME) | compress >$(DIST_NAME).tar.Z
b27d2046 389 rm -rf ../../$(DIST_NAME)
8539db10 390
d7cce023
JG
391# These get around a bug in Sun Make in SunOS 4.1.1
392alloca.o:alloca.c
a26878d1 393am29k-pinsn.o: am29k-pinsn.c
99a42820 394ar.o: ar.c
22923083 395arsup.o: arsup.c
d7cce023
JG
396bucomm.o: bucomm.c
397copy.o: copy.c
d7cce023 398filemode.o:filemode.c
a10d26a1
RP
399getopt.o:getopt.c
400getopt1.o:getopt1.c
d7cce023
JG
401gmalloc.o:gmalloc.c
402i960-pinsn.o: i960-pinsn.c
403is-ranlib.o:is-ranlib.c
d8e89b6b 404is-strip.o:is-strip.c
d7cce023
JG
405m68k-pinsn.o: m68k-pinsn.c
406maybe-ranlib.o:maybe-ranlib.c
d8e89b6b 407maybe-strip.o:maybe-strip.c
d7cce023
JG
408nm.o: nm.c
409not-ranlib.o:not-ranlib.c
d8e89b6b 410not-strip.o:not-strip.c
d7cce023
JG
411objdump.o: objdump.c
412size.o: size.c
413sparc-pinsn.o: sparc-pinsn.c
60c80016 414i386-pinsn.o: i386-pinsn.c
d7cce023 415strip.o:strip.c
d8e89b6b 416version.o: $(srcdir)/version.c
3f97524f 417 $(CC) $(CFLAGS) $(INCLUDES) $(HDEFINES) $(TDEFINES) -DVERSION='"$(VERSION)"' -c $(srcdir)/version.c
8539db10 418
99a42820
RP
419#-----------------------------------------------------------------------------
420# 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
421#
422# 'VERSION' file must be present and contain a string of the form "x.y"
423#-----------------------------------------------------------------------------
424
425ver960.c: FORCE
426 rm -f ver960.c
427 echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
428
429
430# Dummy target to force execution of dependent targets.
431#
6a3958b2 432force:
99a42820
RP
433
434# Target to uncomment host-specific lines in this makefile. Such lines must
435# have the following string beginning in column 1: #__<hostname>__#
436# Original Makefile is backed up as 'Makefile.old'.
437#
438# Invoke with: make make HOST=xxx
439#
440make:
441 -@if test $(HOST)x = x ; then \
442 echo '\aSpecify "make make HOST=???"'; \
443 exit 1; \
444 fi ; \
445 grep -s "^#The next line was generated by 'make make'" Makefile; \
446 if test $$? = 0 ; then \
447 echo "\aMakefile has already been processed with 'make make'";\
448 exit 1; \
449 fi ; \
450 mv -f Makefile Makefile.old; \
451 echo "#The next line was generated by 'make make'" >Makefile ; \
452 echo "HOST=$(HOST)" >>Makefile ; \
453 echo >>Makefile ; \
454 sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile
455
f1eb48b6 456Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
a26878d1 457 $(SHELL) ./config.status
99a42820
RP
458
459### Local Variables: ***
460### mode:fundamental ***
461### page-delimiter: "^#\f" ***
462### End: ***
463### end of file
This page took 0.112244 seconds and 4 git commands to generate.