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
# 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.
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 ;;
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 ;;
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
;;
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