removing excess verbosity
[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
3f97524f 68VERSION=2.0
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
c83497f5
RP
147all: $(ADDL_LIBS) $(PROGS)
148
eeece52d 149check: all
dc760829 150 /bin/sh $(srcdir)/sanity.sh .
d8e89b6b 151
7d6cc102
RP
152test-install:
153 /bin/sh $(srcdir)/sanity.sh $(bindir)
154
d8e89b6b 155info: binutils.info
a10d26a1 156
c921e2aa
FF
157dvi: binutils.dvi
158
a10d26a1
RP
159#$(BFD):$(LIBDIR)/../common/*.c
160# (cd $(LIBDIR); make)
99a42820 161
a10d26a1 162$(SIZE_PROG): $(ADDL_LIBS) size.o $(BFD)
6a3958b2 163 $(CC) $(LDFLAGS) $(CFLAGS) -o $(SIZE_PROG) size.o $(ADDL_LIBS) $(LOADLIBES)
99a42820 164
d8e89b6b
RP
165$(COPY_PROG): $(ADDL_LIBS) copy.o not-strip.o $(BFD)
166 $(CC) $(LDFLAGS) $(CFLAGS) -o $(COPY_PROG) copy.o not-strip.o $(ADDL_LIBS) $(LOADLIBES)
167
168$(STRIP_PROG): $(ADDL_LIBS) copy.o is-strip.o $(BFD)
169 $(CC) $(LDFLAGS) $(CFLAGS) -o $(STRIP_PROG) copy.o is-strip.o $(ADDL_LIBS) $(LOADLIBES)
99a42820 170
a10d26a1 171$(NM_PROG): $(ADDL_LIBS) nm.o $(BFD)
6a3958b2 172 $(CC) $(LDFLAGS) $(CFLAGS) -o $(NM_PROG) nm.o $(ADDL_LIBS) $(LOADLIBES)
99a42820 173
a4ef8601 174$(OBJDUMP_PROG): $(ADDL_LIBS) size.o objdump.o $(DISASMS) $(BFD) $(OPCODES)
fd9d7e4a 175 $(CC) $(LDFLAGS) $(CFLAGS) -o $(OBJDUMP_PROG) objdump.o $(DISASMS) $(ADDL_LIBS) $(OPCODES) $(LOADLIBES)
99a42820 176
c921e2aa
FF
177$(DEMANGLER_PROG): $(LIBIBERTY_SRC_DIR)/cplus-dem.c
178 $(CC) $(LDFLAGS) $(CFLAGS) $(INCLUDES) $(HDEFINES) $(TDEFINES) -DMAIN -o $(DEMANGLER_PROG) $(LIBIBERTY_SRC_DIR)/cplus-dem.c $(LIBIBERTY) $(LOADLIBES)
179
d8e89b6b 180arparse.c:arparse.y
9752f9fd
ME
181 $(BISON) $(BISONFLAGS) $(srcdir)/arparse.y
182 -mv y.tab.c arparse.c
183 -mv y.tab.h arparse.h
d8e89b6b 184
99a42820 185
9752f9fd
ME
186arlex.c: arlex.l
187 $(LEX) $(LEX_OPTIONS) $(srcdir)/arlex.l
188 mv lex.yy.c arlex.c
d8e89b6b
RP
189
190$(AR_PROG): $(ADDL_LIBS) ar.o arparse.o arlex.o not-ranlib.o $(BFD) arsup.o
191 $(CC) $(LDFLAGS) $(CFLAGS) -o $(AR_PROG) ar.o arparse.o arlex.o arsup.o not-ranlib.o $(ADDL_LIBS) $(LOADLIBES)
192
193$(RANLIB_PROG): $(ADDL_LIBS) ar.o is-ranlib.o arparse.o arlex.o arsup.o $(BFD)
194 $(CC) $(LDFLAGS) $(CFLAGS) -o $(RANLIB_PROG) ar.o arparse.o arlex.o arsup.o is-ranlib.o $(ADDL_LIBS) $(LOADLIBES)
06a97fbd
PB
195
196# This rule creates a single binary that switches between ar and ranlib
197# by looking at argv[0]. Use this kludge to save some disk space.
198# However, you have to install things by hand.
199# (That is after 'make install', replace the installed ranlib by a link to ar.)
200
201# Alternatively, you can install ranlib.sh as ranlib.
202
203ar_with_ranlib: $(ADDL_LIBS) ar.o maybe-ranlib.o $(BFD)
204 $(CC) $(LDFLAGS) $(CFLAGS) -o $(AR_PROG) ar.o maybe-ranlib.o $(ADDL_LIBS) $(LOADLIBES)
a10d26a1
RP
205 -rm -f $(RANLIB_PROG)
206 -ln $(AR_PROG) $(RANLIB_PROG)
99a42820 207
d8e89b6b
RP
208# copy and strip in one binary that uses argv[0] to decide its action.
209
210copy_with_strip: $(ADDL_LIBS) copy.o maybe-strip.o $(BFD)
211 $(CC) $(LDFLAGS) $(CFLAGS) -o $(COPY_PROG) copy.o maybe-strip.o $(ADDL_LIBS) $(LOADLIBES)
a10d26a1
RP
212 -rm -f $(STRIP_PROG)
213 -ln $(COPY_PROG) $(STRIP_PROG)
99a42820 214
6a3958b2
RP
215stage1: force
216 - mkdir stage1
a01bf1fb 217 - mv -f $(STAGESTUFF) stage1
6a3958b2
RP
218
219stage2: force
220 - mkdir stage2
a01bf1fb 221 - mv -f $(STAGESTUFF) stage2
6a3958b2
RP
222
223stage3: force
224 - mkdir stage3
a01bf1fb
RP
225 - mv -f $(STAGESTUFF) stage3
226
227against=stage2
228
229comparison: force
230 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
6a3958b2
RP
231
232de-stage1: force
233 - (cd stage1 ; mv -f * ..)
234 - rmdir stage1
235
236de-stage2: force
237 - (cd stage2 ; mv -f * ..)
238 - rmdir stage2
239
240de-stage3: force
241 - (cd stage3 ; mv -f * ..)
242 - rmdir stage3
243
6b583720
RP
244######################################################################
245# DOCUMENTATION TARGETS
246# TeX output
2226a090 247binutils.dvi: $(srcdir)/binutils.texi
c921e2aa 248 $(TEXI2DVI) $(srcdir)/binutils.texi
b7a11ec2 249
6b583720 250# info file for online browsing
2226a090 251binutils.info: $(srcdir)/binutils.texi
6141fd50 252 $(MAKEINFO) -o binutils.info $(srcdir)/binutils.texi
b7a11ec2 253
0c10ff03 254# different targets for -ms, -mm, -me
c83497f5
RP
255# Try to use a recent texi2roff. v2 was put on prep in jan91.
256# If you want an index, see texi2roff doc for postprocessing
257# and add -i to texi2roff invocations below.
258# Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
259# correspondint -e lines when later texi2roff's are current)
260# + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
261# + @c's deleted explicitly because texi2roff sees texinfo commands in them
262# + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
263# + @alphaenumerate is ridiculously new, turned into @enumerate
264
0c10ff03 265# roff output (-ms)
2226a090 266binutils.ms: $(srcdir)/binutils.texi
6b583720
RP
267 sed -e '/\\input texinfo/d' \
268 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
c83497f5
RP
269 -e '/^@ifinfo/,/^@end ifinfo/d' \
270 -e '/^@c/d' \
2226a090 271 -e 's/{.*,,/{/' \
c83497f5
RP
272 -e 's/@ / /g' \
273 -e 's/^@alphaenumerate/@enumerate/g' \
274 -e 's/^@end alphaenumerate/@end enumerate/g' \
2226a090 275 $(srcdir)/binutils.texi | \
d8e89b6b 276 $(TEXI2ROFF) -ms | \
c83497f5
RP
277 sed -e 's/---/\\(em/g' \
278 >binutils.ms
6b583720 279
0c10ff03 280# roff output (-mm)
c83497f5
RP
281# '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
282# try leaving them in
2226a090 283binutils.mm: $(srcdir)/binutils.texi
0c10ff03
RP
284 sed -e '/\\input texinfo/d' \
285 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
c83497f5
RP
286 -e '/^@ifinfo/,/^@end ifinfo/d' \
287 -e '/^@c/d' \
2226a090
RP
288 -e 's/{.*,,/{/' \
289 -e '/@noindent/d' \
c83497f5
RP
290 -e 's/@ / /g' \
291 -e 's/^@alphaenumerate/@enumerate/g' \
292 -e 's/^@end alphaenumerate/@end enumerate/g' \
2226a090 293 $(srcdir)/binutils.texi | \
d8e89b6b 294 $(TEXI2ROFF) -mm | \
2226a090
RP
295 sed -e 's/---/\\(em/g' \
296 >binutils.mm
0c10ff03
RP
297
298# roff output (-me)
2226a090 299binutils.me: $(srcdir)/binutils.texi
0c10ff03
RP
300 sed -e '/\\input texinfo/d' \
301 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
c83497f5
RP
302 -e '/^@ifinfo/,/^@end ifinfo/d' \
303 -e '/^@c/d' \
2226a090 304 -e 's/{.*,,/{/' \
c83497f5
RP
305 -e 's/@ / /g' \
306 -e 's/^@alphaenumerate/@enumerate/g' \
307 -e 's/^@end alphaenumerate/@end enumerate/g' \
2226a090 308 $(srcdir)/binutils.texi | \
d8e89b6b 309 $(TEXI2ROFF) -me | \
c83497f5
RP
310 sed -e 's/---/\\(em/g' \
311 >binutils.me
0c10ff03
RP
312
313
6b583720
RP
314######################################################################
315
8d5d0e11 316mostlyclean:
3f97524f 317 -rm -f *.o *~ \#* core binutils.?? binutils.???
8d5d0e11 318clean: mostlyclean
3f97524f 319 -rm -f $(PROGS)
8d5d0e11 320distclean: clean
eeece52d 321 -rm -f Makefile config.status sysdep.h
8d5d0e11
PB
322realclean: distclean
323 -rm -f $(DISTSTUFF) TAGS
99a42820
RP
324
325etags tags: TAGS
326
6a3958b2 327TAGS: force
99a42820
RP
328 etags $(INCDIR)/*.h $(BFDSRC)/*.[hc] *.[hc]
329
c83497f5 330install: all
f478fcf6
ILT
331 -parent=`echo $(bindir)|sed -e 's@/[^/]*$$@@'`; \
332 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
333 -if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; fi
3f97524f 334 -for i in $(PROGS) ; do \
3790af1d 335 $(INSTALL_PROGRAM) $$i $(bindir)/`t='$(program_transform_name)'; echo $$i | sed -e "" $$t` ; \
99a42820 336 done
f478fcf6
ILT
337 -parent=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \
338 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
339 -if [ -d $(man1dir) ] ; then true ; else mkdir $(man1dir) ; fi
3f97524f 340 -for i in $(MANPAGES) ; do \
3790af1d 341 $(INSTALL_DATA) $(srcdir)/$$i.1 $(man1dir)/`t='$(program_transform_name)'; echo $$i | sed -e "" $$t`.1 ; \
de53632c 342 done
3f97524f
DZ
343 -if [ -d $(tooldir) ]; then \
344 if [ -d $(tooldir)/bin ] ; then true ; else mkdir $(tooldir)/bin ; fi; \
345 for i in nm strip ; do \
346 rm -f $(tooldir)/bin/$$i; \
347 ln $(bindir)/`t='$(program_transform_name)'; echo $$i | sed -e "" $$t` $(tooldir)/bin/$$i \
348 || $(INSTALL_PROGRAM) $$i $(tooldir)/bin/$$i; \
349 done; \
350 else true; fi
c83497f5 351
d8e89b6b 352install-info: info
f478fcf6
ILT
353 -parent=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \
354 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
355 -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi
de53632c 356 for i in *.info* ; do \
d8e89b6b 357 $(INSTALL_DATA) $$i $(infodir)/$$i ; \
84396dcf 358 done
99a42820 359
d8e89b6b
RP
360clean-info:
361 -rm -rf *.info*
362
e2fe2df4
PB
363# Making a dist:
364# cvs rtag binutils-x-yy binutils
365# cvs co -r binutils-x-yy binutils
366# Sanitize
367# cd {HERE}; make dist [-f Makefile.in]
368
8539db10
PB
369dist: $(DIST_NAME).tar.Z
370
8d5d0e11
PB
371diststuff: $(DISTSTUFF)
372
d8474a9b 373$(DIST_NAME).tar.Z:
e2fe2df4 374 cd ..; chmod og=u `find . -print`
b27d2046 375 cd ../..; rm -f $(DIST_NAME); ln -s devo $(DIST_NAME)
8d5d0e11
PB
376 make diststuff -f Makefile.in
377 cd ../ld; make diststuff -f Makefile.in
3f97524f 378 cd ../gprof; make diststuff -f Makefile.in
d8474a9b 379 cd ../..; tar chf - $(DIST_NAME) | compress >$(DIST_NAME).tar.Z
b27d2046 380 rm -rf ../../$(DIST_NAME)
8539db10 381
d7cce023
JG
382# These get around a bug in Sun Make in SunOS 4.1.1
383alloca.o:alloca.c
a26878d1 384am29k-pinsn.o: am29k-pinsn.c
99a42820 385ar.o: ar.c
22923083 386arsup.o: arsup.c
d7cce023
JG
387bucomm.o: bucomm.c
388copy.o: copy.c
d7cce023 389filemode.o:filemode.c
a10d26a1
RP
390getopt.o:getopt.c
391getopt1.o:getopt1.c
d7cce023
JG
392gmalloc.o:gmalloc.c
393i960-pinsn.o: i960-pinsn.c
394is-ranlib.o:is-ranlib.c
d8e89b6b 395is-strip.o:is-strip.c
d7cce023
JG
396m68k-pinsn.o: m68k-pinsn.c
397maybe-ranlib.o:maybe-ranlib.c
d8e89b6b 398maybe-strip.o:maybe-strip.c
d7cce023
JG
399nm.o: nm.c
400not-ranlib.o:not-ranlib.c
d8e89b6b 401not-strip.o:not-strip.c
d7cce023
JG
402objdump.o: objdump.c
403size.o: size.c
404sparc-pinsn.o: sparc-pinsn.c
60c80016 405i386-pinsn.o: i386-pinsn.c
d7cce023 406strip.o:strip.c
d8e89b6b 407version.o: $(srcdir)/version.c
3f97524f 408 $(CC) $(CFLAGS) $(INCLUDES) $(HDEFINES) $(TDEFINES) -DVERSION='"$(VERSION)"' -c $(srcdir)/version.c
8539db10 409
99a42820
RP
410#-----------------------------------------------------------------------------
411# 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
412#
413# 'VERSION' file must be present and contain a string of the form "x.y"
414#-----------------------------------------------------------------------------
415
416ver960.c: FORCE
417 rm -f ver960.c
418 echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
419
420
421# Dummy target to force execution of dependent targets.
422#
6a3958b2 423force:
99a42820
RP
424
425# Target to uncomment host-specific lines in this makefile. Such lines must
426# have the following string beginning in column 1: #__<hostname>__#
427# Original Makefile is backed up as 'Makefile.old'.
428#
429# Invoke with: make make HOST=xxx
430#
431make:
432 -@if test $(HOST)x = x ; then \
433 echo '\aSpecify "make make HOST=???"'; \
434 exit 1; \
435 fi ; \
436 grep -s "^#The next line was generated by 'make make'" Makefile; \
437 if test $$? = 0 ; then \
438 echo "\aMakefile has already been processed with 'make make'";\
439 exit 1; \
440 fi ; \
441 mv -f Makefile Makefile.old; \
442 echo "#The next line was generated by 'make make'" >Makefile ; \
443 echo "HOST=$(HOST)" >>Makefile ; \
444 echo >>Makefile ; \
445 sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile
446
f1eb48b6 447Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
a26878d1 448 $(SHELL) ./config.status
99a42820
RP
449
450### Local Variables: ***
451### mode:fundamental ***
452### page-delimiter: "^#\f" ***
453### End: ***
454### end of file
This page took 0.082854 seconds and 4 git commands to generate.