blob: 461160ad7336f62a56eebb04ed4498cc91fb298b [file] [log] [blame]
Adam Lesinski16c4d152014-01-24 13:27:13 -08001# 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
Adam Lesinski4bf58102014-11-03 11:21:19 -080017# libandroidfw is partially built for the host (used by obbtool, aapt, and others)
Adam Lesinski16c4d152014-01-24 13:27:13 -080018# These files are common to host and target builds.
19
20commonSources := \
21 Asset.cpp \
22 AssetDir.cpp \
23 AssetManager.cpp \
24 misc.cpp \
25 ObbFile.cpp \
26 ResourceTypes.cpp \
27 StreamingZipInflater.cpp \
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070028 TypeWrappers.cpp \
Adam Lesinski16c4d152014-01-24 13:27:13 -080029 ZipFileRO.cpp \
30 ZipUtils.cpp
31
32deviceSources := \
33 $(commonSources) \
34 BackupData.cpp \
35 BackupHelpers.cpp \
36 CursorWindow.cpp
37
Adam Lesinski4bf58102014-11-03 11:21:19 -080038hostSources := $(commonSources)
Adam Lesinski16c4d152014-01-24 13:27:13 -080039
40# For the host
41# =====================================================
Adam Lesinski16c4d152014-01-24 13:27:13 -080042include $(CLEAR_VARS)
Dan Albert00b4e772014-10-21 08:58:39 -070043LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Adam Lesinski16c4d152014-01-24 13:27:13 -080044
Adam Lesinski16c4d152014-01-24 13:27:13 -080045LOCAL_MODULE:= libandroidfw
Adam Lesinski16c4d152014-01-24 13:27:13 -080046LOCAL_MODULE_TAGS := optional
Adam Lesinski16c4d152014-01-24 13:27:13 -080047LOCAL_CFLAGS += -DSTATIC_ANDROIDFW_FOR_TOOLS
Andreas Gampe2204f0b2014-10-21 23:04:54 -070048LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
Adam Lesinski4bf58102014-11-03 11:21:19 -080049LOCAL_SRC_FILES:= $(hostSources)
50LOCAL_C_INCLUDES := external/zlib
Adam Lesinski16c4d152014-01-24 13:27:13 -080051
52include $(BUILD_HOST_STATIC_LIBRARY)
53
54
55# For the device
56# =====================================================
57
58include $(CLEAR_VARS)
Dan Albert00b4e772014-10-21 08:58:39 -070059LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Adam Lesinski16c4d152014-01-24 13:27:13 -080060
Adam Lesinski4bf58102014-11-03 11:21:19 -080061LOCAL_MODULE:= libandroidfw
62LOCAL_MODULE_TAGS := optional
Adam Lesinski16c4d152014-01-24 13:27:13 -080063LOCAL_SRC_FILES:= $(deviceSources)
Adam Lesinski4bf58102014-11-03 11:21:19 -080064LOCAL_C_INCLUDES := \
65 external/zlib \
66 system/core/include
67LOCAL_STATIC_LIBRARIES := libziparchive
Adam Lesinski16c4d152014-01-24 13:27:13 -080068LOCAL_SHARED_LIBRARIES := \
Andreas Gampe2204f0b2014-10-21 23:04:54 -070069 libbinder \
70 liblog \
71 libcutils \
72 libutils \
73 libz
Mathias Agopian83c64e62012-02-20 16:58:20 -080074
Andreas Gampe2204f0b2014-10-21 23:04:54 -070075LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
Adam Lesinski16c4d152014-01-24 13:27:13 -080076
Adam Lesinski16c4d152014-01-24 13:27:13 -080077include $(BUILD_SHARED_LIBRARY)
78
79
80# Include subdirectory makefiles
81# ============================================================
82
83# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
84# team really wants is to build the stuff defined by this makefile.
85ifeq (,$(ONE_SHOT_MAKEFILE))
86include $(call first-makefiles-under,$(LOCAL_PATH))
87endif