alpha: add fine granular CPU selection
[openadk.git] / mk / vars.mk
blobe252efb319fd1d5c203fd1bb014f09c4c41f982c
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_DISABLE_HONOUR_CFLAGS),)
69 GCC_CHECK:= GCC_HONOUR_COPTS=2
70 else
71 GCC_CHECK:=
72 endif
74 ifeq ($(ADK_TARGET_UCLINUX),y)
75 ADK_TARGET_LINUXTYPE:= uclinux
76 else
77 ADK_TARGET_LINUXTYPE:= linux
78 endif
80 GNU_TARGET_NAME:= $(ADK_TARGET_CPU_ARCH)-$(ADK_VENDOR)-$(ADK_TARGET_LINUXTYPE)-$(ADK_TARGET_SUFFIX)
81 ifeq ($(ADK_TARGET_ARCH_C6X),y)
82 GNU_TARGET_NAME:= $(ADK_TARGET_CPU_ARCH)-$(ADK_TARGET_LINUXTYPE)
83 endif
84 ifeq ($(ADK_TARGET_LIB_NEWLIB),y)
85 GNU_TARGET_NAME:= $(ADK_TARGET_CPU_ARCH)-$(ADK_TARGET_SUFFIX)
86 endif
87 TARGET_CROSS:= $(TOOLCHAIN_DIR)/usr/bin/$(GNU_TARGET_NAME)-
88 TARGET_COMPILER_PREFIX?=${TARGET_CROSS}
89 CONFIGURE_TRIPLE:= --build=${GNU_HOST_NAME} \
90 --host=${GNU_TARGET_NAME} \
91 --target=${GNU_TARGET_NAME}
93 # target tools
94 ifeq ($(ADK_BUILD_COMPILER_GCC),y)
95 TARGET_CC:= ${TARGET_COMPILER_PREFIX}gcc
96 TARGET_CXX:= ${TARGET_COMPILER_PREFIX}g++
97 TARGET_CC_NO_CCACHE:= ${TARGET_CC}
98 TARGET_CXX_NO_CCACHE:= ${TARGET_CXX}
99 endif
100 ifeq ($(ADK_BUILD_COMPILER_LLVM),y)
101 TARGET_CC:= clang --target=${GNU_TARGET_NAME} --sysroot=$(STAGING_TARGET_DIR)
102 TARGET_CXX:= clang++ --target=${GNU_TARGET_NAME} --sysroot=$(STAGING_TARGET_DIR)
103 TARGET_LDFLAGS:= -fuse-ld=lld -stdlib=libc++
104 endif
106 # gcc specific
107 ifeq ($(ADK_BUILD_COMPILER_GCC),y)
108 ifneq ($(strip ${ADK_USE_CCACHE}),)
109 TARGET_CC:= $(STAGING_HOST_DIR)/usr/bin/ccache ${TARGET_CC_NO_CCACHE}
110 TARGET_CXX:= $(STAGING_HOST_DIR)/usr/bin/ccache ${TARGET_CXX_NO_CCACHE}
111 endif
113 # for x86_64 x32 ABI we need to extend TARGET_CC/TARGET_CXX
114 ifeq ($(ADK_TARGET_ABI_X32),y)
115 TARGET_CC+= $(ADK_TARGET_ABI_CFLAGS)
116 TARGET_CXX+= $(ADK_TARGET_ABI_CFLAGS)
117 endif
119 TARGET_LD:= ${TARGET_COMPILER_PREFIX}ld
120 ifneq ($(ADK_TARGET_USE_LTO),)
121 TARGET_AR:= ${TARGET_COMPILER_PREFIX}gcc-ar
122 TARGET_RANLIB:= ${TARGET_COMPILER_PREFIX}gcc-ranlib
123 else
124 TARGET_AR:= ${TARGET_COMPILER_PREFIX}ar
125 TARGET_RANLIB:= ${TARGET_COMPILER_PREFIX}ranlib
126 endif
128 TARGET_CPPFLAGS:=
129 TARGET_CFLAGS:= -fwrapv -fno-ident
130 TARGET_CXXFLAGS:= -fwrapv -fno-ident
131 TARGET_LDFLAGS:= -L$(STAGING_TARGET_DIR)/lib -L$(STAGING_TARGET_DIR)/usr/lib \
132 -Wl,-O1 -Wl,-rpath -Wl,/usr/lib \
133 -Wl,-rpath-link -Wl,${STAGING_TARGET_DIR}/usr/lib
135 ifeq ($(ADK_BUILD_COMPILER_GCC),y)
136 ifeq ($(ADK_DISABLE_HONOUR_CFLAGS),)
137 TARGET_CFLAGS+= -fhonour-copts
138 TARGET_CXXFLAGS+= -fhonour-copts
139 endif
140 endif
142 # for architectures where gcc --with-cpu matches -mcpu=
143 ifneq ($(ADK_TARGET_GCC_CPU),)
144 TARGET_CFLAGS+= -mcpu=$(ADK_TARGET_GCC_CPU)
145 TARGET_CXXFLAGS+= -mcpu=$(ADK_TARGET_GCC_CPU)
146 endif
148 # for archiectures where gcc --with-arch matches -march=
149 ifneq ($(ADK_TARGET_GCC_ARCH),)
150 TARGET_CFLAGS+= -march=$(ADK_TARGET_GCC_ARCH)
151 TARGET_CXXFLAGS+= -march=$(ADK_TARGET_GCC_ARCH)
152 endif
154 ifneq ($(ADK_TARGET_CPU_FLAGS),)
155 TARGET_CFLAGS+= $(ADK_TARGET_CPU_FLAGS)
156 TARGET_CXXFLAGS+= $(ADK_TARGET_CPU_FLAGS)
157 TARGET_LDFLAGS+= $(ADK_TARGET_CPU_FLAGS)
158 endif
160 ifneq ($(ADK_TARGET_FPU),)
161 TARGET_CFLAGS+= -mfpu=$(ADK_TARGET_FPU)
162 TARGET_CXXFLAGS+= -mfpu=$(ADK_TARGET_FPU)
163 endif
165 ifneq ($(ADK_TARGET_FLOAT),)
166 ifeq ($(ADK_TARGET_ARCH_ARM),y)
167 TARGET_CFLAGS+= -mfloat-abi=$(ADK_TARGET_FLOAT)
168 TARGET_CXXFLAGS+= -mfloat-abi=$(ADK_TARGET_FLOAT)
169 endif
170 ifeq ($(ADK_TARGET_ARCH_MIPS),y)
171 TARGET_CFLAGS+= -m$(ADK_TARGET_FLOAT)-float
172 TARGET_CXXFLAGS+= -m$(ADK_TARGET_FLOAT)-float
173 endif
174 endif
176 ifeq ($(ADK_TARGET_BINFMT_FLAT),y)
177 TARGET_LDFLAGS+= -Wl,-elf2flt
178 TARGET_CFLAGS+= -Wl,-elf2flt
179 TARGET_CXXFLAGS+= -Wl,-elf2flt
180 endif
182 ifeq ($(ADK_TARGET_BINFMT_FLAT_SEP_DATA),y)
183 TARGET_CFLAGS+= -msep-data
184 TARGET_CXXFLAGS+= -msep-data
185 endif
187 ifeq ($(ADK_TARGET_BINFMT_FLAT_SHARED),y)
188 TARGET_LDFLAGS+= -mid-shared-library
189 endif
191 # security optimization, see http://www.akkadia.org/drepper/dsohowto.pdf
192 ifneq ($(ADK_TARGET_USE_LD_RELRO),)
193 TARGET_LDFLAGS+= -Wl,-z,relro
194 endif
195 ifneq ($(ADK_TARGET_USE_LD_BIND_NOW),)
196 TARGET_LDFLAGS+= -Wl,-z,now
197 endif
199 # needed for musl ppc
200 ifeq ($(ADK_TARGET_ARCH_PPC),y)
201 ifeq ($(ADK_TARGET_LIB_MUSL),y)
202 TARGET_LDFLAGS+= -Wl,--secure-plt
203 endif
204 endif
206 ifeq ($(ADK_TARGET_USE_STATIC_LIBS_ONLY),y)
207 TARGET_CFLAGS+= -static
208 TARGET_CXXFLAGS+= -static
209 TARGET_LDFLAGS+= -static
210 endif
212 ifneq ($(ADK_TARGET_USE_SSP),)
213 TARGET_CFLAGS+= -fstack-protector-all --param=ssp-buffer-size=4
214 TARGET_CXXFLAGS+= -fstack-protector-all --param=ssp-buffer-size=4
215 TARGET_LDFLAGS+= -fstack-protector-all
216 endif
218 ifneq ($(ADK_TARGET_USE_LD_GC),)
219 TARGET_CFLAGS+= -fdata-sections -ffunction-sections
220 TARGET_CXXFLAGS+= -fdata-sections -ffunction-sections
221 TARGET_LDFLAGS+= -Wl,--gc-sections
222 endif
224 ifneq ($(ADK_TARGET_USE_LTO),)
225 TARGET_CFLAGS+= -flto
226 TARGET_CXXFLAGS+= -flto
227 TARGET_LDFLAGS+= -flto
228 endif
230 # performance optimization, see http://www.akkadia.org/drepper/dsohowto.pdf
231 ifneq ($(ADK_TARGET_USE_GNU_HASHSTYLE),)
232 TARGET_LDFLAGS+= -Wl,--hash-style=gnu
233 endif
235 # special architecture optimization flags
236 ifeq ($(ADK_TARGET_ARCH_XTENSA),y)
237 ifeq ($(ADK_TARGET_BIG_ENDIAN),)
238 TARGET_CFLAGS+= -mlongcalls -mauto-litpools
239 TARGET_CXXFLAGS+= -mlongcalls -mauto-litpools
240 endif
241 endif
242 ifeq ($(ADK_TARGET_ARCH_MICROBLAZE),y)
243 TARGET_CFLAGS+= -mxl-barrel-shift
244 TARGET_CXXFLAGS+= -mxl-barrel-shift
245 endif
247 endif
248 # end gcc specific
250 # add configured compiler flags for optimization
251 TARGET_CFLAGS+= $(ADK_TARGET_CFLAGS_OPT)
252 TARGET_CXXFLAGS+= $(ADK_TARGET_CFLAGS_OPT)
254 # add compiler flags for debug information
255 ifneq ($(ADK_DEBUG),)
256 TARGET_CFLAGS+= -g3
257 TARGET_CXXFLAGS+= -g3
258 endif
260 ifneq ($(ADK_DEBUG),)
261 ifeq ($(ADK_TARGET_ARCH_ARM_WITH_THUMB),)
262 TARGET_CFLAGS+= -fno-omit-frame-pointer
263 TARGET_CXXFLAGS+= -fno-omit-frame-pointer
264 endif
265 TARGET_CFLAGS+= -funwind-tables -fasynchronous-unwind-tables
266 TARGET_CXXFLAGS+= -funwind-tables -fasynchronous-unwind-tables
267 else
268 TARGET_CPPFLAGS+= -DNDEBUG
269 TARGET_CFLAGS+= -fomit-frame-pointer
270 TARGET_CXXFLAGS+= -fomit-frame-pointer
271 # stop generating eh_frame stuff
272 TARGET_CFLAGS+= -fno-unwind-tables -fno-asynchronous-unwind-tables
273 TARGET_CXXFLAGS+= -fno-unwind-tables -fno-asynchronous-unwind-tables
274 ifeq ($(ADK_TARGET_CPU_CF),y)
275 TARGET_CFLAGS+= -fno-dwarf2-cfi-asm
276 TARGET_CXXFLAGS+= -fno-dwarf2-cfi-asm
277 endif
278 endif
280 ifeq ($(ADK_TARGET_ARCH_ARM),y)
281 ifeq ($(ADK_TARGET_ARCH_ARM_WITH_NEON),y)
282 TARGET_CFLAGS+= -ffast-math
283 TARGET_CXXFLAGS+= -ffast-math
284 endif
285 ifeq ($(ADK_TARGET_ARCH_ARM_WITH_THUMB),y)
286 TARGET_CFLAGS+= -mthumb -Wa,-mimplicit-it=thumb -mno-thumb-interwork
287 TARGET_CXXFLAGS+= -mthumb -Wa,-mimplicit-it=thumb -mno-thumb-interwork
288 else
289 TARGET_CFLAGS+= -marm
290 TARGET_CXXFLAGS+= -marm
291 endif
292 endif
294 # host compiler and linker flags
295 HOST_CPPFLAGS:= -I$(STAGING_HOST_DIR)/usr/include
296 ifeq ($(OS_FOR_BUILD),Darwin)
297 HOST_LDFLAGS:= -L$(STAGING_HOST_DIR)/usr/lib
298 else
299 HOST_LDFLAGS:= -L$(STAGING_HOST_DIR)/usr/lib -Wl,-rpath -Wl,${STAGING_HOST_DIR}/usr/lib
300 endif
302 ifneq (${ADK_UPDATE_PATCHES_GIT},)
303 PATCH= PATH='${HOST_PATH}' ${BASH} $(SCRIPT_DIR)/patch_git.sh
304 else
305 PATCH= PATH='${HOST_PATH}' ${BASH} $(SCRIPT_DIR)/patch.sh
306 endif
307 PATCHP0= PATH='${HOST_PATH}' patch -p0
309 ifeq ($(ADK_STATIC_TOOLCHAIN),y)
310 HOST_STATIC_CFLAGS:= -static -Wl,-static
311 HOST_STATIC_CXXFLAGS:= -static -Wl,-static
312 HOST_STATIC_LDFLAGS:= -Wl,-static
313 endif
315 SED:= PATH='${HOST_PATH}' sed -i -e
316 XZ:= PATH='${HOST_PATH}' xz
317 CPIO:= PATH='${HOST_PATH}' cpio
318 LINUX_DIR:= $(BUILD_DIR)/linux
319 KERNEL_MODULE_FLAGS:= ARCH=${ADK_TARGET_KARCH} \
320 PREFIX=/usr \
321 KERNEL_PATH=${LINUX_DIR} \
322 KERNELDIR=${LINUX_DIR} \
323 KERNEL_DIR=${LINUX_DIR} \
324 CROSS_COMPILE="${TARGET_CROSS}" \
327 ifeq ($(ADK_BUILD_COMPILER_GCC),y)
328 ifeq ($(ADK_DISABLE_HONOUR_CFLAGS),)
329 KERNEL_MODULE_FLAGS+= CFLAGS_MODULE="-fhonour-copts"
330 endif
331 endif
333 COMMON_ENV= CONFIG_SHELL='$(strip ${SHELL})' \
334 AUTOM4TE='${STAGING_HOST_DIR}/usr/bin/autom4te' \
335 M4='${STAGING_HOST_DIR}/usr/bin/m4' \
336 LIBTOOLIZE='${STAGING_HOST_DIR}/usr/bin/libtoolize'
338 ifneq ($(ADK_TARGET_USE_LTO),)
339 TOOLS_ENV= AR='$(TARGET_CROSS)gcc-ar' \
340 RANLIB='$(TARGET_CROSS)gcc-ranlib' \
341 NM='$(TARGET_CROSS)gcc-nm'
342 else
343 TOOLS_ENV= AR='$(TARGET_CROSS)ar' \
344 RANLIB='$(TARGET_CROSS)ranlib' \
345 NM='$(TARGET_CROSS)nm'
346 endif
348 TARGET_ENV= $(TOOLS_ENV) \
349 AS='$(TARGET_CROSS)as' \
350 LD='$(TARGET_CROSS)ld' \
351 STRIP='$(TARGET_CROSS)strip' \
352 OBJCOPY='$(TARGET_CROSS)objcopy' \
353 CC='$(TARGET_CC)' \
354 GCC='$(TARGET_CC)' \
355 CXX='$(TARGET_CXX)' \
356 CROSS='$(TARGET_CROSS)' \
357 CROSS_COMPILE='$(TARGET_CROSS)' \
358 CFLAGS='$(TARGET_CFLAGS)' \
359 CXXFLAGS='$(TARGET_CXXFLAGS)' \
360 CPPFLAGS='$(TARGET_CPPFLAGS)' \
361 LDFLAGS='$(TARGET_LDFLAGS)' \
362 CC_FOR_BUILD='$(HOST_CC)' \
363 CXX_FOR_BUILD='$(HOST_CXX)' \
364 CPPFLAGS_FOR_BUILD='$(HOST_CPPFLAGS)' \
365 CFLAGS_FOR_BUILD='$(HOST_CFLAGS)' \
366 CXXFLAGS_FOR_BUILD='$(HOST_CXXFLAGS)' \
367 LDFLAGS_FOR_BUILD='$(HOST_LDFLAGS)' \
368 LIBS_FOR_BUILD='$(HOST_LIBS)'
370 HOST_ENV= CC='$(HOST_CC)' \
371 CXX='$(HOST_CXX)' \
372 CPPFLAGS='$(HOST_CPPFLAGS)' \
373 CFLAGS='$(HOST_CFLAGS)' \
374 CXXFLAGS='$(HOST_CXXFLAGS)' \
375 LDFLAGS='$(HOST_LDFLAGS)' \
376 CC_FOR_BUILD='$(HOST_CC)' \
377 CFLAGS_FOR_BUILD='$(HOST_CFLAGS)'
379 PKG_SUFFIX:= $(strip $(subst ",, $(ADK_PACKAGE_SUFFIX)))
381 ifeq ($(ADK_TARGET_PACKAGE_IPKG),y)
382 PKG_BUILD:= ${BASH} ${SCRIPT_DIR}/ipkg-build
383 PKG_INSTALL:= PATH='${HOST_PATH}' \
384 IPKG_TMP=$(BUILD_DIR)/tmp \
385 IPKG_INSTROOT=$(TARGET_DIR) \
386 IPKG_CONF_DIR=$(STAGING_TARGET_DIR)/etc \
387 IPKG_OFFLINE_ROOT=$(TARGET_DIR) \
388 BIN_DIR=$(STAGING_HOST_DIR)/usr/bin \
389 ${BASH} ${SCRIPT_DIR}/ipkg \
390 -force-defaults -force-depends install
391 PKG_STATE_DIR:= $(TARGET_DIR)/usr/lib/ipkg
392 endif
394 ifeq ($(ADK_TARGET_PACKAGE_OPKG),y)
395 PKG_BUILD:= ${BASH} ${SCRIPT_DIR}/ipkg-build
396 PKG_INSTALL:= PATH='${HOST_PATH}' \
397 IPKG_TMP=$(BUILD_DIR)/tmp \
398 IPKG_INSTROOT=$(TARGET_DIR) \
399 IPKG_CONF_DIR=$(STAGING_TARGET_DIR)/etc \
400 IPKG_OFFLINE_ROOT=$(TARGET_DIR) \
401 BIN_DIR=$(STAGING_HOST_DIR)/usr/bin \
402 ${BASH} ${SCRIPT_DIR}/ipkg \
403 -force-defaults -force-depends install
404 PKG_STATE_DIR:= $(TARGET_DIR)/usr/lib/opkg
405 endif
407 ifeq ($(ADK_TARGET_PACKAGE_TXZ),y)
408 PKG_BUILD:= ${BASH} ${SCRIPT_DIR}/tarpkg build
409 PKG_INSTALL:= PKG_INSTROOT='$(TARGET_DIR)' \
410 PATH='${HOST_PATH}' ${BASH} ${SCRIPT_DIR}/tarpkg install
411 PKG_STATE_DIR:= $(TARGET_DIR)/usr/lib/pkg
412 endif
414 RSTRIP:= PATH="$(TARGET_PATH)" prefix='${TARGET_CROSS}' ${BASH} ${SCRIPT_DIR}/rstrip.sh
416 STATCMD:=$(shell if stat -qs .>/dev/null 2>&1; then echo 'stat -f %z';else echo 'stat -c %s';fi)
418 EXTRACT_CMD= PATH='${HOST_PATH}'; mkdir -p ${WRKDIR}; \
419 cd ${WRKDIR} && \
420 for file in ${FULLDISTFILES}; do case $$file in \
421 *.cpio) \
422 cat $$file | cpio -i -d ;; \
423 *.tar) \
424 tar -xf $$file ;; \
425 *.cpio.Z | *.cpio.gz | *.cgz | *.mcz) \
426 gzip -dc $$file | cpio -i -d ;; \
427 *.tar.xz | *.txz) \
428 xz -dc $$file | tar -xf - ;; \
429 *.tar.Z | *.tar.gz | *.taz | *.tgz) \
430 gzip -dc $$file | tar -xf - ;; \
431 *.cpio.bz2 | *.cbz) \
432 bzip2 -dc $$file | cpio -i -d ;; \
433 *.tar.bz2 | *.tbz | *.tbz2) \
434 bzip2 -dc $$file | tar -xf - ;; \
435 *.tar.lz | *.tlz) \
436 lzip -dc $$file | tar -xf - ;; \
437 *.zip) \
438 unzip -d ${WRKDIR} $$file ;; \
439 *.arm|*.jar|*.ids.gz) \
440 mkdir ${WRKBUILD}; cp $$file ${WRKBUILD} ;; \
441 *.bin) \
442 sh $$file --force --auto-accept ;; \
443 *) \
444 echo "Cannot extract '$$file'" >&2; \
445 false ;; \
446 esac; done
448 ifneq (,$(filter CYGWIN%,${OS_FOR_BUILD}))
449 EXEEXT:= .exe
450 endif
452 include $(ADK_TOPDIR)/mk/mirrors.mk