Android.mk revision 2b14c5eaf61635d1c3a69a2e59faa23cb6b7f7cb
1# Copyright (C) 2010 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
15LOCAL_PATH:= $(call my-dir)
16
17# libandroidfw is partially built for the host (used by obbtool, aapt, and others)
18# These files are common to host and target builds.
19
20commonSources := \
21    Asset.cpp \
22    AssetDir.cpp \
23    AssetManager.cpp \
24    AttributeResolution.cpp \
25    LocaleData.cpp \
26    misc.cpp \
27    ObbFile.cpp \
28    ResourceTypes.cpp \
29    StreamingZipInflater.cpp \
30    TypeWrappers.cpp \
31    ZipFileRO.cpp \
32    ZipUtils.cpp
33
34deviceSources := \
35    $(commonSources) \
36    BackupData.cpp \
37    BackupHelpers.cpp \
38    CursorWindow.cpp \
39    DisplayEventDispatcher.cpp
40
41hostSources := $(commonSources)
42
43# For the host
44# =====================================================
45include $(CLEAR_VARS)
46
47LOCAL_MODULE:= libandroidfw
48LOCAL_MODULE_HOST_OS := darwin linux windows
49LOCAL_CFLAGS += -DSTATIC_ANDROIDFW_FOR_TOOLS
50LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
51LOCAL_SRC_FILES:= $(hostSources)
52LOCAL_C_INCLUDES := external/zlib
53LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
54LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
55
56include $(BUILD_HOST_STATIC_LIBRARY)
57
58
59# For the device
60# =====================================================
61
62include $(CLEAR_VARS)
63
64LOCAL_MODULE:= libandroidfw
65LOCAL_SRC_FILES:= $(deviceSources)
66LOCAL_C_INCLUDES := \
67    system/core/include
68LOCAL_SHARED_LIBRARIES := \
69    libziparchive \
70    libbase \
71    libbinder \
72    liblog \
73    libcutils \
74    libgui \
75    libutils \
76    libz
77
78LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
79LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
80LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
81
82include $(BUILD_SHARED_LIBRARY)
83
84
85# Include subdirectory makefiles
86# ============================================================
87
88# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
89# team really wants is to build the stuff defined by this makefile.
90ifeq (,$(ONE_SHOT_MAKEFILE))
91include $(call first-makefiles-under,$(LOCAL_PATH))
92endif
93