flat fix
[openadk.git] / toolchain / uclibc-ng / Makefile
blobe07ab8ecedec3ef03992e4c3ef7edf6bbeee43eb
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 _IN_CVTC= 1
6 include $(ADK_TOPDIR)/rules.mk
7 include ../rules.mk
8 include Makefile.inc
9 include ${ADK_TOPDIR}/mk/buildhlp.mk
11 # disable LTO
12 TARGET_CFLAGS:= $(filter-out -flto,$(TARGET_CFLAGS))
13 # handled by uClibc-ng makefiles
14 TARGET_CFLAGS:= $(filter-out -fstack-protector-all,$(TARGET_CFLAGS))
15 TARGET_LDFLAGS:=$(filter-out -fstack-protector-all,$(TARGET_LDFLAGS))
16 # don't use fast-math for C library
17 TARGET_CFLAGS:= $(filter-out -ffast-math,$(TARGET_CFLAGS))
19 ifeq ($(ADK_TARGET_USE_STATIC_AND_SHARED_LIBS),y)
20 TARGET_CFLAGS:= $(filter-out -static,$(TARGET_CFLAGS))
21 TARGET_LDFLAGS:=$(filter-out -static,$(TARGET_LDFLAGS))
22 endif
24 ifeq ($(ADK_BUILD_COMPILER_GCC),y)
25 ifeq ($(ADK_TARGET_HARD_FLOAT),y)
26 ifeq ($(ADK_TARGET_HARD_FLOAT_SP),y)
27 ifeq ($(ADK_TARGET_HARD_FLOAT_DP),y)
28 ifeq ($(ADK_TARGET_ARCH_ARM),y)
29 TARGET_CFLAGS+= -Wa,-mfloat-abi=hard
30 endif
31 endif
32 endif
33 ifeq ($(ADK_TARGET_ARCH_MIPS),y)
34 TARGET_CFLAGS+= -Wa,-mhard-float
35 endif
36 endif
38 ifeq ($(ADK_TARGET_SOFT_FLOAT),y)
39 ifeq ($(ADK_TARGET_ARCH_ARM),y)
40 TARGET_CFLAGS+= -Wa,-mfloat-abi=soft
41 endif
42 ifeq ($(ADK_TARGET_ARCH_MIPS),y)
43 TARGET_CFLAGS+= -Wa,-msoft-float
44 endif
45 endif
46 endif
48 ifeq (${ADK_MAKE_PARALLEL},y)
49 UCLIBC_MAKEOPTS+= -j${ADK_MAKE_JOBS}
50 endif
52 $(WRKBUILD)/.configured: $(WRKBUILD)/.prepared
53 PATH='$(HOST_PATH)' sed -e 's\x01^KERNEL_HEADERS.*$$\x01KERNEL_HEADERS=\"${STAGING_TARGET_DIR}/usr/include\"\x01' \
54 $(ADK_TOPDIR)/target/$(ADK_TARGET_ARCH)/uclibc-ng.config >${WRKBUILD}/.config
55 $(SED) 's^.*\(CROSS_COMPILER_PREFIX\).*^\1=\"$(TARGET_CROSS)\"^' ${WRKBUILD}/.config
56 ifeq ($(ADK_TARGET_ENDIAN),little)
57 $(SED) 's/.*\(ARCH_LITTLE_ENDIAN\).*/\1=y/' ${WRKBUILD}/.config
58 $(SED) 's/.*\(ARCH_WANTS_LITTLE_ENDIAN\).*/\1=y/' ${WRKBUILD}/.config
59 $(SED) 's/.*\(ARCH_BIG_ENDIAN\).*/# \1 is not set/' ${WRKBUILD}/.config
60 $(SED) 's/.*\(ARCH_WANTS_BIG_ENDIAN\).*/# \1 is not set/' ${WRKBUILD}/.config
61 else
62 $(SED) 's/.*\(ARCH_BIG_ENDIAN\).*/\1=y/' ${WRKBUILD}/.config
63 $(SED) 's/.*\(ARCH_WANTS_BIG_ENDIAN\).*/\1=y/' ${WRKBUILD}/.config
64 $(SED) 's/.*\(ARCH_LITTLE_ENDIAN\).*/# \1 is not set/' ${WRKBUILD}/.config
65 $(SED) 's/.*\(ARCH_WANTS_LITTLE_ENDIAN\).*/# \1 is not set/' ${WRKBUILD}/.config
66 endif
67 ifeq ($(ADK_TARGET_SOFT_FLOAT),y)
68 $(SED) 's/.*\(UCLIBC_HAS_FPU\).*/# \1 is not set/' ${WRKBUILD}/.config
69 $(SED) 's/.*\(UCLIBC_HAS_SOFT_FLOAT\).*/#\1=y/' ${WRKBUILD}/.config
70 endif
71 ifeq ($(ADK_TARGET_HARD_FLOAT),y)
72 $(SED) 's/.*\(UCLIBC_HAS_FPU\).*/\1=y/' ${WRKBUILD}/.config
73 $(SED) 's/.*\(UCLIBC_HAS_SOFT_FLOAT\).*/# \1 is not set/' ${WRKBUILD}/.config
74 endif
75 ifeq ($(ADK_TARGET_HARD_FLOAT_SP),y)
76 $(SED) 's/.*\(UCLIBC_HAS_FPU\).*/\1=y/' ${WRKBUILD}/.config
77 $(SED) 's/.*\(UCLIBC_HAS_SOFT_FLOAT\).*/# \1 is not set/' ${WRKBUILD}/.config
78 endif
79 ifeq ($(ADK_TARGET_HARD_FLOAT_DP),y)
80 $(SED) 's/.*\(UCLIBC_HAS_FPU\).*/\1=y/' ${WRKBUILD}/.config
81 $(SED) 's/.*\(UCLIBC_HAS_SOFT_FLOAT\).*/# \1 is not set/' ${WRKBUILD}/.config
82 endif
83 ifeq ($(ADK_TARGET_BINFMT_FDPIC),y)
84 $(SED) 's/.*\(UCLIBC_FORMAT_FDPIC_ELF\).*/\1=y/' ${WRKBUILD}/.config
85 $(SED) 's/.*\(UCLIBC_FORMAT_FLAT\).*/# \1 is not set/' ${WRKBUILD}/.config
86 $(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SEP_DATA\).*/# \1 is not set/' ${WRKBUILD}/.config
87 $(SED) 's/.*\(UCLIBC_FORMAT_SHARED_FLAT\).*/# \1 is not set/' ${WRKBUILD}/.config
88 endif
89 ifeq ($(ADK_TARGET_BINFMT_FLAT),y)
90 echo '# UCLIBC_FORMAT_FLAT is not set' >> ${WRKBUILD}/.config
91 $(SED) 's/.*\(UCLIBC_FORMAT_FLAT\).*/\1=y/' ${WRKBUILD}/.config
92 $(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SEP_DATA\).*/# \1 is not set/' ${WRKBUILD}/.config
93 $(SED) 's/.*\(UCLIBC_FORMAT_SHARED_FLAT\).*/# \1 is not set/' ${WRKBUILD}/.config
94 $(SED) 's/.*\(UCLIBC_FORMAT_FDPIC_ELF\).*/# \1 is not set/' ${WRKBUILD}/.config
95 ifeq ($(ADK_TARGET_BINFMT_FLAT_SEP_DATA),y)
96 echo '# UCLIBC_FORMAT_FLAT_SEP_DATA is not set' >> ${WRKBUILD}/.config
97 $(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SEP_DATA\).*/\1=y/' ${WRKBUILD}/.config
98 $(SED) 's/.*\(UCLIBC_FORMAT_FLAT \).*/# \1 is not set/' ${WRKBUILD}/.config
99 $(SED) 's/.*\(UCLIBC_FORMAT_SHARED_FLAT\).*/# \1 is not set/' ${WRKBUILD}/.config
100 $(SED) 's/.*\(UCLIBC_FORMAT_FDPIC_ELF\).*/# \1 is not set/' ${WRKBUILD}/.config
101 endif
102 ifeq ($(ADK_TARGET_BINFMT_FLAT_SHARED),y)
103 echo '# UCLIBC_FORMAT_SHARED_FLAT is not set' >> ${WRKBUILD}/.config
104 echo '# HAVE_NO_SHARED is not set' >> ${WRKBUILD}/.config
105 $(SED) 's/.*\(UCLIBC_FORMAT_SHARED_FLAT\).*/\1=y/' ${WRKBUILD}/.config
106 $(SED) 's/.*\(UCLIBC_FORMAT_FLAT \).*/# \1 is not set/' ${WRKBUILD}/.config
107 $(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SEP_DATA\).*/# \1 is not set/' ${WRKBUILD}/.config
108 $(SED) 's/.*\(UCLIBC_FORMAT_FDPIC_ELF\).*/# \1 is not set/' ${WRKBUILD}/.config
109 endif
110 endif
111 ifeq ($(ADK_TARGET_LIBC_WITH_LIBICONV),y)
112 $(SED) 's/.*\(UCLIBC_HAS_LIBICONV\).*/\1=y/' ${WRKBUILD}/.config
113 endif
114 ifeq ($(ADK_TARGET_LIBC_WITH_LIBINTL),y)
115 $(SED) 's/.*\(UCLIBC_HAS_LIBINTL\).*/\1=y/' ${WRKBUILD}/.config
116 endif
117 ifeq ($(ADK_TARGET_LIBC_WITH_LOCALE),y)
118 $(SED) 's/.*\(UCLIBC_HAS_LOCALE\).*/\1=y/' ${WRKBUILD}/.config
119 echo 'UCLIBC_HAS_XLOCALE=y' >> ${WRKBUILD}/.config
120 endif
121 ifeq ($(ADK_TARGET_UCLINUX),y)
122 $(SED) 's/.*\(ARCH_USE_MMU\).*/# \1 is not set/' ${WRKBUILD}/.config
123 endif
124 ifeq ($(ADK_TARGET_WITH_MMU),)
125 $(SED) 's/.*\(ARCH_USE_MMU\).*/# \1 is not set/' ${WRKBUILD}/.config
126 endif
127 ifeq ($(ADK_TARGET_WITH_NPTL),y)
128 $(SED) 's/.*\(UCLIBC_HAS_THREADS_NATIVE\).*/\1=y/' ${WRKBUILD}/.config
129 $(SED) 's/.*\(UCLIBC_HAS_TLS\).*/\1=y/' ${WRKBUILD}/.config
130 $(SED) 's/.*\(PTHREADS_DEBUG_SUPPORT\).*/\1=y/' ${WRKBUILD}/.config
131 $(SED) 's/.*\(UCLIBC_HAS_LINUXTHREADS\).*/# \1 is not set/' ${WRKBUILD}/.config
132 $(SED) 's/.*\(HAS_NO_THREADS\).*/# \1 is not set/' ${WRKBUILD}/.config
133 endif
134 ifeq ($(ADK_TARGET_WITH_LT),y)
135 echo '# UCLIBC_HAS_THREADS is not set' >> ${WRKBUILD}/.config
136 echo '# UCLIBC_HAS_LINUXTHREADS is not set' >> ${WRKBUILD}/.config
137 $(SED) 's/.*\(UCLIBC_HAS_THREADS_NATIVE\).*/# \1 is not set/' ${WRKBUILD}/.config
138 $(SED) 's/.*\(UCLIBC_HAS_TLS\).*/# \1 is not set/' ${WRKBUILD}/.config
139 $(SED) 's/.*\(UCLIBC_HAS_THREADS\).*/\1=y/' ${WRKBUILD}/.config
140 $(SED) 's/.*\(UCLIBC_HAS_LINUXTHREADS\).*/\1=y/' ${WRKBUILD}/.config
141 $(SED) 's/.*\(HAS_NO_THREADS\).*/# \1 is not set/' ${WRKBUILD}/.config
142 endif
143 ifeq ($(ADK_TARGET_LIB_WITHOUT_THREADS)$(ADK_TARGET_WITHOUT_THREADS),y)
144 $(SED) 's/.*\(UCLIBC_HAS_LINUXTHREADS\).*/# \1 is not set/' ${WRKBUILD}/.config
145 $(SED) 's/.*\(UCLIBC_HAS_THREADS_NATIVE\).*/# \1 is not set/' ${WRKBUILD}/.config
146 $(SED) 's/.*\(UCLIBC_HAS_TLS\).*/# \1 is not set/' ${WRKBUILD}/.config
147 $(SED) 's/.*\(PTHREADS_DEBUG_SUPPORT\).*/# \1 is not set/' ${WRKBUILD}/.config
148 $(SED) 's/.*\(HAS_NO_THREADS\).*/\1=y/' ${WRKBUILD}/.config
149 endif
150 ifeq ($(ADK_TARGET_USE_STATIC_LIBS_ONLY)$(ADK_TARGET_BINFMT_FLAT),)
151 $(SED) 's/.*\(HAVE_SHARED\).*/\1=y/' ${WRKBUILD}/.config
152 else
153 $(SED) 's/.*\(HAVE_SHARED\).*/# \1 is not set/' ${WRKBUILD}/.config
154 endif
155 ifeq ($(ADK_TARGET_USE_GNU_HASHSTYLE),y)
156 $(SED) 's/.*\(LDSO_GNU_HASH_SUPPORT\).*/\1=y/' ${WRKBUILD}/.config
157 else
158 $(SED) 's/.*\(LDSO_GNU_HASH_SUPPORT\).*/# \1 is not set/' ${WRKBUILD}/.config
159 endif
160 ifeq ($(ADK_TARGET_USE_SSP),y)
161 $(SED) 's,.*UCLIBC_HAS_SSP,UCLIBC_HAS_SSP=y,' ${WRKBUILD}/.config
162 echo "UCLIBC_HAS_SSP_COMPAT=n" >> ${WRKBUILD}/.config
163 echo "SSP_QUICK_CANARY=n" >> ${WRKBUILD}/.config
164 echo "UCLIBC_BUILD_SSP=y" >> ${WRKBUILD}/.config
165 endif
166 ifeq ($(ADK_DEBUG),y)
167 $(SED) 's/.*\(DODEBUG\).*/\1=y/' ${WRKBUILD}/.config
168 endif
171 # architecture specific options
174 # arc
175 ifeq ($(ADK_TARGET_ARCH_ARC),y)
176 ifeq ($(ADK_TARGET_CPU_ARC_ARC700),y)
177 $(SED) 's/.*\(CONFIG_ARC_CPU_HS\).*/# \1 is not set/' ${WRKBUILD}/.config
178 $(SED) 's/.*\(CONFIG_ARC_CPU_700\).*/\1=y/' ${WRKBUILD}/.config
179 endif
180 ifeq ($(ADK_TARGET_CPU_ARC_ARC_HS),y)
181 $(SED) 's/.*\(CONFIG_ARC_CPU_700\).*/# \1 is not set/' ${WRKBUILD}/.config
182 $(SED) 's/.*\(CONFIG_ARC_CPU_HS\).*/\1=y/' ${WRKBUILD}/.config
183 endif
184 endif
186 # arm
187 ifeq ($(ADK_TARGET_ARCH_ARM),y)
188 ifeq ($(ADK_TARGET_WITH_MMU),)
189 $(SED) 's/.*\(DOPIC\).*/# \1 is not set/' ${WRKBUILD}/.config
190 endif
191 ifeq ($(ADK_TARGET_ARCH_ARM_WITH_THUMB),y)
192 $(SED) 's/.*\(UCLIBC_HAS_CONTEXT_FUNCS\).*/# \1 is not set/' ${WRKBUILD}/.config
193 endif
194 endif
196 # cris
197 ifeq ($(ADK_TARGET_ARCH_CRIS),y)
198 ifeq ($(ADK_TARGET_CPU_CRIS_CRISV32),y)
199 $(SED) 's/.*\(CONFIG_CRIS=\).*/# \1 is not set/' ${WRKBUILD}/.config
200 $(SED) 's/.*\(CONFIG_CRISV32\).*/\1=y/' ${WRKBUILD}/.config
201 endif
202 ifeq ($(ADK_TARGET_CPU_CRIS_CRISV10),y)
203 $(SED) 's/.*\(CONFIG_CRIS=\).*/\1=y/' ${WRKBUILD}/.config
204 $(SED) 's/.*\(CONFIG_CRISV32\).*/# \1 is not set/' ${WRKBUILD}/.config
205 endif
206 endif
208 # h8300
209 ifeq ($(ADK_TARGET_ARCH_H8300),y)
210 ifeq ($(ADK_TARGET_CPU_H8300H),y)
211 $(SED) 's/.*\(CONFIG_H8S\).*/# \1 is not set/' ${WRKBUILD}/.config
212 $(SED) 's/.*\(CONFIG_H8300H\).*/\1=y/' ${WRKBUILD}/.config
213 endif
214 ifeq ($(ADK_TARGET_CPU_H8S),y)
215 $(SED) 's/.*\(CONFIG_H8S\).*/\1=y/' ${WRKBUILD}/.config
216 $(SED) 's/.*\(CONFIG_H8300H\).*/# \1 is not set/' ${WRKBUILD}/.config
217 endif
218 endif
220 # sh
221 ifeq ($(ADK_TARGET_ARCH_SH),y)
222 ifeq ($(ADK_TARGET_CPU_SH_SH4A),y)
223 $(SED) 's/.*\(CONFIG_SH2A\).*/# \1 is not set/' ${WRKBUILD}/.config
224 $(SED) 's/.*\(CONFIG_SH2\).*/# \1 is not set/' ${WRKBUILD}/.config
225 $(SED) 's/.*\(CONFIG_SH3\).*/# \1 is not set/' ${WRKBUILD}/.config
226 $(SED) 's/.*\(CONFIG_SH4=\).*/# \1 is not set/' ${WRKBUILD}/.config
227 $(SED) 's/.*\(CONFIG_SH4A\).*/\1=y/' ${WRKBUILD}/.config
228 endif
229 ifeq ($(ADK_TARGET_CPU_SH_SH4),y)
230 $(SED) 's/.*\(CONFIG_SH2A\).*/# \1 is not set/' ${WRKBUILD}/.config
231 $(SED) 's/.*\(CONFIG_SH2\).*/# \1 is not set/' ${WRKBUILD}/.config
232 $(SED) 's/.*\(CONFIG_SH3\).*/# \1 is not set/' ${WRKBUILD}/.config
233 $(SED) 's/.*\(CONFIG_SH4A\).*/# \1 is not set/' ${WRKBUILD}/.config
234 $(SED) 's/.*\(CONFIG_SH4\).*/\1=y/' ${WRKBUILD}/.config
235 endif
236 ifeq ($(ADK_TARGET_CPU_SH_SH3),y)
237 $(SED) 's/.*\(UCLIBC_HAS_FPU\).*/# \1 is not set/' ${WRKBUILD}/.config
238 $(SED) 's/.*\(CONFIG_SH2A\).*/# \1 is not set/' ${WRKBUILD}/.config
239 $(SED) 's/.*\(CONFIG_SH2\).*/# \1 is not set/' ${WRKBUILD}/.config
240 $(SED) 's/.*\(CONFIG_SH4\).*/# \1 is not set/' ${WRKBUILD}/.config
241 $(SED) 's/.*\(CONFIG_SH4A\).*/# \1 is not set/' ${WRKBUILD}/.config
242 $(SED) 's/.*\(CONFIG_SH3\).*/\1=y/' ${WRKBUILD}/.config
243 endif
244 ifeq ($(ADK_TARGET_CPU_SH_SH2)$(ADK_TARGET_CPU_SH_J2),y)
245 $(SED) 's/.*\(UCLIBC_HAS_FPU\).*/# \1 is not set/' ${WRKBUILD}/.config
246 $(SED) 's/.*\(CONFIG_SH2A\).*/# \1 is not set/' ${WRKBUILD}/.config
247 $(SED) 's/.*\(CONFIG_SH3\).*/# \1 is not set/' ${WRKBUILD}/.config
248 $(SED) 's/.*\(CONFIG_SH4\).*/# \1 is not set/' ${WRKBUILD}/.config
249 $(SED) 's/.*\(CONFIG_SH4A\).*/# \1 is not set/' ${WRKBUILD}/.config
250 $(SED) 's/.*\(CONFIG_SH2\).*/\1=y/' ${WRKBUILD}/.config
251 endif
252 ifeq ($(ADK_TARGET_CPU_SH_SH2A),y)
253 $(SED) 's/.*\(UCLIBC_HAS_FPU\).*/# \1 is not set/' ${WRKBUILD}/.config
254 $(SED) 's/.*\(CONFIG_SH2\).*/# \1 is not set/' ${WRKBUILD}/.config
255 $(SED) 's/.*\(CONFIG_SH3\).*/# \1 is not set/' ${WRKBUILD}/.config
256 $(SED) 's/.*\(CONFIG_SH4\).*/# \1 is not set/' ${WRKBUILD}/.config
257 $(SED) 's/.*\(CONFIG_SH4A\).*/# \1 is not set/' ${WRKBUILD}/.config
258 $(SED) 's/.*\(CONFIG_SH2A\).*/\1=y/' ${WRKBUILD}/.config
259 endif
260 endif
262 # x86
263 ifeq ($(ADK_TARGET_ARCH_X86),y)
264 ifeq ($(ADK_TARGET_CPU_X86_I486),y)
265 $(SED) 's/.*\(CONFIG_686\).*/# \1 is not set/' ${WRKBUILD}/.config
266 $(SED) 's/.*\(CONFIG_586\).*/# \1 is not set/' ${WRKBUILD}/.config
267 $(SED) 's/.*\(CONFIG_486\).*/\1=y/' ${WRKBUILD}/.config
268 endif
269 ifeq ($(ADK_TARGET_CPU_X86_I586),y)
270 $(SED) 's/.*\(CONFIG_686\).*/# \1 is not set/' ${WRKBUILD}/.config
271 $(SED) 's/.*\(CONFIG_586\).*/\1=y/' ${WRKBUILD}/.config
272 $(SED) 's/.*\(CONFIG_486\).*/# \1 is not set/' ${WRKBUILD}/.config
273 endif
274 ifeq ($(ADK_TARGET_CPU_X86_I686),y)
275 $(SED) 's/.*\(CONFIG_686\).*/\1=y/' ${WRKBUILD}/.config
276 $(SED) 's/.*\(CONFIG_586\).*/# \1 is not set/' ${WRKBUILD}/.config
277 $(SED) 's/.*\(CONFIG_486\).*/# \1 is not set/' ${WRKBUILD}/.config
278 endif
279 endif
281 # m68k
282 ifeq ($(ADK_TARGET_ARCH_M68K),y)
283 ifeq ($(ADK_TARGET_WITH_MMU),)
284 ifeq ($(ADK_TARGET_BINFMT_FLAT_ONE)$(ADK_TARGET_BINFMT_FLAT_SEP_DATA),y)
285 $(SED) 's/.*\(DOPIC\).*/# \1 is not set/' ${WRKBUILD}/.config
286 endif
287 endif
288 endif
290 # mips/mips64 NaN
291 ifeq ($(ADK_TARGET_ARCH_MIPS_WITH_NAN_2008),y)
292 $(SED) 's/.*\(CONFIG_MIPS_NAN_LEGACY\).*/# \1 is not set/' ${WRKBUILD}/.config
293 $(SED) 's/.*\(CONFIG_MIPS_NAN_2008\).*/\1=y/' ${WRKBUILD}/.config
294 endif
295 ifeq ($(ADK_TARGET_ARCH_MIPS_WITH_NAN_LEGACY),y)
296 $(SED) 's/.*\(CONFIG_MIPS_NAN_2008\).*/# \1 is not set/' ${WRKBUILD}/.config
297 $(SED) 's/.*\(CONFIG_MIPS_NAN_LEGACY\).*/\1=y/' ${WRKBUILD}/.config
298 endif
300 # mips64 abi
301 ifeq ($(ADK_TARGET_ARCH_MIPS64),y)
302 ifeq ($(ADK_TARGET_ABI_N64),y)
303 $(SED) 's/.*\(CONFIG_MIPS_N64_ABI\).*/\1=y/' ${WRKBUILD}/.config
304 $(SED) 's/.*\(CONFIG_MIPS_O32_ABI\).*/# \1 is not set/' ${WRKBUILD}/.config
305 $(SED) 's/.*\(CONFIG_MIPS_N32_ABI\).*/# \1 is not set/' ${WRKBUILD}/.config
306 endif
307 ifeq ($(ADK_TARGET_ABI_N32),y)
308 $(SED) 's/.*\(CONFIG_MIPS_N32_ABI\).*/\1=y/' ${WRKBUILD}/.config
309 $(SED) 's/.*\(CONFIG_MIPS_O32_ABI\).*/# \1 is not set/' ${WRKBUILD}/.config
310 $(SED) 's/.*\(CONFIG_MIPS_N64_ABI\).*/# \1 is not set/' ${WRKBUILD}/.config
311 endif
312 ifeq ($(ADK_TARGET_ABI_O32),y)
313 $(SED) 's/.*\(CONFIG_MIPS_O32_ABI\).*/\1=y/' ${WRKBUILD}/.config
314 $(SED) 's/.*\(CONFIG_MIPS_N32_ABI\).*/# \1 is not set/' ${WRKBUILD}/.config
315 $(SED) 's/.*\(CONFIG_MIPS_N64_ABI\).*/# \1 is not set/' ${WRKBUILD}/.config
316 endif
317 endif
318 echo N|PATH='$(HOST_PATH)' $(MAKE) -C $(WRKBUILD) \
319 HOSTCC="$(HOST_CC)" \
320 CC='$(TARGET_CC)' \
321 PREFIX=$(STAGING_TARGET_DIR) \
322 DEVEL_PREFIX=/usr/ \
323 RUNTIME_PREFIX=$(STAGING_TARGET_DIR) \
324 UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
325 UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
326 oldconfig
327 ifeq ($(ADK_TARGET_LIBC_WITH_LOCALE),y)
328 $(SED) 's/.*\(UCLIBC_BUILD_MINIMAL_LOCALES\).*/\1="$(ADK_RUNTIME_DEFAULT_LOCALE)"/' ${WRKBUILD}/.config
329 endif
330 touch $@
332 $(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
333 PATH='$(HOST_PATH)' $(MAKE) $(UCLIBC_MAKEOPTS) -C $(WRKBUILD) \
334 ARCH="$(ADK_TARGET_ARCH)" \
335 CROSS_COMPILE="$(TARGET_CROSS)" \
336 HOSTCC="$(HOST_CC)" \
337 PREFIX=$(STAGING_TARGET_DIR) \
338 DEVEL_PREFIX=/usr/ \
339 RUNTIME_PREFIX=/ \
340 UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
341 UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
342 VERBOSE=1 \
344 ifeq ($(ADK_TARGET_LIBC_UTILS),y)
345 PATH='$(HOST_PATH)' $(MAKE) $(UCLIBC_MAKEOPTS) -C $(WRKBUILD) \
346 ARCH="$(ADK_TARGET_ARCH)" \
347 CROSS_COMPILE="$(TARGET_CROSS)" \
348 HOSTCC="$(HOST_CC)" \
349 PREFIX=$(STAGING_TARGET_DIR) \
350 DEVEL_PREFIX=/usr/ \
351 RUNTIME_PREFIX=/ \
352 UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
353 UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
354 VERBOSE=1 \
355 utils
356 endif
357 touch $@
359 $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
360 PATH='$(HOST_PATH)' $(MAKE) -C $(WRKBUILD) \
361 ARCH="$(ADK_TARGET_ARCH)" \
362 CROSS_COMPILE="$(TARGET_CROSS)" \
363 HOSTCC="$(HOST_CC)" \
364 PREFIX=$(STAGING_TARGET_DIR) \
365 DEVEL_PREFIX=/usr/ \
366 RUNTIME_PREFIX=/ \
367 UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
368 UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
369 VERBOSE=1 \
370 install_runtime install_dev
371 ifeq ($(ADK_TARGET_LIBC_UTILS),y)
372 PATH='$(HOST_PATH)' $(MAKE) -C $(WRKBUILD) \
373 ARCH="$(ADK_TARGET_ARCH)" \
374 CROSS_COMPILE="$(TARGET_CROSS)" \
375 HOSTCC="$(HOST_CC)" \
376 PREFIX=$(STAGING_TARGET_DIR) \
377 DEVEL_PREFIX=/usr/ \
378 RUNTIME_PREFIX=/ \
379 UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
380 UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
381 VERBOSE=1 \
382 install_utils
383 endif
384 touch $@
386 include ${ADK_TOPDIR}/mk/toolchain.mk