Home | History | Annotate | Download | only in base
      1 #
      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 
     17 LOCAL_PATH := $(call my-dir)
     18 
     19 libbase_src_files := \
     20     file.cpp \
     21     stringprintf.cpp \
     22     strings.cpp \
     23 
     24 libbase_test_src_files := \
     25     file_test.cpp \
     26     stringprintf_test.cpp \
     27     strings_test.cpp \
     28     test_main.cpp \
     29     test_utils.cpp \
     30 
     31 libbase_cppflags := \
     32     -Wall \
     33     -Wextra \
     34     -Werror \
     35 
     36 # Device
     37 # ------------------------------------------------------------------------------
     38 include $(CLEAR_VARS)
     39 LOCAL_MODULE := libbase
     40 LOCAL_CLANG := true
     41 LOCAL_SRC_FILES := $(libbase_src_files) logging.cpp
     42 LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
     43 LOCAL_CPPFLAGS := $(libbase_cppflags)
     44 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
     45 LOCAL_STATIC_LIBRARIES := libcutils
     46 LOCAL_MULTILIB := both
     47 include $(BUILD_STATIC_LIBRARY)
     48 
     49 include $(CLEAR_VARS)
     50 LOCAL_MODULE := libbase
     51 LOCAL_CLANG := true
     52 LOCAL_WHOLE_STATIC_LIBRARIES := libbase
     53 LOCAL_SHARED_LIBRARIES := liblog
     54 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
     55 LOCAL_SHARED_LIBRARIES := libcutils
     56 LOCAL_MULTILIB := both
     57 include $(BUILD_SHARED_LIBRARY)
     58 
     59 # Host
     60 # ------------------------------------------------------------------------------
     61 include $(CLEAR_VARS)
     62 LOCAL_MODULE := libbase
     63 LOCAL_SRC_FILES := $(libbase_src_files)
     64 ifneq ($(HOST_OS),windows)
     65     LOCAL_SRC_FILES += logging.cpp
     66 endif
     67 LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
     68 LOCAL_CPPFLAGS := $(libbase_cppflags)
     69 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
     70 LOCAL_STATIC_LIBRARIES := libcutils
     71 LOCAL_MULTILIB := both
     72 include $(BUILD_HOST_STATIC_LIBRARY)
     73 
     74 include $(CLEAR_VARS)
     75 LOCAL_MODULE := libbase
     76 LOCAL_WHOLE_STATIC_LIBRARIES := libbase
     77 LOCAL_SHARED_LIBRARIES := liblog
     78 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
     79 LOCAL_STATIC_LIBRARIES := libcutils
     80 LOCAL_MULTILIB := both
     81 include $(BUILD_HOST_SHARED_LIBRARY)
     82 
     83 # Tests
     84 # ------------------------------------------------------------------------------
     85 include $(CLEAR_VARS)
     86 LOCAL_MODULE := libbase_test
     87 LOCAL_CLANG := true
     88 LOCAL_SRC_FILES := $(libbase_test_src_files) logging_test.cpp
     89 LOCAL_C_INCLUDES := $(LOCAL_PATH)
     90 LOCAL_CPPFLAGS := $(libbase_cppflags)
     91 LOCAL_SHARED_LIBRARIES := libbase
     92 LOCAL_MULTILIB := both
     93 LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
     94 LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
     95 include $(BUILD_NATIVE_TEST)
     96 
     97 include $(CLEAR_VARS)
     98 LOCAL_MODULE := libbase_test
     99 LOCAL_SRC_FILES := $(libbase_test_src_files)
    100 ifneq ($(HOST_OS),windows)
    101     LOCAL_SRC_FILES += logging_test.cpp
    102 endif
    103 LOCAL_C_INCLUDES := $(LOCAL_PATH)
    104 LOCAL_CPPFLAGS := $(libbase_cppflags)
    105 LOCAL_SHARED_LIBRARIES := libbase
    106 LOCAL_MULTILIB := both
    107 LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
    108 LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
    109 include $(BUILD_HOST_NATIVE_TEST)
    110