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
)
20 INSTALL_PROGRAM
= $(INSTALL
)
21 INSTALL_FILE
= $(INSTALL
)
23 ## Configuration options
24 # These should be all you need set before compiling
27 # these two are almost the same program
31 # copy and strip should be the same program
35 # These should all be the same program too.
40 PROGS
= $(SIZE_PROG
) $(COPY_PROG
) $(OBJDUMP_PROG
) $(NM_PROG
) $(AR_PROG
) $(STRIP_PROG
) $(RANLIB_PROG
)
41 STAGESTUFF
= $(PROGS
) *.o
43 BASEDIR
= $(unsubdir
)/..
44 LIBDIR
= $(unsubdir
)/..
/bfd
$(subdir
)
46 #### host and target dependant Makefile fragments come in here.
49 INCDIR
= $(BASEDIR
)/include
51 CFLAGS
= -g
-I
$(srcdir)/..
/include -I
$(INCDIR
) $(HDEFINES
) $(TDEFINES
)
53 # When adding .o files, to make VPATH work in Sun Make, you have to
54 # also add a foo.o: foo.c line at the bottom of the file.
55 DISASMS
= m68k-pinsn.o i960-pinsn.o sparc-pinsn.o am29k-pinsn.o
59 # Hopefully all these may be flushed once we get configuration down pat.
61 # alloca only needed for systems which don't have it and when cc != gcc.
64 # nm tries to malloc enough space for the string table. The old GNU malloc
65 # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might
66 # fail unnecessarily. I've also seen some Unix malloc's fail, even when
67 # there is enough memory. So use the new GNU malloc.
70 # Use the GNU getopt unless you have problems with it.
71 # The IRIS version could probably benefit from being assembled with
72 # libmalloc rather than the ordinary malloc.
73 LIBIBERTY
= $(unsubdir
)/..
/libiberty
$(subdir
)/libiberty.a
75 # Code shared by all the binutils.
76 BULIBS
= bucomm.o version.o filemode.o
78 ADDL_LIBS
= $(MALLOC
) $(BULIBS
) $(BFD
) $(LIBIBERTY
)
80 BFD
= $(LIBDIR
)/libbfd.a
84 all: $(ADDL_LIBS
) $(PROGS
)
87 #$(BFD):$(LIBDIR)/../common/*.c
88 # (cd $(LIBDIR); make)
90 $(SIZE_PROG
): $(ADDL_LIBS
) size.o
$(BFD
)
91 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(SIZE_PROG
) size.o
$(ADDL_LIBS
) $(LOADLIBES
)
93 $(COPY_PROG
): $(ADDL_LIBS
) copy.o
$(BFD
)
94 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(COPY_PROG
) copy.o
$(ADDL_LIBS
) $(LOADLIBES
)
96 $(NM_PROG
): $(ADDL_LIBS
) nm.o
$(BFD
)
97 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(NM_PROG
) nm.o
$(ADDL_LIBS
) $(LOADLIBES
)
99 $(OBJDUMP_PROG
): $(ADDL_LIBS
) size.o objdump.o
$(DISASMS
) $(BFD
)
100 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(OBJDUMP_PROG
) objdump.o
$(DISASMS
) $(ADDL_LIBS
) $(LOADLIBES
)
102 $(AR_PROG
): $(ADDL_LIBS
) ar.o not-ranlib.o
$(BFD
)
103 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(AR_PROG
) ar.o not-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
105 $(RANLIB_PROG
): $(ADDL_LIBS
) ar.o is-ranlib.o
$(BFD
)
106 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(RANLIB_PROG
) ar.o is-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
108 # This rule creates a single binary that switches between ar and ranlib
109 # by looking at argv[0]. Use this kludge to save some disk space.
110 # However, you have to install things by hand.
111 # (That is after 'make install', replace the installed ranlib by a link to ar.)
113 # Alternatively, you can install ranlib.sh as ranlib.
115 ar_with_ranlib
: $(ADDL_LIBS
) ar.o maybe-ranlib.o
$(BFD
)
116 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(AR_PROG
) ar.o maybe-ranlib.o
$(ADDL_LIBS
) $(LOADLIBES
)
117 -rm -f
$(RANLIB_PROG
)
118 -ln
$(AR_PROG
) $(RANLIB_PROG
)
120 $(STRIP_PROG
): $(COPY_PROG
)
122 -ln
$(COPY_PROG
) $(STRIP_PROG
)
126 - mv
-f
$(STAGESTUFF
) stage1
130 - mv
-f
$(STAGESTUFF
) stage2
134 - mv
-f
$(STAGESTUFF
) stage3
139 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
142 - (cd stage1
; mv
-f
* ..
)
146 - (cd stage2
; mv
-f
* ..
)
150 - (cd stage3
; mv
-f
* ..
)
154 -rm -f
*.o
*~ \
#* core $(STAGESTUFF) TAGS
159 etags
$(INCDIR
)/*.h
$(BFDSRC
)/*.
[hc
] *.
[hc
]
162 -rm -f
$(STAGESTUFF
) TAGS
165 for i in
$(PROGS
) ; do \
166 $(INSTALL_PROGRAM
) $$i $(bindir)/$$i ; \
169 dist: $(DIST_NAME
).
tar.Z
171 $(DIST_NAME
).
tar.Z
: proto-dir
172 ln
-s proto-dir
$(DIST_NAME
)
173 tar chf
- $(DIST_NAME
) | compress
>$(DIST_NAME
).
tar.Z
181 m68k-pinsn.o
: m68k-pinsn.c
182 i960-pinsn.o
: i960-pinsn.c
183 sparc-pinsn.o
: sparc-pinsn.c
184 am29k-pinsn.o
: am29k-pinsn.c
189 filemode.o
:filemode.c
191 #-----------------------------------------------------------------------------
192 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
194 # 'VERSION' file must be present and contain a string of the form "x.y"
195 #-----------------------------------------------------------------------------
199 echo
"char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
202 # Dummy target to force execution of dependent targets.
206 # Target to uncomment host-specific lines in this makefile. Such lines must
207 # have the following string beginning in column 1: #__<hostname>__#
208 # Original Makefile is backed up as 'Makefile.old'.
210 # Invoke with: make make HOST=xxx
213 -@if
test $(HOST
)x
= x
; then \
214 echo
'\aSpecify "make make HOST=???"'; \
217 grep
-s
"^#The next line was generated by 'make make'" Makefile
; \
218 if
test $$?
= 0 ; then \
219 echo
"\aMakefile has already been processed with 'make make'";\
222 mv
-f Makefile Makefile.old
; \
223 echo
"#The next line was generated by 'make make'" >Makefile
; \
224 echo
"HOST=$(HOST)" >>Makefile
; \
226 sed
"s/^#__$(HOST)__#//" < Makefile.old
>>Makefile
228 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
229 $(SHELL
) .
/config.status
231 ### Local Variables: ***
232 ### mode:fundamental ***
233 ### page-delimiter: "^#\f" ***