Makefile 15 KB

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