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 TEXIDIR
= $(srcdir)/..
/texinfo
/fsf
20 #INSTALL_PROGRAM = $(INSTALL)
21 #INSTALL_FILE = $(INSTALL)
24 # these two are almost the same program
28 # copy and strip should be the same program
32 # These should all be the same program too.
37 PROGS
= $(SIZE_PROG
) $(COPY_PROG
) $(OBJDUMP_PROG
) $(NM_PROG
) $(AR_PROG
) $(STRIP_PROG
) $(RANLIB_PROG
)
38 STAGESTUFF
= $(PROGS
) *.o
40 BASEDIR
= $(unsubdir
)/..
41 LIBDIR
= $(unsubdir
)/..
/bfd
$(subdir
)
43 #### host and target dependant Makefile fragments come in here.
46 INCDIR
= $(BASEDIR
)/include
48 CFLAGS
= -g
-I.
-I
$(INCDIR
) $(HDEFINES
) $(TDEFINES
)
50 # When adding .o files, to make VPATH work in Sun Make, you have to
51 # also add a foo.o: foo.c line at the bottom of the file.
52 DISASMS
= m68k-pinsn.o i960-pinsn.o sparc-pinsn.o am29k-pinsn.o
56 # Hopefully all these may be flushed once we get configuration down pat.
58 # alloca only needed for systems which don't have it and when cc != gcc.
61 # nm tries to malloc enough space for the string table. The old GNU malloc
62 # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might
63 # fail unnecessarily. I've also seen some Unix malloc's fail, even when
64 # there is enough memory. So use the new GNU malloc.
67 # Use the GNU getopt unless you have problems with it.
68 # The IRIS version could probably benefit from being assembled with
69 # libmalloc rather than the ordinary malloc.
70 LIBIBERTY
= $(unsubdir
)/..
/libiberty
$(subdir
)/libiberty.a
72 # Code shared by all the binutils.
73 BULIBS
= bucomm.o version.o filemode.o
75 ADDL_LIBS
= $(MALLOC
) $(BULIBS
) $(BFD
) $(LIBIBERTY
)
77 BFD
= $(LIBDIR
)/libbfd.a
81 all: $(ADDL_LIBS
) $(PROGS
)
84 #$(BFD):$(LIBDIR)/../common/*.c
85 # (cd $(LIBDIR); make)
87 $(SIZE_PROG
): $(ADDL_LIBS
) size.o
$(BFD
)
88 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(SIZE_PROG
) size.o
$(ADDL_LIBS
) $(LOADLIBES
)
90 $(COPY_PROG
): $(ADDL_LIBS
) copy.o
$(BFD
)
91 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(COPY_PROG
) copy.o
$(ADDL_LIBS
) $(LOADLIBES
)
93 $(NM_PROG
): $(ADDL_LIBS
) nm.o
$(BFD
)
94 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(NM_PROG
) nm.o
$(ADDL_LIBS
) $(LOADLIBES
)
96 $(OBJDUMP_PROG
): $(ADDL_LIBS
) size.o objdump.o
$(DISASMS
) $(BFD
)
97 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(OBJDUMP_PROG
) objdump.o
$(DISASMS
) $(ADDL_LIBS
) $(LOADLIBES
)
99 $(AR_PROG
): $(ADDL_LIBS
) ar.o not-ranlib.o
$(BFD
)
100 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(AR_PROG
) ar.o not-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
102 $(RANLIB_PROG
): $(ADDL_LIBS
) ar.o is-ranlib.o
$(BFD
)
103 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(RANLIB_PROG
) ar.o is-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
105 # This rule creates a single binary that switches between ar and ranlib
106 # by looking at argv[0]. Use this kludge to save some disk space.
107 # However, you have to install things by hand.
108 # (That is after 'make install', replace the installed ranlib by a link to ar.)
110 # Alternatively, you can install ranlib.sh as ranlib.
112 ar_with_ranlib
: $(ADDL_LIBS
) ar.o maybe-ranlib.o
$(BFD
)
113 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(AR_PROG
) ar.o maybe-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
114 -rm -f
$(RANLIB_PROG
)
115 -ln
$(AR_PROG
) $(RANLIB_PROG
)
117 $(STRIP_PROG
): $(COPY_PROG
)
119 -ln
$(COPY_PROG
) $(STRIP_PROG
)
123 - mv
-f
$(STAGESTUFF
) stage1
127 - mv
-f
$(STAGESTUFF
) stage2
131 - mv
-f
$(STAGESTUFF
) stage3
136 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
139 - (cd stage1
; mv
-f
* ..
)
143 - (cd stage2
; mv
-f
* ..
)
147 - (cd stage3
; mv
-f
* ..
)
150 binutils.
dvi: binutils.texinfo
151 TEXINPUTS
=${TEXIDIR}:.
:$$TEXINPUTS tex binutils.texinfo
153 TEXINPUTS
=${TEXIDIR}:.
:$$TEXINPUTS tex binutils.texinfo
155 binutils.
info: binutils.texinfo
156 makeinfo binutils.texinfo
159 -rm -f
*.o
*~ \
#* core $(STAGESTUFF) TAGS binutils.?? binutils.???
164 etags
$(INCDIR
)/*.h
$(BFDSRC
)/*.
[hc
] *.
[hc
]
167 -rm -f
$(STAGESTUFF
) TAGS
170 for i in
$(PROGS
) ; do \
171 cp
$$i $(bindir)/$$i.new
; \
172 mv
-f
$(bindir)/$$i.new
$(bindir)/$$i ; \
175 dist: $(DIST_NAME
).
tar.Z
177 $(DIST_NAME
).
tar.Z
: proto-dir
178 ln
-s proto-dir
$(DIST_NAME
)
179 tar chf
- $(DIST_NAME
) | compress
>$(DIST_NAME
).
tar.Z
187 m68k-pinsn.o
: m68k-pinsn.c
188 i960-pinsn.o
: i960-pinsn.c
189 sparc-pinsn.o
: sparc-pinsn.c
190 am29k-pinsn.o
: am29k-pinsn.c
195 filemode.o
:filemode.c
197 #-----------------------------------------------------------------------------
198 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
200 # 'VERSION' file must be present and contain a string of the form "x.y"
201 #-----------------------------------------------------------------------------
205 echo
"char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
208 # Dummy target to force execution of dependent targets.
212 # Target to uncomment host-specific lines in this makefile. Such lines must
213 # have the following string beginning in column 1: #__<hostname>__#
214 # Original Makefile is backed up as 'Makefile.old'.
216 # Invoke with: make make HOST=xxx
219 -@if
test $(HOST
)x
= x
; then \
220 echo
'\aSpecify "make make HOST=???"'; \
223 grep
-s
"^#The next line was generated by 'make make'" Makefile
; \
224 if
test $$?
= 0 ; then \
225 echo
"\aMakefile has already been processed with 'make make'";\
228 mv
-f Makefile Makefile.old
; \
229 echo
"#The next line was generated by 'make make'" >Makefile
; \
230 echo
"HOST=$(HOST)" >>Makefile
; \
232 sed
"s/^#__$(HOST)__#//" < Makefile.old
>>Makefile
234 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
235 $(SHELL
) .
/config.status
237 ### Local Variables: ***
238 ### mode:fundamental ***
239 ### page-delimiter: "^#\f" ***