1
0

Makefile 15 KB

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