Jean-Baptiste Queru | 9b4a812 | 2010-02-23 12:36:56 -0800 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2006 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 17 | # Select a combo based on the compiler being used. |
| 18 | # |
| 19 | # Inputs: |
| 20 | # combo_target -- prefix for final variables (HOST_ or TARGET_) |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 21 | # combo_2nd_arch_prefix -- it's defined if this is loaded for the 2nd arch. |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 22 | # |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 23 | |
| 24 | # Build a target string like "linux-arm" or "darwin-x86". |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 25 | combo_os_arch := $($(combo_target)OS)-$($(combo_target)$(combo_2nd_arch_prefix)ARCH) |
Ying Wang | 1d274d2 | 2013-12-27 11:09:36 -0800 | [diff] [blame] | 26 | |
| 27 | combo_var_prefix := $(combo_2nd_arch_prefix)$(combo_target) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 28 | |
Jean-Baptiste Queru | 9b4a812 | 2010-02-23 12:36:56 -0800 | [diff] [blame] | 29 | # Set reasonable defaults for the various variables |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 30 | |
Ying Wang | 1d274d2 | 2013-12-27 11:09:36 -0800 | [diff] [blame] | 31 | $(combo_var_prefix)CC := $(CC) |
| 32 | $(combo_var_prefix)CXX := $(CXX) |
| 33 | $(combo_var_prefix)AR := $(AR) |
| 34 | $(combo_var_prefix)STRIP := $(STRIP) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 35 | |
Ying Wang | 1d274d2 | 2013-12-27 11:09:36 -0800 | [diff] [blame] | 36 | $(combo_var_prefix)GLOBAL_CFLAGS := -fno-exceptions -Wno-multichar |
| 37 | $(combo_var_prefix)RELEASE_CFLAGS := -O2 -g -fno-strict-aliasing |
| 38 | $(combo_var_prefix)GLOBAL_CPPFLAGS := |
| 39 | $(combo_var_prefix)GLOBAL_LDFLAGS := |
Dan Albert | 3c12b5c | 2014-05-27 19:30:36 +0000 | [diff] [blame] | 40 | $(combo_var_prefix)GLOBAL_ARFLAGS := crsPD |
Ying Wang | 4d2cc66 | 2014-01-16 12:36:34 -0800 | [diff] [blame] | 41 | $(combo_var_prefix)GLOBAL_LD_DIRS := |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 42 | |
Ying Wang | 1d274d2 | 2013-12-27 11:09:36 -0800 | [diff] [blame] | 43 | $(combo_var_prefix)EXECUTABLE_SUFFIX := |
| 44 | $(combo_var_prefix)SHLIB_SUFFIX := .so |
| 45 | $(combo_var_prefix)JNILIB_SUFFIX := $($(combo_var_prefix)SHLIB_SUFFIX) |
| 46 | $(combo_var_prefix)STATIC_LIB_SUFFIX := .a |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 47 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 48 | # Now include the combo for this specific target. |
Jean-Baptiste Queru | 9b4a812 | 2010-02-23 12:36:56 -0800 | [diff] [blame] | 49 | include $(BUILD_COMBOS)/$(combo_target)$(combo_os_arch).mk |