1 ### Makefile for GNU binary-file utilities
11 DIST_NAME
=binutils-beta-
${VERSION}
13 version
=`$(unsubdir)/../gcc$(subdir)/gcc -dumpversion`
15 bindir = $(prefix)/bin
16 libdir = $(prefix)/lib
17 libsubdir
= $(libdir)/gcc
/$(target
)/$(version
)
19 TEXIDIR
= $(srcdir)/..
/texinfo
/fsf
22 INSTALL_PROGRAM
= $(INSTALL
)
23 INSTALL_FILE
= $(INSTALL
)
25 ## Configuration options
26 # These should be all you need set before compiling
29 # these two are almost the same program
33 # copy and strip should be the same program
37 # These should all be the same program too.
42 PROGS
= $(SIZE_PROG
) $(COPY_PROG
) $(OBJDUMP_PROG
) $(NM_PROG
) $(AR_PROG
) $(STRIP_PROG
) $(RANLIB_PROG
)
43 STAGESTUFF
= $(PROGS
) *.o
45 BASEDIR
= $(unsubdir
)/..
46 LIBDIR
= $(unsubdir
)/..
/bfd
$(subdir
)
48 #### host and target dependant Makefile fragments come in here.
51 INCDIR
= $(BASEDIR
)/include
53 CFLAGS
= -g
-I
$(srcdir)/..
/include -I
$(INCDIR
) $(HDEFINES
) $(TDEFINES
)
55 # When adding .o files, to make VPATH work in Sun Make, you have to
56 # also add a foo.o: foo.c line at the bottom of the file.
57 DISASMS
= m68k-pinsn.o i960-pinsn.o sparc-pinsn.o am29k-pinsn.o
61 # Hopefully all these may be flushed once we get configuration down pat.
63 # alloca only needed for systems which don't have it and when cc != gcc.
66 # nm tries to malloc enough space for the string table. The old GNU malloc
67 # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might
68 # fail unnecessarily. I've also seen some Unix malloc's fail, even when
69 # there is enough memory. So use the new GNU malloc.
72 # Use the GNU getopt unless you have problems with it.
73 # The IRIS version could probably benefit from being assembled with
74 # libmalloc rather than the ordinary malloc.
75 LIBIBERTY
= $(unsubdir
)/..
/libiberty
$(subdir
)/libiberty.a
77 # Code shared by all the binutils.
78 BULIBS
= bucomm.o version.o filemode.o
80 ADDL_LIBS
= $(MALLOC
) $(BULIBS
) $(BFD
) $(LIBIBERTY
)
82 BFD
= $(LIBDIR
)/libbfd.a
86 all: $(ADDL_LIBS
) $(PROGS
)
89 #$(BFD):$(LIBDIR)/../common/*.c
90 # (cd $(LIBDIR); make)
92 $(SIZE_PROG
): $(ADDL_LIBS
) size.o
$(BFD
)
93 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(SIZE_PROG
) size.o
$(ADDL_LIBS
) $(LOADLIBES
)
95 $(COPY_PROG
): $(ADDL_LIBS
) copy.o
$(BFD
)
96 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(COPY_PROG
) copy.o
$(ADDL_LIBS
) $(LOADLIBES
)
98 $(NM_PROG
): $(ADDL_LIBS
) nm.o
$(BFD
)
99 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(NM_PROG
) nm.o
$(ADDL_LIBS
) $(LOADLIBES
)
101 $(OBJDUMP_PROG
): $(ADDL_LIBS
) size.o objdump.o
$(DISASMS
) $(BFD
)
102 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(OBJDUMP_PROG
) objdump.o
$(DISASMS
) $(ADDL_LIBS
) $(LOADLIBES
)
104 $(AR_PROG
): $(ADDL_LIBS
) ar.o not-ranlib.o
$(BFD
)
105 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(AR_PROG
) ar.o not-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
107 $(RANLIB_PROG
): $(ADDL_LIBS
) ar.o is-ranlib.o
$(BFD
)
108 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(RANLIB_PROG
) ar.o is-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
110 # This rule creates a single binary that switches between ar and ranlib
111 # by looking at argv[0]. Use this kludge to save some disk space.
112 # However, you have to install things by hand.
113 # (That is after 'make install', replace the installed ranlib by a link to ar.)
115 # Alternatively, you can install ranlib.sh as ranlib.
117 ar_with_ranlib
: $(ADDL_LIBS
) ar.o maybe-ranlib.o
$(BFD
)
118 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(AR_PROG
) ar.o maybe-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
119 -rm -f
$(RANLIB_PROG
)
120 -ln
$(AR_PROG
) $(RANLIB_PROG
)
122 $(STRIP_PROG
): $(COPY_PROG
)
124 -ln
$(COPY_PROG
) $(STRIP_PROG
)
128 - mv
-f
$(STAGESTUFF
) stage1
132 - mv
-f
$(STAGESTUFF
) stage2
136 - mv
-f
$(STAGESTUFF
) stage3
141 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
144 - (cd stage1
; mv
-f
* ..
)
148 - (cd stage2
; mv
-f
* ..
)
152 - (cd stage3
; mv
-f
* ..
)
155 binutils.
dvi: binutils.texinfo
156 TEXINPUTS
=${TEXIDIR}:.
:$$TEXINPUTS tex binutils.texinfo
158 TEXINPUTS
=${TEXIDIR}:.
:$$TEXINPUTS tex binutils.texinfo
160 binutils.
info: binutils.texinfo
161 makeinfo binutils.texinfo
164 -rm -f
*.o
*~ \
#* core $(STAGESTUFF) TAGS binutils.?? binutils.???
169 etags
$(INCDIR
)/*.h
$(BFDSRC
)/*.
[hc
] *.
[hc
]
172 -rm -f
$(STAGESTUFF
) TAGS
175 for i in
$(PROGS
) ; do \
176 $(INSTALL_PROGRAM
) $$i $(bindir)/$$i ; \
179 dist: $(DIST_NAME
).
tar.Z
181 $(DIST_NAME
).
tar.Z
: proto-dir
182 ln
-s proto-dir
$(DIST_NAME
)
183 tar chf
- $(DIST_NAME
) | compress
>$(DIST_NAME
).
tar.Z
191 m68k-pinsn.o
: m68k-pinsn.c
192 i960-pinsn.o
: i960-pinsn.c
193 sparc-pinsn.o
: sparc-pinsn.c
194 am29k-pinsn.o
: am29k-pinsn.c
199 filemode.o
:filemode.c
201 #-----------------------------------------------------------------------------
202 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
204 # 'VERSION' file must be present and contain a string of the form "x.y"
205 #-----------------------------------------------------------------------------
209 echo
"char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
212 # Dummy target to force execution of dependent targets.
216 # Target to uncomment host-specific lines in this makefile. Such lines must
217 # have the following string beginning in column 1: #__<hostname>__#
218 # Original Makefile is backed up as 'Makefile.old'.
220 # Invoke with: make make HOST=xxx
223 -@if
test $(HOST
)x
= x
; then \
224 echo
'\aSpecify "make make HOST=???"'; \
227 grep
-s
"^#The next line was generated by 'make make'" Makefile
; \
228 if
test $$?
= 0 ; then \
229 echo
"\aMakefile has already been processed with 'make make'";\
232 mv
-f Makefile Makefile.old
; \
233 echo
"#The next line was generated by 'make make'" >Makefile
; \
234 echo
"HOST=$(HOST)" >>Makefile
; \
236 sed
"s/^#__$(HOST)__#//" < Makefile.old
>>Makefile
238 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
239 $(SHELL
) .
/config.status
241 ### Local Variables: ***
242 ### mode:fundamental ***
243 ### page-delimiter: "^#\f" ***