Adam Lesinski | 40e8eef | 2014-09-16 14:43:29 -0700 | [diff] [blame] | 1 | # |
| 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. |
| 18 | ifeq ($(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK)),) |
| 19 | |
Adam Lesinski | 40e8eef | 2014-09-16 14:43:29 -0700 | [diff] [blame] | 20 | # ========================================================== |
| 21 | # Setup some common variables for the different build |
| 22 | # targets here. |
| 23 | # ========================================================== |
| 24 | LOCAL_PATH:= $(call my-dir) |
| 25 | |
| 26 | main := Main.cpp |
| 27 | sources := \ |
| 28 | Abi.cpp \ |
| 29 | Grouper.cpp \ |
| 30 | Rule.cpp \ |
| 31 | RuleGenerator.cpp \ |
Adam Lesinski | 42eea27 | 2015-01-15 17:01:39 -0800 | [diff] [blame] | 32 | SplitDescription.cpp \ |
| 33 | SplitSelector.cpp |
Adam Lesinski | 40e8eef | 2014-09-16 14:43:29 -0700 | [diff] [blame] | 34 | |
| 35 | testSources := \ |
| 36 | Grouper_test.cpp \ |
| 37 | Rule_test.cpp \ |
Adam Lesinski | dcdfe9f | 2014-11-06 12:54:36 -0800 | [diff] [blame] | 38 | RuleGenerator_test.cpp \ |
Adam Lesinski | 42eea27 | 2015-01-15 17:01:39 -0800 | [diff] [blame] | 39 | SplitSelector_test.cpp \ |
Adam Lesinski | dcdfe9f | 2014-11-06 12:54:36 -0800 | [diff] [blame] | 40 | TestRules.cpp |
Adam Lesinski | 40e8eef | 2014-09-16 14:43:29 -0700 | [diff] [blame] | 41 | |
| 42 | cIncludes := \ |
Adam Lesinski | 40e8eef | 2014-09-16 14:43:29 -0700 | [diff] [blame] | 43 | frameworks/base/tools |
| 44 | |
Adam Lesinski | 40e8eef | 2014-09-16 14:43:29 -0700 | [diff] [blame] | 45 | hostStaticLibs := \ |
| 46 | libaapt \ |
| 47 | libandroidfw \ |
| 48 | libpng \ |
Adam Lesinski | 40e8eef | 2014-09-16 14:43:29 -0700 | [diff] [blame] | 49 | libutils \ |
Sergio Giro | d90d8d6 | 2016-06-28 18:26:10 +0100 | [diff] [blame] | 50 | liblog \ |
Adam Lesinski | 40e8eef | 2014-09-16 14:43:29 -0700 | [diff] [blame] | 51 | libcutils \ |
| 52 | libexpat \ |
Colin Cross | 9a1a3bc | 2016-08-26 11:15:17 -0700 | [diff] [blame] | 53 | libziparchive \ |
Dan Willemsen | 85aee73 | 2017-09-08 21:26:31 -0700 | [diff] [blame^] | 54 | libbase \ |
| 55 | libz |
Adam Lesinski | 40e8eef | 2014-09-16 14:43:29 -0700 | [diff] [blame] | 56 | |
Adam Lesinski | c3dc0b5 | 2014-11-03 12:05:15 -0800 | [diff] [blame] | 57 | cFlags := -Wall -Werror |
Adam Lesinski | 40e8eef | 2014-09-16 14:43:29 -0700 | [diff] [blame] | 58 | |
Adam Lesinski | 40e8eef | 2014-09-16 14:43:29 -0700 | [diff] [blame] | 59 | |
| 60 | # ========================================================== |
| 61 | # Build the host static library: libsplit-select |
| 62 | # ========================================================== |
| 63 | include $(CLEAR_VARS) |
| 64 | LOCAL_MODULE := libsplit-select |
Dan Willemsen | 4aa679f | 2015-08-19 11:13:56 -0700 | [diff] [blame] | 65 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Adam Lesinski | 40e8eef | 2014-09-16 14:43:29 -0700 | [diff] [blame] | 66 | |
| 67 | LOCAL_SRC_FILES := $(sources) |
John Reck | f6113af | 2016-11-03 16:16:47 -0700 | [diff] [blame] | 68 | LOCAL_STATIC_LIBRARIES := $(hostStaticLibs) |
Dan Willemsen | 4aa679f | 2015-08-19 11:13:56 -0700 | [diff] [blame] | 69 | LOCAL_C_INCLUDES := $(cIncludes) |
| 70 | LOCAL_CFLAGS := $(cFlags) -D_DARWIN_UNLIMITED_STREAMS |
Adam Lesinski | 40e8eef | 2014-09-16 14:43:29 -0700 | [diff] [blame] | 71 | |
| 72 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 73 | |
| 74 | |
| 75 | # ========================================================== |
| 76 | # Build the host tests: libsplit-select_tests |
| 77 | # ========================================================== |
| 78 | include $(CLEAR_VARS) |
| 79 | LOCAL_MODULE := libsplit-select_tests |
| 80 | LOCAL_MODULE_TAGS := tests |
| 81 | |
| 82 | LOCAL_SRC_FILES := $(testSources) |
| 83 | |
Dan Willemsen | 4aa679f | 2015-08-19 11:13:56 -0700 | [diff] [blame] | 84 | LOCAL_C_INCLUDES := $(cIncludes) |
| 85 | LOCAL_STATIC_LIBRARIES := libsplit-select $(hostStaticLibs) |
Dan Willemsen | 4aa679f | 2015-08-19 11:13:56 -0700 | [diff] [blame] | 86 | LOCAL_CFLAGS := $(cFlags) |
Adam Lesinski | 40e8eef | 2014-09-16 14:43:29 -0700 | [diff] [blame] | 87 | |
| 88 | include $(BUILD_HOST_NATIVE_TEST) |
| 89 | |
| 90 | # ========================================================== |
| 91 | # Build the host executable: split-select |
| 92 | # ========================================================== |
| 93 | include $(CLEAR_VARS) |
| 94 | LOCAL_MODULE := split-select |
Dan Willemsen | 4aa679f | 2015-08-19 11:13:56 -0700 | [diff] [blame] | 95 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Adam Lesinski | 40e8eef | 2014-09-16 14:43:29 -0700 | [diff] [blame] | 96 | |
| 97 | LOCAL_SRC_FILES := $(main) |
| 98 | |
Dan Willemsen | 4aa679f | 2015-08-19 11:13:56 -0700 | [diff] [blame] | 99 | LOCAL_C_INCLUDES := $(cIncludes) |
| 100 | LOCAL_STATIC_LIBRARIES := libsplit-select $(hostStaticLibs) |
Dan Willemsen | 4aa679f | 2015-08-19 11:13:56 -0700 | [diff] [blame] | 101 | LOCAL_CFLAGS := $(cFlags) |
Adam Lesinski | 40e8eef | 2014-09-16 14:43:29 -0700 | [diff] [blame] | 102 | |
| 103 | include $(BUILD_HOST_EXECUTABLE) |
| 104 | |
Adam Lesinski | 40e8eef | 2014-09-16 14:43:29 -0700 | [diff] [blame] | 105 | endif # No TARGET_BUILD_APPS or TARGET_BUILD_PDK |