Hack to cut down compilations needed for minimal-bfd:

* Makefile.in (ALL_MACHINES): Renamed from BFD_MACHINES.
	(ofiles): New target.  Build a list of unique file names, in case
	any got duplicated.
	(TARGETLIB): Use list of files from ofiles.
	* configure.in: Set BFD_MACHINES and BFD_BACKENDS depending on
	minimal-bfd flag and target makefile frag contents.
This commit is contained in:
Ken Raeburn 1993-07-06 20:27:25 +00:00
parent 70e009144e
commit c812942fc5
2 changed files with 40 additions and 20 deletions

View File

@ -73,7 +73,7 @@ BFD_LIBS = libbfd.o opncls.o bfd.o archive.o targets.o cache.o \
archures.o core.o section.o format.o syms.o reloc.o init.o \
ctor.o seclet.o coffgen.o reloc16.o
BFD_MACHINES = cpu-h8300.o cpu-i960.o cpu-sparc.o cpu-m68k.o cpu-m88k.o \
ALL_MACHINES = cpu-h8300.o cpu-i960.o cpu-sparc.o cpu-m68k.o cpu-m88k.o \
cpu-vax.o cpu-mips.o cpu-a29k.o cpu-i386.o cpu-rs6000.o cpu-hppa.o \
cpu-z8k.o cpu-we32k.o cpu-h8500.o cpu-alpha.o cpu-sh.o
@ -168,10 +168,21 @@ install-info: force
# HDEPFILES comes from the host config; TDEPFILES from the target config.
OFILES = $(BFD_LIBS) $(BFD_BACKENDS) $(BFD_MACHINES) $(HDEPFILES) $(TDEPFILES)
$(TARGETLIB): $(OFILES)
rm -f $(TARGETLIB)
$(AR) $(AR_FLAGS) $(TARGETLIB) $(OFILES)
$(RANLIB) $(TARGETLIB)
ofiles : Makefile
rm -f ofiles2 ofiles ofiles3
cp /dev/null ofiles2
for i in $(OFILES) ; do \
echo $$i >> ofiles2 ; \
done
sort < ofiles2 | uniq > ofiles3
mv ofiles3 ofiles
rm -f ofiles2 ofiles3
$(TARGETLIB): $(OFILES) ofiles
rm -f $(TARGETLIB)
@echo ofiles = `cat ofiles`
$(AR) $(AR_FLAGS) $(TARGETLIB) `cat ofiles`
$(RANLIB) $(TARGETLIB)
# When compiling archures.c and targets.c, supply the default target
# info from configure.

View File

@ -54,6 +54,7 @@ case "${target}" in
i[34]86-*-isc*) bfd_target=i386-sco ;; # gets core dump reading right
i[34]86-*-sco*) bfd_target=i386-sco ;;
i[34]86-*-bsd*) bfd_target=i386-bsd ;;
i[34]86-*-coff) bfd_target=i386-coff ;;
i[34]86-*-aix*) bfd_target=i386-coff ;;
i[34]86-*-elf) bfd_target=i386-elf ;;
i[34]86-*-linux*) bfd_target=i386-linux ;;
@ -79,12 +80,13 @@ case "${target}" in
mips-*-ecoff*) bfd_target=bigmips ;;
mips-sgi-*) bfd_target=bigmips ;;
mips-*-sysv*) bfd_target=riscos ;;
mips-*-riscos*) bfd_target=riscos ;;
mips-*-bsd*) bfd_target=noop ;;
rs6000-*-*) bfd_target=rs6000 ;;
sparc-*-solaris2*) bfd_target=sparc-elf ;;
sparc-*-sysv4*) bfd_target=sparc-elf ;;
sparc64-*-aout*) bfd_target=sparc-aout ; target64=true ;; # v9
sparc64-*-elf*) bfd_target=sparc-aout ; target64=true ;; # v9
sparc64-*-elf*) bfd_target=sparc64-elf ; target64=true ;; # v9
sparc*-*-*) bfd_target=sparc-aout ;;
tahoe-*-*) bfd_target=tahoe ;;
vax-*-vms) bfd_target=vax-vms ;;
@ -130,25 +132,18 @@ rm -f Makefile.tmp Makefile.2
mv Makefile Makefile.tmp
case ${with_minimal_bfd} in
yes)
echo MINIMIZE=1 > Makefile.2
;;
no | "")
echo MINIMIZE=0 > Makefile.2
;;
yes) echo MINIMIZE=1 > Makefile.2 ;;
no | "") echo MINIMIZE=0 > Makefile.2 ;;
*)
echo "*** bad value \"${with_minimal_bfd}\" for minimal-bfd flag; ignored" 1>&2
with_minimal_bfd=no
echo MINIMIZE=0 > Makefile.2
;;
esac
case ${with_64_bit_bfd} in
yes)
want64=true
;;
no | "")
want64=false
;;
yes) want64=true ;;
no | "") want64=false ;;
*)
echo "*** bad value \"${with_64_bit_bfd}\" for 64-bit-bfd flag; ignored" 1>&2
;;
@ -157,14 +152,28 @@ esac
case ${host64}-${target64}-${want64} in
*true*)
echo WORDSIZE=64 >> Makefile.2
echo 'BFD_BACKENDS = $(BFD32_BACKENDS) $(BFD64_BACKENDS)' >> Makefile.2
echo 'ALL_BACKENDS = $(BFD64_BACKENDS) $(BFD32_BACKENDS)' >> Makefile.2
;;
false-false-false)
echo WORDSIZE=32 >> Makefile.2
echo 'BFD_BACKENDS = $(BFD32_BACKENDS)' >> Makefile.2
echo 'ALL_BACKENDS = $(BFD32_BACKENDS)' >> Makefile.2
;;
esac
if [ ${with_minimal_bfd} = yes ] \
&& grep -s TARGET_BACKENDS ${srcdir}/${target_makefile_frag} ; then
echo 'BFD_BACKENDS = $(TARGET_BACKENDS)' >> Makefile.2
else
echo 'BFD_BACKENDS = $(ALL_BACKENDS)' >> Makefile.2
fi
if [ ${with_minimal_bfd} = yes ] \
&& grep -s TARGET_CPUS ${srcdir}/${target_makefile_frag} ; then
echo 'BFD_MACHINES = $(TARGET_CPUS)' >> Makefile.2
else
echo 'BFD_MACHINES = $(ALL_MACHINES)' >> Makefile.2
fi
cat Makefile.tmp >> Makefile.2
rm -f Makefile.tmp
mv Makefile.2 Makefile