blob: 5877e2fcc4f5259c79065e4960e9690b4f2b440d [file] [log] [blame]
Carl Shapiro7b216702011-06-17 15:09:26 -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
Brian Carlstrom07d579f2011-07-27 13:31:51 -070017# $(1): target or host
18# $(2): ndebug or debug
19define 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
36 LOCAL_CFLAGS := $(ART_CFLAGS)
37 ifeq ($(2),debug)
38 LOCAL_CFLAGS += -UNDEBUG
39 endif
Brian Carlstromb0460ea2011-07-29 10:08:05 -070040 LOCAL_C_INCLUDES += src $(ART_C_INCLUDES)
Elliott Hughes18c07532011-08-18 15:50:51 -070041 LOCAL_SHARED_LIBRARIES := liblog libnativehelper
Brian Carlstrom07d579f2011-07-27 13:31:51 -070042 ifeq ($(1),target)
Elliott Hughes0af55432011-08-17 18:37:28 -070043 LOCAL_SHARED_LIBRARIES += libcutils libstlport libz libdl
Brian Carlstrom07d579f2011-07-27 13:31:51 -070044 else
45 LOCAL_SHARED_LIBRARIES += libz-host
46 LOCAL_LDLIBS := -ldl -lpthread -lrt
47 endif
buzbeec143c552011-08-20 17:38:58 -070048 LOCAL_STATIC_LIBRARIES += libdex
Brian Carlstrom07d579f2011-07-27 13:31:51 -070049 ifeq ($(1),target)
50 include $(BUILD_SHARED_LIBRARY)
51 else
52 include $(BUILD_HOST_SHARED_LIBRARY)
53 endif
54endef
55
56$(eval $(call build-libart,target,ndebug))
57$(eval $(call build-libart,target,debug))
58ifeq ($(WITH_HOST_DALVIK),true)
59 $(eval $(call build-libart,host,ndebug))
60 $(eval $(call build-libart,host,debug))
61endif