1 # Makefile for GNU binary-file utilities
2 # Copyright (C) 1989-1992 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.
27 exec_prefix = $(prefix)
28 bindir = $(exec_prefix)/bin
29 libdir = $(exec_prefix)/lib
32 datadir = $(prefix)/lib
33 mandir = $(prefix)/man
34 man1dir = $(mandir)/man1
35 man2dir = $(mandir)/man2
36 man3dir = $(mandir)/man3
37 man4dir = $(mandir)/man4
38 man5dir = $(mandir)/man5
39 man6dir = $(mandir)/man6
40 man7dir = $(mandir)/man7
41 man8dir = $(mandir)/man8
42 man9dir = $(mandir)/man9
43 infodir = $(prefix)/info
44 includedir = $(prefix)/include
45 docdir
= $(datadir)/doc
50 INSTALL_PROGRAM
= $(INSTALL
)
51 INSTALL_DATA
= $(INSTALL
)
63 # Distribution version
66 DIST_NAME
=binutils-
${VERSION}
68 version
=`./../gcc/gcc -dumpversion`
70 # Where to find texinfo.tex to format docn with TeX
71 TEXIDIR
= $(srcdir)/..
/texinfo
/fsf
73 MANPAGES
= ar.1 nm
.1 objdump
.1 ranlib
.1 size
.1 strip.1
76 # these two are almost the same program
80 # copy and strip should be the same program
84 # These should all be the same program too.
89 PROGS
= $(SIZE_PROG
) $(OBJDUMP_PROG
) $(NM_PROG
) $(AR_PROG
) $(STRIP_PROG
) $(RANLIB_PROG
)
90 STAGESTUFF
= $(PROGS
) *.o
92 BASEDIR
= $(srcdir)/..
95 #### host and target dependant Makefile fragments come in here.
98 INCDIR
= $(BASEDIR
)/include
101 $(CC
) -c
$(CFLAGS
) -I.
-I
$(srcdir) -I
$(INCDIR
) $(HDEFINES
) $(TDEFINES
) $<
103 # When adding .o files, to make VPATH work in Sun Make, you have to
104 # also add a foo.o: foo.c line at the bottom of the file.
105 DISASMS
= m68k-pinsn.o i960-pinsn.o i386-pinsn.o sparc-pinsn.o am29k-pinsn.o
108 ## Random definitions
109 # Hopefully all these may be flushed once we get configuration down pat.
111 # alloca only needed for systems which don't have it and when cc != gcc.
114 # nm tries to malloc enough space for the string table. The old GNU malloc
115 # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might
116 # fail unnecessarily. I've also seen some Unix malloc's fail, even when
117 # there is enough memory. So use the new GNU malloc.
120 # Use the GNU getopt unless you have problems with it.
121 # The IRIS version could probably benefit from being assembled with
122 # libmalloc rather than the ordinary malloc.
123 LIBIBERTY
= .
/..
/libiberty
/libiberty.a
125 # Code shared by all the binutils.
126 BULIBS
= bucomm.o version.o filemode.o
128 ADDL_LIBS
= $(MALLOC
) $(BULIBS
) $(BFD
) $(LIBIBERTY
)
130 BFD
= $(LIBDIR
)/libbfd.a
134 all: $(ADDL_LIBS
) $(PROGS
)
137 /bin
/sh
$(srcdir)/sanity.sh .
141 #$(BFD):$(LIBDIR)/../common/*.c
142 # (cd $(LIBDIR); make)
144 $(SIZE_PROG
): $(ADDL_LIBS
) size.o
$(BFD
)
145 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(SIZE_PROG
) size.o
$(ADDL_LIBS
) $(LOADLIBES
)
147 $(COPY_PROG
): $(ADDL_LIBS
) copy.o not-strip.o
$(BFD
)
148 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(COPY_PROG
) copy.o not-strip.o
$(ADDL_LIBS
) $(LOADLIBES
)
150 $(STRIP_PROG
): $(ADDL_LIBS
) copy.o is-strip.o
$(BFD
)
151 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(STRIP_PROG
) copy.o is-strip.o
$(ADDL_LIBS
) $(LOADLIBES
)
153 $(NM_PROG
): $(ADDL_LIBS
) nm.o
$(BFD
)
154 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(NM_PROG
) nm.o
$(ADDL_LIBS
) $(LOADLIBES
)
156 $(OBJDUMP_PROG
): $(ADDL_LIBS
) size.o objdump.o
$(DISASMS
) $(BFD
)
157 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(OBJDUMP_PROG
) objdump.o
$(DISASMS
) $(ADDL_LIBS
) $(LOADLIBES
)
160 $(BISON
) $(BISONFLAGS
) $(VPATH
)/arparse.y
166 $(FLEX
) -I
-Cem
-t
$(VPATH
)/arlex.l
>arlex.c
168 $(AR_PROG
): $(ADDL_LIBS
) ar.o arparse.o arlex.o not-ranlib.o
$(BFD
) arsup.o
169 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(AR_PROG
) ar.o arparse.o arlex.o arsup.o not-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
171 $(RANLIB_PROG
): $(ADDL_LIBS
) ar.o is-ranlib.o arparse.o arlex.o arsup.o
$(BFD
)
172 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(RANLIB_PROG
) ar.o arparse.o arlex.o arsup.o is-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
174 # This rule creates a single binary that switches between ar and ranlib
175 # by looking at argv[0]. Use this kludge to save some disk space.
176 # However, you have to install things by hand.
177 # (That is after 'make install', replace the installed ranlib by a link to ar.)
179 # Alternatively, you can install ranlib.sh as ranlib.
181 ar_with_ranlib
: $(ADDL_LIBS
) ar.o maybe-ranlib.o
$(BFD
)
182 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(AR_PROG
) ar.o maybe-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
183 -rm -f
$(RANLIB_PROG
)
184 -ln
$(AR_PROG
) $(RANLIB_PROG
)
186 # copy and strip in one binary that uses argv[0] to decide its action.
188 copy_with_strip
: $(ADDL_LIBS
) copy.o maybe-strip.o
$(BFD
)
189 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(COPY_PROG
) copy.o maybe-strip.o
$(ADDL_LIBS
) $(LOADLIBES
)
191 -ln
$(COPY_PROG
) $(STRIP_PROG
)
195 - mv
-f
$(STAGESTUFF
) stage1
199 - mv
-f
$(STAGESTUFF
) stage2
203 - mv
-f
$(STAGESTUFF
) stage3
208 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
211 - (cd stage1
; mv
-f
* ..
)
215 - (cd stage2
; mv
-f
* ..
)
219 - (cd stage3
; mv
-f
* ..
)
222 ######################################################################
223 # DOCUMENTATION TARGETS
225 binutils.
dvi: $(srcdir)/binutils.texi
226 TEXINPUTS
=${TEXIDIR}:.
:$$TEXINPUTS tex $(srcdir)/binutils.texi
228 TEXINPUTS
=${TEXIDIR}:.
:$$TEXINPUTS tex $(srcdir)/binutils.texi
230 # info file for online browsing
231 binutils.
info: $(srcdir)/binutils.texi
232 $(MAKEINFO
) -o binutils.
info $(srcdir)/binutils.texi
234 # different targets for -ms, -mm, -me
235 # Try to use a recent texi2roff. v2 was put on prep in jan91.
236 # If you want an index, see texi2roff doc for postprocessing
237 # and add -i to texi2roff invocations below.
238 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
239 # correspondint -e lines when later texi2roff's are current)
240 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
241 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
242 # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
243 # + @alphaenumerate is ridiculously new, turned into @enumerate
246 binutils.ms
: $(srcdir)/binutils.texi
247 sed
-e
'/\\input texinfo/d' \
248 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
249 -e
'/^@ifinfo/,/^@end ifinfo/d' \
253 -e
's/^@alphaenumerate/@enumerate/g' \
254 -e
's/^@end alphaenumerate/@end enumerate/g' \
255 $(srcdir)/binutils.texi | \
257 sed
-e
's/---/\\(em/g' \
261 # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
262 # try leaving them in
263 binutils.mm
: $(srcdir)/binutils.texi
264 sed
-e
'/\\input texinfo/d' \
265 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
266 -e
'/^@ifinfo/,/^@end ifinfo/d' \
271 -e
's/^@alphaenumerate/@enumerate/g' \
272 -e
's/^@end alphaenumerate/@end enumerate/g' \
273 $(srcdir)/binutils.texi | \
275 sed
-e
's/---/\\(em/g' \
279 binutils.me
: $(srcdir)/binutils.texi
280 sed
-e
'/\\input texinfo/d' \
281 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
282 -e
'/^@ifinfo/,/^@end ifinfo/d' \
286 -e
's/^@alphaenumerate/@enumerate/g' \
287 -e
's/^@end alphaenumerate/@end enumerate/g' \
288 $(srcdir)/binutils.texi | \
290 sed
-e
's/---/\\(em/g' \
294 ######################################################################
297 -rm -f
*.o
*~ \
#* core $(STAGESTUFF) TAGS binutils.?? binutils.???
302 etags
$(INCDIR
)/*.h
$(BFDSRC
)/*.
[hc
] *.
[hc
]
305 -rm -f
$(STAGESTUFF
) TAGS
308 for i in
$(PROGS
) ; do \
309 $(INSTALL_PROGRAM
) $$i $(bindir)/$(program_prefix
)$$i ; \
311 for i in
$(MANPAGES
) ; do \
312 $(INSTALL_DATA
) $(srcdir)/$$i $(man1dir)/$(program_prefix
)$$i ; \
316 for i in
*.
info* ; do \
317 $(INSTALL_DATA
) $$i $(infodir)/$$i ; \
323 dist: $(DIST_NAME
).
tar.Z
326 cd ..
/..
; rm -f
$(DIST_NAME
); ln
-s devo
$(DIST_NAME
)
327 make binutils.mm
-f Makefile.in
328 cd ..
/ld; make
ld.mm
-f Makefile.in
329 cd ..
/..
; tar chf
- $(DIST_NAME
) | compress
>$(DIST_NAME
).
tar.Z
330 rm -rf ..
/..
/$(DIST_NAME
)
332 # These get around a bug in Sun Make in SunOS 4.1.1
334 am29k-pinsn.o
: am29k-pinsn.c
338 cplus-dem.o
:cplus-dem.c
339 filemode.o
:filemode.c
343 i960-pinsn.o
: i960-pinsn.c
344 is-ranlib.o
:is-ranlib.c
345 is-strip.o
:is-strip.c
346 m68k-pinsn.o
: m68k-pinsn.c
347 maybe-ranlib.o
:maybe-ranlib.c
348 maybe-strip.o
:maybe-strip.c
350 not-ranlib.o
:not-ranlib.c
351 not-strip.o
:not-strip.c
354 sparc-pinsn.o
: sparc-pinsn.c
355 i386-pinsn.o
: i386-pinsn.c
357 version.o
: $(srcdir)/version.c
358 $(CC
) $(CFLAGS
) -I.
-I
$(srcdir) -I
$(INCDIR
) $(HDEFINES
) $(TDEFINES
) -DVERSION
='"$(VERSION)"' -c
$(srcdir)/version.c
360 #-----------------------------------------------------------------------------
361 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
363 # 'VERSION' file must be present and contain a string of the form "x.y"
364 #-----------------------------------------------------------------------------
368 echo
"char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
371 # Dummy target to force execution of dependent targets.
375 # Target to uncomment host-specific lines in this makefile. Such lines must
376 # have the following string beginning in column 1: #__<hostname>__#
377 # Original Makefile is backed up as 'Makefile.old'.
379 # Invoke with: make make HOST=xxx
382 -@if
test $(HOST
)x
= x
; then \
383 echo
'\aSpecify "make make HOST=???"'; \
386 grep
-s
"^#The next line was generated by 'make make'" Makefile
; \
387 if
test $$?
= 0 ; then \
388 echo
"\aMakefile has already been processed with 'make make'";\
391 mv
-f Makefile Makefile.old
; \
392 echo
"#The next line was generated by 'make make'" >Makefile
; \
393 echo
"HOST=$(HOST)" >>Makefile
; \
395 sed
"s/^#__$(HOST)__#//" < Makefile.old
>>Makefile
397 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
398 $(SHELL
) .
/config.status
400 ### Local Variables: ***
401 ### mode:fundamental ***
402 ### page-delimiter: "^#\f" ***