The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 1 | # Copyright (C) 2008 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 | # |
Dan Bornstein | 4212241 | 2009-07-21 16:08:39 -0700 | [diff] [blame] | 16 | # Android.mk for Dalvik VM. |
| 17 | # |
| 18 | # This makefile builds both for host and target, and so the very large |
| 19 | # swath of common definitions are factored out into a separate file to |
| 20 | # minimize duplication. |
| 21 | # |
Andy McFadden | 12def72 | 2009-12-01 15:53:41 -0800 | [diff] [blame] | 22 | # If you enable or disable optional features here (or in Dvm.mk), |
| 23 | # rebuild the VM with: |
| 24 | # |
| 25 | # make clean-libdvm clean-libdvm_assert clean-libdvm_sv clean-libdvm_interp |
| 26 | # make -j4 libdvm |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 27 | # |
Dan Bornstein | 4212241 | 2009-07-21 16:08:39 -0700 | [diff] [blame] | 28 | |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 29 | LOCAL_PATH:= $(call my-dir) |
Dan Bornstein | 4212241 | 2009-07-21 16:08:39 -0700 | [diff] [blame] | 30 | |
| 31 | # |
| 32 | # Build for the target (device). |
| 33 | # |
| 34 | |
Bill Buzbee | 02388cf | 2010-03-23 14:34:11 -0700 | [diff] [blame^] | 35 | ifeq ($(TARGET_ARCH_VARIANT),armv5te) |
| 36 | WITH_JIT := false |
| 37 | endif |
| 38 | |
Ben Cheng | bb0dce5 | 2009-11-03 16:19:11 -0800 | [diff] [blame] | 39 | # Build the installed version (libdvm.so) first |
| 40 | include $(LOCAL_PATH)/ReconfigureDvm.mk |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 41 | |
Ben Cheng | bb0dce5 | 2009-11-03 16:19:11 -0800 | [diff] [blame] | 42 | # Overwrite default settings |
| 43 | ifeq ($(TARGET_SIMULATOR),false) |
| 44 | LOCAL_PRELINK_MODULE := true |
| 45 | endif |
| 46 | LOCAL_MODULE_TAGS := user |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 47 | LOCAL_MODULE := libdvm |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 48 | include $(BUILD_SHARED_LIBRARY) |
Dan Bornstein | 4212241 | 2009-07-21 16:08:39 -0700 | [diff] [blame] | 49 | |
Ben Cheng | bb0dce5 | 2009-11-03 16:19:11 -0800 | [diff] [blame] | 50 | # If WITH_JIT is configured, build multiple versions of libdvm.so to facilitate |
| 51 | # correctness/performance bugs triage |
| 52 | ifeq ($(WITH_JIT),true) |
| 53 | |
| 54 | # Derivation #1 |
| 55 | # Enable assert and JIT tuning |
| 56 | include $(LOCAL_PATH)/ReconfigureDvm.mk |
| 57 | |
Elliott Hughes | b4c0597 | 2010-02-24 16:36:18 -0800 | [diff] [blame] | 58 | # Enable assertions and JIT-tuning |
Ben Cheng | bb0dce5 | 2009-11-03 16:19:11 -0800 | [diff] [blame] | 59 | LOCAL_CFLAGS += -UNDEBUG -DDEBUG=1 -DLOG_NDEBUG=1 -DWITH_DALVIK_ASSERT \ |
Ben Cheng | 86717f7 | 2010-03-05 15:27:21 -0800 | [diff] [blame] | 60 | -DWITH_JIT_TUNING -DJIT_STATS |
Ben Cheng | bb0dce5 | 2009-11-03 16:19:11 -0800 | [diff] [blame] | 61 | LOCAL_MODULE := libdvm_assert |
| 62 | include $(BUILD_SHARED_LIBRARY) |
| 63 | |
| 64 | # Derivation #2 |
| 65 | # Enable assert and self-verification |
| 66 | include $(LOCAL_PATH)/ReconfigureDvm.mk |
| 67 | |
Elliott Hughes | b4c0597 | 2010-02-24 16:36:18 -0800 | [diff] [blame] | 68 | # Enable assertions and JIT self-verification |
Ben Cheng | bb0dce5 | 2009-11-03 16:19:11 -0800 | [diff] [blame] | 69 | LOCAL_CFLAGS += -UNDEBUG -DDEBUG=1 -DLOG_NDEBUG=1 -DWITH_DALVIK_ASSERT \ |
| 70 | -DWITH_SELF_VERIFICATION |
| 71 | LOCAL_MODULE := libdvm_sv |
| 72 | include $(BUILD_SHARED_LIBRARY) |
| 73 | |
| 74 | # Devivation #3 |
| 75 | # Compile out the JIT |
| 76 | WITH_JIT := false |
| 77 | include $(LOCAL_PATH)/ReconfigureDvm.mk |
| 78 | |
| 79 | LOCAL_MODULE := libdvm_interp |
| 80 | include $(BUILD_SHARED_LIBRARY) |
| 81 | |
| 82 | endif |
Dan Bornstein | 4212241 | 2009-07-21 16:08:39 -0700 | [diff] [blame] | 83 | |
| 84 | # |
| 85 | # Build for the host. |
| 86 | # |
| 87 | |
| 88 | ifeq ($(WITH_HOST_DALVIK),true) |
| 89 | |
| 90 | include $(CLEAR_VARS) |
| 91 | |
| 92 | # Variables used in the included Dvm.mk. |
| 93 | dvm_os := $(HOST_OS) |
| 94 | dvm_arch := $(HOST_ARCH) |
| 95 | dvm_arch_variant := $(HOST_ARCH_VARIANT) |
| 96 | dvm_simulator := false |
| 97 | |
| 98 | include $(LOCAL_PATH)/Dvm.mk |
| 99 | |
Dan Bornstein | 524fea1 | 2009-10-23 13:25:03 -0700 | [diff] [blame] | 100 | # We need to include all of these libraries. The end result of this |
| 101 | # section is a static library, but LOCAL_STATIC_LIBRARIES doesn't |
| 102 | # actually cause any code from the specified libraries to be included, |
| 103 | # whereas LOCAL_WHOLE_STATIC_LIBRARIES does. No, I (danfuzz) am not |
| 104 | # entirely sure what LOCAL_STATIC_LIBRARIES is even supposed to mean |
| 105 | # in this context, but it is in (apparently) meaningfully used in |
| 106 | # other parts of the build. |
Dan Bornstein | 22620b8 | 2009-10-16 10:51:23 -0700 | [diff] [blame] | 107 | LOCAL_WHOLE_STATIC_LIBRARIES += \ |
Dan Bornstein | 524fea1 | 2009-10-23 13:25:03 -0700 | [diff] [blame] | 108 | libnativehelper-host libdex liblog libcutils |
Dan Bornstein | 4212241 | 2009-07-21 16:08:39 -0700 | [diff] [blame] | 109 | |
Dan Bornstein | d45a48f | 2009-10-22 15:58:32 -0700 | [diff] [blame] | 110 | # The libffi from the source tree should never be used by host builds. |
| 111 | # The recommendation is that host builds should always either |
| 112 | # have sufficient custom code so that libffi isn't needed at all, |
| 113 | # or they should use the platform's provided libffi. So, if the common |
| 114 | # build rules decided to include it, axe it back out here. |
Dan Bornstein | 93194e9 | 2009-08-24 17:50:34 -0700 | [diff] [blame] | 115 | ifneq (,$(findstring libffi,$(LOCAL_SHARED_LIBRARIES))) |
| 116 | LOCAL_SHARED_LIBRARIES := \ |
| 117 | $(patsubst libffi, ,$(LOCAL_SHARED_LIBRARIES)) |
Dan Bornstein | 93194e9 | 2009-08-24 17:50:34 -0700 | [diff] [blame] | 118 | endif |
Dan Bornstein | d45a48f | 2009-10-22 15:58:32 -0700 | [diff] [blame] | 119 | |
Dan Bornstein | 4212241 | 2009-07-21 16:08:39 -0700 | [diff] [blame] | 120 | LOCAL_MODULE := libdvm-host |
| 121 | |
Dan Bornstein | 93194e9 | 2009-08-24 17:50:34 -0700 | [diff] [blame] | 122 | include $(BUILD_HOST_STATIC_LIBRARY) |
Dan Bornstein | 4212241 | 2009-07-21 16:08:39 -0700 | [diff] [blame] | 123 | |
| 124 | endif |