blob: 1705cf2ef235dfb15dd8c221ad188b01aa0a178a [file] [log] [blame]
Dmitriy Ivanovf41e8ea2014-04-10 15:45:17 -07001# 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
15include $(CLEAR_VARS)
16
Dmitriy Ivanov82fb91c2014-12-05 14:37:56 -080017LOCAL_ARM_MODE := arm
Dmitriy Ivanovf41e8ea2014-04-10 15:45:17 -070018ifeq ($(vg_build_second_arch),true)
19LOCAL_MULTILIB := 32
Dmitriy Ivanovf41e8ea2014-04-10 15:45:17 -070020vg_local_arch := $(TARGET_2ND_ARCH)
Dimitry Ivanovff3686f2016-08-22 13:17:03 -070021vg_local_android_arch := $(TARGET_2ND_ARCH)
Dmitriy Ivanovf41e8ea2014-04-10 15:45:17 -070022else
23LOCAL_MULTILIB := first
Dmitriy Ivanovf2815ab2014-11-08 14:05:23 -080024vg_local_arch := $(vg_arch)
Dimitry Ivanovff3686f2016-08-22 13:17:03 -070025vg_local_android_arch := $(TARGET_ARCH)
Dmitriy Ivanovf41e8ea2014-04-10 15:45:17 -070026endif
27
Chih-Hung Hsieh606dc242016-08-24 19:59:10 -070028# For arm and arm64 targets, clang compiled module has other
29# undefined errors, see bug 28454823.
Dmitriy Ivanov82fb91c2014-12-05 14:37:56 -080030ifeq ($(filter $TARGET_ARCH,x86 x86_64),)
31 LOCAL_CLANG := false
32endif
33
Chih-Hung Hsieh606dc242016-08-24 19:59:10 -070034# Do not call (builtin) memset from VG(memset).
35LOCAL_CLANG_CFLAGS += -fno-builtin-memset
36
Dmitriy Ivanovf41e8ea2014-04-10 15:45:17 -070037LOCAL_MODULE := $(vg_local_module)-$(vg_local_arch)-linux
38
Dimitry Ivanovff3686f2016-08-22 13:17:03 -070039LOCAL_MODULE_TARGET_ARCH := $(vg_local_android_arch)
Ying Wang4bf606d2016-03-16 19:45:49 -070040
Dmitriy Ivanovf41e8ea2014-04-10 15:45:17 -070041LOCAL_SRC_FILES := $(vg_local_src_files)
42
43LOCAL_C_INCLUDES := $(common_includes) $(vg_local_c_includes)
44
Dmitriy Ivanovdcf50a32015-05-07 15:12:30 -070045LOCAL_PACK_MODULE_RELOCATIONS := false
46
Dmitriy Ivanovf41e8ea2014-04-10 15:45:17 -070047LOCAL_CFLAGS := $(vg_local_cflags)
Dmitriy Ivanov82fb91c2014-12-05 14:37:56 -080048LOCAL_CFLAGS_$(TARGET_ARCH) := $(vg_local_target_arch_cflags)
49LOCAL_CFLAGS_$(TARGET_2ND_ARCH) := $(vg_local_target_2nd_arch_cflags)
Dmitriy Ivanovf41e8ea2014-04-10 15:45:17 -070050
51LOCAL_ASFLAGS := $(common_cflags)
Dmitriy Ivanov82fb91c2014-12-05 14:37:56 -080052LOCAL_ASFLAGS_$(TARGET_ARCH) := $(vg_local_target_arch_cflags)
53LOCAL_ASFLAGS_$(TARGET_2ND_ARCH) := $(vg_local_target_2nd_arch_cflags)
Dmitriy Ivanovf41e8ea2014-04-10 15:45:17 -070054
55
56LOCAL_LDFLAGS := $(vg_local_ldflags)
57
Dmitriy Ivanovf41e8ea2014-04-10 15:45:17 -070058LOCAL_MODULE_CLASS := $(vg_local_module_class)
59
60LOCAL_STATIC_LIBRARIES := \
61 $(foreach l,$(vg_local_static_libraries),$l-$(vg_local_arch)-linux)
62LOCAL_WHOLE_STATIC_LIBRARIES := \
63 $(foreach l,$(vg_local_whole_static_libraries),$l-$(vg_local_arch)-linux)
64
65ifeq ($(vg_local_target),EXECUTABLE)
66 LOCAL_FORCE_STATIC_EXECUTABLE := true
Dmitriy Ivanov82fb91c2014-12-05 14:37:56 -080067 LOCAL_NO_FPIE := true
Dmitriy Ivanovf41e8ea2014-04-10 15:45:17 -070068endif
69
Dmitriy Ivanov92a86352014-05-21 16:21:59 -070070ifneq ($(vg_local_target),STATIC_LIBRARY)
Dmitriy Ivanov82fb91c2014-12-05 14:37:56 -080071 LOCAL_MODULE_PATH=$(PRODUCT_OUT)$(vg_target_module_path)
Dmitriy Ivanov92a86352014-05-21 16:21:59 -070072endif
73
Dmitriy Ivanovf41e8ea2014-04-10 15:45:17 -070074ifeq ($(vg_local_without_system_shared_libraries),true)
75 LOCAL_SYSTEM_SHARED_LIBRARIES :=
76endif
77
78ifeq ($(vg_local_no_crt),true)
79 LOCAL_NO_CRT := true
80endif
81
Dmitriy Ivanovf41e8ea2014-04-10 15:45:17 -070082include $(BUILD_$(vg_local_target))