1 ### Makefile for GNU binary-file utilities
8 version
=`$(srcdir)/../gcc$(subdir)/gcc -dumpversion`
10 bindir = $(prefix)/bin
11 libdir = $(prefix)/lib
12 libsubdir
= $(libdir)/gcc
/$(target
)/$(version
)
15 INSTALL_PROGRAM
= $(INSTALL
)
16 INSTALL_FILE
= $(INSTALL
)
18 ## Configuration options
19 # These should be all you need set before compiling
22 # these two should be the same program
26 # copy and strip should be the same program
30 # These should all be the same program too.
35 PROGS
= $(SIZE_PROG
) $(COPY_PROG
) $(OBJDUMP_PROG
) $(NM_PROG
) $(AR_PROG
) $(STRIP_PROG
) $(RANLIB_PROG
)
36 STAGESTUFF
= $(PROGS
) *.o
38 BASEDIR
= $(srcdir)/..
39 LIBDIR
= $(srcdir)/..
/bfd
$(subdir
)
41 #### host and target dependant Makefile fragments come in here.
44 INCDIR
= $(BASEDIR
)/include
46 CFLAGS
= -g
-I
$(srcdir)/..
/include -I
$(INCDIR
) $(HDEFINES
) $(TDEFINES
)
48 DISASMS
= m68k-pinsn.o i960-pinsn.o sparc-pinsn.o
52 # Hopefully all these may be flushed once we get configuration down pat.
54 # alloca only needed for systems which don't have it and when cc != gcc.
57 # nm tries to malloc enough space for the string table. The old GNU malloc
58 # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might
59 # fail unnecessarily. I've also seen some Unix malloc's fail, even when
60 # there is enough memory. So use the new GNU malloc.
63 # Use the GNU getopt unless you have problems with it.
64 # The IRIS version could probably benefit from being assembled with
65 # libmalloc rather than the ordinary malloc.
66 LIBIBERTY
= $(srcdir)/..
/libiberty
$(subdir
)/libiberty.a
68 # Code shared by all the binutils.
69 BULIBS
= bucomm.o version.o filemode.o
71 ADDL_LIBS
= $(MALLOC
) $(BULIBS
) $(BFD
) $(LIBIBERTY
)
73 BFD
= $(LIBDIR
)/libbfd.a
77 all: $(ADDL_LIBS
) $(PROGS
)
80 #$(BFD):$(LIBDIR)/../common/*.c
81 # (cd $(LIBDIR); make)
83 $(SIZE_PROG
): $(ADDL_LIBS
) size.o
$(BFD
)
84 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(SIZE_PROG
) size.o
$(ADDL_LIBS
) $(LOADLIBES
)
86 $(COPY_PROG
): $(ADDL_LIBS
) copy.o
$(BFD
)
87 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(COPY_PROG
) copy.o
$(ADDL_LIBS
) $(LOADLIBES
)
89 $(NM_PROG
): $(ADDL_LIBS
) nm.o
$(BFD
)
90 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(NM_PROG
) nm.o
$(ADDL_LIBS
) $(LOADLIBES
)
92 $(OBJDUMP_PROG
): $(ADDL_LIBS
) size.o objdump.o
$(DISASMS
) $(BFD
)
93 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(OBJDUMP_PROG
) objdump.o
$(DISASMS
) $(ADDL_LIBS
) $(LOADLIBES
)
95 $(AR_PROG
): $(ADDL_LIBS
) ar.o
$(BFD
)
96 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(AR_PROG
) ar.o
$(ADDL_LIBS
) $(LOADLIBES
)
98 $(RANLIB_PROG
): $(AR_PROG
)
100 -ln
$(AR_PROG
) $(RANLIB_PROG
)
102 $(STRIP_PROG
): $(COPY_PROG
)
104 -ln
$(COPY_PROG
) $(STRIP_PROG
)
108 - mv
-f
$(STAGESTUFF
) stage1
112 - mv
-f
$(STAGESTUFF
) stage2
116 - mv
-f
$(STAGESTUFF
) stage3
121 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
124 - (cd stage1
; mv
-f
* ..
)
128 - (cd stage2
; mv
-f
* ..
)
132 - (cd stage3
; mv
-f
* ..
)
136 -rm -f
*.o
*~ \
#* core $(STAGESTUFF) TAGS
141 etags
$(INCDIR
)/*.h
$(BFDSRC
)/*.
[hc
] *.
[hc
]
144 -rm -f
$(STAGESTUFF
) TAGS
147 for i in
$(PROGS
) ; do \
148 $(INSTALL_PROGRAM
) $$i $(destdir
)/bin
/$$i ; \
156 m68k-pinsn.o
: m68k-pinsn.c
157 i960-pinsn.o
: i960-pinsn.c
158 sparc-pinsn.o
: sparc-pinsn.c
163 filemode.o
:filemode.c
164 #-----------------------------------------------------------------------------
165 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
167 # 'VERSION' file must be present and contain a string of the form "x.y"
168 #-----------------------------------------------------------------------------
172 echo
"char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
175 # Dummy target to force execution of dependent targets.
179 # Target to uncomment host-specific lines in this makefile. Such lines must
180 # have the following string beginning in column 1: #__<hostname>__#
181 # Original Makefile is backed up as 'Makefile.old'.
183 # Invoke with: make make HOST=xxx
186 -@if
test $(HOST
)x
= x
; then \
187 echo
'\aSpecify "make make HOST=???"'; \
190 grep
-s
"^#The next line was generated by 'make make'" Makefile
; \
191 if
test $$?
= 0 ; then \
192 echo
"\aMakefile has already been processed with 'make make'";\
195 mv
-f Makefile Makefile.old
; \
196 echo
"#The next line was generated by 'make make'" >Makefile
; \
197 echo
"HOST=$(HOST)" >>Makefile
; \
199 sed
"s/^#__$(HOST)__#//" < Makefile.old
>>Makefile
203 Makefile
: $(srcdir)/Makefile.in
$(srcdir)/configure
205 .
/configure
+norecurse \
206 +destdir
=$(destdir
) \
207 `if [ "$(srcdir)" != "." ] ; then echo +f; fi` \
208 $(host
) +target
=$(target
))
210 ### Local Variables: ***
211 ### mode:fundamental ***
212 ### page-delimiter: "^#\f" ***