Makefile 14 KB

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