blob: a09a747c8193cbb14f773f25ade8e79f26bdf844 [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
39# Device
40# ------------------------------------------------------------------------------
41include $(CLEAR_VARS)
42LOCAL_MODULE := libbase
43LOCAL_CLANG := true
Dan Albert5c190402015-04-29 11:32:23 -070044LOCAL_SRC_FILES := $(libbase_src_files)
Dan Albertc007bc32015-03-16 10:08:46 -070045LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
46LOCAL_CPPFLAGS := $(libbase_cppflags)
47LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -070048LOCAL_STATIC_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -070049LOCAL_MULTILIB := both
50include $(BUILD_STATIC_LIBRARY)
51
52include $(CLEAR_VARS)
53LOCAL_MODULE := libbase
54LOCAL_CLANG := true
55LOCAL_WHOLE_STATIC_LIBRARIES := libbase
56LOCAL_SHARED_LIBRARIES := liblog
57LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -070058LOCAL_SHARED_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -070059LOCAL_MULTILIB := both
60include $(BUILD_SHARED_LIBRARY)
61
62# Host
63# ------------------------------------------------------------------------------
64include $(CLEAR_VARS)
65LOCAL_MODULE := libbase
Dan Albertc007bc32015-03-16 10:08:46 -070066LOCAL_SRC_FILES := $(libbase_src_files)
67LOCAL_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
Dan Willemsen87a419c2015-08-13 14:43:34 -070072LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albertc007bc32015-03-16 10:08:46 -070073include $(BUILD_HOST_STATIC_LIBRARY)
74
75include $(CLEAR_VARS)
76LOCAL_MODULE := libbase
Dan Albertc007bc32015-03-16 10:08:46 -070077LOCAL_WHOLE_STATIC_LIBRARIES := libbase
78LOCAL_SHARED_LIBRARIES := liblog
79LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -070080LOCAL_STATIC_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -070081LOCAL_MULTILIB := both
82include $(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)