2010-02-23 21:36:56 +01:00
|
|
|
#
|
|
|
|
# Copyright (C) 2006 The Android Open Source Project
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
# Select a combo based on the compiler being used.
|
|
|
|
#
|
|
|
|
# Inputs:
|
|
|
|
# combo_target -- prefix for final variables (HOST_ or TARGET_)
|
|
|
|
#
|
|
|
|
|
|
|
|
# Build a target string like "linux-arm" or "darwin-x86".
|
|
|
|
combo_os_arch := $($(combo_target)OS)-$($(combo_target)ARCH)
|
|
|
|
|
2010-02-23 21:36:56 +01:00
|
|
|
# Set reasonable defaults for the various variables
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2010-02-23 21:36:56 +01:00
|
|
|
$(combo_target)CC := $(CC)
|
|
|
|
$(combo_target)CXX := $(CXX)
|
|
|
|
$(combo_target)AR := $(AR)
|
2010-06-24 23:02:00 +02:00
|
|
|
$(combo_target)STRIP := $(STRIP)
|
2009-03-04 04:28:42 +01:00
|
|
|
|
|
|
|
$(combo_target)BINDER_MINI := 0
|
|
|
|
|
|
|
|
$(combo_target)HAVE_EXCEPTIONS := 0
|
|
|
|
$(combo_target)HAVE_UNIX_FILE_PATH := 1
|
|
|
|
$(combo_target)HAVE_WINDOWS_FILE_PATH := 0
|
|
|
|
$(combo_target)HAVE_RTTI := 1
|
|
|
|
$(combo_target)HAVE_CALL_STACKS := 1
|
|
|
|
$(combo_target)HAVE_64BIT_IO := 1
|
|
|
|
$(combo_target)HAVE_CLOCK_TIMERS := 1
|
|
|
|
$(combo_target)HAVE_PTHREAD_RWLOCK := 1
|
|
|
|
$(combo_target)HAVE_STRNLEN := 1
|
|
|
|
$(combo_target)HAVE_STRERROR_R_STRRET := 1
|
|
|
|
$(combo_target)HAVE_STRLCPY := 0
|
|
|
|
$(combo_target)HAVE_STRLCAT := 0
|
|
|
|
$(combo_target)HAVE_KERNEL_MODULES := 0
|
|
|
|
|
|
|
|
$(combo_target)GLOBAL_CFLAGS := -fno-exceptions -Wno-multichar
|
|
|
|
$(combo_target)RELEASE_CFLAGS := -O2 -g -fno-strict-aliasing
|
2009-07-18 00:57:10 +02:00
|
|
|
$(combo_target)GLOBAL_LDFLAGS :=
|
2009-10-08 01:27:38 +02:00
|
|
|
$(combo_target)GLOBAL_ARFLAGS := crsP
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2010-10-07 19:45:02 +02:00
|
|
|
$(combo_target)EXECUTABLE_SUFFIX :=
|
2009-03-04 04:28:42 +01:00
|
|
|
$(combo_target)SHLIB_SUFFIX := .so
|
|
|
|
$(combo_target)JNILIB_SUFFIX := $($(combo_target)SHLIB_SUFFIX)
|
|
|
|
$(combo_target)STATIC_LIB_SUFFIX := .a
|
|
|
|
|
|
|
|
# Now include the combo for this specific target.
|
2010-02-23 21:36:56 +01:00
|
|
|
include $(BUILD_COMBOS)/$(combo_target)$(combo_os_arch).mk
|
2009-03-04 04:28:42 +01:00
|
|
|
|
|
|
|
ifneq ($(USE_CCACHE),)
|
2011-03-12 13:19:01 +01:00
|
|
|
CCACHE_HOST_TAG := $(HOST_PREBUILT_TAG)
|
|
|
|
# If we are cross-compiling Windows binaries on Linux
|
|
|
|
# then use the linux ccache binary instead.
|
|
|
|
ifeq ($(HOST_OS)-$(BUILD_OS),windows-linux)
|
|
|
|
CCACHE_HOST_TAG := linux-$(BUILD_ARCH)
|
2010-10-07 19:45:02 +02:00
|
|
|
endif
|
2012-01-09 20:52:23 +01:00
|
|
|
ccache := prebuilts/misc/$(CCACHE_HOST_TAG)/ccache/ccache
|
2011-03-12 13:19:01 +01:00
|
|
|
# Check that the executable is here.
|
|
|
|
ccache := $(strip $(wildcard $(ccache)))
|
|
|
|
ifdef ccache
|
|
|
|
# prepend ccache if necessary
|
|
|
|
ifneq ($(ccache),$(firstword $($(combo_target)CC)))
|
|
|
|
$(combo_target)CC := $(ccache) $($(combo_target)CC)
|
|
|
|
endif
|
|
|
|
ifneq ($(ccache),$(firstword $($(combo_target)CXX)))
|
|
|
|
$(combo_target)CXX := $(ccache) $($(combo_target)CXX)
|
|
|
|
endif
|
|
|
|
ccache =
|
2010-10-07 19:45:02 +02:00
|
|
|
endif
|
2009-03-04 04:28:42 +01:00
|
|
|
endif
|