1
0

Makefile 14 KB

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