linux: update 4.13.x
[openadk.git] / toolchain / binutils / Makefile
bloba844388cc22de0e924806ab51bd8c423c0705d54
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
5 include Makefile.inc
6 include ../rules.mk
7 include ${ADK_TOPDIR}/mk/buildhlp.mk
9 ifeq ($(ADK_TOOLCHAIN_WITH_SSP),y)
10 CONFOPTS+= --enable-libssp
11 else
12 CONFOPTS+= --disable-libssp
13 endif
15 ifeq ($(ADK_TOOLCHAIN_WITH_LTO),y)
16 CONFOPTS+= --enable-lto --enable-plugins
17 else
18 CONFOPTS+= --disable-lto --disable-plugins
19 endif
21 ifeq ($(ADK_TOOLCHAIN_WITH_GOLD),y)
22 ifeq ($(ADK_TARGET_USE_GOLD),y)
23 CONFOPTS+= --enable-gold=default
24 else
25 CONFOPTS+= --enable-gold
26 endif
27 else
28 CONFOPTS+= --disable-gold
29 endif
31 ifeq ($(ADK_TARGET_ARCH_X86_64)$(ADK_TARGET_CPU_CF),)
32 CONFOPTS+= --disable-multilib
33 else
34 CONFOPTS+= --enable-multilib
35 endif
37 ifeq (${ADK_MAKE_PARALLEL},y)
38 BINUTILS_MAKEOPTS+= -j${ADK_MAKE_JOBS}
39 endif
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
45 endif
46 (cd $(WRKBUILD); PATH='$(HOST_PATH)' \
47 MAKEINFO=true \
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 \
55 --disable-nls \
56 --disable-sim \
57 --disable-gdb \
58 --disable-werror \
59 --disable-install-libiberty \
60 ${CONFOPTS} \
62 PATH='$(HOST_PATH)' $(MAKE) ${BINUTILS_MAKEOPTS} MAKEINFO=true -C $(WRKBUILD) configure-host
63 touch $@
65 $(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
66 PATH='$(HOST_PATH)' $(MAKE) ${BINUTILS_MAKEOPTS} MAKEINFO=true -C $(WRKBUILD) all
67 touch $@
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/
74 endif
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)
78 else
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)
82 endif
83 endif
84 touch $@
86 include ${ADK_TOPDIR}/mk/toolchain.mk