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)
32 SplitDescription.cpp \
38 RuleGenerator_test.cpp \
39 SplitSelector_test.cpp \
57 cFlags := -Wall -Werror
59 ifeq ($(HOST_OS),linux)
60 hostLdLibs += -lrt -ldl -lpthread
63 # Statically link libz for MinGW (Win SDK under Linux),
64 # and dynamically link for all others.
65 ifneq ($(strip $(USE_MINGW)),)
66 hostStaticLibs += libz
72 # ==========================================================
73 # Build the host static library: libsplit-select
74 # ==========================================================
76 LOCAL_MODULE := libsplit-select
78 LOCAL_SRC_FILES := $(sources)
80 LOCAL_C_INCLUDES += $(cIncludes)
81 LOCAL_CFLAGS += $(cFlags) -D_DARWIN_UNLIMITED_STREAMS
83 include $(BUILD_HOST_STATIC_LIBRARY)
86 # ==========================================================
87 # Build the host tests: libsplit-select_tests
88 # ==========================================================
90 LOCAL_MODULE := libsplit-select_tests
91 LOCAL_MODULE_TAGS := tests
93 LOCAL_SRC_FILES := $(testSources)
95 LOCAL_C_INCLUDES += $(cIncludes)
96 LOCAL_STATIC_LIBRARIES += libsplit-select $(hostStaticLibs)
97 LOCAL_LDLIBS += $(hostLdLibs)
98 LOCAL_CFLAGS += $(cFlags)
100 include $(BUILD_HOST_NATIVE_TEST)
102 # ==========================================================
103 # Build the host executable: split-select
104 # ==========================================================
105 include $(CLEAR_VARS)
106 LOCAL_MODULE := split-select
108 LOCAL_SRC_FILES := $(main)
110 LOCAL_C_INCLUDES += $(cIncludes)
111 LOCAL_STATIC_LIBRARIES += libsplit-select $(hostStaticLibs)
112 LOCAL_LDLIBS += $(hostLdLibs)
113 LOCAL_CFLAGS += $(cFlags)
115 include $(BUILD_HOST_EXECUTABLE)
117 endif # No TARGET_BUILD_APPS or TARGET_BUILD_PDK