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
)
61 BISON
= `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/ ; else echo bison -y ; fi`
62 # Comment these out if using lex.
64 LEX
= `if [ -f ../flex/flex ] ; then echo ../flex/flex -S../flex/flex.skel ; else echo flex ; fi`
66 # Distribution version
69 DIST_NAME
=binutils-
${VERSION}
71 version
=`./../gcc/gcc -dumpversion`
73 # Where to find texinfo.tex to format docn with TeX
74 TEXIDIR
= $(srcdir)/..
/texinfo
/fsf
76 MANPAGES
= ar.1 nm
.1 objdump
.1 ranlib
.1 size
.1 strip.1
79 # these two are almost the same program
83 # copy and strip should be the same program
87 # These should all be the same program too.
92 PROGS
= $(SIZE_PROG
) $(OBJDUMP_PROG
) $(NM_PROG
) $(AR_PROG
) $(STRIP_PROG
) $(RANLIB_PROG
)
93 STAGESTUFF
= $(PROGS
) *.o
95 BASEDIR
= $(srcdir)/..
98 #### host and target dependant Makefile fragments come in here.
101 INCDIR
= $(BASEDIR
)/include
104 $(CC
) -c
$(CFLAGS
) -I.
-I
$(srcdir) -I
$(INCDIR
) $(HDEFINES
) $(TDEFINES
) $<
106 # When adding .o files, to make VPATH work in Sun Make, you have to
107 # also add a foo.o: foo.c line at the bottom of the file.
108 DISASMS
= m68k-pinsn.o i960-pinsn.o i386-pinsn.o sparc-pinsn.o am29k-pinsn.o
111 ## Random definitions
112 # Hopefully all these may be flushed once we get configuration down pat.
114 # alloca only needed for systems which don't have it and when cc != gcc.
117 # nm tries to malloc enough space for the string table. The old GNU malloc
118 # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might
119 # fail unnecessarily. I've also seen some Unix malloc's fail, even when
120 # there is enough memory. So use the new GNU malloc.
123 # Use the GNU getopt unless you have problems with it.
124 # The IRIS version could probably benefit from being assembled with
125 # libmalloc rather than the ordinary malloc.
126 LIBIBERTY
= .
/..
/libiberty
/libiberty.a
128 # Code shared by all the binutils.
129 BULIBS
= bucomm.o version.o filemode.o
131 ADDL_LIBS
= $(MALLOC
) $(BULIBS
) $(BFD
) $(LIBIBERTY
)
133 BFD
= $(LIBDIR
)/libbfd.a
137 all: $(ADDL_LIBS
) $(PROGS
)
140 /bin
/sh
$(srcdir)/sanity.sh .
143 /bin
/sh
$(srcdir)/sanity.sh
$(bindir)
147 #$(BFD):$(LIBDIR)/../common/*.c
148 # (cd $(LIBDIR); make)
150 $(SIZE_PROG
): $(ADDL_LIBS
) size.o
$(BFD
)
151 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(SIZE_PROG
) size.o
$(ADDL_LIBS
) $(LOADLIBES
)
153 $(COPY_PROG
): $(ADDL_LIBS
) copy.o not-strip.o
$(BFD
)
154 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(COPY_PROG
) copy.o not-strip.o
$(ADDL_LIBS
) $(LOADLIBES
)
156 $(STRIP_PROG
): $(ADDL_LIBS
) copy.o is-strip.o
$(BFD
)
157 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(STRIP_PROG
) copy.o is-strip.o
$(ADDL_LIBS
) $(LOADLIBES
)
159 $(NM_PROG
): $(ADDL_LIBS
) nm.o
$(BFD
)
160 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(NM_PROG
) nm.o
$(ADDL_LIBS
) $(LOADLIBES
)
162 $(OBJDUMP_PROG
): $(ADDL_LIBS
) size.o objdump.o
$(DISASMS
) $(BFD
)
163 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(OBJDUMP_PROG
) objdump.o
$(DISASMS
) $(ADDL_LIBS
) $(LOADLIBES
)
166 $(BISON
) $(BISONFLAGS
) $(VPATH
)/arparse.y
172 $(LEX
) $(LEX_OPTIONS
) -t
$(VPATH
)/arlex.l
>arlex.c
174 $(AR_PROG
): $(ADDL_LIBS
) ar.o arparse.o arlex.o not-ranlib.o
$(BFD
) arsup.o
175 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(AR_PROG
) ar.o arparse.o arlex.o arsup.o not-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
177 $(RANLIB_PROG
): $(ADDL_LIBS
) ar.o is-ranlib.o arparse.o arlex.o arsup.o
$(BFD
)
178 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(RANLIB_PROG
) ar.o arparse.o arlex.o arsup.o is-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
180 # This rule creates a single binary that switches between ar and ranlib
181 # by looking at argv[0]. Use this kludge to save some disk space.
182 # However, you have to install things by hand.
183 # (That is after 'make install', replace the installed ranlib by a link to ar.)
185 # Alternatively, you can install ranlib.sh as ranlib.
187 ar_with_ranlib
: $(ADDL_LIBS
) ar.o maybe-ranlib.o
$(BFD
)
188 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(AR_PROG
) ar.o maybe-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
189 -rm -f
$(RANLIB_PROG
)
190 -ln
$(AR_PROG
) $(RANLIB_PROG
)
192 # copy and strip in one binary that uses argv[0] to decide its action.
194 copy_with_strip
: $(ADDL_LIBS
) copy.o maybe-strip.o
$(BFD
)
195 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(COPY_PROG
) copy.o maybe-strip.o
$(ADDL_LIBS
) $(LOADLIBES
)
197 -ln
$(COPY_PROG
) $(STRIP_PROG
)
201 - mv
-f
$(STAGESTUFF
) stage1
205 - mv
-f
$(STAGESTUFF
) stage2
209 - mv
-f
$(STAGESTUFF
) stage3
214 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
217 - (cd stage1
; mv
-f
* ..
)
221 - (cd stage2
; mv
-f
* ..
)
225 - (cd stage3
; mv
-f
* ..
)
228 ######################################################################
229 # DOCUMENTATION TARGETS
231 binutils.
dvi: $(srcdir)/binutils.texi
232 TEXINPUTS
=${TEXIDIR}:.
:$$TEXINPUTS tex $(srcdir)/binutils.texi
234 TEXINPUTS
=${TEXIDIR}:.
:$$TEXINPUTS tex $(srcdir)/binutils.texi
236 # info file for online browsing
237 binutils.
info: $(srcdir)/binutils.texi
238 $(MAKEINFO
) -o binutils.
info $(srcdir)/binutils.texi
240 # different targets for -ms, -mm, -me
241 # Try to use a recent texi2roff. v2 was put on prep in jan91.
242 # If you want an index, see texi2roff doc for postprocessing
243 # and add -i to texi2roff invocations below.
244 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
245 # correspondint -e lines when later texi2roff's are current)
246 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
247 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
248 # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
249 # + @alphaenumerate is ridiculously new, turned into @enumerate
252 binutils.ms
: $(srcdir)/binutils.texi
253 sed
-e
'/\\input texinfo/d' \
254 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
255 -e
'/^@ifinfo/,/^@end ifinfo/d' \
259 -e
's/^@alphaenumerate/@enumerate/g' \
260 -e
's/^@end alphaenumerate/@end enumerate/g' \
261 $(srcdir)/binutils.texi | \
263 sed
-e
's/---/\\(em/g' \
267 # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
268 # try leaving them in
269 binutils.mm
: $(srcdir)/binutils.texi
270 sed
-e
'/\\input texinfo/d' \
271 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
272 -e
'/^@ifinfo/,/^@end ifinfo/d' \
277 -e
's/^@alphaenumerate/@enumerate/g' \
278 -e
's/^@end alphaenumerate/@end enumerate/g' \
279 $(srcdir)/binutils.texi | \
281 sed
-e
's/---/\\(em/g' \
285 binutils.me
: $(srcdir)/binutils.texi
286 sed
-e
'/\\input texinfo/d' \
287 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
288 -e
'/^@ifinfo/,/^@end ifinfo/d' \
292 -e
's/^@alphaenumerate/@enumerate/g' \
293 -e
's/^@end alphaenumerate/@end enumerate/g' \
294 $(srcdir)/binutils.texi | \
296 sed
-e
's/---/\\(em/g' \
300 ######################################################################
303 -rm -f
*.o
*~ \
#* core $(STAGESTUFF) TAGS binutils.?? binutils.???
308 etags
$(INCDIR
)/*.h
$(BFDSRC
)/*.
[hc
] *.
[hc
]
311 -rm -f
$(STAGESTUFF
) TAGS
314 for i in
$(PROGS
) ; do \
315 $(INSTALL_PROGRAM
) $$i $(bindir)/$(program_prefix
)$$i ; \
317 for i in
$(MANPAGES
) ; do \
318 $(INSTALL_DATA
) $(srcdir)/$$i $(man1dir)/$(program_prefix
)$$i ; \
322 for i in
*.
info* ; do \
323 $(INSTALL_DATA
) $$i $(infodir)/$$i ; \
329 dist: $(DIST_NAME
).
tar.Z
332 cd ..
/..
; rm -f
$(DIST_NAME
); ln
-s devo
$(DIST_NAME
)
333 make arparse.c arlex.c binutils.mm
-f Makefile.in
334 cd ..
/ld; make ldgram.c ldgram.h ldlex.c
ld.mm
-f Makefile.in
335 cd ..
/..
; tar chf
- $(DIST_NAME
) | compress
>$(DIST_NAME
).
tar.Z
336 rm -rf ..
/..
/$(DIST_NAME
)
338 # These get around a bug in Sun Make in SunOS 4.1.1
340 am29k-pinsn.o
: am29k-pinsn.c
345 cplus-dem.o
:cplus-dem.c
346 filemode.o
:filemode.c
350 i960-pinsn.o
: i960-pinsn.c
351 is-ranlib.o
:is-ranlib.c
352 is-strip.o
:is-strip.c
353 m68k-pinsn.o
: m68k-pinsn.c
354 maybe-ranlib.o
:maybe-ranlib.c
355 maybe-strip.o
:maybe-strip.c
357 not-ranlib.o
:not-ranlib.c
358 not-strip.o
:not-strip.c
361 sparc-pinsn.o
: sparc-pinsn.c
362 i386-pinsn.o
: i386-pinsn.c
364 version.o
: $(srcdir)/version.c
365 $(CC
) $(CFLAGS
) -I.
-I
$(srcdir) -I
$(INCDIR
) $(HDEFINES
) $(TDEFINES
) -DVERSION
='"$(VERSION)"' -c
$(srcdir)/version.c
367 #-----------------------------------------------------------------------------
368 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
370 # 'VERSION' file must be present and contain a string of the form "x.y"
371 #-----------------------------------------------------------------------------
375 echo
"char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
378 # Dummy target to force execution of dependent targets.
382 # Target to uncomment host-specific lines in this makefile. Such lines must
383 # have the following string beginning in column 1: #__<hostname>__#
384 # Original Makefile is backed up as 'Makefile.old'.
386 # Invoke with: make make HOST=xxx
389 -@if
test $(HOST
)x
= x
; then \
390 echo
'\aSpecify "make make HOST=???"'; \
393 grep
-s
"^#The next line was generated by 'make make'" Makefile
; \
394 if
test $$?
= 0 ; then \
395 echo
"\aMakefile has already been processed with 'make make'";\
398 mv
-f Makefile Makefile.old
; \
399 echo
"#The next line was generated by 'make make'" >Makefile
; \
400 echo
"HOST=$(HOST)" >>Makefile
; \
402 sed
"s/^#__$(HOST)__#//" < Makefile.old
>>Makefile
404 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
405 $(SHELL
) .
/config.status
407 ### Local Variables: ***
408 ### mode:fundamental ***
409 ### page-delimiter: "^#\f" ***