2 # Copyright (C) 2015 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)
29 BinaryResourceParser.cpp \
30 ConfigDescription.cpp \
33 JavaClassGenerator.cpp \
38 ManifestValidator.cpp \
40 ResChunkPullParser.cpp \
50 ScopedXmlPullParser.cpp \
51 SourceXmlPullParser.cpp \
52 XliffXmlPullParser.cpp \
58 ConfigDescription_test.cpp \
59 JavaClassGenerator_test.cpp \
62 ManifestParser_test.cpp \
64 ResourceParser_test.cpp \
66 ResourceTable_test.cpp \
67 ScopedXmlPullParser_test.cpp \
68 StringPiece_test.cpp \
71 XliffXmlPullParser_test.cpp \
89 ifneq ($(strip $(USE_MINGW)),)
90 hostStaticLibs += libz
95 cFlags := -Wall -Werror -Wno-unused-parameter -UNDEBUG
96 cppFlags := -std=c++11 -Wno-missing-field-initializers
98 # ==========================================================
99 # Build the host static library: libaapt2
100 # ==========================================================
101 include $(CLEAR_VARS)
102 LOCAL_MODULE := libaapt2
104 LOCAL_SRC_FILES := $(sources)
105 LOCAL_C_INCLUDES += $(cIncludes)
106 LOCAL_CFLAGS += $(cFlags)
107 LOCAL_CPPFLAGS += $(cppFlags)
109 include $(BUILD_HOST_STATIC_LIBRARY)
112 # ==========================================================
113 # Build the host tests: libaapt2_tests
114 # ==========================================================
115 include $(CLEAR_VARS)
116 LOCAL_MODULE := libaapt2_tests
117 LOCAL_MODULE_TAGS := tests
119 LOCAL_SRC_FILES := $(testSources)
121 LOCAL_C_INCLUDES += $(cIncludes)
122 LOCAL_STATIC_LIBRARIES += libaapt2 $(hostStaticLibs)
123 LOCAL_LDLIBS += $(hostLdLibs)
124 LOCAL_CFLAGS += $(cFlags)
125 LOCAL_CPPFLAGS += $(cppFlags)
127 include $(BUILD_HOST_NATIVE_TEST)
129 # ==========================================================
130 # Build the host executable: aapt2
131 # ==========================================================
132 include $(CLEAR_VARS)
133 LOCAL_MODULE := aapt2
135 LOCAL_SRC_FILES := $(main)
137 LOCAL_C_INCLUDES += $(cIncludes)
138 LOCAL_STATIC_LIBRARIES += libaapt2 $(hostStaticLibs)
139 LOCAL_LDLIBS += $(hostLdLibs)
140 LOCAL_CFLAGS += $(cFlags)
141 LOCAL_CPPFLAGS += $(cppFlags)
143 include $(BUILD_HOST_EXECUTABLE)
145 endif # No TARGET_BUILD_APPS or TARGET_BUILD_PDK