blob: 328f60a375077beea97ac973aa88111eb9d8beb9 [file] [log] [blame]
Brian Carlstrom69b15fb2011-09-03 12:25:21 -07001#
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
17ART_HOST_EXECUTABLES :=
18ART_TARGET_EXECUTABLES :=
19
20# $(1): executable ("d" will be appended for debug version)
21# $(2): source
22# $(3): target or host
23# $(4): ndebug or debug
24define build-art-executable
25 include $(CLEAR_VARS)
26 ifeq ($(3),target)
27 include external/stlport/libstlport.mk
28 endif
29 LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION)
30 ifeq ($(4),ndebug)
31 LOCAL_MODULE := $(1)
32 else
33 LOCAL_MODULE := $(1)d
34 endif
35 LOCAL_MODULE_TAGS := optional
36 LOCAL_SRC_FILES := $(2)
37 LOCAL_CFLAGS := $(ART_CFLAGS)
38 ifeq ($(4),debug)
39 LOCAL_CFLAGS += -UNDEBUG
40 endif
41 LOCAL_C_INCLUDES += $(ART_C_INCLUDES)
42 LOCAL_SHARED_LIBRARIES := libnativehelper
43 ifeq ($(4),ndebug)
44 LOCAL_SHARED_LIBRARIES += libart
45 else
46 LOCAL_SHARED_LIBRARIES += libartd
47 endif
48 ifeq ($(3),target)
49 LOCAL_SHARED_LIBRARIES += libstlport
50 endif
51 ifeq ($(3),target)
52 include $(BUILD_EXECUTABLE)
53 else
54 include $(BUILD_HOST_EXECUTABLE)
55 endif
56 ifeq ($(1),target)
57 ART_TARGET_EXECUTABLES += $(TARGET_OUT_EXECUTABLES)/$$(LOCAL_MODULE)
58 else
59 ART_HOST_EXECUTABLES += $(HOST_OUT_EXECUTABLES)/$$(LOCAL_MODULE)
60 endif
61endef
62
63$(eval $(call build-art-executable,dex2oat,$(DEX2OAT_SRC_FILES),target,ndebug))
64$(eval $(call build-art-executable,dex2oat,$(DEX2OAT_SRC_FILES),target,debug))
65ifeq ($(WITH_HOST_DALVIK),true)
66 $(eval $(call build-art-executable,dex2oat,$(DEX2OAT_SRC_FILES),host,ndebug))
67 $(eval $(call build-art-executable,dex2oat,$(DEX2OAT_SRC_FILES),host,debug))
68endif
69
70$(eval $(call build-art-executable,oatexec,$(OATEXEC_SRC_FILES),target,ndebug))
71$(eval $(call build-art-executable,oatexec,$(OATEXEC_SRC_FILES),target,debug))
72ifeq ($(WITH_HOST_DALVIK),true)
73 $(eval $(call build-art-executable,oatexec,$(OATEXEC_SRC_FILES),host,ndebug))
74 $(eval $(call build-art-executable,oatexec,$(OATEXEC_SRC_FILES),host,debug))
75endif
76