1#
2# Copyright (C) 2015 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
17LOCAL_PATH := $(call my-dir)
18
19libbase_src_files := \
20    file.cpp \
21    logging.cpp \
22    parsenetaddress.cpp \
23    stringprintf.cpp \
24    strings.cpp \
25    test_utils.cpp \
26
27libbase_linux_src_files := \
28    errors_unix.cpp \
29
30libbase_darwin_src_files := \
31    errors_unix.cpp \
32
33libbase_windows_src_files := \
34    errors_windows.cpp \
35    utf8.cpp \
36
37libbase_test_src_files := \
38    errors_test.cpp \
39    file_test.cpp \
40    logging_test.cpp \
41    parseint_test.cpp \
42    parsenetaddress_test.cpp \
43    stringprintf_test.cpp \
44    strings_test.cpp \
45    test_main.cpp \
46
47libbase_test_windows_src_files := \
48    utf8_test.cpp \
49
50libbase_cppflags := \
51    -Wall \
52    -Wextra \
53    -Werror \
54
55libbase_linux_cppflags := \
56    -Wexit-time-destructors \
57
58libbase_darwin_cppflags := \
59    -Wexit-time-destructors \
60
61# Device
62# ------------------------------------------------------------------------------
63include $(CLEAR_VARS)
64LOCAL_MODULE := libbase
65LOCAL_CLANG := true
66LOCAL_SRC_FILES := $(libbase_src_files) $(libbase_linux_src_files)
67LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
68LOCAL_CPPFLAGS := $(libbase_cppflags) $(libbase_linux_cppflags)
69LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
70LOCAL_STATIC_LIBRARIES := liblog
71LOCAL_MULTILIB := both
72include $(BUILD_STATIC_LIBRARY)
73
74include $(CLEAR_VARS)
75LOCAL_MODULE := libbase
76LOCAL_CLANG := true
77LOCAL_WHOLE_STATIC_LIBRARIES := libbase
78LOCAL_SHARED_LIBRARIES := liblog
79LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
80LOCAL_MULTILIB := both
81include $(BUILD_SHARED_LIBRARY)
82
83# Host
84# ------------------------------------------------------------------------------
85include $(CLEAR_VARS)
86LOCAL_MODULE := libbase
87LOCAL_SRC_FILES := $(libbase_src_files)
88LOCAL_SRC_FILES_darwin := $(libbase_darwin_src_files)
89LOCAL_SRC_FILES_linux := $(libbase_linux_src_files)
90LOCAL_SRC_FILES_windows := $(libbase_windows_src_files)
91LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
92LOCAL_CPPFLAGS := $(libbase_cppflags)
93LOCAL_CPPFLAGS_darwin := $(libbase_darwin_cppflags)
94LOCAL_CPPFLAGS_linux := $(libbase_linux_cppflags)
95LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
96LOCAL_STATIC_LIBRARIES := liblog
97LOCAL_MULTILIB := both
98LOCAL_MODULE_HOST_OS := darwin linux windows
99include $(BUILD_HOST_STATIC_LIBRARY)
100
101include $(CLEAR_VARS)
102LOCAL_MODULE := libbase
103LOCAL_WHOLE_STATIC_LIBRARIES := libbase
104LOCAL_SHARED_LIBRARIES := liblog
105LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
106LOCAL_MULTILIB := both
107LOCAL_MODULE_HOST_OS := darwin linux windows
108include $(BUILD_HOST_SHARED_LIBRARY)
109
110# Tests
111# ------------------------------------------------------------------------------
112include $(CLEAR_VARS)
113LOCAL_MODULE := libbase_test
114LOCAL_CLANG := true
115LOCAL_SRC_FILES := $(libbase_test_src_files)
116LOCAL_SRC_FILES_darwin := $(libbase_test_darwin_src_files)
117LOCAL_SRC_FILES_linux := $(libbase_test_linux_src_files)
118LOCAL_SRC_FILES_windows := $(libbase_test_windows_src_files)
119LOCAL_C_INCLUDES := $(LOCAL_PATH)
120LOCAL_CPPFLAGS := $(libbase_cppflags)
121LOCAL_SHARED_LIBRARIES := libbase
122LOCAL_MULTILIB := both
123LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
124LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
125include $(BUILD_NATIVE_TEST)
126
127include $(CLEAR_VARS)
128LOCAL_MODULE := libbase_test
129LOCAL_MODULE_HOST_OS := darwin linux windows
130LOCAL_SRC_FILES := $(libbase_test_src_files)
131LOCAL_SRC_FILES_darwin := $(libbase_test_darwin_src_files)
132LOCAL_SRC_FILES_linux := $(libbase_test_linux_src_files)
133LOCAL_SRC_FILES_windows := $(libbase_test_windows_src_files)
134LOCAL_C_INCLUDES := $(LOCAL_PATH)
135LOCAL_CPPFLAGS := $(libbase_cppflags)
136LOCAL_SHARED_LIBRARIES := libbase
137LOCAL_MULTILIB := both
138LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
139LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
140include $(BUILD_HOST_NATIVE_TEST)
141