summaryrefslogtreecommitdiffstats
path: root/vm/Android.mk
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2009-11-12 18:45:15 -0800
committerJean-Baptiste Queru <jbq@google.com>2009-11-12 18:45:15 -0800
commit72e93344b4d1ffc71e9c832ec23de0657e5b04a5 (patch)
tree1a08d1e43d54200ea737234d865c4668c5d3535b /vm/Android.mk
parentdfd0afbcb08b871e224a28ecb4ed427a7693545c (diff)
downloadandroid_dalvik-72e93344b4d1ffc71e9c832ec23de0657e5b04a5.tar.gz
android_dalvik-72e93344b4d1ffc71e9c832ec23de0657e5b04a5.tar.bz2
android_dalvik-72e93344b4d1ffc71e9c832ec23de0657e5b04a5.zip
eclair snapshot
Diffstat (limited to 'vm/Android.mk')
-rw-r--r--vm/Android.mk279
1 files changed, 44 insertions, 235 deletions
diff --git a/vm/Android.mk b/vm/Android.mk
index f3eed3f36..5c276aaec 100644
--- a/vm/Android.mk
+++ b/vm/Android.mk
@@ -12,262 +12,71 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-#
-# Android.mk for Dalvik VM. If you enable or disable optional features here,
-# rebuild the VM with "make clean-libdvm && make -j4 libdvm".
-#
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
#
-# Compiler defines.
+# Android.mk for Dalvik VM.
#
-LOCAL_CFLAGS += -fstrict-aliasing -Wstrict-aliasing=2 -fno-align-jumps
-
+# This makefile builds both for host and target, and so the very large
+# swath of common definitions are factored out into a separate file to
+# minimize duplication.
#
-# Optional features. These may impact the size or performance of the VM.
+# Also, if you enable or disable optional features here (or Dvm.mk),
+# rebuild the VM with "make clean-libdvm && make -j4 libdvm".
#
-LOCAL_CFLAGS += -DWITH_PROFILER -DWITH_DEBUGGER
-# 0=full cache, 1/2=reduced, 3=no cache
-LOCAL_CFLAGS += -DDVM_RESOLVER_CACHE=0
+LOCAL_PATH:= $(call my-dir)
-ifeq ($(WITH_DEADLOCK_PREDICTION),true)
- LOCAL_CFLAGS += -DWITH_DEADLOCK_PREDICTION
- WITH_MONITOR_TRACKING := true
-endif
-ifeq ($(WITH_MONITOR_TRACKING),true)
- LOCAL_CFLAGS += -DWITH_MONITOR_TRACKING
-endif
+#
+# Build for the target (device).
+#
-# Make DEBUG_DALVIK_VM default to true when building the simulator.
-ifeq ($(TARGET_SIMULATOR),true)
- ifeq ($(strip $(DEBUG_DALVIK_VM)),)
- DEBUG_DALVIK_VM := true
- endif
-endif
+include $(CLEAR_VARS)
-ifeq ($(strip $(DEBUG_DALVIK_VM)),true)
- #
- # "Debug" profile:
- # - debugger enabled
- # - profiling enabled
- # - tracked-reference verification enabled
- # - allocation limits enabled
- # - GDB helpers enabled
- # - LOGV
- # - assert() (NDEBUG is handled in the build system)
- #
- LOCAL_CFLAGS += -DWITH_INSTR_CHECKS -DWITH_EXTRA_OBJECT_VALIDATION
- LOCAL_CFLAGS += -DWITH_TRACKREF_CHECKS
- LOCAL_CFLAGS += -DWITH_ALLOC_LIMITS
- #LOCAL_CFLAGS += -DCHECK_MUTEX
- #LOCAL_CFLAGS += -DPROFILE_FIELD_ACCESS
- LOCAL_CFLAGS += -DDVM_SHOW_EXCEPTION=3
- # add some extra stuff to make it easier to examine with GDB
- LOCAL_CFLAGS += -DEASY_GDB
-else # !DALVIK_VM_DEBUG
- #
- # "Performance" profile:
- # - all development features disabled
- # - compiler optimizations enabled (redundant for "release" builds)
- # - (debugging and profiling still enabled)
- #
- #LOCAL_CFLAGS += -DNDEBUG -DLOG_NDEBUG=1
- # "-O2" is redundant for device (release) but useful for sim (debug)
- #LOCAL_CFLAGS += -O2 -Winline
- LOCAL_CFLAGS += -DDVM_SHOW_EXCEPTION=1
- # if you want to try with assertions on the device, add:
- #LOCAL_CFLAGS += -UNDEBUG -DDEBUG=1 -DLOG_NDEBUG=1 -DWITH_DALVIK_ASSERT
-endif # !DALVIK_VM_DEBUG
+# Variables used in the included Dvm.mk.
+dvm_os := $(TARGET_OS)
+dvm_arch := $(TARGET_ARCH)
+dvm_arch_variant := $(TARGET_ARCH_VARIANT)
+dvm_simulator := $(TARGET_SIMULATOR)
-# bug hunting: checksum and verify interpreted stack when making JNI calls
-#LOCAL_CFLAGS += -DWITH_JNI_STACK_CHECK
+include $(LOCAL_PATH)/Dvm.mk
-LOCAL_SRC_FILES := \
- AllocTracker.c \
- AtomicCache.c \
- CheckJni.c \
- Ddm.c \
- Debugger.c \
- DvmDex.c \
- Exception.c \
- Hash.c \
- Init.c \
- InlineNative.c.arm \
- Inlines.c \
- Intern.c \
- Jni.c \
- JarFile.c \
- LinearAlloc.c \
- Misc.c.arm \
- Native.c \
- PointerSet.c \
- Profile.c \
- Properties.c \
- RawDexFile.c \
- ReferenceTable.c \
- SignalCatcher.c \
- StdioConverter.c \
- Sync.c \
- Thread.c \
- UtfString.c \
- alloc/clz.c.arm \
- alloc/Alloc.c \
- alloc/HeapBitmap.c.arm \
- alloc/HeapDebug.c \
- alloc/HeapSource.c \
- alloc/HeapTable.c \
- alloc/HeapWorker.c \
- alloc/Heap.c.arm \
- alloc/MarkSweep.c.arm \
- alloc/DdmHeap.c \
- analysis/CodeVerify.c \
- analysis/DexOptimize.c \
- analysis/DexVerify.c \
- analysis/ReduceConstants.c \
- analysis/RegisterMap.c \
- analysis/VerifySubs.c \
- interp/Interp.c.arm \
- interp/Stack.c \
- jdwp/ExpandBuf.c \
- jdwp/JdwpAdb.c \
- jdwp/JdwpConstants.c \
- jdwp/JdwpEvent.c \
- jdwp/JdwpHandler.c \
- jdwp/JdwpMain.c \
- jdwp/JdwpSocket.c \
- mterp/Mterp.c.arm \
- mterp/out/InterpC-portstd.c.arm \
- mterp/out/InterpC-portdbg.c.arm \
- native/InternalNative.c \
- native/dalvik_system_DexFile.c \
- native/dalvik_system_VMDebug.c \
- native/dalvik_system_VMRuntime.c \
- native/dalvik_system_VMStack.c \
- native/dalvik_system_Zygote.c \
- native/java_lang_Class.c \
- native/java_lang_Object.c \
- native/java_lang_Runtime.c \
- native/java_lang_String.c \
- native/java_lang_System.c \
- native/java_lang_SystemProperties.c \
- native/java_lang_Throwable.c \
- native/java_lang_VMClassLoader.c \
- native/java_lang_VMThread.c \
- native/java_lang_reflect_AccessibleObject.c \
- native/java_lang_reflect_Array.c \
- native/java_lang_reflect_Constructor.c \
- native/java_lang_reflect_Field.c \
- native/java_lang_reflect_Method.c \
- native/java_lang_reflect_Proxy.c \
- native/java_security_AccessController.c \
- native/java_util_concurrent_atomic_AtomicLong.c \
- native/org_apache_harmony_dalvik_NativeTestTarget.c \
- native/org_apache_harmony_dalvik_ddmc_DdmServer.c \
- native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.c \
- native/sun_misc_Unsafe.c \
- oo/AccessCheck.c \
- oo/Array.c \
- oo/Class.c \
- oo/Object.c \
- oo/Resolve.c \
- oo/TypeCheck.c \
- reflect/Annotation.c \
- reflect/Proxy.c \
- reflect/Reflect.c \
- test/TestHash.c
+# liblog and libcutils are shared for target.
+LOCAL_SHARED_LIBRARIES += \
+ liblog libcutils
-WITH_HPROF := $(strip $(WITH_HPROF))
-ifeq ($(WITH_HPROF),)
- WITH_HPROF := true
-endif
-ifeq ($(WITH_HPROF),true)
- LOCAL_SRC_FILES += \
- hprof/Hprof.c \
- hprof/HprofClass.c \
- hprof/HprofHeap.c \
- hprof/HprofOutput.c \
- hprof/HprofString.c
- LOCAL_CFLAGS += -DWITH_HPROF=1
+LOCAL_MODULE := libdvm
- ifeq ($(strip $(WITH_HPROF_UNREACHABLE)),true)
- LOCAL_CFLAGS += -DWITH_HPROF_UNREACHABLE=1
- endif
+include $(BUILD_SHARED_LIBRARY)
- ifeq ($(strip $(WITH_HPROF_STACK)),true)
- LOCAL_SRC_FILES += \
- hprof/HprofStack.c \
- hprof/HprofStackFrame.c
- LOCAL_CFLAGS += -DWITH_HPROF_STACK=1
- endif # WITH_HPROF_STACK
-endif # WITH_HPROF
-ifeq ($(strip $(DVM_TRACK_HEAP_MARKING)),true)
- LOCAL_CFLAGS += -DDVM_TRACK_HEAP_MARKING=1
-endif
+#
+# Build for the host.
+#
-LOCAL_C_INCLUDES += \
- $(JNI_H_INCLUDE) \
- dalvik \
- dalvik/vm \
- external/zlib \
- $(KERNEL_HEADERS)
+ifeq ($(WITH_HOST_DALVIK),true)
+ include $(CLEAR_VARS)
-ifeq ($(TARGET_SIMULATOR),true)
- LOCAL_LDLIBS += -lpthread -ldl
- ifeq ($(HOST_OS),linux)
- # need this for clock_gettime() in profiling
- LOCAL_LDLIBS += -lrt
- endif
-else
- LOCAL_SHARED_LIBRARIES += libdl
-endif
+ # Variables used in the included Dvm.mk.
+ dvm_os := $(HOST_OS)
+ dvm_arch := $(HOST_ARCH)
+ dvm_arch_variant := $(HOST_ARCH_VARIANT)
+ dvm_simulator := false
-ifeq ($(TARGET_ARCH),arm)
- LOCAL_SRC_FILES += \
- arch/arm/CallOldABI.S \
- arch/arm/CallEABI.S \
- arch/arm/HintsEABI.c
- # TODO: select sources for ARMv4 vs. ARMv5TE
- LOCAL_SRC_FILES += \
- mterp/out/InterpC-armv5te.c.arm \
- mterp/out/InterpAsm-armv5te.S
- LOCAL_SHARED_LIBRARIES += libdl
-else
- ifeq ($(TARGET_ARCH),x86)
- LOCAL_SRC_FILES += \
- arch/x86/Call386ABI.S \
- arch/x86/Hints386ABI.c
- LOCAL_SRC_FILES += \
- mterp/out/InterpC-x86.c \
- mterp/out/InterpAsm-x86.S
- else
- # unknown architecture, try to use FFI
- LOCAL_C_INCLUDES += external/libffi/$(TARGET_OS)-$(TARGET_ARCH)
- LOCAL_SRC_FILES += \
- arch/generic/Call.c \
- arch/generic/Hints.c
- LOCAL_SHARED_LIBRARIES += libffi
-
- LOCAL_SRC_FILES += \
- mterp/out/InterpC-allstubs.c \
- mterp/out/InterpAsm-allstubs.S
- endif
-endif
+ include $(LOCAL_PATH)/Dvm.mk
+ # liblog and libcutils are static for host.
+ LOCAL_STATIC_LIBRARIES += \
+ liblog libcutils
-LOCAL_MODULE := libdvm
+ # libffi is called libffi-host on the host. Similarly libnativehelper.
+ LOCAL_SHARED_LIBRARIES := \
+ $(patsubst libffi,libffi-host,$(LOCAL_SHARED_LIBRARIES))
+ LOCAL_SHARED_LIBRARIES := \
+ $(patsubst libnativehelper,libnativehelper-host,$(LOCAL_SHARED_LIBRARIES))
-LOCAL_SHARED_LIBRARIES += \
- liblog \
- libcutils \
- libnativehelper \
- libz
+ LOCAL_MODULE := libdvm-host
-LOCAL_STATIC_LIBRARIES += \
- libdex
+ include $(BUILD_HOST_SHARED_LIBRARY)
-include $(BUILD_SHARED_LIBRARY)
+endif