linux 4.15.4: add missing patches
[openadk.git] / mk / vars.mk
blob09031dcf8eef6fe7e9c87b682c3b4e048a43ca46
1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 CP= cp -fpR
5 INSTALL_DIR= install -d -m0755
6 INSTALL_DATA= install -m0644
7 INSTALL_BIN= install -m0755
8 INSTALL_SCRIPT= install -m0755
9 MAKEFLAGS= $(EXTRA_MAKEFLAGS)
10 BUILD_USER= $(shell id -un)
11 BUILD_GROUP= $(shell id -gn)
12 ADK_SUFFIX:= ${ADK_TARGET_SYSTEM}
13 ifneq ($(ADK_TARGET_LIBC),)
14 ADK_SUFFIX:= $(ADK_SUFFIX)_$(ADK_TARGET_LIBC)
15 endif
16 ifneq ($(ADK_TARGET_CPU_TYPE),)
17 ADK_SUFFIX:= $(ADK_SUFFIX)_$(ADK_TARGET_CPU_TYPE)
18 endif
19 ifneq ($(ADK_TARGET_ENDIAN_SUFFIX),)
20 ADK_SUFFIX:= $(ADK_SUFFIX)$(ADK_TARGET_ENDIAN_SUFFIX)
21 endif
22 ifneq ($(ADK_TARGET_FLOAT),)
23 ADK_SUFFIX:= $(ADK_SUFFIX)_$(ADK_TARGET_FLOAT)
24 endif
25 ifneq ($(ADK_TARGET_ABI),)
26 ADK_SUFFIX:= $(ADK_SUFFIX)_$(ADK_TARGET_ABI)
27 endif
28 ifneq ($(ADK_TARGET_BINFMT),)
29 ADK_SUFFIX:= $(ADK_SUFFIX)_$(ADK_TARGET_BINFMT)
30 endif
32 # some global dirs
33 BASE_DIR:= $(ADK_TOPDIR)
34 ifeq ($(ADK_DL_DIR),)
35 DL_DIR?= $(BASE_DIR)/dl
36 else
37 DL_DIR?= $(ADK_DL_DIR)
38 endif
39 SCRIPT_DIR:= $(BASE_DIR)/scripts
40 STAGING_HOST_DIR:= ${BASE_DIR}/host_${GNU_HOST_NAME}
41 HOST_BUILD_DIR:= ${BASE_DIR}/host_build_${GNU_HOST_NAME}
42 TOOLCHAIN_DIR:= ${BASE_DIR}/toolchain_${ADK_SUFFIX}
44 # dirs for cleandir
45 FW_DIR_PFX:= $(BASE_DIR)/firmware
46 BUILD_DIR_PFX:= $(BASE_DIR)/build_*
47 STAGING_PKG_DIR_PFX:= ${BASE_DIR}/pkg_*
48 STAGING_TARGET_DIR_PFX:=${BASE_DIR}/target_*
49 TOOLCHAIN_DIR_PFX= $(BASE_DIR)/toolchain_*
50 STAGING_HOST_DIR_PFX:= ${BASE_DIR}/host_*
51 TARGET_DIR_PFX:= $(BASE_DIR)/root_*
53 TARGET_DIR:= $(BASE_DIR)/root_${ADK_SUFFIX}
54 FW_DIR:= $(BASE_DIR)/firmware/${ADK_SUFFIX}
55 BUILD_DIR:= ${BASE_DIR}/build_${ADK_SUFFIX}
56 STAGING_TARGET_DIR:= ${BASE_DIR}/target_${ADK_SUFFIX}
57 STAGING_PKG_DIR:= ${BASE_DIR}/pkg_${ADK_SUFFIX}
58 STAGING_HOST2TARGET:= ../../target_${ADK_SUFFIX}
59 TOOLCHAIN_BUILD_DIR= $(BASE_DIR)/toolchain_build_${ADK_SUFFIX}
60 PACKAGE_DIR:= $(FW_DIR)/packages
61 SCRIPT_TARGET_DIR:= ${STAGING_TARGET_DIR}/scripts
63 # PATH variables
64 TARGET_PATH= ${SCRIPT_DIR}:${STAGING_TARGET_DIR}/scripts:${TOOLCHAIN_DIR}/usr/bin:${STAGING_HOST_DIR}/usr/bin:${_PATH}
65 HOST_PATH= ${SCRIPT_DIR}:${TOOLCHAIN_DIR}/usr/bin:${STAGING_HOST_DIR}/usr/bin:${STAGING_HOST_DIR}/usr/sbin:${_PATH}
66 AUTOTOOL_PATH= ${TOOLCHAIN_DIR}/usr/bin:${STAGING_HOST_DIR}/usr/bin:${STAGING_TARGET_DIR}/scripts:${_PATH}
68 ifeq ($(ADK_TARGET_UCLINUX),y)
69 ADK_TARGET_LINUXTYPE:= uclinux
70 else
71 ADK_TARGET_LINUXTYPE:= linux
72 endif
74 GNU_TARGET_NAME:= $(ADK_TARGET_CPU_ARCH)-$(ADK_VENDOR)-$(ADK_TARGET_LINUXTYPE)-$(ADK_TARGET_SUFFIX)
75 ifeq ($(ADK_TARGET_ARCH_C6X),y)
76 GNU_TARGET_NAME:= $(ADK_TARGET_CPU_ARCH)-$(ADK_TARGET_LINUXTYPE)
77 endif
78 ifeq ($(ADK_TARGET_ARCH_CSKY),y)
79 ifeq ($(ADK_TARGET_CPU_CSKY_CK610),y)
80 GNU_TARGET_NAME:= $(ADK_TARGET_CPU_ARCH)-unknown-$(ADK_TARGET_LINUXTYPE)
81 else
82 GNU_TARGET_NAME:= $(ADK_TARGET_CPU_ARCH)-abiv2-$(ADK_TARGET_LINUXTYPE)
83 endif
84 endif
85 ifeq ($(ADK_TARGET_OS_BAREMETAL),y)
86 GNU_TARGET_NAME:= $(ADK_TARGET_CPU_ARCH)-$(ADK_TARGET_SUFFIX)
87 endif
88 ifeq ($(ADK_TARGET_OS_FROSTED),y)
89 GNU_TARGET_NAME:= $(ADK_TARGET_CPU_ARCH)-$(ADK_TARGET_OS)-$(ADK_TARGET_SUFFIX)
90 endif
91 ifeq ($(ADK_TARGET_OS_RTEMS),y)
92 GNU_TARGET_NAME:= $(ADK_TARGET_CPU_ARCH)-$(ADK_TARGET_OS)
93 endif
94 ifeq ($(ADK_TARGET_OS_ZEPHYR),y)
95 GNU_TARGET_NAME:= $(ADK_TARGET_CPU_ARCH)-$(ADK_TARGET_OS)
96 endif
98 TARGET_CROSS:= $(TOOLCHAIN_DIR)/usr/bin/$(GNU_TARGET_NAME)-
99 TARGET_COMPILER_PREFIX?=${TARGET_CROSS}
100 CONFIGURE_TRIPLE:= --build=${GNU_HOST_NAME} \
101 --host=${GNU_TARGET_NAME} \
102 --target=${GNU_TARGET_NAME}
104 # target tools
105 ifeq ($(ADK_BUILD_COMPILER_GCC),y)
106 TARGET_CC:= ${TARGET_COMPILER_PREFIX}gcc
107 TARGET_CXX:= ${TARGET_COMPILER_PREFIX}g++
108 TARGET_CC_NO_CCACHE:= ${TARGET_CC}
109 TARGET_CXX_NO_CCACHE:= ${TARGET_CXX}
110 endif
111 ifeq ($(ADK_BUILD_COMPILER_LLVM),y)
112 TARGET_CC:= clang --target=${GNU_TARGET_NAME} --sysroot=$(STAGING_TARGET_DIR)
113 TARGET_CXX:= clang++ --target=${GNU_TARGET_NAME} --sysroot=$(STAGING_TARGET_DIR)
114 TARGET_LDFLAGS:= -fuse-ld=lld -stdlib=libc++
115 endif
117 # gcc specific
118 ifeq ($(ADK_BUILD_COMPILER_GCC),y)
119 ifneq ($(strip ${ADK_USE_CCACHE}),)
120 TARGET_CC:= $(STAGING_HOST_DIR)/usr/bin/ccache ${TARGET_CC_NO_CCACHE}
121 TARGET_CXX:= $(STAGING_HOST_DIR)/usr/bin/ccache ${TARGET_CXX_NO_CCACHE}
122 endif
124 # for x86_64 x32 ABI we need to extend TARGET_CC/TARGET_CXX
125 ifeq ($(ADK_TARGET_ABI_X32),y)
126 TARGET_CC+= $(ADK_TARGET_ABI_CFLAGS)
127 TARGET_CXX+= $(ADK_TARGET_ABI_CFLAGS)
128 endif
130 TARGET_LD:= ${TARGET_COMPILER_PREFIX}ld
131 ifneq ($(ADK_TARGET_USE_LTO),)
132 TARGET_AR:= ${TARGET_COMPILER_PREFIX}gcc-ar
133 TARGET_RANLIB:= ${TARGET_COMPILER_PREFIX}gcc-ranlib
134 else
135 TARGET_AR:= ${TARGET_COMPILER_PREFIX}ar
136 TARGET_RANLIB:= ${TARGET_COMPILER_PREFIX}ranlib
137 endif
139 TARGET_CPPFLAGS:=
140 TARGET_CFLAGS:= -fwrapv -fno-ident
141 TARGET_CXXFLAGS:= -fwrapv -fno-ident
142 TARGET_LDFLAGS:= -L$(STAGING_TARGET_DIR)/lib -L$(STAGING_TARGET_DIR)/usr/lib \
143 -Wl,-O1 -Wl,-rpath -Wl,/usr/lib \
144 -Wl,-rpath-link -Wl,${STAGING_TARGET_DIR}/usr/lib
146 # for architectures where gcc --with-cpu matches -mcpu=
147 ifneq ($(ADK_TARGET_GCC_CPU),)
148 TARGET_CFLAGS+= -mcpu=$(ADK_TARGET_GCC_CPU)
149 TARGET_CXXFLAGS+= -mcpu=$(ADK_TARGET_GCC_CPU)
150 endif
152 # for archiectures where gcc --with-arch matches -march=
153 ifneq ($(ADK_TARGET_GCC_ARCH),)
154 TARGET_CFLAGS+= -march=$(ADK_TARGET_GCC_ARCH)
155 TARGET_CXXFLAGS+= -march=$(ADK_TARGET_GCC_ARCH)
156 endif
158 ifneq ($(ADK_TARGET_CPU_FLAGS),)
159 TARGET_CFLAGS+= $(ADK_TARGET_CPU_FLAGS)
160 TARGET_CXXFLAGS+= $(ADK_TARGET_CPU_FLAGS)
161 TARGET_LDFLAGS+= $(ADK_TARGET_CPU_FLAGS)
162 endif
164 ifneq ($(ADK_TARGET_FPU),)
165 TARGET_CFLAGS+= -mfpu=$(ADK_TARGET_FPU)
166 TARGET_CXXFLAGS+= -mfpu=$(ADK_TARGET_FPU)
167 endif
169 ifneq ($(ADK_TARGET_FLOAT),)
170 ifeq ($(ADK_TARGET_ARCH_ARM),y)
171 TARGET_CFLAGS+= -mfloat-abi=$(ADK_TARGET_FLOAT)
172 TARGET_CXXFLAGS+= -mfloat-abi=$(ADK_TARGET_FLOAT)
173 endif
174 ifeq ($(ADK_TARGET_ARCH_MIPS),y)
175 TARGET_CFLAGS+= -m$(ADK_TARGET_FLOAT)-float
176 TARGET_CXXFLAGS+= -m$(ADK_TARGET_FLOAT)-float
177 endif
178 endif
180 ifeq ($(ADK_TARGET_BINFMT_FLAT)$(ADK_TARGET_OS_FROSTED),y)
181 TARGET_LDFLAGS+= -Wl,-elf2flt
182 TARGET_CFLAGS+= -Wl,-elf2flt
183 TARGET_CXXFLAGS+= -Wl,-elf2flt
184 endif
186 ifeq ($(ADK_TARGET_BINFMT_FLAT_SEP_DATA),y)
187 TARGET_CFLAGS+= -msep-data
188 TARGET_CXXFLAGS+= -msep-data
189 endif
191 ifeq ($(ADK_TARGET_BINFMT_FLAT_SHARED),y)
192 TARGET_LDFLAGS+= -mid-shared-library
193 endif
195 # security optimization, see http://www.akkadia.org/drepper/dsohowto.pdf
196 ifneq ($(ADK_TARGET_USE_LD_RELRO),)
197 TARGET_LDFLAGS+= -Wl,-z,relro
198 endif
199 ifneq ($(ADK_TARGET_USE_LD_BIND_NOW),)
200 TARGET_LDFLAGS+= -Wl,-z,now
201 endif
203 # needed for musl ppc
204 ifeq ($(ADK_TARGET_ARCH_PPC),y)
205 ifeq ($(ADK_TARGET_LIB_MUSL),y)
206 TARGET_LDFLAGS+= -Wl,--secure-plt
207 endif
208 endif
210 ifeq ($(ADK_TARGET_USE_STATIC_LIBS_ONLY)$(ADK_TARGET_USE_STATIC_AND_SHARED_LIBS),y)
211 TARGET_CFLAGS+= -static
212 TARGET_CXXFLAGS+= -static
213 TARGET_LDFLAGS+= -static
214 endif
216 ifneq ($(ADK_TARGET_USE_SSP),)
217 TARGET_CFLAGS+= -fstack-protector-all --param=ssp-buffer-size=4
218 TARGET_CXXFLAGS+= -fstack-protector-all --param=ssp-buffer-size=4
219 TARGET_LDFLAGS+= -fstack-protector-all
220 endif
222 ifneq ($(ADK_TARGET_USE_LD_GC),)
223 TARGET_CFLAGS+= -fdata-sections -ffunction-sections
224 TARGET_CXXFLAGS+= -fdata-sections -ffunction-sections
225 TARGET_LDFLAGS+= -Wl,--gc-sections
226 endif
228 ifneq ($(ADK_TARGET_USE_LTO),)
229 TARGET_CFLAGS+= -flto
230 TARGET_CXXFLAGS+= -flto
231 TARGET_LDFLAGS+= -flto
232 endif
234 # performance optimization, see http://www.akkadia.org/drepper/dsohowto.pdf
235 ifneq ($(ADK_TARGET_USE_GNU_HASHSTYLE),)
236 TARGET_LDFLAGS+= -Wl,--hash-style=gnu
237 endif
239 # special operating system flags
240 ifeq ($(ADK_TARGET_OS_FROSTED),y)
241 TARGET_CFLAGS+= -fPIC -mlong-calls -fno-common -msingle-pic-base -mno-pic-data-is-text-relative
242 endif
244 # special architecture optimization flags
245 ifeq ($(ADK_TARGET_ARCH_XTENSA),y)
246 ifeq ($(ADK_TARGET_BIG_ENDIAN),)
247 ifeq ($(ADK_TARGET_LIB_NEWLIB),)
248 TARGET_CFLAGS+= -mlongcalls -mauto-litpools
249 TARGET_CXXFLAGS+= -mlongcalls -mauto-litpools
250 endif
251 endif
252 endif
253 ifeq ($(ADK_TARGET_ARCH_MICROBLAZE),y)
254 TARGET_CFLAGS+= -mxl-barrel-shift
255 TARGET_CXXFLAGS+= -mxl-barrel-shift
256 endif
258 endif
259 # end gcc specific
261 # add configured compiler flags for optimization
262 TARGET_CFLAGS+= $(ADK_TARGET_CFLAGS_OPT)
263 TARGET_CXXFLAGS+= $(ADK_TARGET_CFLAGS_OPT)
265 # add compiler flags for debug information
266 ifneq ($(ADK_DEBUG),)
267 TARGET_CFLAGS+= -g3
268 TARGET_CXXFLAGS+= -g3
269 endif
271 ifneq ($(ADK_DEBUG),)
272 ifeq ($(ADK_TARGET_ARCH_ARM_WITH_THUMB),)
273 TARGET_CFLAGS+= -fno-omit-frame-pointer
274 TARGET_CXXFLAGS+= -fno-omit-frame-pointer
275 endif
276 TARGET_CFLAGS+= -funwind-tables -fasynchronous-unwind-tables
277 TARGET_CXXFLAGS+= -funwind-tables -fasynchronous-unwind-tables
278 else
279 TARGET_CPPFLAGS+= -DNDEBUG
280 TARGET_CFLAGS+= -fomit-frame-pointer
281 TARGET_CXXFLAGS+= -fomit-frame-pointer
282 # stop generating eh_frame stuff
283 TARGET_CFLAGS+= -fno-unwind-tables -fno-asynchronous-unwind-tables
284 TARGET_CXXFLAGS+= -fno-unwind-tables -fno-asynchronous-unwind-tables
285 ifeq ($(ADK_TARGET_CPU_CF),y)
286 TARGET_CFLAGS+= -fno-dwarf2-cfi-asm
287 TARGET_CXXFLAGS+= -fno-dwarf2-cfi-asm
288 endif
289 endif
291 ifeq ($(ADK_TARGET_ARCH_ARM),y)
292 ifeq ($(ADK_TARGET_ARCH_ARM_WITH_NEON),y)
293 TARGET_CFLAGS+= -ffast-math
294 TARGET_CXXFLAGS+= -ffast-math
295 endif
296 ifeq ($(ADK_TARGET_ARCH_ARM_WITH_THUMB),y)
297 TARGET_CFLAGS+= -mthumb -Wa,-mimplicit-it=thumb -mno-thumb-interwork
298 TARGET_CXXFLAGS+= -mthumb -Wa,-mimplicit-it=thumb -mno-thumb-interwork
299 else
300 TARGET_CFLAGS+= -marm
301 TARGET_CXXFLAGS+= -marm
302 endif
303 endif
305 # host compiler and linker flags
306 HOST_CPPFLAGS:= -I$(STAGING_HOST_DIR)/usr/include
307 ifeq ($(OS_FOR_BUILD),Darwin)
308 HOST_LDFLAGS:= -L$(STAGING_HOST_DIR)/usr/lib
309 else
310 HOST_LDFLAGS:= -L$(STAGING_HOST_DIR)/usr/lib -Wl,-rpath -Wl,${STAGING_HOST_DIR}/usr/lib
311 endif
313 ifneq (${ADK_UPDATE_PATCHES_GIT},)
314 PATCH= PATH='${HOST_PATH}' ${BASH} $(SCRIPT_DIR)/patch_git.sh
315 else
316 PATCH= PATH='${HOST_PATH}' ${BASH} $(SCRIPT_DIR)/patch.sh
317 endif
318 PATCHP0= PATH='${HOST_PATH}' patch -p0
320 ifeq ($(ADK_STATIC_TOOLCHAIN),y)
321 HOST_STATIC_CFLAGS:= -static -Wl,-static
322 HOST_STATIC_CXXFLAGS:= -static -Wl,-static
323 HOST_STATIC_LDFLAGS:= -Wl,-static
324 endif
326 SED:= PATH='${HOST_PATH}' sed -i -e
327 XZ:= PATH='${HOST_PATH}' xz
328 CPIO:= PATH='${HOST_PATH}' cpio
329 LINUX_DIR:= $(BUILD_DIR)/linux
330 KERNEL_MODULE_FLAGS:= ARCH=${ADK_TARGET_KARCH} \
331 PREFIX=/usr \
332 KERNEL_PATH=${LINUX_DIR} \
333 KERNELDIR=${LINUX_DIR} \
334 KERNEL_DIR=${LINUX_DIR} \
335 CROSS_COMPILE="${TARGET_CROSS}" \
338 COMMON_ENV= CONFIG_SHELL='$(strip ${SHELL})' \
339 AUTOM4TE='${STAGING_HOST_DIR}/usr/bin/autom4te' \
340 M4='${STAGING_HOST_DIR}/usr/bin/m4' \
341 LIBTOOLIZE='${STAGING_HOST_DIR}/usr/bin/libtoolize'
343 ifneq ($(ADK_TARGET_USE_LTO),)
344 TOOLS_ENV= AR='$(TARGET_CROSS)gcc-ar' \
345 RANLIB='$(TARGET_CROSS)gcc-ranlib' \
346 NM='$(TARGET_CROSS)gcc-nm'
347 else
348 TOOLS_ENV= AR='$(TARGET_CROSS)ar' \
349 RANLIB='$(TARGET_CROSS)ranlib' \
350 NM='$(TARGET_CROSS)nm'
351 endif
353 TARGET_ENV= $(TOOLS_ENV) \
354 AS='$(TARGET_CROSS)as' \
355 LD='$(TARGET_CROSS)ld' \
356 STRIP='$(TARGET_CROSS)strip' \
357 OBJCOPY='$(TARGET_CROSS)objcopy' \
358 CC='$(TARGET_CC)' \
359 GCC='$(TARGET_CC)' \
360 CXX='$(TARGET_CXX)' \
361 CROSS='$(TARGET_CROSS)' \
362 CROSS_COMPILE='$(TARGET_CROSS)' \
363 CFLAGS='$(TARGET_CFLAGS)' \
364 CXXFLAGS='$(TARGET_CXXFLAGS)' \
365 CPPFLAGS='$(TARGET_CPPFLAGS)' \
366 LDFLAGS='$(TARGET_LDFLAGS)' \
367 CC_FOR_BUILD='$(HOST_CC)' \
368 CXX_FOR_BUILD='$(HOST_CXX)' \
369 CPPFLAGS_FOR_BUILD='$(HOST_CPPFLAGS)' \
370 CFLAGS_FOR_BUILD='$(HOST_CFLAGS)' \
371 CXXFLAGS_FOR_BUILD='$(HOST_CXXFLAGS)' \
372 LDFLAGS_FOR_BUILD='$(HOST_LDFLAGS)' \
373 LIBS_FOR_BUILD='$(HOST_LIBS)'
375 HOST_ENV= CC='$(HOST_CC)' \
376 CXX='$(HOST_CXX)' \
377 CPPFLAGS='$(HOST_CPPFLAGS)' \
378 CFLAGS='$(HOST_CFLAGS)' \
379 CXXFLAGS='$(HOST_CXXFLAGS)' \
380 LDFLAGS='$(HOST_LDFLAGS)' \
381 CC_FOR_BUILD='$(HOST_CC)' \
382 CFLAGS_FOR_BUILD='$(HOST_CFLAGS)'
384 PKG_SUFFIX:= $(strip $(subst ",, $(ADK_PACKAGE_SUFFIX)))
386 ifeq ($(ADK_TARGET_PACKAGE_IPKG),y)
387 PKG_BUILD:= ${BASH} ${SCRIPT_DIR}/ipkg-build
388 PKG_INSTALL:= PATH='${HOST_PATH}' \
389 IPKG_TMP=$(BUILD_DIR)/tmp \
390 IPKG_INSTROOT=$(TARGET_DIR) \
391 IPKG_CONF_DIR=$(STAGING_TARGET_DIR)/etc \
392 IPKG_OFFLINE_ROOT=$(TARGET_DIR) \
393 BIN_DIR=$(STAGING_HOST_DIR)/usr/bin \
394 ${BASH} ${SCRIPT_DIR}/ipkg \
395 -force-defaults -force-depends install
396 PKG_STATE_DIR:= $(TARGET_DIR)/usr/lib/ipkg
397 endif
399 ifeq ($(ADK_TARGET_PACKAGE_OPKG),y)
400 PKG_BUILD:= ${BASH} ${SCRIPT_DIR}/ipkg-build
401 PKG_INSTALL:= PATH='${HOST_PATH}' \
402 IPKG_TMP=$(BUILD_DIR)/tmp \
403 IPKG_INSTROOT=$(TARGET_DIR) \
404 IPKG_CONF_DIR=$(STAGING_TARGET_DIR)/etc \
405 IPKG_OFFLINE_ROOT=$(TARGET_DIR) \
406 BIN_DIR=$(STAGING_HOST_DIR)/usr/bin \
407 ${BASH} ${SCRIPT_DIR}/ipkg \
408 -force-defaults -force-depends install
409 PKG_STATE_DIR:= $(TARGET_DIR)/usr/lib/opkg
410 endif
412 ifeq ($(ADK_TARGET_PACKAGE_TXZ),y)
413 PKG_BUILD:= ${BASH} ${SCRIPT_DIR}/tarpkg build
414 PKG_INSTALL:= PKG_INSTROOT='$(TARGET_DIR)' \
415 PATH='${HOST_PATH}' ${BASH} ${SCRIPT_DIR}/tarpkg install
416 PKG_STATE_DIR:= $(TARGET_DIR)/usr/lib/pkg
417 endif
419 RSTRIP:= PATH="$(TARGET_PATH)" prefix='${TARGET_CROSS}' ${BASH} ${SCRIPT_DIR}/rstrip.sh
421 STATCMD:=$(shell if stat -qs .>/dev/null 2>&1; then echo 'stat -f %z';else echo 'stat -c %s';fi)
423 EXTRACT_CMD= PATH='${HOST_PATH}'; mkdir -p ${WRKDIR}; \
424 cd ${WRKDIR} && \
425 for file in ${FULLDISTFILES}; do case $$file in \
426 *.cpio) \
427 cat $$file | cpio -i -d ;; \
428 *.tar) \
429 tar -xf $$file ;; \
430 *.cpio.Z | *.cpio.gz | *.cgz | *.mcz) \
431 gzip -dc $$file | cpio -i -d ;; \
432 *.tar.xz | *.txz) \
433 xz -dc $$file | tar -xf - ;; \
434 *.tar.Z | *.tar.gz | *.taz | *.tgz) \
435 gzip -dc $$file | tar -xf - ;; \
436 *.cpio.bz2 | *.cbz) \
437 bzip2 -dc $$file | cpio -i -d ;; \
438 *.tar.bz2 | *.tbz | *.tbz2) \
439 bzip2 -dc $$file | tar -xf - ;; \
440 *.tar.lz | *.tlz) \
441 lzip -dc $$file | tar -xf - ;; \
442 *.zip) \
443 unzip -d ${WRKDIR} $$file ;; \
444 *.arm|*.jar|*.ids.gz) \
445 mkdir ${WRKBUILD}; cp $$file ${WRKBUILD} ;; \
446 *.bin) \
447 sh $$file --force --auto-accept ;; \
448 *) \
449 echo "Cannot extract '$$file'" >&2; \
450 false ;; \
451 esac; done
453 ifneq (,$(filter CYGWIN%,${OS_FOR_BUILD}))
454 EXEEXT:= .exe
455 endif
457 include $(ADK_TOPDIR)/mk/mirrors.mk