blob: 18f86866d0ebd75693315987f4851c63efc4b64f [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
Elliott Hughesc1fd4922015-11-11 18:02:29 +000027libbase_windows_src_files := \
28 utf8.cpp \
29
Dan Albertc007bc32015-03-16 10:08:46 -070030libbase_test_src_files := \
31 file_test.cpp \
Dan Albert5c190402015-04-29 11:32:23 -070032 logging_test.cpp \
Elliott Hughesafe151f2015-09-04 16:26:51 -070033 parseint_test.cpp \
David Pursell706955f2016-01-21 08:40:59 -080034 parsenetaddress_test.cpp \
Dan Albertc007bc32015-03-16 10:08:46 -070035 stringprintf_test.cpp \
Dan Albert0f1e5442015-03-13 22:57:40 -070036 strings_test.cpp \
Dan Albert58310b42015-03-13 23:06:01 -070037 test_main.cpp \
Dan Albertc007bc32015-03-16 10:08:46 -070038
Elliott Hughesc1fd4922015-11-11 18:02:29 +000039libbase_test_windows_src_files := \
40 utf8_test.cpp \
41
Dan Albertc007bc32015-03-16 10:08:46 -070042libbase_cppflags := \
43 -Wall \
44 -Wextra \
45 -Werror \
46
Josh Gao7df6b5f2015-11-12 11:54:47 -080047libbase_linux_cppflags := \
48 -Wexit-time-destructors \
49
50libbase_darwin_cppflags := \
51 -Wexit-time-destructors \
52
Dan Albertc007bc32015-03-16 10:08:46 -070053# Device
54# ------------------------------------------------------------------------------
55include $(CLEAR_VARS)
56LOCAL_MODULE := libbase
57LOCAL_CLANG := true
Dan Albert5c190402015-04-29 11:32:23 -070058LOCAL_SRC_FILES := $(libbase_src_files)
Elliott Hughesc1fd4922015-11-11 18:02:29 +000059LOCAL_SRC_FILES_darwin := $(libbase_darwin_src_files)
60LOCAL_SRC_FILES_linux := $(libbase_linux_src_files)
61LOCAL_SRC_FILES_windows := $(libbase_windows_src_files)
Dan Albertc007bc32015-03-16 10:08:46 -070062LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Josh Gao7df6b5f2015-11-12 11:54:47 -080063LOCAL_CPPFLAGS := $(libbase_cppflags) $(libbase_linux_cppflags)
Dan Albertc007bc32015-03-16 10:08:46 -070064LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -070065LOCAL_STATIC_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -070066LOCAL_MULTILIB := both
67include $(BUILD_STATIC_LIBRARY)
68
69include $(CLEAR_VARS)
70LOCAL_MODULE := libbase
71LOCAL_CLANG := true
72LOCAL_WHOLE_STATIC_LIBRARIES := libbase
73LOCAL_SHARED_LIBRARIES := liblog
74LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -070075LOCAL_SHARED_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -070076LOCAL_MULTILIB := both
77include $(BUILD_SHARED_LIBRARY)
78
79# Host
80# ------------------------------------------------------------------------------
81include $(CLEAR_VARS)
82LOCAL_MODULE := libbase
Dan Albertc007bc32015-03-16 10:08:46 -070083LOCAL_SRC_FILES := $(libbase_src_files)
Elliott Hughesc1fd4922015-11-11 18:02:29 +000084LOCAL_SRC_FILES_darwin := $(libbase_darwin_src_files)
85LOCAL_SRC_FILES_linux := $(libbase_linux_src_files)
86LOCAL_SRC_FILES_windows := $(libbase_windows_src_files)
Dan Albertc007bc32015-03-16 10:08:46 -070087LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
88LOCAL_CPPFLAGS := $(libbase_cppflags)
Josh Gao7df6b5f2015-11-12 11:54:47 -080089LOCAL_CPPFLAGS_darwin := $(libbase_darwin_cppflags)
90LOCAL_CPPFLAGS_linux := $(libbase_linux_cppflags)
Dan Albertc007bc32015-03-16 10:08:46 -070091LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -070092LOCAL_STATIC_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -070093LOCAL_MULTILIB := both
Dan Willemsen87a419c2015-08-13 14:43:34 -070094LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albertc007bc32015-03-16 10:08:46 -070095include $(BUILD_HOST_STATIC_LIBRARY)
96
97include $(CLEAR_VARS)
98LOCAL_MODULE := libbase
Dan Albertc007bc32015-03-16 10:08:46 -070099LOCAL_WHOLE_STATIC_LIBRARIES := libbase
100LOCAL_SHARED_LIBRARIES := liblog
101LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -0700102LOCAL_STATIC_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -0700103LOCAL_MULTILIB := both
Stephen Hinesb0e4f082015-09-10 22:47:07 -0700104LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albertc007bc32015-03-16 10:08:46 -0700105include $(BUILD_HOST_SHARED_LIBRARY)
106
107# Tests
108# ------------------------------------------------------------------------------
109include $(CLEAR_VARS)
110LOCAL_MODULE := libbase_test
111LOCAL_CLANG := true
Dan Albert5c190402015-04-29 11:32:23 -0700112LOCAL_SRC_FILES := $(libbase_test_src_files)
Elliott Hughesc1fd4922015-11-11 18:02:29 +0000113LOCAL_SRC_FILES_darwin := $(libbase_test_darwin_src_files)
114LOCAL_SRC_FILES_linux := $(libbase_test_linux_src_files)
115LOCAL_SRC_FILES_windows := $(libbase_test_windows_src_files)
Dan Albert58310b42015-03-13 23:06:01 -0700116LOCAL_C_INCLUDES := $(LOCAL_PATH)
Dan Albertc007bc32015-03-16 10:08:46 -0700117LOCAL_CPPFLAGS := $(libbase_cppflags)
118LOCAL_SHARED_LIBRARIES := libbase
119LOCAL_MULTILIB := both
120LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
121LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
122include $(BUILD_NATIVE_TEST)
123
124include $(CLEAR_VARS)
125LOCAL_MODULE := libbase_test
Spencer Lowb2d49492015-09-11 20:01:29 -0700126LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albertc007bc32015-03-16 10:08:46 -0700127LOCAL_SRC_FILES := $(libbase_test_src_files)
Elliott Hughesc1fd4922015-11-11 18:02:29 +0000128LOCAL_SRC_FILES_darwin := $(libbase_test_darwin_src_files)
129LOCAL_SRC_FILES_linux := $(libbase_test_linux_src_files)
130LOCAL_SRC_FILES_windows := $(libbase_test_windows_src_files)
Dan Albert58310b42015-03-13 23:06:01 -0700131LOCAL_C_INCLUDES := $(LOCAL_PATH)
Dan Albertc007bc32015-03-16 10:08:46 -0700132LOCAL_CPPFLAGS := $(libbase_cppflags)
133LOCAL_SHARED_LIBRARIES := libbase
134LOCAL_MULTILIB := both
135LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
136LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
137include $(BUILD_HOST_NATIVE_TEST)