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 $(TOPDIR
)/rules.mk
7 TARGET_CFLAGS
:= $(filter-out -fstack-protector
,$(TARGET_CFLAGS
))
11 GCC_CONFOPTS
= --prefix=$(STAGING_HOST_DIR
) \
12 --build
=$(GNU_HOST_NAME
) \
13 --host
=$(GNU_HOST_NAME
) \
14 --target
=$(REAL_GNU_TARGET_NAME
) \
15 --with-gmp
=$(STAGING_HOST_DIR
) \
16 --with-mpfr
=$(STAGING_HOST_DIR
) \
17 --with-libelf
=$(STAGING_HOST_DIR
) \
18 --disable-__cxa_atexit \
20 --disable-libmudflap \
23 --disable-decimal-float \
25 --disable-sjlj-exceptions \
26 --disable-libstdcxx-pch \
27 --disable-ppl-version-check \
28 --disable-cloog-version-check \
33 ifeq ($(ADK_TOOLCHAIN_GCC_SSP
),y
)
34 GCC_CONFOPTS
+= --enable-libssp
36 GCC_CONFOPTS
+= --disable-libssp
39 ifeq ($(ADK_TOOLCHAIN_GCC_LTO
),y
)
40 GCC_CONFOPTS
+= --enable-lto
42 GCC_CONFOPTS
+= --disable-lto
46 GCC_CONFOPTS
+= --disable-tls
48 GCC_CONFOPTS
+= --enable-tls
51 ifeq ($(ARCH
),powerpc
)
52 GCC_CONFOPTS
+= --disable-target-optspace
54 GCC_CONFOPTS
+= --enable-target-optspace
57 ifeq ($(ADK_TARGET_NO_FPU
),y
)
58 GCC_CONFOPTS
+= --with-float
=soft
61 ifeq ($(ADK_LINUX_MIPS64
),y
)
62 GCC_CONFOPTS
+= --with-abi
=64
65 ifeq ($(ADK_LINUX_MIPS64EL
),y
)
66 GCC_CONFOPTS
+= --with-abi
=64
69 ifeq (${ADK_MAKE_PARALLEL},y
)
70 GCC_MAKEOPTS
+= -j
${ADK_MAKE_JOBS}
74 ifeq ($(ADK_TOOLCHAIN_GCC_CXX
),y
)
75 LANGUAGES
:=${LANGUAGES},c
++
77 ifeq ($(ADK_TOOLCHAIN_GCC_JAVA
),y
)
78 LANGUAGES
:=${LANGUAGES},java
80 ifeq ($(ADK_TOOLCHAIN_GCC_ADA
),y
)
81 LANGUAGES
:=${LANGUAGES},ada
84 include ${TOPDIR}/mk
/buildhlp.mk
86 GCC_BUILD_DIR_MINIMAL
:= $(WRKBUILD
)-minimal
87 GCC_BUILD_DIR_INITIAL
:= $(WRKBUILD
)-initial
88 GCC_BUILD_DIR_FINAL
:= $(WRKBUILD
)-final
90 $(GCC_BUILD_DIR_MINIMAL
)/.configured
:
91 mkdir
-p
$(GCC_BUILD_DIR_MINIMAL
)
92 # these symlinks are very important, do not remove
93 rm -rf
$(STAGING_HOST_DIR
)/$(REAL_GNU_TARGET_NAME
)/sys-include
94 ln
-sf
${STAGING_TARGET_DIR}/include $(STAGING_HOST_DIR
)/$(REAL_GNU_TARGET_NAME
)/sys-include
95 rm -rf
${STAGING_HOST_DIR}/$(REAL_GNU_TARGET_NAME
)/lib
96 ln
-sf
${STAGING_TARGET_DIR}/lib
$(STAGING_HOST_DIR
)/$(REAL_GNU_TARGET_NAME
)/lib
97 (cd
$(GCC_BUILD_DIR_MINIMAL
); \
98 PATH
='$(TARGET_PATH)' \
99 $(WRKBUILD
)/configure \
101 --enable-languages
=c \
108 $(GCC_BUILD_DIR_MINIMAL
)/.compiled
: $(GCC_BUILD_DIR_MINIMAL
)/.configured
109 PATH
='$(TARGET_PATH)' \
110 $(MAKE
) ${GCC_MAKEOPTS} -C
$(GCC_BUILD_DIR_MINIMAL
) all-gcc
113 $(WRKBUILD
)/.headers
: $(GCC_BUILD_DIR_MINIMAL
)/.compiled
114 PATH
='$(TARGET_PATH)' \
115 $(MAKE
) -C
$(GCC_BUILD_DIR_MINIMAL
) install-gcc
118 $(GCC_BUILD_DIR_INITIAL
)/.configured
:
119 mkdir
-p
$(GCC_BUILD_DIR_INITIAL
)
120 (cd
$(GCC_BUILD_DIR_INITIAL
); \
121 PATH
='$(TARGET_PATH)' \
122 $(WRKBUILD
)/configure \
124 --enable-languages
=c \
128 --with-sysroot
=$(STAGING_TARGET_DIR
) \
133 $(GCC_BUILD_DIR_INITIAL
)/.compiled
: $(GCC_BUILD_DIR_INITIAL
)/.configured
134 PATH
='$(TARGET_PATH)' \
135 $(MAKE
) ${GCC_MAKEOPTS} -C
$(GCC_BUILD_DIR_INITIAL
) all-gcc all-target-libgcc
138 $(WRKBUILD
)/.configured
: $(GCC_BUILD_DIR_INITIAL
)/.compiled
139 PATH
='$(TARGET_PATH)' \
140 $(MAKE
) -C
$(GCC_BUILD_DIR_INITIAL
) install-gcc install-target-libgcc
143 $(GCC_BUILD_DIR_FINAL
)/.configured
:
144 mkdir
-p
$(GCC_BUILD_DIR_FINAL
)
145 (cd
$(GCC_BUILD_DIR_FINAL
); \
146 PATH
='$(TARGET_PATH)' \
147 $(WRKBUILD
)/configure \
149 --enable-languages
=$(LANGUAGES
) \
150 --with-sysroot
='$${prefix}/${STAGING_HOST2TARGET}' \
151 --with-slibdir
=$(STAGING_TARGET_DIR
)/lib \
156 $(WRKBUILD
)/.compiled
: $(GCC_BUILD_DIR_FINAL
)/.configured
157 PATH
='$(TARGET_PATH)' \
158 $(MAKE
) ${GCC_MAKEOPTS} -C
$(GCC_BUILD_DIR_FINAL
) all
161 $(WRKBUILD
)/.installed
: $(WRKBUILD
)/.compiled
162 PATH
='$(TARGET_PATH)' $(MAKE
) -C
$(GCC_BUILD_DIR_FINAL
) install
163 # Set up the symlinks to enable lying about target name.
165 (cd
$(STAGING_HOST_DIR
); \
166 ln
-sf
$(REAL_GNU_TARGET_NAME
) $(GNU_TARGET_NAME
); \
168 for app in
$(REAL_GNU_TARGET_NAME
)-* ; do \
170 $(GNU_TARGET_NAME
)$${app
##$(REAL_GNU_TARGET_NAME)}; \
175 include ${TOPDIR}/mk
/toolchain.mk