Makefile 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  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. TARGET_CFLAGS:=$(filter-out -flto,$(TARGET_CFLAGS))
  9. # handled by uClibc-ng makefiles
  10. TARGET_CFLAGS:=$(filter-out -fstack-protector-all,$(TARGET_CFLAGS))
  11. TARGET_LDFLAGS:=$(filter-out -fstack-protector-all,$(TARGET_LDFLAGS))
  12. ifeq ($(ADK_TARGET_HARD_FLOAT),y)
  13. ifeq ($(ADK_TARGET_ARCH_ARM),y)
  14. TARGET_CFLAGS+= -Wa,-mfloat-abi=hard
  15. endif
  16. ifeq ($(ADK_TARGET_ARCH_MIPS),y)
  17. TARGET_CFLAGS+= -Wa,-mhard-float
  18. endif
  19. endif
  20. ifeq ($(ADK_TARGET_SOFT_FLOAT),y)
  21. ifeq ($(ADK_TARGET_ARCH_ARM),y)
  22. TARGET_CFLAGS+= -Wa,-mfloat-abi=soft
  23. endif
  24. ifeq ($(ADK_TARGET_ARCH_MIPS),y)
  25. TARGET_CFLAGS+= -Wa,-msoft-float
  26. endif
  27. endif
  28. ifeq (${ADK_MAKE_PARALLEL},y)
  29. UCLIBC_MAKEOPTS+= -j${ADK_MAKE_JOBS}
  30. endif
  31. $(WRKBUILD)/.headers:
  32. $(SED) 's,^CROSS_COMPILE=.*,CROSS_COMPILE=$(TARGET_CROSS),g' $(WRKBUILD)/Rules.mak
  33. ifeq ($(ADK_TARGET_LIB_UCLIBC_NG_GIT),y)
  34. PATH='$(HOST_PATH)' sed -e 's^KERNEL_HEADERS.*$$KERNEL_HEADERS=\"${STAGING_TARGET_DIR}/usr/include\"' \
  35. $(ADK_TOPDIR)/target/$(ADK_TARGET_ARCH)/uclibc-ng.config >${WRKBUILD}/.config
  36. else
  37. PATH='$(HOST_PATH)' sed -e 's^KERNEL_HEADERS.*$$KERNEL_HEADERS=\"${STAGING_TARGET_DIR}/usr/include\"' \
  38. $(ADK_TOPDIR)/target/$(ADK_TARGET_ARCH)/uclibc.config >${WRKBUILD}/.config
  39. endif
  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_FLAT_SHARED\).*/# \1 is not set/' ${WRKBUILD}/.config
  64. endif
  65. ifeq ($(ADK_TARGET_BINFMT_FLAT),y)
  66. ifeq ($(ADK_TARGET_BINFMT_FLAT_ONE),y)
  67. $(SED) 's/.*\(UCLIBC_FORMAT_FLAT\).*/\1=y/' ${WRKBUILD}/.config
  68. $(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SEP_DATA\).*/# \1 is not set/' ${WRKBUILD}/.config
  69. $(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SHARED\).*/# \1 is not set/' ${WRKBUILD}/.config
  70. $(SED) 's/.*\(UCLIBC_FORMAT_FDPIC_ELF\).*/# \1 is not set/' ${WRKBUILD}/.config
  71. endif
  72. ifeq ($(ADK_TARGET_BINFMT_FLAT_SEP_DATA),y)
  73. $(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SEP_DATA\).*/\1=y/' ${WRKBUILD}/.config
  74. $(SED) 's/.*\(UCLIBC_FORMAT_FLAT\).*/# \1 is not set/' ${WRKBUILD}/.config
  75. $(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SHARED\).*/# \1 is not set/' ${WRKBUILD}/.config
  76. $(SED) 's/.*\(UCLIBC_FORMAT_FDPIC_ELF\).*/# \1 is not set/' ${WRKBUILD}/.config
  77. endif
  78. ifeq ($(ADK_TARGET_BINFMT_FLAT_SHARED),y)
  79. $(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SHARED\).*/\1=y/' ${WRKBUILD}/.config
  80. $(SED) 's/.*\(UCLIBC_FORMAT_FLAT\).*/# \1 is not set/' ${WRKBUILD}/.config
  81. $(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SEP_DATA\).*/# \1 is not set/' ${WRKBUILD}/.config
  82. $(SED) 's/.*\(UCLIBC_FORMAT_FDPIC_ELF\).*/# \1 is not set/' ${WRKBUILD}/.config
  83. endif
  84. endif
  85. ifeq ($(ADK_TARGET_LIBC_ICONV),y)
  86. $(SED) 's/.*\(UCLIBC_HAS_LOCALE\).*/\1=y/' ${WRKBUILD}/.config
  87. endif
  88. ifeq ($(ADK_TARGET_UCLINUX),y)
  89. $(SED) 's/.*\(ARCH_USE_MMU\).*/# \1 is not set/' ${WRKBUILD}/.config
  90. endif
  91. ifeq ($(ADK_TARGET_LIB_UCLIBC_NG_GIT),y)
  92. ifeq ($(ADK_TARGET_WITH_NPTL),y)
  93. $(SED) 's/.*\(UCLIBC_HAS_THREADS_NATIVE\).*/\1=y/' ${WRKBUILD}/.config
  94. $(SED) 's/.*\(UCLIBC_HAS_TLS\).*/\1=y/' ${WRKBUILD}/.config
  95. $(SED) 's/.*\(PTHREADS_DEBUG_SUPPORT\).*/\1=y/' ${WRKBUILD}/.config
  96. $(SED) 's/.*\(UCLIBC_HAS_LINUXTHREADS\).*/# \1 is not set/' ${WRKBUILD}/.config
  97. $(SED) 's/.*\(HAS_NO_THREADS\).*/# \1 is not set/' ${WRKBUILD}/.config
  98. endif
  99. ifeq ($(ADK_TARGET_WITH_LT),y)
  100. $(SED) 's/.*\(UCLIBC_HAS_LINUXTHREADS\).*/\1=y/' ${WRKBUILD}/.config
  101. $(SED) 's/.*\(UCLIBC_HAS_THREADS_NATIVE\).*/# \1 is not set/' ${WRKBUILD}/.config
  102. $(SED) 's/.*\(UCLIBC_HAS_TLS\).*/# \1 is not set/' ${WRKBUILD}/.config
  103. $(SED) 's/.*\(PTHREADS_DEBUG_SUPPORT\).*/\1=y/' ${WRKBUILD}/.config
  104. $(SED) 's/.*\(HAS_NO_THREADS\).*/# \1 is not set/' ${WRKBUILD}/.config
  105. endif
  106. ifeq ($(ADK_TARGET_LIB_WITHOUT_THREADS)$(ADK_TARGET_WITHOUT_THREADS),y)
  107. $(SED) 's/.*\(UCLIBC_HAS_LINUXTHREADS\).*/# \1 is not set/' ${WRKBUILD}/.config
  108. $(SED) 's/.*\(UCLIBC_HAS_THREADS_NATIVE\).*/# \1 is not set/' ${WRKBUILD}/.config
  109. $(SED) 's/.*\(UCLIBC_HAS_TLS\).*/# \1 is not set/' ${WRKBUILD}/.config
  110. $(SED) 's/.*\(PTHREADS_DEBUG_SUPPORT\).*/# \1 is not set/' ${WRKBUILD}/.config
  111. $(SED) 's/.*\(HAS_NO_THREADS\).*/\1=y/' ${WRKBUILD}/.config
  112. endif
  113. endif
  114. ifeq ($(ADK_TARGET_LIB_UCLIBC_NG_1_0),y)
  115. ifeq ($(ADK_TARGET_WITH_NPTL),y)
  116. $(SED) 's/.*\(UCLIBC_HAS_THREADS_NATIVE\).*/\1=y/' ${WRKBUILD}/.config
  117. $(SED) 's/.*\(UCLIBC_HAS_TLS\).*/\1=y/' ${WRKBUILD}/.config
  118. $(SED) 's/.*\(PTHREADS_DEBUG_SUPPORT\).*/\1=y/' ${WRKBUILD}/.config
  119. $(SED) 's/.*\(LINUXTHREADS_OLD\).*/# \1 is not set/' ${WRKBUILD}/.config
  120. $(SED) 's/.*\(LINUXTHREADS_NEW\).*/# \1 is not set/' ${WRKBUILD}/.config
  121. $(SED) 's/.*\(HAS_NO_THREADS\).*/# \1 is not set/' ${WRKBUILD}/.config
  122. endif
  123. ifeq ($(ADK_TARGET_WITH_LT),y)
  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/.*\(LINUXTHREADS_OLD\).*/\1=y/' ${WRKBUILD}/.config
  127. $(SED) 's/.*\(LINUXTHREADS_NEW\).*/# \1 is not set/' ${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/.*\(LINUXTHREADS_OLD\).*/# \1 is not set/' ${WRKBUILD}/.config
  132. $(SED) 's/.*\(LINUXTHREADS_NEW\).*/# \1 is not set/' ${WRKBUILD}/.config
  133. $(SED) 's/.*\(UCLIBC_HAS_THREADS_NATIVE\).*/# \1 is not set/' ${WRKBUILD}/.config
  134. $(SED) 's/.*\(UCLIBC_HAS_TLS\).*/# \1 is not set/' ${WRKBUILD}/.config
  135. $(SED) 's/.*\(PTHREADS_DEBUG_SUPPORT\).*/# \1 is not set/' ${WRKBUILD}/.config
  136. $(SED) 's/.*\(HAS_NO_THREADS\).*/\1=y/' ${WRKBUILD}/.config
  137. endif
  138. endif
  139. ifeq ($(ADK_TARGET_USE_STATIC_LIBS)$(ADK_TARGET_BINFMT_FLAT),)
  140. $(SED) 's/.*\(HAVE_SHARED\).*/\1=y/' ${WRKBUILD}/.config
  141. else
  142. $(SED) 's/.*\(HAVE_SHARED\).*/# \1 is not set/' ${WRKBUILD}/.config
  143. endif
  144. ifeq ($(ADK_TARGET_USE_GNU_HASHSTYLE),y)
  145. $(SED) 's/.*\(LDSO_GNU_HASH_SUPPORT\).*/#\1=y/' ${WRKBUILD}/.config
  146. else
  147. $(SED) 's/.*\(LDSO_GNU_HASH_SUPPORT\).*/# \1 is not set/' ${WRKBUILD}/.config
  148. endif
  149. ifeq ($(ADK_TARGET_USE_SSP),y)
  150. $(SED) 's,.*UCLIBC_HAS_SSP,UCLIBC_HAS_SSP=y,' ${WRKBUILD}/.config
  151. echo "UCLIBC_HAS_SSP_COMPAT=n" >> ${WRKBUILD}/.config
  152. echo "SSP_QUICK_CANARY=n" >> ${WRKBUILD}/.config
  153. echo "UCLIBC_BUILD_SSP=y" >> ${WRKBUILD}/.config
  154. endif
  155. #
  156. # architecture specific options
  157. #
  158. # arc
  159. ifeq ($(ADK_TARGET_ARCH_ARC),y)
  160. ifeq ($(ADK_CPU_ARC700),y)
  161. $(SED) 's/.*\(CONFIG_ARC_CPU_HS\).*/# \1 is not set/' ${WRKBUILD}/.config
  162. $(SED) 's/.*\(CONFIG_ARC_CPU_700\).*/\1=y/' ${WRKBUILD}/.config
  163. endif
  164. ifeq ($(ADK_CPU_ARC_HS),y)
  165. $(SED) 's/.*\(CONFIG_ARC_CPU_700\).*/# \1 is not set/' ${WRKBUILD}/.config
  166. $(SED) 's/.*\(CONFIG_ARC_CPU_HS\).*/\1=y/' ${WRKBUILD}/.config
  167. endif
  168. endif
  169. # arm
  170. ifeq ($(ADK_TARGET_ARCH_ARM),y)
  171. ifeq ($(ADK_TARGET_ARCH_ARM_WITH_THUMB),y)
  172. $(SED) 's/.*\(COMPILE_IN_THUMB_MODE\).*/\1=y/' ${WRKBUILD}/.config
  173. $(SED) 's/.*\(UCLIBC_HAS_CONTEXT_FUNCS\).*/# \1 is not set/' ${WRKBUILD}/.config
  174. endif
  175. endif
  176. # cris
  177. ifeq ($(ADK_TARGET_ARCH_CRIS),y)
  178. ifeq ($(ADK_CPU_CRIS_V32),y)
  179. $(SED) 's/.*\(CONFIG_CRIS=\).*/# \1 is not set/' ${WRKBUILD}/.config
  180. $(SED) 's/.*\(CONFIG_CRISV32\).*/\1=y/' ${WRKBUILD}/.config
  181. endif
  182. ifeq ($(ADK_CPU_CRIS_V10),y)
  183. $(SED) 's/.*\(CONFIG_CRIS=\).*/\1=y/' ${WRKBUILD}/.config
  184. $(SED) 's/.*\(CONFIG_CRISV32\).*/# \1 is not set/' ${WRKBUILD}/.config
  185. endif
  186. endif
  187. # mips
  188. ifeq ($(ADK_TARGET_ARCH_MIPS),y)
  189. ifeq ($(ADK_CPU_MIPS32R2),y)
  190. $(SED) 's/.*\(CONFIG_MIPS_ISA_MIPS32 \).*/# \1 is not set/' ${WRKBUILD}/.config
  191. $(SED) 's/.*\(CONFIG_MIPS_ISA_MIPS32R2\).*/\1=y/' ${WRKBUILD}/.config
  192. endif
  193. endif
  194. # sh
  195. ifeq ($(ADK_TARGET_ARCH_SH),y)
  196. ifeq ($(ADK_CPU_SH4A),y)
  197. $(SED) 's/.*\(CONFIG_SH2A\).*/# \1 is not set/' ${WRKBUILD}/.config
  198. $(SED) 's/.*\(CONFIG_SH2\).*/# \1 is not set/' ${WRKBUILD}/.config
  199. $(SED) 's/.*\(CONFIG_SH3\).*/# \1 is not set/' ${WRKBUILD}/.config
  200. $(SED) 's/.*\(CONFIG_SH4=\).*/# \1 is not set/' ${WRKBUILD}/.config
  201. $(SED) 's/.*\(CONFIG_SH4A\).*/\1=y/' ${WRKBUILD}/.config
  202. echo foo
  203. cat ${WRKBUILD}/.config
  204. endif
  205. ifeq ($(ADK_CPU_SH4),y)
  206. $(SED) 's/.*\(CONFIG_SH2A\).*/# \1 is not set/' ${WRKBUILD}/.config
  207. $(SED) 's/.*\(CONFIG_SH2\).*/# \1 is not set/' ${WRKBUILD}/.config
  208. $(SED) 's/.*\(CONFIG_SH3\).*/# \1 is not set/' ${WRKBUILD}/.config
  209. $(SED) 's/.*\(CONFIG_SH4A\).*/# \1 is not set/' ${WRKBUILD}/.config
  210. $(SED) 's/.*\(CONFIG_SH4\).*/\1=y/' ${WRKBUILD}/.config
  211. endif
  212. ifeq ($(ADK_CPU_SH3),y)
  213. $(SED) 's/.*\(CONFIG_SH2A\).*/# \1 is not set/' ${WRKBUILD}/.config
  214. $(SED) 's/.*\(CONFIG_SH2\).*/# \1 is not set/' ${WRKBUILD}/.config
  215. $(SED) 's/.*\(CONFIG_SH4\).*/# \1 is not set/' ${WRKBUILD}/.config
  216. $(SED) 's/.*\(CONFIG_SH4A\).*/# \1 is not set/' ${WRKBUILD}/.config
  217. $(SED) 's/.*\(CONFIG_SH3\).*/\1=y/' ${WRKBUILD}/.config
  218. endif
  219. ifeq ($(ADK_CPU_SH2),y)
  220. $(SED) 's/.*\(CONFIG_SH2A\).*/# \1 is not set/' ${WRKBUILD}/.config
  221. $(SED) 's/.*\(CONFIG_SH3\).*/# \1 is not set/' ${WRKBUILD}/.config
  222. $(SED) 's/.*\(CONFIG_SH4\).*/# \1 is not set/' ${WRKBUILD}/.config
  223. $(SED) 's/.*\(CONFIG_SH4A\).*/# \1 is not set/' ${WRKBUILD}/.config
  224. $(SED) 's/.*\(CONFIG_SH2\).*/\1=y/' ${WRKBUILD}/.config
  225. endif
  226. ifeq ($(ADK_CPU_SH2A),y)
  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_SH2A\).*/\1=y/' ${WRKBUILD}/.config
  232. endif
  233. endif
  234. # x86
  235. ifeq ($(ADK_TARGET_ARCH_X86),y)
  236. ifeq ($(ADK_CPU_I486),y)
  237. $(SED) 's/.*\(CONFIG_686\).*/# \1 is not set/' ${WRKBUILD}/.config
  238. $(SED) 's/.*\(CONFIG_586\).*/# \1 is not set/' ${WRKBUILD}/.config
  239. $(SED) 's/.*\(CONFIG_486\).*/\1=y/' ${WRKBUILD}/.config
  240. endif
  241. ifeq ($(ADK_CPU_I586),y)
  242. $(SED) 's/.*\(CONFIG_686\).*/# \1 is not set/' ${WRKBUILD}/.config
  243. $(SED) 's/.*\(CONFIG_586\).*/\1=y/' ${WRKBUILD}/.config
  244. $(SED) 's/.*\(CONFIG_486\).*/# \1 is not set/' ${WRKBUILD}/.config
  245. endif
  246. ifeq ($(ADK_CPU_I686),y)
  247. $(SED) 's/.*\(CONFIG_686\).*/\1=y/' ${WRKBUILD}/.config
  248. $(SED) 's/.*\(CONFIG_586\).*/# \1 is not set/' ${WRKBUILD}/.config
  249. $(SED) 's/.*\(CONFIG_486\).*/# \1 is not set/' ${WRKBUILD}/.config
  250. endif
  251. endif
  252. # mips64
  253. ifeq ($(ADK_TARGET_ARCH_MIPS64),y)
  254. $(SED) 's/.*\(CONFIG_MIPS_ISA_MIPS64\).*/\1=y/' ${WRKBUILD}/.config
  255. $(SED) 's/.*\(CONFIG_MIPS_ISA_MIPS32\).*/# \1 is not set/' ${WRKBUILD}/.config
  256. ifeq ($(ADK_TARGET_ABI_N64),y)
  257. $(SED) 's/.*\(CONFIG_MIPS_N64_ABI\).*/\1=y/' ${WRKBUILD}/.config
  258. $(SED) 's/.*\(CONFIG_MIPS_O32_ABI\).*/# \1 is not set/' ${WRKBUILD}/.config
  259. $(SED) 's/.*\(CONFIG_MIPS_N32_ABI\).*/# \1 is not set/' ${WRKBUILD}/.config
  260. endif
  261. ifeq ($(ADK_TARGET_ABI_N32),y)
  262. $(SED) 's/.*\(CONFIG_MIPS_N32_ABI\).*/\1=y/' ${WRKBUILD}/.config
  263. $(SED) 's/.*\(CONFIG_MIPS_O32_ABI\).*/# \1 is not set/' ${WRKBUILD}/.config
  264. $(SED) 's/.*\(CONFIG_MIPS_N64_ABI\).*/# \1 is not set/' ${WRKBUILD}/.config
  265. endif
  266. ifeq ($(ADK_TARGET_ABI_O32),y)
  267. $(SED) 's/.*\(CONFIG_MIPS_O32_ABI\).*/\1=y/' ${WRKBUILD}/.config
  268. $(SED) 's/.*\(CONFIG_MIPS_N32_ABI\).*/# \1 is not set/' ${WRKBUILD}/.config
  269. $(SED) 's/.*\(CONFIG_MIPS_N64_ABI\).*/# \1 is not set/' ${WRKBUILD}/.config
  270. endif
  271. endif
  272. echo N|PATH='$(HOST_PATH)' $(MAKE) ${UCLIBC_MAKEOPTS} -C $(WRKBUILD) \
  273. PREFIX=$(STAGING_TARGET_DIR) \
  274. DEVEL_PREFIX=/usr/ \
  275. RUNTIME_PREFIX=$(STAGING_TARGET_DIR) \
  276. HOSTCC="$(HOST_CC)" \
  277. UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
  278. UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
  279. oldconfig
  280. PATH='$(HOST_PATH)' $(MAKE) ${UCLIBC_MAKEOPTS} -C $(WRKBUILD) \
  281. PREFIX=$(STAGING_TARGET_DIR) \
  282. DEVEL_PREFIX=/usr/ \
  283. RUNTIME_PREFIX=$(STAGING_TARGET_DIR) \
  284. HOSTCC="$(HOST_CC)" \
  285. UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
  286. UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
  287. install_headers
  288. touch $(WRKBUILD)/.configured
  289. touch $@
  290. $(WRKBUILD)/.compiled:
  291. PATH='$(HOST_PATH)' $(MAKE) ${UCLIBC_MAKEOPTS} -C $(WRKBUILD) \
  292. PREFIX= \
  293. DEVEL_PREFIX=/usr/ \
  294. RUNTIME_PREFIX=/ \
  295. HOSTCC="$(HOST_CC)" \
  296. UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
  297. UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
  298. VERBOSE=1 \
  299. all
  300. touch $@
  301. $(WRKBUILD)/.install_headers: $(WRKBUILD)/.compiled
  302. PATH='$(HOST_PATH)' $(MAKE) -C $(WRKBUILD) \
  303. PREFIX=$(STAGING_TARGET_DIR) \
  304. DEVEL_PREFIX=/usr/ \
  305. DEVEL_PREFIX_LIB=/ \
  306. RUNTIME_PREFIX=/ \
  307. UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
  308. UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
  309. VERBOSE=1 \
  310. install_dev
  311. touch $@
  312. $(WRKBUILD)/.installed: $(WRKBUILD)/.install_headers
  313. PATH='$(HOST_PATH)' $(MAKE) -C $(WRKBUILD) \
  314. PREFIX=$(STAGING_TARGET_DIR) \
  315. DEVEL_PREFIX=/usr/ \
  316. DEVEL_PREFIX_LIB=/ \
  317. RUNTIME_PREFIX=/ \
  318. UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
  319. UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
  320. VERBOSE=1 \
  321. install_runtime
  322. touch $@
  323. $(WRKBUILD)/.fixup:
  324. ifeq ($(ADK_UCLIBC_TEST),y)
  325. PATH='$(HOST_PATH)' $(MAKE) -C $(WRKBUILD) \
  326. CC='$(TARGET_CC)' \
  327. TEST_INSTALLED_UCLIBC=1 \
  328. UCLIBC_ONLY=1 \
  329. UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
  330. UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
  331. VERBOSE=1 \
  332. test_compile test_gen
  333. endif
  334. ifeq ($(ADK_TARGET_TOOLCHAIN),y)
  335. # cleanup toolchain
  336. -find $(STAGING_TARGET_DIR) $(STAGING_HOST_DIR) -name \*.la -exec rm {} \;
  337. # strip target libs and host tools for toolchain builds
  338. PATH="$(TARGET_PATH)" debug='0' prefix='${TARGET_CROSS}' ${BASH} ${SCRIPT_DIR}/rstrip.sh \
  339. $(STAGING_TARGET_DIR) $(TOOLCHAIN_DIR)/usr/lib/gcc/$(GNU_TARGET_NAME)
  340. debug='0' prefix=' ' ${BASH} ${SCRIPT_DIR}/rstrip.sh $(TOOLCHAIN_DIR)/usr/bin
  341. endif
  342. touch $@
  343. include ${ADK_TOPDIR}/mk/toolchain.mk