blob: 1693e74114954bb8a67b67739dbbeb8cbe07f512 [file] [log] [blame]
Dan Albertc007bc32015-03-16 10:08:46 -07001#
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 \
Dan Albert5c190402015-04-29 11:32:23 -070021 logging.cpp \
David Pursell706955f2016-01-21 08:40:59 -080022 parsenetaddress.cpp \
Dan Albertc007bc32015-03-16 10:08:46 -070023 stringprintf.cpp \
Dan Albert0f1e5442015-03-13 22:57:40 -070024 strings.cpp \
Alex Vallée47d67c92015-05-06 16:26:00 -040025 test_utils.cpp \
Dan Albertc007bc32015-03-16 10:08:46 -070026
David Pursell5f787ed2016-01-27 08:52:53 -080027libbase_linux_src_files := \
28 errors_unix.cpp \
29
30libbase_darwin_src_files := \
31 errors_unix.cpp \
32
Elliott Hughesc1fd4922015-11-11 18:02:29 +000033libbase_windows_src_files := \
David Pursell5f787ed2016-01-27 08:52:53 -080034 errors_windows.cpp \
Elliott Hughesc1fd4922015-11-11 18:02:29 +000035 utf8.cpp \
36
Dan Albertc007bc32015-03-16 10:08:46 -070037libbase_test_src_files := \
David Pursell5f787ed2016-01-27 08:52:53 -080038 errors_test.cpp \
Dan Albertc007bc32015-03-16 10:08:46 -070039 file_test.cpp \
Dan Albert5c190402015-04-29 11:32:23 -070040 logging_test.cpp \
Elliott Hughesafe151f2015-09-04 16:26:51 -070041 parseint_test.cpp \
David Pursell706955f2016-01-21 08:40:59 -080042 parsenetaddress_test.cpp \
Dan Albertc007bc32015-03-16 10:08:46 -070043 stringprintf_test.cpp \
Dan Albert0f1e5442015-03-13 22:57:40 -070044 strings_test.cpp \
Dan Albert58310b42015-03-13 23:06:01 -070045 test_main.cpp \
Dan Albertc007bc32015-03-16 10:08:46 -070046
Elliott Hughesc1fd4922015-11-11 18:02:29 +000047libbase_test_windows_src_files := \
48 utf8_test.cpp \
49
Dan Albertc007bc32015-03-16 10:08:46 -070050libbase_cppflags := \
51 -Wall \
52 -Wextra \
53 -Werror \
54
Josh Gao7df6b5f2015-11-12 11:54:47 -080055libbase_linux_cppflags := \
56 -Wexit-time-destructors \
57
58libbase_darwin_cppflags := \
59 -Wexit-time-destructors \
60
Dan Albertc007bc32015-03-16 10:08:46 -070061# Device
62# ------------------------------------------------------------------------------
63include $(CLEAR_VARS)
64LOCAL_MODULE := libbase
65LOCAL_CLANG := true
David Pursell5f787ed2016-01-27 08:52:53 -080066LOCAL_SRC_FILES := $(libbase_src_files) $(libbase_linux_src_files)
Dan Albertc007bc32015-03-16 10:08:46 -070067LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Josh Gao7df6b5f2015-11-12 11:54:47 -080068LOCAL_CPPFLAGS := $(libbase_cppflags) $(libbase_linux_cppflags)
Dan Albertc007bc32015-03-16 10:08:46 -070069LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Elliott Hughes5cf0dcd2016-02-04 08:24:55 -080070LOCAL_STATIC_LIBRARIES := liblog
Dan Albertc007bc32015-03-16 10:08:46 -070071LOCAL_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
Dan Albertc007bc32015-03-16 10:08:46 -070087LOCAL_SRC_FILES := $(libbase_src_files)
Elliott Hughesc1fd4922015-11-11 18:02:29 +000088LOCAL_SRC_FILES_darwin := $(libbase_darwin_src_files)
89LOCAL_SRC_FILES_linux := $(libbase_linux_src_files)
90LOCAL_SRC_FILES_windows := $(libbase_windows_src_files)
Dan Albertc007bc32015-03-16 10:08:46 -070091LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
92LOCAL_CPPFLAGS := $(libbase_cppflags)
Josh Gao7df6b5f2015-11-12 11:54:47 -080093LOCAL_CPPFLAGS_darwin := $(libbase_darwin_cppflags)
94LOCAL_CPPFLAGS_linux := $(libbase_linux_cppflags)
Dan Albertc007bc32015-03-16 10:08:46 -070095LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Elliott Hughes5cf0dcd2016-02-04 08:24:55 -080096LOCAL_STATIC_LIBRARIES := liblog
Dan Albertc007bc32015-03-16 10:08:46 -070097LOCAL_MULTILIB := both
Dan Willemsen87a419c2015-08-13 14:43:34 -070098LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albertc007bc32015-03-16 10:08:46 -070099include $(BUILD_HOST_STATIC_LIBRARY)
100
101include $(CLEAR_VARS)
102LOCAL_MODULE := libbase
Dan Albertc007bc32015-03-16 10:08:46 -0700103LOCAL_WHOLE_STATIC_LIBRARIES := libbase
104LOCAL_SHARED_LIBRARIES := liblog
105LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
106LOCAL_MULTILIB := both
Stephen Hinesb0e4f082015-09-10 22:47:07 -0700107LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albertc007bc32015-03-16 10:08:46 -0700108include $(BUILD_HOST_SHARED_LIBRARY)
109
110# Tests
111# ------------------------------------------------------------------------------
112include $(CLEAR_VARS)
113LOCAL_MODULE := libbase_test
114LOCAL_CLANG := true
Dan Albert5c190402015-04-29 11:32:23 -0700115LOCAL_SRC_FILES := $(libbase_test_src_files)
Elliott Hughesc1fd4922015-11-11 18:02:29 +0000116LOCAL_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)
Dan Albert58310b42015-03-13 23:06:01 -0700119LOCAL_C_INCLUDES := $(LOCAL_PATH)
Dan Albertc007bc32015-03-16 10:08:46 -0700120LOCAL_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
Spencer Lowb2d49492015-09-11 20:01:29 -0700129LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albertc007bc32015-03-16 10:08:46 -0700130LOCAL_SRC_FILES := $(libbase_test_src_files)
Elliott Hughesc1fd4922015-11-11 18:02:29 +0000131LOCAL_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)
Dan Albert58310b42015-03-13 23:06:01 -0700134LOCAL_C_INCLUDES := $(LOCAL_PATH)
Dan Albertc007bc32015-03-16 10:08:46 -0700135LOCAL_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)