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)' MAKEINFO
=true \
47 $(WRKBUILD
)/configure \
48 --prefix=$(TOOLCHAIN_DIR
)/usr \
49 --target
=$(GNU_TARGET_NAME
) \
50 --with-sysroot
=$(STAGING_TARGET_DIR
) \
51 --disable-dependency-tracking \
52 --disable-libtool-lock \
57 --disable-install-libiberty \
60 PATH
='$(HOST_PATH)' $(MAKE
) ${BINUTILS_MAKEOPTS} MAKEINFO
=true
-C
$(WRKBUILD
) configure-host
63 $(WRKBUILD
)/.compiled
: $(WRKBUILD
)/.configured
64 PATH
='$(HOST_PATH)' $(MAKE
) ${BINUTILS_MAKEOPTS} MAKEINFO
=true
-C
$(WRKBUILD
) all
67 $(WRKBUILD
)/.installed
: $(WRKBUILD
)/.compiled
68 PATH
='$(HOST_PATH)' $(MAKE
) MAKEINFO
=true
-C
$(WRKBUILD
) install
69 ifeq ($(ADK_TARGET_ARCH_H8300
)$(ADK_TARGET_ARCH_NDS32
)$(ADK_TARGET_CPU_SH_J2
),y
)
70 $(INSTALL_DIR
) $(STAGING_TARGET_DIR
)/usr
/lib
/ldscripts
71 $(CP
) $(WRKBUILD
)/ld/ldscripts
/* $(STAGING_TARGET_DIR
)/usr
/lib
/ldscripts
/
73 ifeq ($(ADK_TARGET_USE_GOLD
),y
)
74 (cd
$(TOOLCHAIN_DIR
)/usr
/bin
&& \
75 ln
-sf
$(GNU_TARGET_NAME
)-ld.gold
$(GNU_TARGET_NAME
)-ld)
77 ifeq (ADK_TOOLCHAIN_BINUTILS_2_20_1
),)
78 (cd
$(TOOLCHAIN_DIR
)/usr
/bin
&& \
79 ln
-sf
$(GNU_TARGET_NAME
)-ld.bfd
$(GNU_TARGET_NAME
)-ld)
84 include ${ADK_TOPDIR}/mk
/toolchain.mk