blob: cb04927f88fff8c6cae38a4a2de02c70828e73cb [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 \
Dan Albertc007bc32015-03-16 10:08:46 -070029 stringprintf_test.cpp \
Dan Albert0f1e5442015-03-13 22:57:40 -070030 strings_test.cpp \
Dan Albert58310b42015-03-13 23:06:01 -070031 test_main.cpp \
Dan Albertc007bc32015-03-16 10:08:46 -070032
33libbase_cppflags := \
34 -Wall \
35 -Wextra \
36 -Werror \
37
38# Device
39# ------------------------------------------------------------------------------
40include $(CLEAR_VARS)
41LOCAL_MODULE := libbase
42LOCAL_CLANG := true
Dan Albert5c190402015-04-29 11:32:23 -070043LOCAL_SRC_FILES := $(libbase_src_files)
Dan Albertc007bc32015-03-16 10:08:46 -070044LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
45LOCAL_CPPFLAGS := $(libbase_cppflags)
46LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -070047LOCAL_STATIC_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -070048LOCAL_MULTILIB := both
49include $(BUILD_STATIC_LIBRARY)
50
51include $(CLEAR_VARS)
52LOCAL_MODULE := libbase
53LOCAL_CLANG := true
54LOCAL_WHOLE_STATIC_LIBRARIES := libbase
55LOCAL_SHARED_LIBRARIES := liblog
56LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -070057LOCAL_SHARED_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -070058LOCAL_MULTILIB := both
59include $(BUILD_SHARED_LIBRARY)
60
61# Host
62# ------------------------------------------------------------------------------
63include $(CLEAR_VARS)
64LOCAL_MODULE := libbase
Dan Albertc007bc32015-03-16 10:08:46 -070065LOCAL_SRC_FILES := $(libbase_src_files)
66LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
67LOCAL_CPPFLAGS := $(libbase_cppflags)
68LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -070069LOCAL_STATIC_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -070070LOCAL_MULTILIB := both
Dan Willemsen87a419c2015-08-13 14:43:34 -070071LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albertc007bc32015-03-16 10:08:46 -070072include $(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
Stephen Hinesb0e4f082015-09-10 22:47:07 -070081LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albertc007bc32015-03-16 10:08:46 -070082include $(BUILD_HOST_SHARED_LIBRARY)
83
84# Tests
85# ------------------------------------------------------------------------------
86include $(CLEAR_VARS)
87LOCAL_MODULE := libbase_test
88LOCAL_CLANG := true
Dan Albert5c190402015-04-29 11:32:23 -070089LOCAL_SRC_FILES := $(libbase_test_src_files)
Dan Albert58310b42015-03-13 23:06:01 -070090LOCAL_C_INCLUDES := $(LOCAL_PATH)
Dan Albertc007bc32015-03-16 10:08:46 -070091LOCAL_CPPFLAGS := $(libbase_cppflags)
92LOCAL_SHARED_LIBRARIES := libbase
93LOCAL_MULTILIB := both
94LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
95LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
96include $(BUILD_NATIVE_TEST)
97
98include $(CLEAR_VARS)
99LOCAL_MODULE := libbase_test
Dan Albertc007bc32015-03-16 10:08:46 -0700100LOCAL_SRC_FILES := $(libbase_test_src_files)
Dan Albert58310b42015-03-13 23:06:01 -0700101LOCAL_C_INCLUDES := $(LOCAL_PATH)
Dan Albertc007bc32015-03-16 10:08:46 -0700102LOCAL_CPPFLAGS := $(libbase_cppflags)
103LOCAL_SHARED_LIBRARIES := libbase
104LOCAL_MULTILIB := both
105LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
106LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
107include $(BUILD_HOST_NATIVE_TEST)