vars.mk 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  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. CP= cp -fpR
  4. INSTALL_DIR= install -d -m0755
  5. INSTALL_DATA= install -m0644
  6. INSTALL_BIN= install -m0755
  7. INSTALL_SCRIPT= install -m0755
  8. MAKEFLAGS= $(EXTRA_MAKEFLAGS)
  9. BUILD_USER= $(shell id -un)
  10. BUILD_GROUP= $(shell id -gn)
  11. ADK_SUFFIX:= ${ADK_TARGET_SYSTEM}_${ADK_TARGET_LIBC}_${ADK_TARGET_CPU_ARCH}
  12. ifneq ($(ADK_TARGET_FLOAT),)
  13. ADK_SUFFIX:= $(ADK_SUFFIX)_$(ADK_TARGET_FLOAT)
  14. endif
  15. ifneq ($(ADK_TARGET_ABI),)
  16. ADK_SUFFIX:= $(ADK_SUFFIX)_$(ADK_TARGET_ABI)
  17. endif
  18. ifneq ($(ADK_TARGET_CPU_TYPE),)
  19. ADK_SUFFIX:= $(ADK_SUFFIX)_$(ADK_TARGET_CPU_TYPE)
  20. endif
  21. ifeq ($(ADK_TARGET_WITH_MMU),)
  22. ADK_SUFFIX:= $(ADK_SUFFIX)_nommu
  23. endif
  24. # some global dirs
  25. BASE_DIR:= $(ADK_TOPDIR)
  26. ifeq ($(ADK_DL_DIR),)
  27. DL_DIR?= $(BASE_DIR)/dl
  28. else
  29. DL_DIR?= $(ADK_DL_DIR)
  30. endif
  31. SCRIPT_DIR:= $(BASE_DIR)/scripts
  32. STAGING_HOST_DIR:= ${BASE_DIR}/host_${GNU_HOST_NAME}
  33. HOST_BUILD_DIR:= ${BASE_DIR}/host_build_${GNU_HOST_NAME}
  34. TOOLCHAIN_DIR:= ${BASE_DIR}/toolchain_${ADK_SUFFIX}
  35. # dirs for cleandir
  36. FW_DIR_PFX:= $(BASE_DIR)/firmware
  37. BUILD_DIR_PFX:= $(BASE_DIR)/build_*
  38. STAGING_PKG_DIR_PFX:= ${BASE_DIR}/pkg_*
  39. STAGING_TARGET_DIR_PFX:=${BASE_DIR}/target_*
  40. TOOLCHAIN_DIR_PFX= $(BASE_DIR)/toolchain_*
  41. STAGING_HOST_DIR_PFX:= ${BASE_DIR}/host_*
  42. TARGET_DIR_PFX:= $(BASE_DIR)/root_*
  43. TARGET_DIR:= $(BASE_DIR)/root_${ADK_SUFFIX}
  44. FW_DIR:= $(BASE_DIR)/firmware/${ADK_SUFFIX}
  45. BUILD_DIR:= ${BASE_DIR}/build_${ADK_SUFFIX}
  46. STAGING_TARGET_DIR:= ${BASE_DIR}/target_${ADK_SUFFIX}
  47. STAGING_PKG_DIR:= ${BASE_DIR}/pkg_${ADK_SUFFIX}
  48. STAGING_HOST2TARGET:= ../../target_${ADK_SUFFIX}
  49. TOOLCHAIN_BUILD_DIR= $(BASE_DIR)/toolchain_build_${ADK_SUFFIX}
  50. PACKAGE_DIR:= $(FW_DIR)/packages
  51. SCRIPT_TARGET_DIR:= ${STAGING_TARGET_DIR}/scripts
  52. # PATH variables
  53. TARGET_PATH= ${SCRIPT_DIR}:${STAGING_TARGET_DIR}/scripts:${TOOLCHAIN_DIR}/usr/bin:${STAGING_HOST_DIR}/usr/bin:${_PATH}
  54. HOST_PATH= ${SCRIPT_DIR}:${TOOLCHAIN_DIR}/usr/bin:${STAGING_HOST_DIR}/usr/bin:${_PATH}
  55. AUTOTOOL_PATH= ${TOOLCHAIN_DIR}/usr/bin:${STAGING_HOST_DIR}/usr/bin:${STAGING_TARGET_DIR}/scripts:${_PATH}
  56. ifeq ($(ADK_DISABLE_HONOUR_CFLAGS),)
  57. GCC_CHECK:= GCC_HONOUR_COPTS=2
  58. else
  59. GCC_CHECK:=
  60. endif
  61. ifeq ($(ADK_TARGET_UCLINUX),y)
  62. ADK_TARGET_LINUXTYPE:= uclinux
  63. else
  64. ADK_TARGET_LINUXTYPE:= linux
  65. endif
  66. GNU_TARGET_NAME:= $(ADK_TARGET_CPU_ARCH)-$(ADK_VENDOR)-$(ADK_TARGET_LINUXTYPE)-$(ADK_TARGET_SUFFIX)
  67. ifeq ($(ADK_TARGET_ARCH_C6X),y)
  68. GNU_TARGET_NAME:= $(ADK_TARGET_CPU_ARCH)-$(ADK_TARGET_LINUXTYPE)
  69. endif
  70. TARGET_CROSS:= $(TOOLCHAIN_DIR)/usr/bin/$(GNU_TARGET_NAME)-
  71. TARGET_COMPILER_PREFIX?=${TARGET_CROSS}
  72. CONFIGURE_TRIPLE:= --build=${GNU_HOST_NAME} \
  73. --host=${GNU_TARGET_NAME} \
  74. --target=${GNU_TARGET_NAME}
  75. ifneq ($(strip ${ADK_USE_CCACHE}),)
  76. TARGET_COMPILER_PREFIX=$(STAGING_HOST_DIR)/usr/bin/ccache ${TARGET_CROSS}
  77. endif
  78. # target tools
  79. TARGET_CC:= ${TARGET_COMPILER_PREFIX}gcc
  80. # use a gcc wrapper for coldfire uclinux support
  81. ifeq ($(ADK_TARGET_UCLINUX),y)
  82. ifeq ($(ADK_TARGET_ARCH_M68K),y)
  83. TARGET_CC:= adk-uclinux-gcc
  84. endif
  85. endif
  86. TARGET_CXX:= ${TARGET_COMPILER_PREFIX}g++
  87. TARGET_LD:= ${TARGET_COMPILER_PREFIX}ld
  88. ifneq ($(ADK_TARGET_USE_LTO),)
  89. TARGET_AR:= ${TARGET_COMPILER_PREFIX}gcc-ar
  90. TARGET_RANLIB:= ${TARGET_COMPILER_PREFIX}gcc-ranlib
  91. else
  92. TARGET_AR:= ${TARGET_COMPILER_PREFIX}ar
  93. TARGET_RANLIB:= ${TARGET_COMPILER_PREFIX}ranlib
  94. endif
  95. ifneq ($(ADK_TARGET_ABI_CFLAGS),)
  96. TARGET_CC+= $(ADK_TARGET_ABI_CFLAGS)
  97. TARGET_CXX+= $(ADK_TARGET_ABI_CFLAGS)
  98. endif
  99. TARGET_CPPFLAGS:=
  100. TARGET_CFLAGS:= -fwrapv -fno-ident
  101. TARGET_CXXFLAGS:= -fwrapv -fno-ident
  102. TARGET_LDFLAGS:= -L$(STAGING_TARGET_DIR)/lib -L$(STAGING_TARGET_DIR)/usr/lib \
  103. -Wl,-O1 -Wl,-rpath -Wl,/usr/lib \
  104. -Wl,-rpath-link -Wl,${STAGING_TARGET_DIR}/usr/lib
  105. ifeq ($(ADK_DISABLE_HONOUR_CFLAGS),)
  106. TARGET_CFLAGS+= -fhonour-copts
  107. TARGET_CXXFLAGS+= -fhonour-copts
  108. endif
  109. # for architectures where gcc --with-cpu matches -mcpu=
  110. ifneq ($(ADK_TARGET_GCC_CPU),)
  111. ifeq ($(ADK_CPU_ARC700),y)
  112. TARGET_CFLAGS+= -mcpu=ARC700
  113. TARGET_CXXFLAGS+= -mcpu=ARC700
  114. else
  115. TARGET_CFLAGS+= -mcpu=$(ADK_TARGET_GCC_CPU)
  116. TARGET_CXXFLAGS+= -mcpu=$(ADK_TARGET_GCC_CPU)
  117. endif
  118. endif
  119. # for archiectures where gcc --with-arch matches -march=
  120. ifneq ($(ADK_TARGET_GCC_ARCH),)
  121. TARGET_CFLAGS+= -march=$(ADK_TARGET_GCC_ARCH)
  122. TARGET_CXXFLAGS+= -march=$(ADK_TARGET_GCC_ARCH)
  123. endif
  124. ifneq ($(ADK_TARGET_CPU_FLAGS),)
  125. TARGET_CFLAGS+= $(ADK_TARGET_CPU_FLAGS)
  126. TARGET_CXXFLAGS+= $(ADK_TARGET_CPU_FLAGS)
  127. endif
  128. ifneq ($(ADK_TARGET_FPU),)
  129. TARGET_CFLAGS+= -mfpu=$(ADK_TARGET_FPU)
  130. TARGET_CXXFLAGS+= -mfpu=$(ADK_TARGET_FPU)
  131. endif
  132. ifneq ($(ADK_TARGET_FLOAT),)
  133. ifeq ($(ADK_TARGET_ARCH_ARM),y)
  134. TARGET_CFLAGS+= -mfloat-abi=$(ADK_TARGET_FLOAT)
  135. TARGET_CXXFLAGS+= -mfloat-abi=$(ADK_TARGET_FLOAT)
  136. endif
  137. ifeq ($(ADK_TARGET_ARCH_MIPS),y)
  138. TARGET_CFLAGS+= -m$(ADK_TARGET_FLOAT)-float
  139. TARGET_CXXFLAGS+= -m$(ADK_TARGET_FLOAT)-float
  140. endif
  141. endif
  142. ifeq ($(ADK_TARGET_ARCH_ARM),y)
  143. ifeq ($(ADK_TARGET_BINFMT_FLAT),y)
  144. TARGET_CFLAGS+= -Wl,-elf2flt
  145. TARGET_CXXFLAGS+= -Wl,-elf2flt
  146. endif
  147. endif
  148. ifeq ($(ADK_TARGET_ARCH_BFIN),y)
  149. ifeq ($(ADK_TARGET_BINFMT_FLAT),y)
  150. TARGET_LDFLAGS+= -elf2flt
  151. endif
  152. ifeq ($(ADK_TARGET_BINFMT_FLAT_SEP_DATA),y)
  153. TARGET_CFLAGS+= -msep-data
  154. TARGET_CXXFLAGS+= -msep-data
  155. endif
  156. endif
  157. ifeq ($(ADK_TARGET_ARCH_H8300),y)
  158. TARGET_CFLAGS+= -mh
  159. TARGET_LDFLAGS+= -mh
  160. ifeq ($(ADK_TARGET_BINFMT_FLAT),y)
  161. TARGET_CFLAGS+= -Wl,-elf2flt
  162. TARGET_CXXFLAGS+= -Wl,-elf2flt
  163. endif
  164. ifeq ($(ADK_TARGET_BINFMT_FLAT_SEP_DATA),y)
  165. TARGET_CFLAGS+= -msep-data
  166. TARGET_CXXFLAGS+= -msep-data
  167. endif
  168. endif
  169. ifeq ($(ADK_TARGET_ARCH_M68K),y)
  170. ifeq ($(ADK_TARGET_BINFMT_FLAT),y)
  171. TARGET_LDFLAGS+= -elf2flt
  172. endif
  173. ifeq ($(ADK_TARGET_BINFMT_FLAT_SEP_DATA),y)
  174. TARGET_CFLAGS+= -msep-data
  175. TARGET_CXXFLAGS+= -msep-data
  176. endif
  177. endif
  178. ifeq ($(ADK_TARGET_LIB_MUSL),y)
  179. # use -static-libgcc by default only for musl
  180. TARGET_CFLAGS+= -static-libgcc
  181. TARGET_CXXFLAGS+= -static-libgcc
  182. TARGET_LDFLAGS+= -static-libgcc
  183. endif
  184. # security optimization, see http://www.akkadia.org/drepper/dsohowto.pdf
  185. ifneq ($(ADK_TARGET_USE_LD_RELRO),)
  186. TARGET_LDFLAGS+= -Wl,-z,relro
  187. endif
  188. ifneq ($(ADK_TARGET_USE_LD_BIND_NOW),)
  189. TARGET_LDFLAGS+= -Wl,-z,now
  190. endif
  191. # needed for musl ppc
  192. ifeq ($(ADK_TARGET_ARCH_PPC),y)
  193. ifeq ($(ADK_TARGET_LIB_MUSL),y)
  194. TARGET_LDFLAGS+= -Wl,--secure-plt
  195. endif
  196. endif
  197. ifeq ($(ADK_TARGET_USE_STATIC_LIBS),y)
  198. TARGET_CFLAGS+= -static
  199. TARGET_CXXFLAGS+= -static
  200. TARGET_LDFLAGS+= -static
  201. endif
  202. ifneq ($(ADK_TARGET_USE_SSP),)
  203. TARGET_CFLAGS+= -fstack-protector-all --param=ssp-buffer-size=4
  204. TARGET_CXXFLAGS+= -fstack-protector-all --param=ssp-buffer-size=4
  205. TARGET_LDFLAGS+= -fstack-protector-all
  206. endif
  207. ifneq ($(ADK_TARGET_USE_LD_GC),)
  208. TARGET_CFLAGS+= -fdata-sections -ffunction-sections
  209. TARGET_CXXFLAGS+= -fdata-sections -ffunction-sections
  210. TARGET_LDFLAGS+= -Wl,--gc-sections
  211. endif
  212. ifneq ($(ADK_TARGET_USE_LTO),)
  213. TARGET_CFLAGS+= -flto
  214. TARGET_CXXFLAGS+= -flto
  215. TARGET_LDFLAGS+= -flto
  216. endif
  217. # performance optimization, see http://www.akkadia.org/drepper/dsohowto.pdf
  218. ifneq ($(ADK_TARGET_USE_GNU_HASHSTYLE),)
  219. TARGET_LDFLAGS+= -Wl,--hash-style=gnu
  220. endif
  221. ifeq ($(ADK_TARGET_ARCH_MICROBLAZE),y)
  222. TARGET_CFLAGS+= -mxl-barrel-shift
  223. TARGET_CXXFLAGS+= -mxl-barrel-shift
  224. endif
  225. ifeq ($(ADK_TARGET_ARCH_XTENSA),y)
  226. TARGET_CFLAGS+= -mlongcalls -mtext-section-literals
  227. TARGET_CXXFLAGS+= -mlongcalls -mtext-section-literals
  228. endif
  229. # add configured compiler flags for optimization
  230. TARGET_CFLAGS+= $(ADK_TARGET_CFLAGS_OPT)
  231. TARGET_CXXFLAGS+= $(ADK_TARGET_CFLAGS_OPT)
  232. # add compiler flags for debug information
  233. ifneq ($(ADK_DEBUG),)
  234. TARGET_CFLAGS+= -g3
  235. TARGET_CXXFLAGS+= -g3
  236. endif
  237. ifneq ($(ADK_DEBUG),)
  238. TARGET_CFLAGS+= -fno-omit-frame-pointer
  239. TARGET_CXXFLAGS+= -fno-omit-frame-pointer
  240. TARGET_CFLAGS+= -funwind-tables -fasynchronous-unwind-tables
  241. TARGET_CXXFLAGS+= -funwind-tables -fasynchronous-unwind-tables
  242. else
  243. TARGET_CPPFLAGS+= -DNDEBUG
  244. TARGET_CFLAGS+= -fomit-frame-pointer
  245. TARGET_CXXFLAGS+= -fomit-frame-pointer
  246. # stop generating eh_frame stuff
  247. TARGET_CFLAGS+= -fno-unwind-tables -fno-asynchronous-unwind-tables
  248. TARGET_CXXFLAGS+= -fno-unwind-tables -fno-asynchronous-unwind-tables
  249. endif
  250. ifeq ($(ADK_TARGET_ARCH_ARM),y)
  251. ifeq ($(ADK_TARGET_ARCH_ARM_WITH_NEON),y)
  252. TARGET_CFLAGS+= -funsafe-math-optimizations -ffast-math
  253. TARGET_CXXFLAGS+= -funsafe-math-optimizations -ffast-math
  254. endif
  255. ifeq ($(ADK_TARGET_ARCH_ARM_WITH_THUMB),y)
  256. TARGET_CFLAGS+= -mthumb -Wa,-mimplicit-it=thumb -mno-thumb-interwork
  257. TARGET_CXXFLAGS+= -mthumb -Wa,-mimplicit-it=thumb -mno-thumb-interwork
  258. else
  259. TARGET_CFLAGS+= -marm
  260. TARGET_CXXFLAGS+= -marm
  261. endif
  262. endif
  263. # host compiler and linker flags
  264. HOST_CPPFLAGS:= -I$(STAGING_HOST_DIR)/usr/include
  265. HOST_LDFLAGS:= -L$(STAGING_HOST_DIR)/usr/lib -Wl,-rpath -Wl,${STAGING_HOST_DIR}/usr/lib
  266. PATCH= PATH='${HOST_PATH}' ${BASH} $(SCRIPT_DIR)/patch.sh
  267. PATCHP0= PATH='${HOST_PATH}' patch -p0
  268. ifeq ($(ADK_STATIC_TOOLCHAIN),y)
  269. HOST_STATIC_CFLAGS:= -static -Wl,-static
  270. HOST_STATIC_CXXFLAGS:= -static -Wl,-static
  271. HOST_STATIC_LDFLAGS:= -Wl,-static
  272. HOST_STATIC_LLDFLAGS:= -all-static
  273. endif
  274. SED:= PATH='${HOST_PATH}' sed -i -e
  275. XZ:= PATH='${HOST_PATH}' xz
  276. LINUX_DIR:= $(BUILD_DIR)/linux
  277. KERNEL_MODULE_FLAGS:= ARCH=${ADK_TARGET_ARCH} \
  278. PREFIX=/usr \
  279. KERNEL_PATH=${LINUX_DIR} \
  280. KERNELDIR=${LINUX_DIR} \
  281. KERNEL_DIR=${LINUX_DIR} \
  282. CROSS_COMPILE="${TARGET_CROSS}" \
  283. CFLAGS_MODULE="-fhonour-copts" \
  284. V=1
  285. COMMON_ENV= CONFIG_SHELL='$(strip ${SHELL})' \
  286. AUTOM4TE='${STAGING_HOST_DIR}/usr/bin/autom4te' \
  287. M4='${STAGING_HOST_DIR}/usr/bin/m4' \
  288. LIBTOOLIZE='${STAGING_HOST_DIR}/usr/bin/libtoolize' \
  289. VERBOSE=1
  290. ifneq ($(ADK_TARGET_USE_LTO),)
  291. TOOLS_ENV= AR='$(TARGET_CROSS)gcc-ar' \
  292. RANLIB='$(TARGET_CROSS)gcc-ranlib' \
  293. NM='$(TARGET_CROSS)gcc-nm'
  294. else
  295. TOOLS_ENV= AR='$(TARGET_CROSS)ar' \
  296. RANLIB='$(TARGET_CROSS)ranlib' \
  297. NM='$(TARGET_CROSS)nm'
  298. endif
  299. TARGET_ENV= $(TOOLS_ENV) \
  300. AS='$(TARGET_CROSS)as' \
  301. LD='$(TARGET_CROSS)ld' \
  302. STRIP='$(TARGET_CROSS)strip' \
  303. OBJCOPY='$(TARGET_CROSS)objcopy' \
  304. CC='$(TARGET_CC)' \
  305. GCC='$(TARGET_CC)' \
  306. CXX='$(TARGET_CXX)' \
  307. CROSS='$(TARGET_CROSS)' \
  308. CROSS_COMPILE='$(TARGET_CROSS)' \
  309. CFLAGS='$(TARGET_CFLAGS)' \
  310. CXXFLAGS='$(TARGET_CXXFLAGS)' \
  311. CPPFLAGS='$(TARGET_CPPFLAGS)' \
  312. LDFLAGS='$(TARGET_LDFLAGS)' \
  313. CC_FOR_BUILD='$(HOST_CC)' \
  314. CXX_FOR_BUILD='$(HOST_CXX)' \
  315. CPPFLAGS_FOR_BUILD='$(HOST_CPPFLAGS)' \
  316. CFLAGS_FOR_BUILD='$(HOST_CFLAGS)' \
  317. CXXFLAGS_FOR_BUILD='$(HOST_CXXFLAGS)' \
  318. LDFLAGS_FOR_BUILD='$(HOST_LDFLAGS)' \
  319. LIBS_FOR_BUILD='$(HOST_LIBS)'
  320. HOST_ENV= CC='$(HOST_CC)' \
  321. CXX='$(HOST_CXX)' \
  322. CPPFLAGS='$(HOST_CPPFLAGS)' \
  323. CFLAGS='$(HOST_CFLAGS)' \
  324. CXXFLAGS='$(HOST_CXXFLAGS)' \
  325. LDFLAGS='$(HOST_LDFLAGS)'
  326. PKG_SUFFIX:= $(strip $(subst ",, $(ADK_PACKAGE_SUFFIX)))
  327. ifeq ($(ADK_TARGET_PACKAGE_IPKG),y)
  328. PKG_BUILD:= PATH='${HOST_PATH}' \
  329. ${BASH} ${SCRIPT_DIR}/ipkg-build
  330. PKG_INSTALL:= PATH='${HOST_PATH}' \
  331. IPKG_TMP=$(BUILD_DIR)/tmp \
  332. IPKG_INSTROOT=$(TARGET_DIR) \
  333. IPKG_CONF_DIR=$(STAGING_TARGET_DIR)/etc \
  334. IPKG_OFFLINE_ROOT=$(TARGET_DIR) \
  335. BIN_DIR=$(STAGING_HOST_DIR)/usr/bin \
  336. ${BASH} ${SCRIPT_DIR}/ipkg \
  337. -force-defaults -force-depends install
  338. PKG_STATE_DIR:= $(TARGET_DIR)/usr/lib/ipkg
  339. endif
  340. ifeq ($(ADK_TARGET_PACKAGE_OPKG),y)
  341. PKG_BUILD:= PATH='${HOST_PATH}' \
  342. ${BASH} ${SCRIPT_DIR}/ipkg-build
  343. PKG_INSTALL:= PATH='${HOST_PATH}' \
  344. IPKG_TMP=$(BUILD_DIR)/tmp \
  345. IPKG_INSTROOT=$(TARGET_DIR) \
  346. IPKG_CONF_DIR=$(STAGING_TARGET_DIR)/etc \
  347. IPKG_OFFLINE_ROOT=$(TARGET_DIR) \
  348. BIN_DIR=$(STAGING_HOST_DIR)/usr/bin \
  349. ${BASH} ${SCRIPT_DIR}/ipkg \
  350. -force-defaults -force-depends install
  351. PKG_STATE_DIR:= $(TARGET_DIR)/usr/lib/opkg
  352. endif
  353. ifeq ($(ADK_TARGET_PACKAGE_TXZ),y)
  354. PKG_BUILD:= PATH='${HOST_PATH}' ${BASH} ${SCRIPT_DIR}/tarpkg build
  355. PKG_INSTALL:= PKG_INSTROOT='$(TARGET_DIR)' \
  356. PATH='${HOST_PATH}' ${BASH} ${SCRIPT_DIR}/tarpkg install
  357. PKG_STATE_DIR:= $(TARGET_DIR)/usr/lib/pkg
  358. endif
  359. RSTRIP:= PATH="$(TARGET_PATH)" prefix='${TARGET_CROSS}' ${BASH} ${SCRIPT_DIR}/rstrip.sh
  360. STATCMD:=$(shell if stat -qs .>/dev/null 2>&1; then echo 'stat -f %z';else echo 'stat -c %s';fi)
  361. EXTRACT_CMD= PATH='${HOST_PATH}'; mkdir -p ${WRKDIR}; \
  362. cd ${WRKDIR} && \
  363. for file in ${FULLDISTFILES}; do case $$file in \
  364. *.cpio) \
  365. cat $$file | cpio -i -d ;; \
  366. *.tar) \
  367. tar -xf $$file ;; \
  368. *.cpio.Z | *.cpio.gz | *.cgz | *.mcz) \
  369. gzip -dc $$file | cpio -i -d ;; \
  370. *.tar.xz | *.txz) \
  371. xz -dc $$file | tar -xf - ;; \
  372. *.tar.Z | *.tar.gz | *.taz | *.tgz) \
  373. gzip -dc $$file | tar -xf - ;; \
  374. *.cpio.bz2 | *.cbz) \
  375. bzip2 -dc $$file | cpio -i -d ;; \
  376. *.tar.bz2 | *.tbz | *.tbz2) \
  377. bzip2 -dc $$file | tar -xf - ;; \
  378. *.zip) \
  379. cat $$file | cpio -id -H zip ;; \
  380. *.arm|*.jar|*.ids.gz) \
  381. mkdir ${WRKBUILD}; cp $$file ${WRKBUILD} ;; \
  382. *.bin) \
  383. sh $$file --force --auto-accept ;; \
  384. *) \
  385. echo "Cannot extract '$$file'" >&2; \
  386. false ;; \
  387. esac; done
  388. ifeq ($(ADK_VERBOSE),1)
  389. QUIET:=
  390. else
  391. QUIET:= --quiet
  392. endif
  393. FETCH_CMD?= PATH='${HOST_PATH}' wget --timeout=$(ADK_WGET_TIMEOUT) -t 3 --no-check-certificate $(QUIET)
  394. ifneq (,$(filter CYGWIN%,${OStype}))
  395. EXEEXT:= .exe
  396. endif
  397. include $(ADK_TOPDIR)/mk/mirrors.mk