vars.mk 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  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. ifeq ($(ADK_TARGET_LIB_NEWLIB),y)
  71. GNU_TARGET_NAME:= $(ADK_TARGET_CPU_ARCH)-$(ADK_VENDOR)-$(ADK_TARGET_SUFFIX)
  72. endif
  73. TARGET_CROSS:= $(TOOLCHAIN_DIR)/usr/bin/$(GNU_TARGET_NAME)-
  74. TARGET_COMPILER_PREFIX?=${TARGET_CROSS}
  75. CONFIGURE_TRIPLE:= --build=${GNU_HOST_NAME} \
  76. --host=${GNU_TARGET_NAME} \
  77. --target=${GNU_TARGET_NAME}
  78. ifneq ($(strip ${ADK_USE_CCACHE}),)
  79. TARGET_COMPILER_PREFIX=$(STAGING_HOST_DIR)/usr/bin/ccache ${TARGET_CROSS}
  80. endif
  81. # target tools
  82. TARGET_CC:= ${TARGET_COMPILER_PREFIX}gcc
  83. # use a gcc wrapper for coldfire uclinux support
  84. ifeq ($(ADK_TARGET_UCLINUX),y)
  85. ifeq ($(ADK_TARGET_ARCH_M68K),y)
  86. TARGET_CC:= adk-uclinux-gcc
  87. endif
  88. endif
  89. TARGET_CXX:= ${TARGET_COMPILER_PREFIX}g++
  90. TARGET_LD:= ${TARGET_COMPILER_PREFIX}ld
  91. ifneq ($(ADK_TARGET_USE_LTO),)
  92. TARGET_AR:= ${TARGET_COMPILER_PREFIX}gcc-ar
  93. TARGET_RANLIB:= ${TARGET_COMPILER_PREFIX}gcc-ranlib
  94. else
  95. TARGET_AR:= ${TARGET_COMPILER_PREFIX}ar
  96. TARGET_RANLIB:= ${TARGET_COMPILER_PREFIX}ranlib
  97. endif
  98. ifneq ($(ADK_TARGET_ABI_CFLAGS),)
  99. TARGET_CC+= $(ADK_TARGET_ABI_CFLAGS)
  100. TARGET_CXX+= $(ADK_TARGET_ABI_CFLAGS)
  101. endif
  102. TARGET_CPPFLAGS:=
  103. TARGET_CFLAGS:= -fwrapv -fno-ident
  104. TARGET_CXXFLAGS:= -fwrapv -fno-ident
  105. TARGET_LDFLAGS:= -L$(STAGING_TARGET_DIR)/lib -L$(STAGING_TARGET_DIR)/usr/lib \
  106. -Wl,-O1 -Wl,-rpath -Wl,/usr/lib \
  107. -Wl,-rpath-link -Wl,${STAGING_TARGET_DIR}/usr/lib
  108. ifeq ($(ADK_DISABLE_HONOUR_CFLAGS),)
  109. TARGET_CFLAGS+= -fhonour-copts
  110. TARGET_CXXFLAGS+= -fhonour-copts
  111. endif
  112. # for architectures where gcc --with-cpu matches -mcpu=
  113. ifneq ($(ADK_TARGET_GCC_CPU),)
  114. ifeq ($(ADK_CPU_ARC700),y)
  115. TARGET_CFLAGS+= -mcpu=ARC700
  116. TARGET_CXXFLAGS+= -mcpu=ARC700
  117. else
  118. TARGET_CFLAGS+= -mcpu=$(ADK_TARGET_GCC_CPU)
  119. TARGET_CXXFLAGS+= -mcpu=$(ADK_TARGET_GCC_CPU)
  120. endif
  121. endif
  122. # for archiectures where gcc --with-arch matches -march=
  123. ifneq ($(ADK_TARGET_GCC_ARCH),)
  124. TARGET_CFLAGS+= -march=$(ADK_TARGET_GCC_ARCH)
  125. TARGET_CXXFLAGS+= -march=$(ADK_TARGET_GCC_ARCH)
  126. endif
  127. ifneq ($(ADK_TARGET_CPU_FLAGS),)
  128. TARGET_CFLAGS+= $(ADK_TARGET_CPU_FLAGS)
  129. TARGET_CXXFLAGS+= $(ADK_TARGET_CPU_FLAGS)
  130. endif
  131. ifneq ($(ADK_TARGET_FPU),)
  132. TARGET_CFLAGS+= -mfpu=$(ADK_TARGET_FPU)
  133. TARGET_CXXFLAGS+= -mfpu=$(ADK_TARGET_FPU)
  134. endif
  135. ifneq ($(ADK_TARGET_FLOAT),)
  136. ifeq ($(ADK_TARGET_ARCH_ARM),y)
  137. TARGET_CFLAGS+= -mfloat-abi=$(ADK_TARGET_FLOAT)
  138. TARGET_CXXFLAGS+= -mfloat-abi=$(ADK_TARGET_FLOAT)
  139. endif
  140. ifeq ($(ADK_TARGET_ARCH_MIPS),y)
  141. TARGET_CFLAGS+= -m$(ADK_TARGET_FLOAT)-float
  142. TARGET_CXXFLAGS+= -m$(ADK_TARGET_FLOAT)-float
  143. endif
  144. endif
  145. ifeq ($(ADK_TARGET_ARCH_ARM),y)
  146. ifeq ($(ADK_TARGET_BINFMT_FLAT),y)
  147. TARGET_CFLAGS+= -Wl,-elf2flt
  148. TARGET_CXXFLAGS+= -Wl,-elf2flt
  149. endif
  150. endif
  151. ifeq ($(ADK_TARGET_ARCH_BFIN),y)
  152. ifeq ($(ADK_TARGET_BINFMT_FLAT),y)
  153. TARGET_CFLAGS+= -Wl,-elf2flt
  154. TARGET_CXXFLAGS+= -Wl,-elf2flt
  155. endif
  156. ifeq ($(ADK_TARGET_BINFMT_FLAT_SEP_DATA),y)
  157. TARGET_CFLAGS+= -msep-data
  158. TARGET_CXXFLAGS+= -msep-data
  159. endif
  160. endif
  161. ifeq ($(ADK_TARGET_ARCH_H8300),y)
  162. TARGET_CFLAGS+= -mh
  163. TARGET_LDFLAGS+= -mh
  164. ifeq ($(ADK_TARGET_BINFMT_FLAT),y)
  165. TARGET_CFLAGS+= -Wl,-elf2flt
  166. TARGET_CXXFLAGS+= -Wl,-elf2flt
  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. # newer gcc does not need this anymore
  227. ifeq ($(ADK_TOOLCHAIN_GCC_GIT),)
  228. TARGET_CFLAGS+= -mlongcalls -mtext-section-literals
  229. TARGET_CXXFLAGS+= -mlongcalls -mtext-section-literals
  230. endif
  231. endif
  232. # add configured compiler flags for optimization
  233. TARGET_CFLAGS+= $(ADK_TARGET_CFLAGS_OPT)
  234. TARGET_CXXFLAGS+= $(ADK_TARGET_CFLAGS_OPT)
  235. # add compiler flags for debug information
  236. ifneq ($(ADK_DEBUG),)
  237. TARGET_CFLAGS+= -g3
  238. TARGET_CXXFLAGS+= -g3
  239. endif
  240. ifneq ($(ADK_DEBUG),)
  241. TARGET_CFLAGS+= -fno-omit-frame-pointer
  242. TARGET_CXXFLAGS+= -fno-omit-frame-pointer
  243. TARGET_CFLAGS+= -funwind-tables -fasynchronous-unwind-tables
  244. TARGET_CXXFLAGS+= -funwind-tables -fasynchronous-unwind-tables
  245. else
  246. TARGET_CPPFLAGS+= -DNDEBUG
  247. TARGET_CFLAGS+= -fomit-frame-pointer
  248. TARGET_CXXFLAGS+= -fomit-frame-pointer
  249. # stop generating eh_frame stuff
  250. TARGET_CFLAGS+= -fno-unwind-tables -fno-asynchronous-unwind-tables
  251. TARGET_CXXFLAGS+= -fno-unwind-tables -fno-asynchronous-unwind-tables
  252. endif
  253. ifeq ($(ADK_TARGET_ARCH_ARM),y)
  254. ifeq ($(ADK_TARGET_ARCH_ARM_WITH_NEON),y)
  255. TARGET_CFLAGS+= -funsafe-math-optimizations -ffast-math
  256. TARGET_CXXFLAGS+= -funsafe-math-optimizations -ffast-math
  257. endif
  258. ifeq ($(ADK_TARGET_ARCH_ARM_WITH_THUMB),y)
  259. TARGET_CFLAGS+= -mthumb -Wa,-mimplicit-it=thumb -mno-thumb-interwork
  260. TARGET_CXXFLAGS+= -mthumb -Wa,-mimplicit-it=thumb -mno-thumb-interwork
  261. else
  262. TARGET_CFLAGS+= -marm
  263. TARGET_CXXFLAGS+= -marm
  264. endif
  265. endif
  266. # host compiler and linker flags
  267. HOST_CPPFLAGS:= -I$(STAGING_HOST_DIR)/usr/include
  268. HOST_LDFLAGS:= -L$(STAGING_HOST_DIR)/usr/lib -Wl,-rpath -Wl,${STAGING_HOST_DIR}/usr/lib
  269. PATCH= PATH='${HOST_PATH}' ${BASH} $(SCRIPT_DIR)/patch.sh
  270. PATCHP0= PATH='${HOST_PATH}' patch -p0
  271. ifeq ($(ADK_STATIC_TOOLCHAIN),y)
  272. HOST_STATIC_CFLAGS:= -static -Wl,-static
  273. HOST_STATIC_CXXFLAGS:= -static -Wl,-static
  274. HOST_STATIC_LDFLAGS:= -Wl,-static
  275. HOST_STATIC_LLDFLAGS:= -all-static
  276. endif
  277. SED:= PATH='${HOST_PATH}' sed -i -e
  278. XZ:= PATH='${HOST_PATH}' xz
  279. LINUX_DIR:= $(BUILD_DIR)/linux
  280. KERNEL_MODULE_FLAGS:= ARCH=${ADK_TARGET_ARCH} \
  281. PREFIX=/usr \
  282. KERNEL_PATH=${LINUX_DIR} \
  283. KERNELDIR=${LINUX_DIR} \
  284. KERNEL_DIR=${LINUX_DIR} \
  285. CROSS_COMPILE="${TARGET_CROSS}" \
  286. CFLAGS_MODULE="-fhonour-copts" \
  287. V=1
  288. COMMON_ENV= CONFIG_SHELL='$(strip ${SHELL})' \
  289. AUTOM4TE='${STAGING_HOST_DIR}/usr/bin/autom4te' \
  290. M4='${STAGING_HOST_DIR}/usr/bin/m4' \
  291. LIBTOOLIZE='${STAGING_HOST_DIR}/usr/bin/libtoolize' \
  292. VERBOSE=1
  293. ifneq ($(ADK_TARGET_USE_LTO),)
  294. TOOLS_ENV= AR='$(TARGET_CROSS)gcc-ar' \
  295. RANLIB='$(TARGET_CROSS)gcc-ranlib' \
  296. NM='$(TARGET_CROSS)gcc-nm'
  297. else
  298. TOOLS_ENV= AR='$(TARGET_CROSS)ar' \
  299. RANLIB='$(TARGET_CROSS)ranlib' \
  300. NM='$(TARGET_CROSS)nm'
  301. endif
  302. TARGET_ENV= $(TOOLS_ENV) \
  303. AS='$(TARGET_CROSS)as' \
  304. LD='$(TARGET_CROSS)ld' \
  305. STRIP='$(TARGET_CROSS)strip' \
  306. OBJCOPY='$(TARGET_CROSS)objcopy' \
  307. CC='$(TARGET_CC)' \
  308. GCC='$(TARGET_CC)' \
  309. CXX='$(TARGET_CXX)' \
  310. CROSS='$(TARGET_CROSS)' \
  311. CROSS_COMPILE='$(TARGET_CROSS)' \
  312. CFLAGS='$(TARGET_CFLAGS)' \
  313. CXXFLAGS='$(TARGET_CXXFLAGS)' \
  314. CPPFLAGS='$(TARGET_CPPFLAGS)' \
  315. LDFLAGS='$(TARGET_LDFLAGS)' \
  316. CC_FOR_BUILD='$(HOST_CC)' \
  317. CXX_FOR_BUILD='$(HOST_CXX)' \
  318. CPPFLAGS_FOR_BUILD='$(HOST_CPPFLAGS)' \
  319. CFLAGS_FOR_BUILD='$(HOST_CFLAGS)' \
  320. CXXFLAGS_FOR_BUILD='$(HOST_CXXFLAGS)' \
  321. LDFLAGS_FOR_BUILD='$(HOST_LDFLAGS)' \
  322. LIBS_FOR_BUILD='$(HOST_LIBS)'
  323. HOST_ENV= CC='$(HOST_CC)' \
  324. CXX='$(HOST_CXX)' \
  325. CPPFLAGS='$(HOST_CPPFLAGS)' \
  326. CFLAGS='$(HOST_CFLAGS)' \
  327. CXXFLAGS='$(HOST_CXXFLAGS)' \
  328. LDFLAGS='$(HOST_LDFLAGS)'
  329. PKG_SUFFIX:= $(strip $(subst ",, $(ADK_PACKAGE_SUFFIX)))
  330. ifeq ($(ADK_TARGET_PACKAGE_IPKG),y)
  331. PKG_BUILD:= PATH='${HOST_PATH}' \
  332. ${BASH} ${SCRIPT_DIR}/ipkg-build
  333. PKG_INSTALL:= PATH='${HOST_PATH}' \
  334. IPKG_TMP=$(BUILD_DIR)/tmp \
  335. IPKG_INSTROOT=$(TARGET_DIR) \
  336. IPKG_CONF_DIR=$(STAGING_TARGET_DIR)/etc \
  337. IPKG_OFFLINE_ROOT=$(TARGET_DIR) \
  338. BIN_DIR=$(STAGING_HOST_DIR)/usr/bin \
  339. ${BASH} ${SCRIPT_DIR}/ipkg \
  340. -force-defaults -force-depends install
  341. PKG_STATE_DIR:= $(TARGET_DIR)/usr/lib/ipkg
  342. endif
  343. ifeq ($(ADK_TARGET_PACKAGE_OPKG),y)
  344. PKG_BUILD:= PATH='${HOST_PATH}' \
  345. ${BASH} ${SCRIPT_DIR}/ipkg-build
  346. PKG_INSTALL:= PATH='${HOST_PATH}' \
  347. IPKG_TMP=$(BUILD_DIR)/tmp \
  348. IPKG_INSTROOT=$(TARGET_DIR) \
  349. IPKG_CONF_DIR=$(STAGING_TARGET_DIR)/etc \
  350. IPKG_OFFLINE_ROOT=$(TARGET_DIR) \
  351. BIN_DIR=$(STAGING_HOST_DIR)/usr/bin \
  352. ${BASH} ${SCRIPT_DIR}/ipkg \
  353. -force-defaults -force-depends install
  354. PKG_STATE_DIR:= $(TARGET_DIR)/usr/lib/opkg
  355. endif
  356. ifeq ($(ADK_TARGET_PACKAGE_TXZ),y)
  357. PKG_BUILD:= PATH='${HOST_PATH}' ${BASH} ${SCRIPT_DIR}/tarpkg build
  358. PKG_INSTALL:= PKG_INSTROOT='$(TARGET_DIR)' \
  359. PATH='${HOST_PATH}' ${BASH} ${SCRIPT_DIR}/tarpkg install
  360. PKG_STATE_DIR:= $(TARGET_DIR)/usr/lib/pkg
  361. endif
  362. RSTRIP:= PATH="$(TARGET_PATH)" prefix='${TARGET_CROSS}' ${BASH} ${SCRIPT_DIR}/rstrip.sh
  363. STATCMD:=$(shell if stat -qs .>/dev/null 2>&1; then echo 'stat -f %z';else echo 'stat -c %s';fi)
  364. EXTRACT_CMD= PATH='${HOST_PATH}'; mkdir -p ${WRKDIR}; \
  365. cd ${WRKDIR} && \
  366. for file in ${FULLDISTFILES}; do case $$file in \
  367. *.cpio) \
  368. cat $$file | cpio -i -d ;; \
  369. *.tar) \
  370. tar -xf $$file ;; \
  371. *.cpio.Z | *.cpio.gz | *.cgz | *.mcz) \
  372. gzip -dc $$file | cpio -i -d ;; \
  373. *.tar.xz | *.txz) \
  374. xz -dc $$file | tar -xf - ;; \
  375. *.tar.Z | *.tar.gz | *.taz | *.tgz) \
  376. gzip -dc $$file | tar -xf - ;; \
  377. *.cpio.bz2 | *.cbz) \
  378. bzip2 -dc $$file | cpio -i -d ;; \
  379. *.tar.bz2 | *.tbz | *.tbz2) \
  380. bzip2 -dc $$file | tar -xf - ;; \
  381. *.zip) \
  382. cat $$file | cpio -id -H zip ;; \
  383. *.arm|*.jar|*.ids.gz) \
  384. mkdir ${WRKBUILD}; cp $$file ${WRKBUILD} ;; \
  385. *.bin) \
  386. sh $$file --force --auto-accept ;; \
  387. *) \
  388. echo "Cannot extract '$$file'" >&2; \
  389. false ;; \
  390. esac; done
  391. ifeq ($(ADK_VERBOSE),1)
  392. QUIET:=
  393. else
  394. QUIET:= --quiet
  395. endif
  396. FETCH_CMD?= PATH='${HOST_PATH}' wget --timeout=$(ADK_WGET_TIMEOUT) -t 3 --no-check-certificate $(QUIET)
  397. ifneq (,$(filter CYGWIN%,${OStype}))
  398. EXEEXT:= .exe
  399. endif
  400. include $(ADK_TOPDIR)/mk/mirrors.mk