2 # Copyright (C) 2014 The Android Open Source Project
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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.
17 # This tool is prebuilt if we're doing an app-only build.
18 ifeq ($(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK)),)
20 # ==========================================================
21 # Setup some common variables for the different build
23 # ==========================================================
24 LOCAL_PATH:= $(call my-dir)
51 tests/AaptConfig_test.cpp \
52 tests/AaptGroupEntry_test.cpp \
53 tests/Pseudolocales_test.cpp \
54 tests/ResourceFilter_test.cpp \
55 tests/ResourceTable_test.cpp
58 system/core/base/include \
63 aaptHostStaticLibs := \
73 aaptCFlags := -DAAPT_VERSION=\"$(BUILD_NUMBER)\"
74 aaptCFlags += -Wall -Werror
76 ifeq ($(HOST_OS),linux)
77 aaptHostLdLibs += -lrt -ldl -lpthread
80 # Statically link libz for MinGW (Win SDK under Linux),
81 # and dynamically link for all others.
82 ifneq ($(strip $(USE_MINGW)),)
83 aaptHostStaticLibs += libz
89 # ==========================================================
90 # Build the host static library: libaapt
91 # ==========================================================
94 LOCAL_MODULE := libaapt
95 LOCAL_CFLAGS += -Wno-format-y2k -DSTATIC_ANDROIDFW_FOR_TOOLS $(aaptCFlags)
96 LOCAL_CPPFLAGS += $(aaptCppFlags)
97 ifeq (darwin,$(HOST_OS))
98 LOCAL_CFLAGS += -D_DARWIN_UNLIMITED_STREAMS
100 LOCAL_C_INCLUDES += $(aaptCIncludes)
101 LOCAL_SRC_FILES := $(aaptSources)
103 include $(BUILD_HOST_STATIC_LIBRARY)
105 # ==========================================================
106 # Build the host executable: aapt
107 # ==========================================================
108 include $(CLEAR_VARS)
111 LOCAL_CFLAGS += $(aaptCFlags)
112 LOCAL_CPPFLAGS += $(aaptCppFlags)
113 LOCAL_LDLIBS += $(aaptHostLdLibs)
114 LOCAL_SRC_FILES := $(aaptMain)
115 LOCAL_STATIC_LIBRARIES += libaapt $(aaptHostStaticLibs)
117 include $(BUILD_HOST_EXECUTABLE)
120 # ==========================================================
121 # Build the host tests: libaapt_tests
122 # ==========================================================
123 include $(CLEAR_VARS)
124 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
126 LOCAL_MODULE := libaapt_tests
127 LOCAL_CFLAGS += $(aaptCFlags)
128 LOCAL_CPPFLAGS += $(aaptCppFlags)
129 LOCAL_LDLIBS += $(aaptHostLdLibs)
130 LOCAL_SRC_FILES += $(aaptTests)
131 LOCAL_C_INCLUDES += $(LOCAL_PATH)
132 LOCAL_STATIC_LIBRARIES += libaapt $(aaptHostStaticLibs)
134 include $(BUILD_HOST_NATIVE_TEST)
137 endif # No TARGET_BUILD_APPS or TARGET_BUILD_PDK