Carl Shapiro | 7b21670 | 2011-06-17 15:09:26 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2011 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 | |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 17 | # $(1): target or host |
| 18 | # $(2): ndebug or debug |
| 19 | define build-libart |
| 20 | include $(CLEAR_VARS) |
| 21 | ifeq ($(1),target) |
| 22 | include external/stlport/libstlport.mk |
| 23 | endif |
| 24 | LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION) |
| 25 | ifeq ($(2),ndebug) |
| 26 | LOCAL_MODULE := libart |
| 27 | else |
| 28 | LOCAL_MODULE := libartd |
| 29 | endif |
| 30 | LOCAL_MODULE_TAGS := optional |
| 31 | ifeq ($(1),target) |
| 32 | LOCAL_SRC_FILES := $(LIBART_TARGET_SRC_FILES) |
| 33 | else |
| 34 | LOCAL_SRC_FILES := $(LIBART_HOST_SRC_FILES) |
| 35 | endif |
Elliott Hughes | 1d3f114 | 2011-09-13 12:00:00 -0700 | [diff] [blame] | 36 | ifeq ($(1),target) |
| 37 | LOCAL_CFLAGS := $(ART_TARGET_CFLAGS) |
| 38 | else |
| 39 | LOCAL_CFLAGS := $(ART_HOST_CFLAGS) |
| 40 | endif |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 41 | ifeq ($(2),debug) |
| 42 | LOCAL_CFLAGS += -UNDEBUG |
| 43 | endif |
Brian Carlstrom | 69b15fb | 2011-09-03 12:25:21 -0700 | [diff] [blame] | 44 | LOCAL_C_INCLUDES += $(ART_C_INCLUDES) |
Elliott Hughes | 18c0753 | 2011-08-18 15:50:51 -0700 | [diff] [blame] | 45 | LOCAL_SHARED_LIBRARIES := liblog libnativehelper |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 46 | ifeq ($(1),target) |
Elliott Hughes | 0af5543 | 2011-08-17 18:37:28 -0700 | [diff] [blame] | 47 | LOCAL_SHARED_LIBRARIES += libcutils libstlport libz libdl |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 48 | else |
| 49 | LOCAL_SHARED_LIBRARIES += libz-host |
| 50 | LOCAL_LDLIBS := -ldl -lpthread -lrt |
| 51 | endif |
buzbee | c143c55 | 2011-08-20 17:38:58 -0700 | [diff] [blame] | 52 | LOCAL_STATIC_LIBRARIES += libdex |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 53 | ifeq ($(1),target) |
| 54 | include $(BUILD_SHARED_LIBRARY) |
| 55 | else |
| 56 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 57 | endif |
| 58 | endef |
| 59 | |
Brian Carlstrom | 4b620ff | 2011-09-11 01:11:01 -0700 | [diff] [blame] | 60 | ifeq ($(ART_BUILD_TARGET_NDEBUG),true) |
| 61 | $(eval $(call build-libart,target,ndebug)) |
| 62 | endif |
| 63 | ifeq ($(ART_BUILD_TARGET_DEBUG),true) |
| 64 | $(eval $(call build-libart,target,debug)) |
| 65 | endif |
| 66 | ifeq ($(ART_BUILD_HOST_NDEBUG),true) |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 67 | $(eval $(call build-libart,host,ndebug)) |
Brian Carlstrom | 4b620ff | 2011-09-11 01:11:01 -0700 | [diff] [blame] | 68 | endif |
| 69 | ifeq ($(ART_BUILD_HOST_DEBUG),true) |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 70 | $(eval $(call build-libart,host,debug)) |
| 71 | endif |