blob: 4e6bd10a2176f27a4c840c572466fe0b9ee7d772 [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 \
Dan Albertc007bc32015-03-16 10:08:46 -070022 stringprintf.cpp \
Dan Albert0f1e5442015-03-13 22:57:40 -070023 strings.cpp \
Alex Vallée47d67c92015-05-06 16:26:00 -040024 test_utils.cpp \
Dan Albertc007bc32015-03-16 10:08:46 -070025
Elliott Hughesc1fd4922015-11-11 18:02:29 +000026libbase_windows_src_files := \
27 utf8.cpp \
28
Dan Albertc007bc32015-03-16 10:08:46 -070029libbase_test_src_files := \
30 file_test.cpp \
Dan Albert5c190402015-04-29 11:32:23 -070031 logging_test.cpp \
Elliott Hughesafe151f2015-09-04 16:26:51 -070032 parseint_test.cpp \
Dan Albertc007bc32015-03-16 10:08:46 -070033 stringprintf_test.cpp \
Dan Albert0f1e5442015-03-13 22:57:40 -070034 strings_test.cpp \
Dan Albert58310b42015-03-13 23:06:01 -070035 test_main.cpp \
Dan Albertc007bc32015-03-16 10:08:46 -070036
Elliott Hughesc1fd4922015-11-11 18:02:29 +000037libbase_test_windows_src_files := \
38 utf8_test.cpp \
39
Dan Albertc007bc32015-03-16 10:08:46 -070040libbase_cppflags := \
41 -Wall \
42 -Wextra \
43 -Werror \
44
45# Device
46# ------------------------------------------------------------------------------
47include $(CLEAR_VARS)
48LOCAL_MODULE := libbase
49LOCAL_CLANG := true
Dan Albert5c190402015-04-29 11:32:23 -070050LOCAL_SRC_FILES := $(libbase_src_files)
Elliott Hughesc1fd4922015-11-11 18:02:29 +000051LOCAL_SRC_FILES_darwin := $(libbase_darwin_src_files)
52LOCAL_SRC_FILES_linux := $(libbase_linux_src_files)
53LOCAL_SRC_FILES_windows := $(libbase_windows_src_files)
Dan Albertc007bc32015-03-16 10:08:46 -070054LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
55LOCAL_CPPFLAGS := $(libbase_cppflags)
56LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -070057LOCAL_STATIC_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -070058LOCAL_MULTILIB := both
59include $(BUILD_STATIC_LIBRARY)
60
61include $(CLEAR_VARS)
62LOCAL_MODULE := libbase
63LOCAL_CLANG := true
64LOCAL_WHOLE_STATIC_LIBRARIES := libbase
65LOCAL_SHARED_LIBRARIES := liblog
66LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -070067LOCAL_SHARED_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -070068LOCAL_MULTILIB := both
69include $(BUILD_SHARED_LIBRARY)
70
71# Host
72# ------------------------------------------------------------------------------
73include $(CLEAR_VARS)
74LOCAL_MODULE := libbase
Dan Albertc007bc32015-03-16 10:08:46 -070075LOCAL_SRC_FILES := $(libbase_src_files)
Elliott Hughesc1fd4922015-11-11 18:02:29 +000076LOCAL_SRC_FILES_darwin := $(libbase_darwin_src_files)
77LOCAL_SRC_FILES_linux := $(libbase_linux_src_files)
78LOCAL_SRC_FILES_windows := $(libbase_windows_src_files)
Dan Albertc007bc32015-03-16 10:08:46 -070079LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
80LOCAL_CPPFLAGS := $(libbase_cppflags)
81LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -070082LOCAL_STATIC_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -070083LOCAL_MULTILIB := both
Dan Willemsen87a419c2015-08-13 14:43:34 -070084LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albertc007bc32015-03-16 10:08:46 -070085include $(BUILD_HOST_STATIC_LIBRARY)
86
87include $(CLEAR_VARS)
88LOCAL_MODULE := libbase
Dan Albertc007bc32015-03-16 10:08:46 -070089LOCAL_WHOLE_STATIC_LIBRARIES := libbase
90LOCAL_SHARED_LIBRARIES := liblog
91LOCAL_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
Stephen Hinesb0e4f082015-09-10 22:47:07 -070094LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albertc007bc32015-03-16 10:08:46 -070095include $(BUILD_HOST_SHARED_LIBRARY)
96
97# Tests
98# ------------------------------------------------------------------------------
99include $(CLEAR_VARS)
100LOCAL_MODULE := libbase_test
101LOCAL_CLANG := true
Dan Albert5c190402015-04-29 11:32:23 -0700102LOCAL_SRC_FILES := $(libbase_test_src_files)
Elliott Hughesc1fd4922015-11-11 18:02:29 +0000103LOCAL_SRC_FILES_darwin := $(libbase_test_darwin_src_files)
104LOCAL_SRC_FILES_linux := $(libbase_test_linux_src_files)
105LOCAL_SRC_FILES_windows := $(libbase_test_windows_src_files)
Dan Albert58310b42015-03-13 23:06:01 -0700106LOCAL_C_INCLUDES := $(LOCAL_PATH)
Dan Albertc007bc32015-03-16 10:08:46 -0700107LOCAL_CPPFLAGS := $(libbase_cppflags)
108LOCAL_SHARED_LIBRARIES := libbase
109LOCAL_MULTILIB := both
110LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
111LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
112include $(BUILD_NATIVE_TEST)
113
114include $(CLEAR_VARS)
115LOCAL_MODULE := libbase_test
Spencer Lowb2d49492015-09-11 20:01:29 -0700116LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albertc007bc32015-03-16 10:08:46 -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_HOST_NATIVE_TEST)