1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 include $(ADK_TOPDIR
)/rules.mk
7 include ${ADK_TOPDIR}/mk
/buildhlp.mk
9 ifeq ($(ADK_TOOLCHAIN_WITH_SSP
),y
)
10 CONFOPTS
+= --enable-libssp
12 CONFOPTS
+= --disable-libssp
15 ifeq ($(ADK_TOOLCHAIN_WITH_LTO
),y
)
16 CONFOPTS
+= --enable-lto
--enable-plugins
18 CONFOPTS
+= --disable-lto
--disable-plugins
21 ifeq ($(ADK_TOOLCHAIN_WITH_GOLD
),y
)
22 ifeq ($(ADK_TARGET_USE_GOLD
),y
)
23 CONFOPTS
+= --enable-gold
=default
25 CONFOPTS
+= --enable-gold
28 CONFOPTS
+= --disable-gold
31 ifeq ($(ADK_TARGET_ARCH_X86_64
)$(ADK_TARGET_CPU_CF
),)
32 CONFOPTS
+= --disable-multilib
34 CONFOPTS
+= --enable-multilib
37 ifeq (${ADK_MAKE_PARALLEL},y
)
38 BINUTILS_MAKEOPTS
+= -j
${ADK_MAKE_JOBS}
41 $(WRKBUILD
)/.configured
:
42 ifeq ($(ADK_TARGET_ARCH_XTENSA
),y
)
43 tar xf
$(ADK_TOPDIR
)/target
/xtensa
/overlay
/xtensa_
$(ADK_TARGET_CPU_TYPE
).
tar \
44 --strip-components
=1 -C
$(WRKSRC
) binutils
46 (cd
$(WRKBUILD
); PATH
='$(HOST_PATH)' \
48 M4
='${STAGING_HOST_DIR}/usr/bin/m4' \
49 $(WRKBUILD
)/configure \
50 --prefix=$(TOOLCHAIN_DIR
)/usr \
51 --target
=$(GNU_TARGET_NAME
) \
52 --with-sysroot
=$(STAGING_TARGET_DIR
) \
53 --disable-dependency-tracking \
54 --disable-libtool-lock \
59 --disable-install-libiberty \
62 PATH
='$(HOST_PATH)' $(MAKE
) ${BINUTILS_MAKEOPTS} MAKEINFO
=true
-C
$(WRKBUILD
) configure-host
65 $(WRKBUILD
)/.compiled
: $(WRKBUILD
)/.configured
66 PATH
='$(HOST_PATH)' $(MAKE
) ${BINUTILS_MAKEOPTS} MAKEINFO
=true
-C
$(WRKBUILD
) all
69 $(WRKBUILD
)/.installed
: $(WRKBUILD
)/.compiled
70 PATH
='$(HOST_PATH)' $(MAKE
) MAKEINFO
=true
-C
$(WRKBUILD
) install
71 ifeq ($(ADK_TARGET_ARCH_H8300
)$(ADK_TARGET_ARCH_NDS32
)$(ADK_TARGET_ARCH_SH
),y
)
72 $(INSTALL_DIR
) $(STAGING_TARGET_DIR
)/usr
/lib
/ldscripts
73 $(CP
) $(WRKBUILD
)/ld/ldscripts
/* $(STAGING_TARGET_DIR
)/usr
/lib
/ldscripts
/
75 ifeq ($(ADK_TARGET_USE_GOLD
),y
)
76 (cd
$(TOOLCHAIN_DIR
)/usr
/bin
&& \
77 ln
-sf
$(GNU_TARGET_NAME
)-ld.gold
$(GNU_TARGET_NAME
)-ld)
79 ifeq (ADK_TOOLCHAIN_BINUTILS_2_20_1
),)
80 (cd
$(TOOLCHAIN_DIR
)/usr
/bin
&& \
81 ln
-sf
$(GNU_TARGET_NAME
)-ld.bfd
$(GNU_TARGET_NAME
)-ld)
86 include ${ADK_TOPDIR}/mk
/toolchain.mk