blob: a21383ed4b6ce981ac9454244fb74bff227631f4 [file] [log] [blame]
Adam Lesinski40e8eef2014-09-16 14:43:29 -07001#
2# Copyright (C) 2014 The Android Open Source Project
3#
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
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
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.
15#
16
17# This tool is prebuilt if we're doing an app-only build.
18ifeq ($(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK)),)
19
Adam Lesinski40e8eef2014-09-16 14:43:29 -070020# ==========================================================
21# Setup some common variables for the different build
22# targets here.
23# ==========================================================
24LOCAL_PATH:= $(call my-dir)
25
26main := Main.cpp
27sources := \
28 Abi.cpp \
29 Grouper.cpp \
30 Rule.cpp \
31 RuleGenerator.cpp \
Adam Lesinski42eea272015-01-15 17:01:39 -080032 SplitDescription.cpp \
33 SplitSelector.cpp
Adam Lesinski40e8eef2014-09-16 14:43:29 -070034
35testSources := \
36 Grouper_test.cpp \
37 Rule_test.cpp \
Adam Lesinskidcdfe9f2014-11-06 12:54:36 -080038 RuleGenerator_test.cpp \
Adam Lesinski42eea272015-01-15 17:01:39 -080039 SplitSelector_test.cpp \
Adam Lesinskidcdfe9f2014-11-06 12:54:36 -080040 TestRules.cpp
Adam Lesinski40e8eef2014-09-16 14:43:29 -070041
42cIncludes := \
Adam Lesinski40e8eef2014-09-16 14:43:29 -070043 frameworks/base/tools
44
Adam Lesinski40e8eef2014-09-16 14:43:29 -070045hostStaticLibs := \
46 libaapt \
47 libandroidfw \
48 libpng \
Adam Lesinski40e8eef2014-09-16 14:43:29 -070049 libutils \
Sergio Girod90d8d62016-06-28 18:26:10 +010050 liblog \
Adam Lesinski40e8eef2014-09-16 14:43:29 -070051 libcutils \
52 libexpat \
Colin Cross9a1a3bc2016-08-26 11:15:17 -070053 libziparchive \
Dan Willemsen85aee732017-09-08 21:26:31 -070054 libbase \
55 libz
Adam Lesinski40e8eef2014-09-16 14:43:29 -070056
Adam Lesinskic3dc0b52014-11-03 12:05:15 -080057cFlags := -Wall -Werror
Adam Lesinski40e8eef2014-09-16 14:43:29 -070058
Adam Lesinski40e8eef2014-09-16 14:43:29 -070059
60# ==========================================================
61# Build the host static library: libsplit-select
62# ==========================================================
63include $(CLEAR_VARS)
64LOCAL_MODULE := libsplit-select
Dan Willemsen4aa679f2015-08-19 11:13:56 -070065LOCAL_MODULE_HOST_OS := darwin linux windows
Adam Lesinski40e8eef2014-09-16 14:43:29 -070066
67LOCAL_SRC_FILES := $(sources)
John Reckf6113af2016-11-03 16:16:47 -070068LOCAL_STATIC_LIBRARIES := $(hostStaticLibs)
Dan Willemsen4aa679f2015-08-19 11:13:56 -070069LOCAL_C_INCLUDES := $(cIncludes)
70LOCAL_CFLAGS := $(cFlags) -D_DARWIN_UNLIMITED_STREAMS
Adam Lesinski40e8eef2014-09-16 14:43:29 -070071
72include $(BUILD_HOST_STATIC_LIBRARY)
73
74
75# ==========================================================
76# Build the host tests: libsplit-select_tests
77# ==========================================================
78include $(CLEAR_VARS)
79LOCAL_MODULE := libsplit-select_tests
80LOCAL_MODULE_TAGS := tests
81
82LOCAL_SRC_FILES := $(testSources)
83
Dan Willemsen4aa679f2015-08-19 11:13:56 -070084LOCAL_C_INCLUDES := $(cIncludes)
85LOCAL_STATIC_LIBRARIES := libsplit-select $(hostStaticLibs)
Dan Willemsen4aa679f2015-08-19 11:13:56 -070086LOCAL_CFLAGS := $(cFlags)
Adam Lesinski40e8eef2014-09-16 14:43:29 -070087
88include $(BUILD_HOST_NATIVE_TEST)
89
90# ==========================================================
91# Build the host executable: split-select
92# ==========================================================
93include $(CLEAR_VARS)
94LOCAL_MODULE := split-select
Dan Willemsen4aa679f2015-08-19 11:13:56 -070095LOCAL_MODULE_HOST_OS := darwin linux windows
Adam Lesinski40e8eef2014-09-16 14:43:29 -070096
97LOCAL_SRC_FILES := $(main)
98
Dan Willemsen4aa679f2015-08-19 11:13:56 -070099LOCAL_C_INCLUDES := $(cIncludes)
100LOCAL_STATIC_LIBRARIES := libsplit-select $(hostStaticLibs)
Dan Willemsen4aa679f2015-08-19 11:13:56 -0700101LOCAL_CFLAGS := $(cFlags)
Adam Lesinski40e8eef2014-09-16 14:43:29 -0700102
103include $(BUILD_HOST_EXECUTABLE)
104
Adam Lesinski40e8eef2014-09-16 14:43:29 -0700105endif # No TARGET_BUILD_APPS or TARGET_BUILD_PDK