blob: d20a81f09363d2f3522f0eee630e8279ad181c02 [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
Dan Albert7dfb61d2015-03-20 13:46:28 -070070LOCAL_STATIC_LIBRARIES := libcutils
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
Dan Albert7dfb61d2015-03-20 13:46:28 -070080LOCAL_SHARED_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -070081LOCAL_MULTILIB := both
82include $(BUILD_SHARED_LIBRARY)
83
84# Host
85# ------------------------------------------------------------------------------
86include $(CLEAR_VARS)
87LOCAL_MODULE := libbase
Dan Albertc007bc32015-03-16 10:08:46 -070088LOCAL_SRC_FILES := $(libbase_src_files)
Elliott Hughesc1fd4922015-11-11 18:02:29 +000089LOCAL_SRC_FILES_darwin := $(libbase_darwin_src_files)
90LOCAL_SRC_FILES_linux := $(libbase_linux_src_files)
91LOCAL_SRC_FILES_windows := $(libbase_windows_src_files)
Dan Albertc007bc32015-03-16 10:08:46 -070092LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
93LOCAL_CPPFLAGS := $(libbase_cppflags)
Josh Gao7df6b5f2015-11-12 11:54:47 -080094LOCAL_CPPFLAGS_darwin := $(libbase_darwin_cppflags)
95LOCAL_CPPFLAGS_linux := $(libbase_linux_cppflags)
Dan Albertc007bc32015-03-16 10:08:46 -070096LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -070097LOCAL_STATIC_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -070098LOCAL_MULTILIB := both
Dan Willemsen87a419c2015-08-13 14:43:34 -070099LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albertc007bc32015-03-16 10:08:46 -0700100include $(BUILD_HOST_STATIC_LIBRARY)
101
102include $(CLEAR_VARS)
103LOCAL_MODULE := libbase
Dan Albertc007bc32015-03-16 10:08:46 -0700104LOCAL_WHOLE_STATIC_LIBRARIES := libbase
105LOCAL_SHARED_LIBRARIES := liblog
106LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -0700107LOCAL_STATIC_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -0700108LOCAL_MULTILIB := both
Stephen Hinesb0e4f082015-09-10 22:47:07 -0700109LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albertc007bc32015-03-16 10:08:46 -0700110include $(BUILD_HOST_SHARED_LIBRARY)
111
112# Tests
113# ------------------------------------------------------------------------------
114include $(CLEAR_VARS)
115LOCAL_MODULE := libbase_test
116LOCAL_CLANG := true
Dan Albert5c190402015-04-29 11:32:23 -0700117LOCAL_SRC_FILES := $(libbase_test_src_files)
Elliott Hughesc1fd4922015-11-11 18:02:29 +0000118LOCAL_SRC_FILES_darwin := $(libbase_test_darwin_src_files)
119LOCAL_SRC_FILES_linux := $(libbase_test_linux_src_files)
120LOCAL_SRC_FILES_windows := $(libbase_test_windows_src_files)
Dan Albert58310b42015-03-13 23:06:01 -0700121LOCAL_C_INCLUDES := $(LOCAL_PATH)
Dan Albertc007bc32015-03-16 10:08:46 -0700122LOCAL_CPPFLAGS := $(libbase_cppflags)
123LOCAL_SHARED_LIBRARIES := libbase
124LOCAL_MULTILIB := both
125LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
126LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
127include $(BUILD_NATIVE_TEST)
128
129include $(CLEAR_VARS)
130LOCAL_MODULE := libbase_test
Spencer Lowb2d49492015-09-11 20:01:29 -0700131LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albertc007bc32015-03-16 10:08:46 -0700132LOCAL_SRC_FILES := $(libbase_test_src_files)
Elliott Hughesc1fd4922015-11-11 18:02:29 +0000133LOCAL_SRC_FILES_darwin := $(libbase_test_darwin_src_files)
134LOCAL_SRC_FILES_linux := $(libbase_test_linux_src_files)
135LOCAL_SRC_FILES_windows := $(libbase_test_windows_src_files)
Dan Albert58310b42015-03-13 23:06:01 -0700136LOCAL_C_INCLUDES := $(LOCAL_PATH)
Dan Albertc007bc32015-03-16 10:08:46 -0700137LOCAL_CPPFLAGS := $(libbase_cppflags)
138LOCAL_SHARED_LIBRARIES := libbase
139LOCAL_MULTILIB := both
140LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
141LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
142include $(BUILD_HOST_NATIVE_TEST)