Dmitriy Ivanov | f41e8ea | 2014-04-10 15:45:17 -0700 | [diff] [blame] | 1 | # Copyright (C) 2014 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | include $(CLEAR_VARS) |
| 16 | |
Dmitriy Ivanov | 82fb91c | 2014-12-05 14:37:56 -0800 | [diff] [blame] | 17 | LOCAL_ARM_MODE := arm |
Dmitriy Ivanov | f41e8ea | 2014-04-10 15:45:17 -0700 | [diff] [blame] | 18 | ifeq ($(vg_build_second_arch),true) |
| 19 | LOCAL_MULTILIB := 32 |
Dmitriy Ivanov | f41e8ea | 2014-04-10 15:45:17 -0700 | [diff] [blame] | 20 | vg_local_arch := $(TARGET_2ND_ARCH) |
| 21 | else |
| 22 | LOCAL_MULTILIB := first |
Dmitriy Ivanov | f2815ab | 2014-11-08 14:05:23 -0800 | [diff] [blame] | 23 | vg_local_arch := $(vg_arch) |
Dmitriy Ivanov | f41e8ea | 2014-04-10 15:45:17 -0700 | [diff] [blame] | 24 | endif |
| 25 | |
Chih-Hung Hsieh | d20e2a6 | 2016-08-15 23:34:52 -0700 | [diff] [blame^] | 26 | # For arm and arm64 targets, clang compiled module has other |
| 27 | # undefined errors, see bug 28454823. |
Dmitriy Ivanov | 82fb91c | 2014-12-05 14:37:56 -0800 | [diff] [blame] | 28 | ifeq ($(filter $TARGET_ARCH,x86 x86_64),) |
| 29 | LOCAL_CLANG := false |
| 30 | endif |
| 31 | |
Chih-Hung Hsieh | d20e2a6 | 2016-08-15 23:34:52 -0700 | [diff] [blame^] | 32 | # Do not call (builtin) memset from VG(memset). |
| 33 | LOCAL_CLANG_CFLAGS += -fno-builtin-memset |
| 34 | |
Dmitriy Ivanov | f41e8ea | 2014-04-10 15:45:17 -0700 | [diff] [blame] | 35 | LOCAL_MODULE := $(vg_local_module)-$(vg_local_arch)-linux |
| 36 | |
Ying Wang | 4bf606d | 2016-03-16 19:45:49 -0700 | [diff] [blame] | 37 | LOCAL_MODULE_TARGET_ARCH := $(vg_local_arch) |
| 38 | |
Dmitriy Ivanov | f41e8ea | 2014-04-10 15:45:17 -0700 | [diff] [blame] | 39 | LOCAL_SRC_FILES := $(vg_local_src_files) |
| 40 | |
| 41 | LOCAL_C_INCLUDES := $(common_includes) $(vg_local_c_includes) |
| 42 | |
Dmitriy Ivanov | dcf50a3 | 2015-05-07 15:12:30 -0700 | [diff] [blame] | 43 | LOCAL_PACK_MODULE_RELOCATIONS := false |
| 44 | |
Dmitriy Ivanov | f41e8ea | 2014-04-10 15:45:17 -0700 | [diff] [blame] | 45 | LOCAL_CFLAGS := $(vg_local_cflags) |
Dmitriy Ivanov | 82fb91c | 2014-12-05 14:37:56 -0800 | [diff] [blame] | 46 | LOCAL_CFLAGS_$(TARGET_ARCH) := $(vg_local_target_arch_cflags) |
| 47 | LOCAL_CFLAGS_$(TARGET_2ND_ARCH) := $(vg_local_target_2nd_arch_cflags) |
Dmitriy Ivanov | f41e8ea | 2014-04-10 15:45:17 -0700 | [diff] [blame] | 48 | |
| 49 | LOCAL_ASFLAGS := $(common_cflags) |
Dmitriy Ivanov | 82fb91c | 2014-12-05 14:37:56 -0800 | [diff] [blame] | 50 | LOCAL_ASFLAGS_$(TARGET_ARCH) := $(vg_local_target_arch_cflags) |
| 51 | LOCAL_ASFLAGS_$(TARGET_2ND_ARCH) := $(vg_local_target_2nd_arch_cflags) |
Dmitriy Ivanov | f41e8ea | 2014-04-10 15:45:17 -0700 | [diff] [blame] | 52 | |
| 53 | |
| 54 | LOCAL_LDFLAGS := $(vg_local_ldflags) |
| 55 | |
Dmitriy Ivanov | f41e8ea | 2014-04-10 15:45:17 -0700 | [diff] [blame] | 56 | LOCAL_MODULE_CLASS := $(vg_local_module_class) |
| 57 | |
| 58 | LOCAL_STATIC_LIBRARIES := \ |
| 59 | $(foreach l,$(vg_local_static_libraries),$l-$(vg_local_arch)-linux) |
| 60 | LOCAL_WHOLE_STATIC_LIBRARIES := \ |
| 61 | $(foreach l,$(vg_local_whole_static_libraries),$l-$(vg_local_arch)-linux) |
| 62 | |
| 63 | ifeq ($(vg_local_target),EXECUTABLE) |
| 64 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
Dmitriy Ivanov | 82fb91c | 2014-12-05 14:37:56 -0800 | [diff] [blame] | 65 | LOCAL_NO_FPIE := true |
Dmitriy Ivanov | f41e8ea | 2014-04-10 15:45:17 -0700 | [diff] [blame] | 66 | endif |
| 67 | |
Dmitriy Ivanov | 92a8635 | 2014-05-21 16:21:59 -0700 | [diff] [blame] | 68 | ifneq ($(vg_local_target),STATIC_LIBRARY) |
Dmitriy Ivanov | 82fb91c | 2014-12-05 14:37:56 -0800 | [diff] [blame] | 69 | LOCAL_MODULE_PATH=$(PRODUCT_OUT)$(vg_target_module_path) |
Dmitriy Ivanov | 92a8635 | 2014-05-21 16:21:59 -0700 | [diff] [blame] | 70 | endif |
| 71 | |
Dmitriy Ivanov | f41e8ea | 2014-04-10 15:45:17 -0700 | [diff] [blame] | 72 | ifeq ($(vg_local_without_system_shared_libraries),true) |
| 73 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 74 | endif |
| 75 | |
| 76 | ifeq ($(vg_local_no_crt),true) |
| 77 | LOCAL_NO_CRT := true |
| 78 | endif |
| 79 | |
Dmitriy Ivanov | f41e8ea | 2014-04-10 15:45:17 -0700 | [diff] [blame] | 80 | include $(BUILD_$(vg_local_target)) |