vars.mk 12 KB

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