blob: ad85c6bac48f5fc735cf7a6a63aa3a5ed129ee63 [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 \
21 stringprintf.cpp \
Dan Albert0f1e5442015-03-13 22:57:40 -070022 strings.cpp \
Dan Albertc007bc32015-03-16 10:08:46 -070023
24libbase_test_src_files := \
25 file_test.cpp \
26 stringprintf_test.cpp \
Dan Albert0f1e5442015-03-13 22:57:40 -070027 strings_test.cpp \
Dan Albert58310b42015-03-13 23:06:01 -070028 test_main.cpp \
29 test_utils.cpp \
Dan Albertc007bc32015-03-16 10:08:46 -070030
31libbase_cppflags := \
32 -Wall \
33 -Wextra \
34 -Werror \
35
36# Device
37# ------------------------------------------------------------------------------
38include $(CLEAR_VARS)
39LOCAL_MODULE := libbase
40LOCAL_CLANG := true
Dan Albertb2326bd2015-03-30 10:30:42 -070041LOCAL_SRC_FILES := $(libbase_src_files) logging.cpp
Dan Albertc007bc32015-03-16 10:08:46 -070042LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
43LOCAL_CPPFLAGS := $(libbase_cppflags)
44LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -070045LOCAL_STATIC_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -070046LOCAL_MULTILIB := both
47include $(BUILD_STATIC_LIBRARY)
48
49include $(CLEAR_VARS)
50LOCAL_MODULE := libbase
51LOCAL_CLANG := true
52LOCAL_WHOLE_STATIC_LIBRARIES := libbase
53LOCAL_SHARED_LIBRARIES := liblog
54LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -070055LOCAL_SHARED_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -070056LOCAL_MULTILIB := both
57include $(BUILD_SHARED_LIBRARY)
58
59# Host
60# ------------------------------------------------------------------------------
61include $(CLEAR_VARS)
62LOCAL_MODULE := libbase
Dan Albertc007bc32015-03-16 10:08:46 -070063LOCAL_SRC_FILES := $(libbase_src_files)
Dan Albertb2326bd2015-03-30 10:30:42 -070064ifneq ($(HOST_OS),windows)
65 LOCAL_SRC_FILES += logging.cpp
66endif
Dan Albertc007bc32015-03-16 10:08:46 -070067LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
68LOCAL_CPPFLAGS := $(libbase_cppflags)
69LOCAL_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_HOST_STATIC_LIBRARY)
73
74include $(CLEAR_VARS)
75LOCAL_MODULE := libbase
Dan Albertc007bc32015-03-16 10:08:46 -070076LOCAL_WHOLE_STATIC_LIBRARIES := libbase
77LOCAL_SHARED_LIBRARIES := liblog
78LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -070079LOCAL_STATIC_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -070080LOCAL_MULTILIB := both
81include $(BUILD_HOST_SHARED_LIBRARY)
82
83# Tests
84# ------------------------------------------------------------------------------
85include $(CLEAR_VARS)
86LOCAL_MODULE := libbase_test
87LOCAL_CLANG := true
Dan Albertb2326bd2015-03-30 10:30:42 -070088LOCAL_SRC_FILES := $(libbase_test_src_files) logging_test.cpp
Dan Albert58310b42015-03-13 23:06:01 -070089LOCAL_C_INCLUDES := $(LOCAL_PATH)
Dan Albertc007bc32015-03-16 10:08:46 -070090LOCAL_CPPFLAGS := $(libbase_cppflags)
91LOCAL_SHARED_LIBRARIES := libbase
92LOCAL_MULTILIB := both
93LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
94LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
95include $(BUILD_NATIVE_TEST)
96
97include $(CLEAR_VARS)
98LOCAL_MODULE := libbase_test
Dan Albertc007bc32015-03-16 10:08:46 -070099LOCAL_SRC_FILES := $(libbase_test_src_files)
Dan Albertb2326bd2015-03-30 10:30:42 -0700100ifneq ($(HOST_OS),windows)
101 LOCAL_SRC_FILES += logging_test.cpp
102endif
Dan Albert58310b42015-03-13 23:06:01 -0700103LOCAL_C_INCLUDES := $(LOCAL_PATH)
Dan Albertc007bc32015-03-16 10:08:46 -0700104LOCAL_CPPFLAGS := $(libbase_cppflags)
105LOCAL_SHARED_LIBRARIES := libbase
106LOCAL_MULTILIB := both
107LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
108LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
109include $(BUILD_HOST_NATIVE_TEST)