blob: 5a0ad05c3c9e4732a303ac6753b5fe268df62785 [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
26libbase_test_src_files := \
27 file_test.cpp \
Dan Albert5c190402015-04-29 11:32:23 -070028 logging_test.cpp \
Elliott Hughesafe151f2015-09-04 16:26:51 -070029 parseint_test.cpp \
Dan Albertc007bc32015-03-16 10:08:46 -070030 stringprintf_test.cpp \
Dan Albert0f1e5442015-03-13 22:57:40 -070031 strings_test.cpp \
Dan Albert58310b42015-03-13 23:06:01 -070032 test_main.cpp \
Dan Albertc007bc32015-03-16 10:08:46 -070033
34libbase_cppflags := \
35 -Wall \
36 -Wextra \
37 -Werror \
38
Josh Gao7df6b5f2015-11-12 11:54:47 -080039libbase_linux_cppflags := \
40 -Wexit-time-destructors \
41
42libbase_darwin_cppflags := \
43 -Wexit-time-destructors \
44
Dan Albertc007bc32015-03-16 10:08:46 -070045# Device
46# ------------------------------------------------------------------------------
47include $(CLEAR_VARS)
48LOCAL_MODULE := libbase
49LOCAL_CLANG := true
Dan Albert5c190402015-04-29 11:32:23 -070050LOCAL_SRC_FILES := $(libbase_src_files)
Dan Albertc007bc32015-03-16 10:08:46 -070051LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Josh Gao7df6b5f2015-11-12 11:54:47 -080052LOCAL_CPPFLAGS := $(libbase_cppflags) $(libbase_linux_cppflags)
Dan Albertc007bc32015-03-16 10:08:46 -070053LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -070054LOCAL_STATIC_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -070055LOCAL_MULTILIB := both
56include $(BUILD_STATIC_LIBRARY)
57
58include $(CLEAR_VARS)
59LOCAL_MODULE := libbase
60LOCAL_CLANG := true
61LOCAL_WHOLE_STATIC_LIBRARIES := libbase
62LOCAL_SHARED_LIBRARIES := liblog
63LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -070064LOCAL_SHARED_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -070065LOCAL_MULTILIB := both
66include $(BUILD_SHARED_LIBRARY)
67
68# Host
69# ------------------------------------------------------------------------------
70include $(CLEAR_VARS)
71LOCAL_MODULE := libbase
Dan Albertc007bc32015-03-16 10:08:46 -070072LOCAL_SRC_FILES := $(libbase_src_files)
73LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
74LOCAL_CPPFLAGS := $(libbase_cppflags)
Josh Gao7df6b5f2015-11-12 11:54:47 -080075LOCAL_CPPFLAGS_darwin := $(libbase_darwin_cppflags)
76LOCAL_CPPFLAGS_linux := $(libbase_linux_cppflags)
Dan Albertc007bc32015-03-16 10:08:46 -070077LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -070078LOCAL_STATIC_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -070079LOCAL_MULTILIB := both
Dan Willemsen87a419c2015-08-13 14:43:34 -070080LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albertc007bc32015-03-16 10:08:46 -070081include $(BUILD_HOST_STATIC_LIBRARY)
82
83include $(CLEAR_VARS)
84LOCAL_MODULE := libbase
Dan Albertc007bc32015-03-16 10:08:46 -070085LOCAL_WHOLE_STATIC_LIBRARIES := libbase
86LOCAL_SHARED_LIBRARIES := liblog
87LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -070088LOCAL_STATIC_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -070089LOCAL_MULTILIB := both
Stephen Hinesb0e4f082015-09-10 22:47:07 -070090LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albertc007bc32015-03-16 10:08:46 -070091include $(BUILD_HOST_SHARED_LIBRARY)
92
93# Tests
94# ------------------------------------------------------------------------------
95include $(CLEAR_VARS)
96LOCAL_MODULE := libbase_test
97LOCAL_CLANG := true
Dan Albert5c190402015-04-29 11:32:23 -070098LOCAL_SRC_FILES := $(libbase_test_src_files)
Dan Albert58310b42015-03-13 23:06:01 -070099LOCAL_C_INCLUDES := $(LOCAL_PATH)
Dan Albertc007bc32015-03-16 10:08:46 -0700100LOCAL_CPPFLAGS := $(libbase_cppflags)
101LOCAL_SHARED_LIBRARIES := libbase
102LOCAL_MULTILIB := both
103LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
104LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
105include $(BUILD_NATIVE_TEST)
106
107include $(CLEAR_VARS)
108LOCAL_MODULE := libbase_test
Spencer Lowb2d49492015-09-11 20:01:29 -0700109LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albertc007bc32015-03-16 10:08:46 -0700110LOCAL_SRC_FILES := $(libbase_test_src_files)
Dan Albert58310b42015-03-13 23:06:01 -0700111LOCAL_C_INCLUDES := $(LOCAL_PATH)
Dan Albertc007bc32015-03-16 10:08:46 -0700112LOCAL_CPPFLAGS := $(libbase_cppflags)
113LOCAL_SHARED_LIBRARIES := libbase
114LOCAL_MULTILIB := both
115LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
116LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
117include $(BUILD_HOST_NATIVE_TEST)