1 ### Makefile for GNU binary-file utilities
11 DIST_NAME
=binutils-beta-
${VERSION}
13 version
=`$(unsubdir)/../gcc$(subdir)/gcc -dumpversion`
15 bindir = $(prefix)/H-
$(host_alias
)/T-independent
/bin
17 # Where to find texinfo.tex to format docn with TeX
18 TEXIDIR
= $(srcdir)/..
/texinfo
/fsf
21 #INSTALL_PROGRAM = $(INSTALL)
22 #INSTALL_FILE = $(INSTALL)
25 # these two are almost the same program
29 # copy and strip should be the same program
33 # These should all be the same program too.
38 PROGS
= $(SIZE_PROG
) $(COPY_PROG
) $(OBJDUMP_PROG
) $(NM_PROG
) $(AR_PROG
) $(STRIP_PROG
) $(RANLIB_PROG
)
39 STAGESTUFF
= $(PROGS
) *.o
41 BASEDIR
= $(unsubdir
)/..
42 LIBDIR
= $(unsubdir
)/..
/bfd
$(subdir
)
44 #### host and target dependant Makefile fragments come in here.
47 INCDIR
= $(BASEDIR
)/include
49 CFLAGS
= -g
-I.
-I
$(INCDIR
) $(HDEFINES
) $(TDEFINES
)
51 # When adding .o files, to make VPATH work in Sun Make, you have to
52 # also add a foo.o: foo.c line at the bottom of the file.
53 DISASMS
= m68k-pinsn.o i960-pinsn.o sparc-pinsn.o am29k-pinsn.o
57 # Hopefully all these may be flushed once we get configuration down pat.
59 # alloca only needed for systems which don't have it and when cc != gcc.
62 # nm tries to malloc enough space for the string table. The old GNU malloc
63 # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might
64 # fail unnecessarily. I've also seen some Unix malloc's fail, even when
65 # there is enough memory. So use the new GNU malloc.
68 # Use the GNU getopt unless you have problems with it.
69 # The IRIS version could probably benefit from being assembled with
70 # libmalloc rather than the ordinary malloc.
71 LIBIBERTY
= $(unsubdir
)/..
/libiberty
$(subdir
)/libiberty.a
73 # Code shared by all the binutils.
74 BULIBS
= bucomm.o version.o filemode.o
76 ADDL_LIBS
= $(MALLOC
) $(BULIBS
) $(BFD
) $(LIBIBERTY
)
78 BFD
= $(LIBDIR
)/libbfd.a
82 all: $(ADDL_LIBS
) $(PROGS
)
85 #$(BFD):$(LIBDIR)/../common/*.c
86 # (cd $(LIBDIR); make)
88 $(SIZE_PROG
): $(ADDL_LIBS
) size.o
$(BFD
)
89 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(SIZE_PROG
) size.o
$(ADDL_LIBS
) $(LOADLIBES
)
91 $(COPY_PROG
): $(ADDL_LIBS
) copy.o
$(BFD
)
92 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(COPY_PROG
) copy.o
$(ADDL_LIBS
) $(LOADLIBES
)
94 $(NM_PROG
): $(ADDL_LIBS
) nm.o
$(BFD
)
95 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(NM_PROG
) nm.o
$(ADDL_LIBS
) $(LOADLIBES
)
97 $(OBJDUMP_PROG
): $(ADDL_LIBS
) size.o objdump.o
$(DISASMS
) $(BFD
)
98 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(OBJDUMP_PROG
) objdump.o
$(DISASMS
) $(ADDL_LIBS
) $(LOADLIBES
)
100 $(AR_PROG
): $(ADDL_LIBS
) ar.o not-ranlib.o
$(BFD
)
101 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(AR_PROG
) ar.o not-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
103 $(RANLIB_PROG
): $(ADDL_LIBS
) ar.o is-ranlib.o
$(BFD
)
104 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(RANLIB_PROG
) ar.o is-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
106 # This rule creates a single binary that switches between ar and ranlib
107 # by looking at argv[0]. Use this kludge to save some disk space.
108 # However, you have to install things by hand.
109 # (That is after 'make install', replace the installed ranlib by a link to ar.)
111 # Alternatively, you can install ranlib.sh as ranlib.
113 ar_with_ranlib
: $(ADDL_LIBS
) ar.o maybe-ranlib.o
$(BFD
)
114 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(AR_PROG
) ar.o maybe-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
115 -rm -f
$(RANLIB_PROG
)
116 -ln
$(AR_PROG
) $(RANLIB_PROG
)
118 $(STRIP_PROG
): $(COPY_PROG
)
120 -ln
$(COPY_PROG
) $(STRIP_PROG
)
124 - mv
-f
$(STAGESTUFF
) stage1
128 - mv
-f
$(STAGESTUFF
) stage2
132 - mv
-f
$(STAGESTUFF
) stage3
137 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
140 - (cd stage1
; mv
-f
* ..
)
144 - (cd stage2
; mv
-f
* ..
)
148 - (cd stage3
; mv
-f
* ..
)
151 ######################################################################
152 # DOCUMENTATION TARGETS
154 binutils.
dvi: binutils.texinfo
155 TEXINPUTS
=${TEXIDIR}:.
:$$TEXINPUTS tex binutils.texinfo
157 TEXINPUTS
=${TEXIDIR}:.
:$$TEXINPUTS tex binutils.texinfo
159 # info file for online browsing
160 binutils.
info: binutils.texinfo
161 makeinfo binutils.texinfo
163 # different targets for -ms, -mm, -me
164 # (we don't use a variable because we don't trust all makes to handle
165 # a var in the target name right).
167 binutils.ms
: binutils.texinfo
168 sed
-e
'/\\input texinfo/d' \
169 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
171 texi2roff
-ms
>binutils.ms
174 binutils.mm
: binutils.texinfo
175 sed
-e
'/\\input texinfo/d' \
176 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
178 texi2roff
-mm
>binutils.mm
181 binutils.me
: binutils.texinfo
182 sed
-e
'/\\input texinfo/d' \
183 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
185 texi2roff
-me
>binutils.me
188 ######################################################################
191 -rm -f
*.o
*~ \
#* core $(STAGESTUFF) TAGS binutils.?? binutils.???
196 etags
$(INCDIR
)/*.h
$(BFDSRC
)/*.
[hc
] *.
[hc
]
199 -rm -f
$(STAGESTUFF
) TAGS
202 for i in
$(PROGS
) ; do \
203 cp
$$i $(bindir)/$$i.new
; \
204 mv
-f
$(bindir)/$$i.new
$(bindir)/$$i ; \
207 dist: $(DIST_NAME
).
tar.Z
209 $(DIST_NAME
).
tar.Z
: proto-dir
210 ln
-s proto-dir
$(DIST_NAME
)
211 tar chf
- $(DIST_NAME
) | compress
>$(DIST_NAME
).
tar.Z
214 # These get around a bug in Sun Make in SunOS 4.1.1
216 am29k-pinsn.o
: am29k-pinsn.c
220 cplus-dem.o
:cplus-dem.c
221 filemode.o
:filemode.c
225 i960-pinsn.o
: i960-pinsn.c
226 is-ranlib.o
:is-ranlib.c
227 m68k-pinsn.o
: m68k-pinsn.c
228 maybe-ranlib.o
:maybe-ranlib.c
230 not-ranlib.o
:not-ranlib.c
233 sparc-pinsn.o
: sparc-pinsn.c
237 #-----------------------------------------------------------------------------
238 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
240 # 'VERSION' file must be present and contain a string of the form "x.y"
241 #-----------------------------------------------------------------------------
245 echo
"char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
248 # Dummy target to force execution of dependent targets.
252 # Target to uncomment host-specific lines in this makefile. Such lines must
253 # have the following string beginning in column 1: #__<hostname>__#
254 # Original Makefile is backed up as 'Makefile.old'.
256 # Invoke with: make make HOST=xxx
259 -@if
test $(HOST
)x
= x
; then \
260 echo
'\aSpecify "make make HOST=???"'; \
263 grep
-s
"^#The next line was generated by 'make make'" Makefile
; \
264 if
test $$?
= 0 ; then \
265 echo
"\aMakefile has already been processed with 'make make'";\
268 mv
-f Makefile Makefile.old
; \
269 echo
"#The next line was generated by 'make make'" >Makefile
; \
270 echo
"HOST=$(HOST)" >>Makefile
; \
272 sed
"s/^#__$(HOST)__#//" < Makefile.old
>>Makefile
274 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
275 $(SHELL
) .
/config.status
277 ### Local Variables: ***
278 ### mode:fundamental ***
279 ### page-delimiter: "^#\f" ***