select.mk revision b6c1cf6de79035f58b512f4400db458c8401379a
1# Select a combo based on the compiler being used. 2# 3# Inputs: 4# combo_target -- prefix for final variables (HOST_ or TARGET_) 5# 6# Outputs: 7# $(combo_target)OS -- standard name for this host (LINUX, DARWIN, etc.) 8# $(combo_target)ARCH -- standard name for process architecture (powerpc, x86, etc.) 9# $(combo_target)GLOBAL_CFLAGS -- C compiler flags to use for everything 10# $(combo_target)DEBUG_CFLAGS -- additional C compiler flags for debug builds 11# $(combo_target)RELEASE_CFLAGS -- additional C compiler flags for release builds 12# $(combo_target)GLOBAL_ARFLAGS -- flags to use for static linking everything 13# $(combo_target)SHLIB_SUFFIX -- suffix of shared libraries 14 15# Build a target string like "linux-arm" or "darwin-x86". 16combo_os_arch := $($(combo_target)OS)-$($(combo_target)ARCH) 17 18# Set the defaults. 19 20HOST_CC ?= $(CC) 21HOST_CXX ?= $(CXX) 22HOST_AR ?= $(AR) 23 24$(combo_target)BINDER_MINI := 0 25 26$(combo_target)HAVE_EXCEPTIONS := 0 27$(combo_target)HAVE_UNIX_FILE_PATH := 1 28$(combo_target)HAVE_WINDOWS_FILE_PATH := 0 29$(combo_target)HAVE_RTTI := 1 30$(combo_target)HAVE_CALL_STACKS := 1 31$(combo_target)HAVE_64BIT_IO := 1 32$(combo_target)HAVE_CLOCK_TIMERS := 1 33$(combo_target)HAVE_PTHREAD_RWLOCK := 1 34$(combo_target)HAVE_STRNLEN := 1 35$(combo_target)HAVE_STRERROR_R_STRRET := 1 36$(combo_target)HAVE_STRLCPY := 0 37$(combo_target)HAVE_STRLCAT := 0 38$(combo_target)HAVE_KERNEL_MODULES := 0 39 40# These flags might (will) be overridden by the target makefiles 41$(combo_target)GLOBAL_CFLAGS := -fno-exceptions -Wno-multichar 42$(combo_target)DEBUG_CFLAGS := -O0 -g 43$(combo_target)RELEASE_CFLAGS := -O2 -g -fno-strict-aliasing 44$(combo_target)GLOBAL_ARFLAGS := crs 45 46$(combo_target)EXECUTABLE_SUFFIX := 47$(combo_target)SHLIB_SUFFIX := .so 48$(combo_target)JNILIB_SUFFIX := $($(combo_target)SHLIB_SUFFIX) 49$(combo_target)STATIC_LIB_SUFFIX := .a 50 51$(combo_target)PRELINKER_MAP := $(BUILD_SYSTEM)/prelink-$(combo_os_arch).map 52 53# Now include the combo for this specific target. 54include $(BUILD_COMBOS)/$(combo_os_arch).mk 55 56ifneq ($(USE_CCACHE),) 57 ccache := prebuilt/$(HOST_PREBUILT_TAG)/ccache/ccache 58 $(combo_target)CC := $(ccache) $($(combo_target)CC) 59 $(combo_target)CXX := $(ccache) $($(combo_target)CXX) 60 ccache = 61endif 62