blob: cba70d4c98199799fe39d84728096d0560d1a628 [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
Josh Gao7df6b5f2015-11-12 11:54:47 -080045libbase_linux_cppflags := \
46 -Wexit-time-destructors \
47
48libbase_darwin_cppflags := \
49 -Wexit-time-destructors \
50
Dan Albertc007bc32015-03-16 10:08:46 -070051# Device
52# ------------------------------------------------------------------------------
53include $(CLEAR_VARS)
54LOCAL_MODULE := libbase
55LOCAL_CLANG := true
Dan Albert5c190402015-04-29 11:32:23 -070056LOCAL_SRC_FILES := $(libbase_src_files)
Elliott Hughesc1fd4922015-11-11 18:02:29 +000057LOCAL_SRC_FILES_darwin := $(libbase_darwin_src_files)
58LOCAL_SRC_FILES_linux := $(libbase_linux_src_files)
59LOCAL_SRC_FILES_windows := $(libbase_windows_src_files)
Dan Albertc007bc32015-03-16 10:08:46 -070060LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Josh Gao7df6b5f2015-11-12 11:54:47 -080061LOCAL_CPPFLAGS := $(libbase_cppflags) $(libbase_linux_cppflags)
Dan Albertc007bc32015-03-16 10:08:46 -070062LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -070063LOCAL_STATIC_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -070064LOCAL_MULTILIB := both
65include $(BUILD_STATIC_LIBRARY)
66
67include $(CLEAR_VARS)
68LOCAL_MODULE := libbase
69LOCAL_CLANG := true
70LOCAL_WHOLE_STATIC_LIBRARIES := libbase
71LOCAL_SHARED_LIBRARIES := liblog
72LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -070073LOCAL_SHARED_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -070074LOCAL_MULTILIB := both
75include $(BUILD_SHARED_LIBRARY)
76
77# Host
78# ------------------------------------------------------------------------------
79include $(CLEAR_VARS)
80LOCAL_MODULE := libbase
Dan Albertc007bc32015-03-16 10:08:46 -070081LOCAL_SRC_FILES := $(libbase_src_files)
Elliott Hughesc1fd4922015-11-11 18:02:29 +000082LOCAL_SRC_FILES_darwin := $(libbase_darwin_src_files)
83LOCAL_SRC_FILES_linux := $(libbase_linux_src_files)
84LOCAL_SRC_FILES_windows := $(libbase_windows_src_files)
Dan Albertc007bc32015-03-16 10:08:46 -070085LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
86LOCAL_CPPFLAGS := $(libbase_cppflags)
Josh Gao7df6b5f2015-11-12 11:54:47 -080087LOCAL_CPPFLAGS_darwin := $(libbase_darwin_cppflags)
88LOCAL_CPPFLAGS_linux := $(libbase_linux_cppflags)
Dan Albertc007bc32015-03-16 10:08:46 -070089LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -070090LOCAL_STATIC_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -070091LOCAL_MULTILIB := both
Dan Willemsen87a419c2015-08-13 14:43:34 -070092LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albertc007bc32015-03-16 10:08:46 -070093include $(BUILD_HOST_STATIC_LIBRARY)
94
95include $(CLEAR_VARS)
96LOCAL_MODULE := libbase
Dan Albertc007bc32015-03-16 10:08:46 -070097LOCAL_WHOLE_STATIC_LIBRARIES := libbase
98LOCAL_SHARED_LIBRARIES := liblog
99LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dan Albert7dfb61d2015-03-20 13:46:28 -0700100LOCAL_STATIC_LIBRARIES := libcutils
Dan Albertc007bc32015-03-16 10:08:46 -0700101LOCAL_MULTILIB := both
Stephen Hinesb0e4f082015-09-10 22:47:07 -0700102LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albertc007bc32015-03-16 10:08:46 -0700103include $(BUILD_HOST_SHARED_LIBRARY)
104
105# Tests
106# ------------------------------------------------------------------------------
107include $(CLEAR_VARS)
108LOCAL_MODULE := libbase_test
109LOCAL_CLANG := true
Dan Albert5c190402015-04-29 11:32:23 -0700110LOCAL_SRC_FILES := $(libbase_test_src_files)
Elliott Hughesc1fd4922015-11-11 18:02:29 +0000111LOCAL_SRC_FILES_darwin := $(libbase_test_darwin_src_files)
112LOCAL_SRC_FILES_linux := $(libbase_test_linux_src_files)
113LOCAL_SRC_FILES_windows := $(libbase_test_windows_src_files)
Dan Albert58310b42015-03-13 23:06:01 -0700114LOCAL_C_INCLUDES := $(LOCAL_PATH)
Dan Albertc007bc32015-03-16 10:08:46 -0700115LOCAL_CPPFLAGS := $(libbase_cppflags)
116LOCAL_SHARED_LIBRARIES := libbase
117LOCAL_MULTILIB := both
118LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
119LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
120include $(BUILD_NATIVE_TEST)
121
122include $(CLEAR_VARS)
123LOCAL_MODULE := libbase_test
Spencer Lowb2d49492015-09-11 20:01:29 -0700124LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albertc007bc32015-03-16 10:08:46 -0700125LOCAL_SRC_FILES := $(libbase_test_src_files)
Elliott Hughesc1fd4922015-11-11 18:02:29 +0000126LOCAL_SRC_FILES_darwin := $(libbase_test_darwin_src_files)
127LOCAL_SRC_FILES_linux := $(libbase_test_linux_src_files)
128LOCAL_SRC_FILES_windows := $(libbase_test_windows_src_files)
Dan Albert58310b42015-03-13 23:06:01 -0700129LOCAL_C_INCLUDES := $(LOCAL_PATH)
Dan Albertc007bc32015-03-16 10:08:46 -0700130LOCAL_CPPFLAGS := $(libbase_cppflags)
131LOCAL_SHARED_LIBRARIES := libbase
132LOCAL_MULTILIB := both
133LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
134LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
135include $(BUILD_HOST_NATIVE_TEST)