Android.mk revision 59e04c6f92da584b322c87072f18e6cab4de4c60
16f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski#
26f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski# Copyright (C) 2015 The Android Open Source Project
36f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski#
46f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski# Licensed under the Apache License, Version 2.0 (the "License");
56f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski# you may not use this file except in compliance with the License.
66f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski# You may obtain a copy of the License at
76f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski#
86f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski#      http://www.apache.org/licenses/LICENSE-2.0
96f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski#
106f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski# Unless required by applicable law or agreed to in writing, software
116f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski# distributed under the License is distributed on an "AS IS" BASIS,
126f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
136f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski# See the License for the specific language governing permissions and
146f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski# limitations under the License.
156f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski#
166f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski
176f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski# This tool is prebuilt if we're doing an app-only build.
186f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinskiifeq ($(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK)),)
196f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski
206f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski# ==========================================================
216f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski# Setup some common variables for the different build
226f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski# targets here.
236f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski# ==========================================================
246f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam LesinskiLOCAL_PATH:= $(call my-dir)
256f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski
266f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinskimain := Main.cpp
276f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinskisources := \
281ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	compile/IdAssigner.cpp \
291ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	compile/Png.cpp \
30393b5f0d6130d3848dd82075986a5cf40c09ce44Adam Lesinski	compile/PseudolocaleGenerator.cpp \
31393b5f0d6130d3848dd82075986a5cf40c09ce44Adam Lesinski	compile/Pseudolocalizer.cpp \
321ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	compile/XmlIdCollector.cpp \
336a008170cb18666e04c42856f992fc7a0afa1e1fAdam Lesinski	filter/ConfigFilter.cpp \
341ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	flatten/Archive.cpp \
351ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	flatten/TableFlattener.cpp \
361ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	flatten/XmlFlattener.cpp \
37a6fe345be955368a13aea76aefb4db821aad11dfAdam Lesinski	io/FileSystem.cpp \
38a6fe345be955368a13aea76aefb4db821aad11dfAdam Lesinski	io/ZipArchive.cpp \
391ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	link/AutoVersioner.cpp \
402ae4a877d1623f851040ce69239552c873f1abf0Adam Lesinski	link/ManifestFixer.cpp \
411ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	link/PrivateAttributeMover.cpp \
421ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	link/ReferenceLinker.cpp \
431ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	link/TableMerger.cpp \
441ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	link/XmlReferenceLinker.cpp \
451ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	process/SymbolTable.cpp \
4659e04c6f92da584b322c87072f18e6cab4de4c60Adam Lesinski	proto/ProtoHelpers.cpp \
4759e04c6f92da584b322c87072f18e6cab4de4c60Adam Lesinski	proto/TableProtoDeserializer.cpp \
4859e04c6f92da584b322c87072f18e6cab4de4c60Adam Lesinski	proto/TableProtoSerializer.cpp \
491ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	unflatten/BinaryResourceParser.cpp \
501ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	unflatten/ResChunkPullParser.cpp \
511ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	util/BigBuffer.cpp \
521ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	util/Files.cpp \
531ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	util/Util.cpp \
546f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski	ConfigDescription.cpp \
55330edcdf1316ed599fe0eb16a64330821fd92f18Adam Lesinski	Debug.cpp \
561ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	Flags.cpp \
57ca5638fd85098c3d0a699492751043545f75553aAdam Lesinski	java/AnnotationProcessor.cpp \
58ca5638fd85098c3d0a699492751043545f75553aAdam Lesinski	java/JavaClassGenerator.cpp \
59ca5638fd85098c3d0a699492751043545f75553aAdam Lesinski	java/ManifestClassGenerator.cpp \
60ca5638fd85098c3d0a699492751043545f75553aAdam Lesinski	java/ProguardRules.cpp \
616f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski	Locale.cpp \
626f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski	Resource.cpp \
636f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski	ResourceParser.cpp \
646f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski	ResourceTable.cpp \
651ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	ResourceUtils.cpp \
666f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski	ResourceValues.cpp \
676f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski	SdkConstants.cpp \
686f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski	StringPool.cpp \
69467f171315f9c2037fcd3eb5edcfabc40671bf7bAdam Lesinski	xml/XmlDom.cpp \
70467f171315f9c2037fcd3eb5edcfabc40671bf7bAdam Lesinski	xml/XmlPullParser.cpp \
71467f171315f9c2037fcd3eb5edcfabc40671bf7bAdam Lesinski	xml/XmlUtil.cpp
726f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski
7359e04c6f92da584b322c87072f18e6cab4de4c60Adam Lesinskisources += Format.proto
7459e04c6f92da584b322c87072f18e6cab4de4c60Adam Lesinski
756f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam LesinskitestSources := \
761ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	compile/IdAssigner_test.cpp \
77393b5f0d6130d3848dd82075986a5cf40c09ce44Adam Lesinski	compile/PseudolocaleGenerator_test.cpp \
78393b5f0d6130d3848dd82075986a5cf40c09ce44Adam Lesinski	compile/Pseudolocalizer_test.cpp \
791ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	compile/XmlIdCollector_test.cpp \
806a008170cb18666e04c42856f992fc7a0afa1e1fAdam Lesinski	filter/ConfigFilter_test.cpp \
811ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	flatten/TableFlattener_test.cpp \
821ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	flatten/XmlFlattener_test.cpp \
831ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	link/AutoVersioner_test.cpp \
842ae4a877d1623f851040ce69239552c873f1abf0Adam Lesinski	link/ManifestFixer_test.cpp \
851ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	link/PrivateAttributeMover_test.cpp \
861ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	link/ReferenceLinker_test.cpp \
871ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	link/TableMerger_test.cpp \
881ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	link/XmlReferenceLinker_test.cpp \
891ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	process/SymbolTable_test.cpp \
9059e04c6f92da584b322c87072f18e6cab4de4c60Adam Lesinski	proto/TableProtoSerializer_test.cpp \
911ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	util/BigBuffer_test.cpp \
921ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	util/Maybe_test.cpp \
931ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	util/StringPiece_test.cpp \
941ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	util/Util_test.cpp \
956f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski	ConfigDescription_test.cpp \
96b274e35abfbbd09e0fce983a215c11522c56cce2Adam Lesinski	java/AnnotationProcessor_test.cpp \
97ca5638fd85098c3d0a699492751043545f75553aAdam Lesinski	java/JavaClassGenerator_test.cpp \
98ca5638fd85098c3d0a699492751043545f75553aAdam Lesinski	java/ManifestClassGenerator_test.cpp \
996f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski	Locale_test.cpp \
1006f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski	Resource_test.cpp \
1011ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	ResourceParser_test.cpp \
1026f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski	ResourceTable_test.cpp \
1031ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	ResourceUtils_test.cpp \
1046f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski	StringPool_test.cpp \
1051ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	ValueVisitor_test.cpp \
106467f171315f9c2037fcd3eb5edcfabc40671bf7bAdam Lesinski	xml/XmlDom_test.cpp \
107467f171315f9c2037fcd3eb5edcfabc40671bf7bAdam Lesinski	xml/XmlPullParser_test.cpp \
108467f171315f9c2037fcd3eb5edcfabc40671bf7bAdam Lesinski	xml/XmlUtil_test.cpp
1091ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski
1101ab598f46c3ff520a67f9d80194847741f3467abAdam LesinskitoolSources := \
1111ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	compile/Compile.cpp \
11259e04c6f92da584b322c87072f18e6cab4de4c60Adam Lesinski	dump/Dump.cpp \
1131ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski	link/Link.cpp
1146f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski
115feefeb4f308261907f5ea5705d66736d45633a27Adam LesinskihostLdLibs :=
1166f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski
1176f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam LesinskihostStaticLibs := \
1186f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski	libandroidfw \
1196f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski	libutils \
1206f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski	liblog \
1216f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski	libcutils \
1226f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski	libexpat \
12398aa3ad6e46e3b0270785c8b3f9798e37e8af140Adam Lesinski	libziparchive-host \
124231e054dfd9dfc2e51ecd41dca5e8d93ae648954Narayan Kamath	libpng \
125231e054dfd9dfc2e51ecd41dca5e8d93ae648954Narayan Kamath	libbase
1266f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski
12759e04c6f92da584b322c87072f18e6cab4de4c60Adam LesinskihostSharedLibs := \
12859e04c6f92da584b322c87072f18e6cab4de4c60Adam Lesinski	libprotobuf-cpp-lite
12959e04c6f92da584b322c87072f18e6cab4de4c60Adam Lesinski
130feefeb4f308261907f5ea5705d66736d45633a27Adam Lesinskiifneq ($(strip $(USE_MINGW)),)
131feefeb4f308261907f5ea5705d66736d45633a27Adam Lesinski	hostStaticLibs += libz
132feefeb4f308261907f5ea5705d66736d45633a27Adam Lesinskielse
133feefeb4f308261907f5ea5705d66736d45633a27Adam Lesinski	hostLdLibs += -lz
134feefeb4f308261907f5ea5705d66736d45633a27Adam Lesinskiendif
135feefeb4f308261907f5ea5705d66736d45633a27Adam Lesinski
1366f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam LesinskicFlags := -Wall -Werror -Wno-unused-parameter -UNDEBUG
1372ae4a877d1623f851040ce69239552c873f1abf0Adam LesinskicppFlags := -std=c++11 -Wno-missing-field-initializers -fno-exceptions -fno-rtti
13859e04c6f92da584b322c87072f18e6cab4de4c60Adam LesinskiprotoIncludes := $(call generated-sources-dir-for,STATIC_LIBRARIES,libaapt2,HOST)
1396f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski
1406f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski# ==========================================================
1416f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski# Build the host static library: libaapt2
1426f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski# ==========================================================
1436f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinskiinclude $(CLEAR_VARS)
14459e04c6f92da584b322c87072f18e6cab4de4c60Adam LesinskiLOCAL_MODULE_CLASS := STATIC_LIBRARIES
1456f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam LesinskiLOCAL_MODULE := libaapt2
1466f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski
1476f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam LesinskiLOCAL_SRC_FILES := $(sources)
14851348d2007b801c7bd7350f72e2300f1a5a41dd1Elliott HughesLOCAL_STATIC_LIBRARIES += $(hostStaticLibs)
1496f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam LesinskiLOCAL_CFLAGS += $(cFlags)
1506f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam LesinskiLOCAL_CPPFLAGS += $(cppFlags)
15159e04c6f92da584b322c87072f18e6cab4de4c60Adam LesinskiLOCAL_C_INCLUDES += $(protoIncludes)
1526f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski
1536f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinskiinclude $(BUILD_HOST_STATIC_LIBRARY)
1546f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski
1556f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski# ==========================================================
1566f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski# Build the host tests: libaapt2_tests
1576f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski# ==========================================================
1586f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinskiinclude $(CLEAR_VARS)
1596f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam LesinskiLOCAL_MODULE := libaapt2_tests
1606f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam LesinskiLOCAL_MODULE_TAGS := tests
1616f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski
1626f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam LesinskiLOCAL_SRC_FILES := $(testSources)
1636f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski
1646f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam LesinskiLOCAL_STATIC_LIBRARIES += libaapt2 $(hostStaticLibs)
16559e04c6f92da584b322c87072f18e6cab4de4c60Adam LesinskiLOCAL_SHARED_LIBRARIES += $(hostSharedLibs)
1666f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam LesinskiLOCAL_LDLIBS += $(hostLdLibs)
1676f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam LesinskiLOCAL_CFLAGS += $(cFlags)
1686f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam LesinskiLOCAL_CPPFLAGS += $(cppFlags)
16959e04c6f92da584b322c87072f18e6cab4de4c60Adam LesinskiLOCAL_C_INCLUDES += $(protoIncludes)
1706f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski
1716f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinskiinclude $(BUILD_HOST_NATIVE_TEST)
1726f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski
1736f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski# ==========================================================
1746f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski# Build the host executable: aapt2
1756f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski# ==========================================================
1766f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinskiinclude $(CLEAR_VARS)
1776f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam LesinskiLOCAL_MODULE := aapt2
1786f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski
1791ab598f46c3ff520a67f9d80194847741f3467abAdam LesinskiLOCAL_SRC_FILES := $(main) $(toolSources)
1806f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski
1816f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam LesinskiLOCAL_STATIC_LIBRARIES += libaapt2 $(hostStaticLibs)
18259e04c6f92da584b322c87072f18e6cab4de4c60Adam LesinskiLOCAL_SHARED_LIBRARIES += $(hostSharedLibs)
1836f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam LesinskiLOCAL_LDLIBS += $(hostLdLibs)
1846f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam LesinskiLOCAL_CFLAGS += $(cFlags)
1856f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam LesinskiLOCAL_CPPFLAGS += $(cppFlags)
18659e04c6f92da584b322c87072f18e6cab4de4c60Adam LesinskiLOCAL_C_INCLUDES += $(protoIncludes)
1876f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski
1886f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinskiinclude $(BUILD_HOST_EXECUTABLE)
1896f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinski
1906f6ceb7e1456698b1f33e04536bfb3227f9fcfcbAdam Lesinskiendif # No TARGET_BUILD_APPS or TARGET_BUILD_PDK
191