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
)
26 # these two are almost the same program
30 # copy and strip should be the same program
34 # These should all be the same program too.
39 PROGS
= $(SIZE_PROG
) $(COPY_PROG
) $(OBJDUMP_PROG
) $(NM_PROG
) $(AR_PROG
) $(STRIP_PROG
) $(RANLIB_PROG
)
40 STAGESTUFF
= $(PROGS
) *.o
42 BASEDIR
= $(unsubdir
)/..
43 LIBDIR
= $(unsubdir
)/..
/bfd
$(subdir
)
45 #### host and target dependant Makefile fragments come in here.
48 INCDIR
= $(BASEDIR
)/include
50 CFLAGS
= -g
-I
$(srcdir)/..
/include -I
$(INCDIR
) $(HDEFINES
) $(TDEFINES
)
52 # When adding .o files, to make VPATH work in Sun Make, you have to
53 # also add a foo.o: foo.c line at the bottom of the file.
54 DISASMS
= m68k-pinsn.o i960-pinsn.o sparc-pinsn.o am29k-pinsn.o
58 # Hopefully all these may be flushed once we get configuration down pat.
60 # alloca only needed for systems which don't have it and when cc != gcc.
63 # nm tries to malloc enough space for the string table. The old GNU malloc
64 # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might
65 # fail unnecessarily. I've also seen some Unix malloc's fail, even when
66 # there is enough memory. So use the new GNU malloc.
69 # Use the GNU getopt unless you have problems with it.
70 # The IRIS version could probably benefit from being assembled with
71 # libmalloc rather than the ordinary malloc.
72 LIBIBERTY
= $(unsubdir
)/..
/libiberty
$(subdir
)/libiberty.a
74 # Code shared by all the binutils.
75 BULIBS
= bucomm.o version.o filemode.o
77 ADDL_LIBS
= $(MALLOC
) $(BULIBS
) $(BFD
) $(LIBIBERTY
)
79 BFD
= $(LIBDIR
)/libbfd.a
83 all: $(ADDL_LIBS
) $(PROGS
)
86 #$(BFD):$(LIBDIR)/../common/*.c
87 # (cd $(LIBDIR); make)
89 $(SIZE_PROG
): $(ADDL_LIBS
) size.o
$(BFD
)
90 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(SIZE_PROG
) size.o
$(ADDL_LIBS
) $(LOADLIBES
)
92 $(COPY_PROG
): $(ADDL_LIBS
) copy.o
$(BFD
)
93 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(COPY_PROG
) copy.o
$(ADDL_LIBS
) $(LOADLIBES
)
95 $(NM_PROG
): $(ADDL_LIBS
) nm.o
$(BFD
)
96 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(NM_PROG
) nm.o
$(ADDL_LIBS
) $(LOADLIBES
)
98 $(OBJDUMP_PROG
): $(ADDL_LIBS
) size.o objdump.o
$(DISASMS
) $(BFD
)
99 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(OBJDUMP_PROG
) objdump.o
$(DISASMS
) $(ADDL_LIBS
) $(LOADLIBES
)
101 $(AR_PROG
): $(ADDL_LIBS
) ar.o not-ranlib.o
$(BFD
)
102 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(AR_PROG
) ar.o not-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
104 $(RANLIB_PROG
): $(ADDL_LIBS
) ar.o is-ranlib.o
$(BFD
)
105 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(RANLIB_PROG
) ar.o is-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
107 # This rule creates a single binary that switches between ar and ranlib
108 # by looking at argv[0]. Use this kludge to save some disk space.
109 # However, you have to install things by hand.
110 # (That is after 'make install', replace the installed ranlib by a link to ar.)
112 # Alternatively, you can install ranlib.sh as ranlib.
114 ar_with_ranlib
: $(ADDL_LIBS
) ar.o maybe-ranlib.o
$(BFD
)
115 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(AR_PROG
) ar.o maybe-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
116 -rm -f
$(RANLIB_PROG
)
117 -ln
$(AR_PROG
) $(RANLIB_PROG
)
119 $(STRIP_PROG
): $(COPY_PROG
)
121 -ln
$(COPY_PROG
) $(STRIP_PROG
)
125 - mv
-f
$(STAGESTUFF
) stage1
129 - mv
-f
$(STAGESTUFF
) stage2
133 - mv
-f
$(STAGESTUFF
) stage3
138 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
141 - (cd stage1
; mv
-f
* ..
)
145 - (cd stage2
; mv
-f
* ..
)
149 - (cd stage3
; mv
-f
* ..
)
152 binutils.
dvi: binutils.texinfo
153 TEXINPUTS
=${TEXIDIR}:.
:$$TEXINPUTS tex binutils.texinfo
155 TEXINPUTS
=${TEXIDIR}:.
:$$TEXINPUTS tex binutils.texinfo
157 binutils.
info: binutils.texinfo
158 makeinfo binutils.texinfo
161 -rm -f
*.o
*~ \
#* core $(STAGESTUFF) TAGS binutils.?? binutils.???
166 etags
$(INCDIR
)/*.h
$(BFDSRC
)/*.
[hc
] *.
[hc
]
169 -rm -f
$(STAGESTUFF
) TAGS
172 for i in
$(PROGS
) ; do \
173 $(INSTALL_PROGRAM
) $$i $(bindir)/$$i ; \
176 dist: $(DIST_NAME
).
tar.Z
178 $(DIST_NAME
).
tar.Z
: proto-dir
179 ln
-s proto-dir
$(DIST_NAME
)
180 tar chf
- $(DIST_NAME
) | compress
>$(DIST_NAME
).
tar.Z
188 m68k-pinsn.o
: m68k-pinsn.c
189 i960-pinsn.o
: i960-pinsn.c
190 sparc-pinsn.o
: sparc-pinsn.c
191 am29k-pinsn.o
: am29k-pinsn.c
196 filemode.o
:filemode.c
198 #-----------------------------------------------------------------------------
199 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
201 # 'VERSION' file must be present and contain a string of the form "x.y"
202 #-----------------------------------------------------------------------------
206 echo
"char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
209 # Dummy target to force execution of dependent targets.
213 # Target to uncomment host-specific lines in this makefile. Such lines must
214 # have the following string beginning in column 1: #__<hostname>__#
215 # Original Makefile is backed up as 'Makefile.old'.
217 # Invoke with: make make HOST=xxx
220 -@if
test $(HOST
)x
= x
; then \
221 echo
'\aSpecify "make make HOST=???"'; \
224 grep
-s
"^#The next line was generated by 'make make'" Makefile
; \
225 if
test $$?
= 0 ; then \
226 echo
"\aMakefile has already been processed with 'make make'";\
229 mv
-f Makefile Makefile.old
; \
230 echo
"#The next line was generated by 'make make'" >Makefile
; \
231 echo
"HOST=$(HOST)" >>Makefile
; \
233 sed
"s/^#__$(HOST)__#//" < Makefile.old
>>Makefile
235 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
236 $(SHELL
) .
/config.status
238 ### Local Variables: ***
239 ### mode:fundamental ***
240 ### page-delimiter: "^#\f" ***