1 # Makefile for GNU binary-file utilities
2 # Copyright (C) 1989-1991 Free Software Foundation, Inc.
4 # This file is part of GNU binutils.
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.
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.
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.
25 idestdir
= $(ddestdir
)
31 # Distribution version
34 DIST_NAME
=binutils-beta-
${VERSION}
36 version
=`$(unsubdir)/../gcc$(subdir)/gcc -dumpversion`
38 bindir = $(prefix)/bin
39 mandir = $(idestdir
)/man
41 # Where to find texinfo.tex to format docn with TeX
42 TEXIDIR
= $(srcdir)/..
/texinfo
/fsf
44 MANPAGES
= ar.1 nm
.1 objdump
.1 ranlib
.1 size
.1 strip.1
47 #INSTALL_PROGRAM = $(INSTALL)
48 #INSTALL_FILE = $(INSTALL)
51 # these two are almost the same program
55 # copy and strip should be the same program
59 # These should all be the same program too.
64 PROGS
= $(SIZE_PROG
) $(COPY_PROG
) $(OBJDUMP_PROG
) $(NM_PROG
) $(AR_PROG
) $(STRIP_PROG
) $(RANLIB_PROG
)
65 STAGESTUFF
= $(PROGS
) *.o
67 BASEDIR
= $(srcdir)/..
68 LIBDIR
= $(unsubdir
)/..
/bfd
$(subdir
)
71 #### host and target dependant Makefile fragments come in here.
74 INCDIR
= $(BASEDIR
)/include
76 CFLAGS
= $(MINUS_G
) -I.
-I
$(srcdir) -I
$(INCDIR
) $(HDEFINES
) $(TDEFINES
)
78 # When adding .o files, to make VPATH work in Sun Make, you have to
79 # also add a foo.o: foo.c line at the bottom of the file.
80 DISASMS
= m68k-pinsn.o i960-pinsn.o sparc-pinsn.o am29k-pinsn.o
84 # Hopefully all these may be flushed once we get configuration down pat.
86 # alloca only needed for systems which don't have it and when cc != gcc.
89 # nm tries to malloc enough space for the string table. The old GNU malloc
90 # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might
91 # fail unnecessarily. I've also seen some Unix malloc's fail, even when
92 # there is enough memory. So use the new GNU malloc.
95 # Use the GNU getopt unless you have problems with it.
96 # The IRIS version could probably benefit from being assembled with
97 # libmalloc rather than the ordinary malloc.
98 LIBIBERTY
= $(unsubdir
)/..
/libiberty
$(subdir
)/libiberty.a
100 # Code shared by all the binutils.
101 BULIBS
= bucomm.o version.o filemode.o
103 ADDL_LIBS
= $(MALLOC
) $(BULIBS
) $(BFD
) $(LIBIBERTY
)
105 BFD
= $(LIBDIR
)/libbfd.a
109 all: $(ADDL_LIBS
) $(PROGS
)
111 all-info
: binutils.
info
113 #$(BFD):$(LIBDIR)/../common/*.c
114 # (cd $(LIBDIR); make)
116 $(SIZE_PROG
): $(ADDL_LIBS
) size.o
$(BFD
)
117 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(SIZE_PROG
) size.o
$(ADDL_LIBS
) $(LOADLIBES
)
119 $(COPY_PROG
): $(ADDL_LIBS
) copy.o
$(BFD
)
120 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(COPY_PROG
) copy.o
$(ADDL_LIBS
) $(LOADLIBES
)
122 $(NM_PROG
): $(ADDL_LIBS
) nm.o
$(BFD
)
123 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(NM_PROG
) nm.o
$(ADDL_LIBS
) $(LOADLIBES
)
125 $(OBJDUMP_PROG
): $(ADDL_LIBS
) size.o objdump.o
$(DISASMS
) $(BFD
)
126 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(OBJDUMP_PROG
) objdump.o
$(DISASMS
) $(ADDL_LIBS
) $(LOADLIBES
)
128 $(AR_PROG
): $(ADDL_LIBS
) ar.o not-ranlib.o
$(BFD
)
129 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(AR_PROG
) ar.o not-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
131 $(RANLIB_PROG
): $(ADDL_LIBS
) ar.o is-ranlib.o
$(BFD
)
132 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(RANLIB_PROG
) ar.o is-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
134 # This rule creates a single binary that switches between ar and ranlib
135 # by looking at argv[0]. Use this kludge to save some disk space.
136 # However, you have to install things by hand.
137 # (That is after 'make install', replace the installed ranlib by a link to ar.)
139 # Alternatively, you can install ranlib.sh as ranlib.
141 ar_with_ranlib
: $(ADDL_LIBS
) ar.o maybe-ranlib.o
$(BFD
)
142 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(AR_PROG
) ar.o maybe-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
143 -rm -f
$(RANLIB_PROG
)
144 -ln
$(AR_PROG
) $(RANLIB_PROG
)
146 $(STRIP_PROG
): $(COPY_PROG
)
148 -ln
$(COPY_PROG
) $(STRIP_PROG
)
152 - mv
-f
$(STAGESTUFF
) stage1
156 - mv
-f
$(STAGESTUFF
) stage2
160 - mv
-f
$(STAGESTUFF
) stage3
165 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
168 - (cd stage1
; mv
-f
* ..
)
172 - (cd stage2
; mv
-f
* ..
)
176 - (cd stage3
; mv
-f
* ..
)
179 ######################################################################
180 # DOCUMENTATION TARGETS
182 binutils.
dvi: $(srcdir)/binutils.texi
183 TEXINPUTS
=${TEXIDIR}:.
:$$TEXINPUTS tex $(srcdir)/binutils.texi
185 TEXINPUTS
=${TEXIDIR}:.
:$$TEXINPUTS tex $(srcdir)/binutils.texi
187 # info file for online browsing
188 binutils.
info: $(srcdir)/binutils.texi
189 $(MAKEINFO
) -o binutils.
info $(srcdir)/binutils.texi
191 # different targets for -ms, -mm, -me
192 # Try to use a recent texi2roff. v2 was put on prep in jan91.
193 # If you want an index, see texi2roff doc for postprocessing
194 # and add -i to texi2roff invocations below.
195 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
196 # correspondint -e lines when later texi2roff's are current)
197 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
198 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
199 # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
200 # + @alphaenumerate is ridiculously new, turned into @enumerate
203 binutils.ms
: $(srcdir)/binutils.texi
204 sed
-e
'/\\input texinfo/d' \
205 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
206 -e
'/^@ifinfo/,/^@end ifinfo/d' \
210 -e
's/^@alphaenumerate/@enumerate/g' \
211 -e
's/^@end alphaenumerate/@end enumerate/g' \
212 $(srcdir)/binutils.texi | \
214 sed
-e
's/---/\\(em/g' \
218 # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
219 # try leaving them in
220 binutils.mm
: $(srcdir)/binutils.texi
221 sed
-e
'/\\input texinfo/d' \
222 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
223 -e
'/^@ifinfo/,/^@end ifinfo/d' \
228 -e
's/^@alphaenumerate/@enumerate/g' \
229 -e
's/^@end alphaenumerate/@end enumerate/g' \
230 $(srcdir)/binutils.texi | \
232 sed
-e
's/---/\\(em/g' \
236 binutils.me
: $(srcdir)/binutils.texi
237 sed
-e
'/\\input texinfo/d' \
238 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
239 -e
'/^@ifinfo/,/^@end ifinfo/d' \
243 -e
's/^@alphaenumerate/@enumerate/g' \
244 -e
's/^@end alphaenumerate/@end enumerate/g' \
245 $(srcdir)/binutils.texi | \
247 sed
-e
's/---/\\(em/g' \
251 ######################################################################
254 -rm -f
*.o
*~ \
#* core $(STAGESTUFF) TAGS binutils.?? binutils.???
259 etags
$(INCDIR
)/*.h
$(BFDSRC
)/*.
[hc
] *.
[hc
]
262 -rm -f
$(STAGESTUFF
) TAGS
265 for i in
$(PROGS
) ; do \
266 (cp
$$i $(bindir)/$$i.new \
267 && mv
-f
$(bindir)/$$i.new
$(bindir)/$$i) \
270 for i in
$(MANPAGES
) ; do \
271 (cp
$(srcdir)/$$i $(mandir)/man1
/$$i.new \
272 && mv
-f
$(mandir)/man1
/$$i.new
$(mandir)/man1
/$$i) \
276 install-info
: all-info
277 for i in
*.
info* ; do \
278 (cp
$$i $(idestdir
)/info/$$i.new \
279 && mv
-f
$(idestdir
)/info/$$i.new
$(idestdir
)/info/$$i) \
283 dist: $(DIST_NAME
).
tar.Z
286 cd ..
/..
; rm -f
$(DIST_NAME
); ln
-s devo
$(DIST_NAME
)
287 make binutils.mm
-f Makefile.in
288 cd ..
/ld; make
ld.mm
-f Makefile.in
289 cd ..
/..
; tar chf
- $(DIST_NAME
) | compress
>$(DIST_NAME
).
tar.Z
290 rm -rf ..
/..
/$(DIST_NAME
)
292 # These get around a bug in Sun Make in SunOS 4.1.1
294 am29k-pinsn.o
: am29k-pinsn.c
298 cplus-dem.o
:cplus-dem.c
299 filemode.o
:filemode.c
303 i960-pinsn.o
: i960-pinsn.c
304 is-ranlib.o
:is-ranlib.c
305 m68k-pinsn.o
: m68k-pinsn.c
306 maybe-ranlib.o
:maybe-ranlib.c
308 not-ranlib.o
:not-ranlib.c
311 sparc-pinsn.o
: sparc-pinsn.c
315 #-----------------------------------------------------------------------------
316 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
318 # 'VERSION' file must be present and contain a string of the form "x.y"
319 #-----------------------------------------------------------------------------
323 echo
"char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
326 # Dummy target to force execution of dependent targets.
330 # Target to uncomment host-specific lines in this makefile. Such lines must
331 # have the following string beginning in column 1: #__<hostname>__#
332 # Original Makefile is backed up as 'Makefile.old'.
334 # Invoke with: make make HOST=xxx
337 -@if
test $(HOST
)x
= x
; then \
338 echo
'\aSpecify "make make HOST=???"'; \
341 grep
-s
"^#The next line was generated by 'make make'" Makefile
; \
342 if
test $$?
= 0 ; then \
343 echo
"\aMakefile has already been processed with 'make make'";\
346 mv
-f Makefile Makefile.old
; \
347 echo
"#The next line was generated by 'make make'" >Makefile
; \
348 echo
"HOST=$(HOST)" >>Makefile
; \
350 sed
"s/^#__$(HOST)__#//" < Makefile.old
>>Makefile
352 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
353 $(SHELL
) .
/config.status
355 ### Local Variables: ***
356 ### mode:fundamental ***
357 ### page-delimiter: "^#\f" ***