Alexey Polyudov | ccdc311 | 2016-08-01 17:41:49 -0700 | [diff] [blame] | 1 | ########################################################### |
| 2 | # takes form LOCAL_AUX_TOOLCHAIN_$(LOCAL_AUX_CPU) |
| 3 | ########################################################### |
| 4 | |
| 5 | ############################### |
| 6 | # setup AUX environment |
| 7 | ############################### |
| 8 | |
| 9 | # shortcuts for targets with a single instance of OS, ARCH, VARIANT, CPU |
| 10 | AUX_TOOLCHAIN := $(if $(LOCAL_AUX_TOOLCHAIN),$(LOCAL_AUX_TOOLCHAIN),$(AUX_TOOLCHAIN_$(AUX_CPU))) |
| 11 | AUX_BUILD_NOT_COMPATIBLE:= |
| 12 | ifeq ($(strip $(AUX_TOOLCHAIN)),) |
| 13 | ifeq ($(strip $(AUX_CPU)),) |
| 14 | $(warning $(LOCAL_PATH): $(LOCAL_MODULE): Undefined CPU for AUX toolchain) |
| 15 | AUX_BUILD_NOT_COMPATIBLE += TOOLCHAIN |
| 16 | else |
| 17 | $(warning $(LOCAL_PATH): $(LOCAL_MODULE): Undefined AUX toolchain for CPU=$(AUX_CPU)) |
| 18 | AUX_BUILD_NOT_COMPATIBLE += TOOLCHAIN |
| 19 | endif |
| 20 | endif |
| 21 | |
| 22 | AUX_BUILD_NOT_COMPATIBLE += $(foreach var,OS ARCH SUBARCH CPU OS_VARIANT,$(if $(LOCAL_AUX_$(var)),$(if \ |
| 23 | $(filter $(LOCAL_AUX_$(var)),$(AUX_$(var))),,$(var)))) |
| 24 | |
| 25 | AUX_BUILD_NOT_COMPATIBLE := $(strip $(AUX_BUILD_NOT_COMPATIBLE)) |
| 26 | |
| 27 | ifneq ($(AUX_BUILD_NOT_COMPATIBLE),) |
| 28 | $(info $(LOCAL_PATH): $(LOCAL_MODULE): not compatible: "$(AUX_BUILD_NOT_COMPATIBLE)" with) |
| 29 | $(info ====> OS=$(AUX_OS) CPU=$(AUX_CPU) ARCH=$(AUX_ARCH) SUBARCH=$(AUX_SUBARCH) OS_VARIANT=$(AUX_OS_VARIANT)) |
| 30 | $(info ====> TOOLCHAIN=$(AUX_TOOLCHAIN)) |
| 31 | endif |
| 32 | |
| 33 | AUX_AR := $(AUX_TOOLCHAIN)ar |
| 34 | AUX_AS := $(AUX_TOOLCHAIN)gcc |
| 35 | AUX_CC := $(AUX_TOOLCHAIN)gcc |
| 36 | AUX_CXX := $(AUX_TOOLCHAIN)g++ |
| 37 | AUX_LINKER := $(AUX_TOOLCHAIN)ld |
| 38 | AUX_OBJCOPY := $(AUX_TOOLCHAIN)objcopy |
| 39 | AUX_OBJDUMP := $(AUX_TOOLCHAIN)objdump |
| 40 | |
| 41 | ############################### |
| 42 | # setup Android environment |
| 43 | ############################### |
| 44 | |
| 45 | LOCAL_IS_AUX_MODULE := true |
| 46 | LOCAL_2ND_ARCH_VAR_PREFIX := |
| 47 | LOCAL_CC := $(AUX_CC) |
| 48 | LOCAL_CXX := $(AUX_CXX) |
| 49 | LOCAL_NO_DEFAULT_COMPILER_FLAGS := true |
| 50 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 51 | LOCAL_CXX_STL := none |
| 52 | LOCAL_NO_PIC := true |