Makefile 16 KB

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