Home | History | Annotate | Download | only in libweave
      1 # Copyright (C) 2015 The Android Open Source Project
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
      4 # you may not use this file except in compliance with the License.
      5 # You may obtain a copy of the License at
      6 #
      7 #      http://www.apache.org/licenses/LICENSE-2.0
      8 #
      9 # Unless required by applicable law or agreed to in writing, software
     10 # distributed under the License is distributed on an "AS IS" BASIS,
     11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 # See the License for the specific language governing permissions and
     13 # limitations under the License.
     14 
     15 LOCAL_PATH := $(call my-dir)
     16 
     17 include $(LOCAL_PATH)/file_lists.mk
     18 
     19 # Common variables
     20 # ========================================================
     21 
     22 libweaveCommonCppExtension := .cc
     23 libweaveCommonCFlags := -Wall -Werror \
     24 	-Wno-char-subscripts -Wno-missing-field-initializers \
     25 	-Wno-unused-function -Wno-unused-parameter
     26 
     27 libweaveCommonCppFlags := \
     28 	-Wno-deprecated-register \
     29 	-Wno-sign-compare \
     30 	-Wno-sign-promo \
     31 	-Wno-non-virtual-dtor \
     32 
     33 libweaveCommonCIncludes := \
     34 	$(LOCAL_PATH)/.. \
     35 	$(LOCAL_PATH)/include \
     36 	$(LOCAL_PATH)/third_party/modp_b64/modp_b64 \
     37 	$(LOCAL_PATH)/third_party/libuweave \
     38 	external/gtest/include \
     39 
     40 libweaveSharedLibraries := \
     41 	libchrome \
     42 	libexpat \
     43 	libcrypto \
     44 
     45 # libweave-external
     46 # ========================================================
     47 include $(CLEAR_VARS)
     48 LOCAL_MODULE := libweave-external
     49 LOCAL_CPP_EXTENSION := $(libweaveCommonCppExtension)
     50 LOCAL_CFLAGS := $(libweaveCommonCFlags)
     51 LOCAL_CPPFLAGS := $(libweaveCommonCppFlags)
     52 LOCAL_C_INCLUDES := $(libweaveCommonCIncludes)
     53 LOCAL_SHARED_LIBRARIES := $(libweaveSharedLibraries)
     54 LOCAL_STATIC_LIBRARIES :=
     55 LOCAL_CLANG := true
     56 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/external
     57 
     58 LOCAL_SRC_FILES := \
     59 	$(THIRD_PARTY_CHROMIUM_CRYPTO_SRC_FILES) \
     60 	$(THIRD_PARTY_MODP_B64_SRC_FILES) \
     61 	$(THIRD_PARTY_LIBUWEAVE_SRC_FILES)
     62 
     63 include $(BUILD_STATIC_LIBRARY)
     64 
     65 # libweave-common
     66 # ========================================================
     67 include $(CLEAR_VARS)
     68 LOCAL_MODULE := libweave-common
     69 LOCAL_CPP_EXTENSION := $(libweaveCommonCppExtension)
     70 LOCAL_CFLAGS := $(libweaveCommonCFlags)
     71 LOCAL_CPPFLAGS := $(libweaveCommonCppFlags)
     72 LOCAL_C_INCLUDES := $(libweaveCommonCIncludes)
     73 LOCAL_SHARED_LIBRARIES := $(libweaveSharedLibraries)
     74 LOCAL_STATIC_LIBRARIES := libweave-external
     75 LOCAL_CLANG := true
     76 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
     77 
     78 LOCAL_SRC_FILES := $(WEAVE_SRC_FILES)
     79 
     80 include $(BUILD_STATIC_LIBRARY)
     81 
     82 # libweave-test
     83 # ========================================================
     84 include $(CLEAR_VARS)
     85 LOCAL_MODULE := libweave-test
     86 LOCAL_CPP_EXTENSION := $(libweaveCommonCppExtension)
     87 LOCAL_CFLAGS := $(libweaveCommonCFlags)
     88 LOCAL_CPPFLAGS := $(libweaveCommonCppFlags)
     89 LOCAL_C_INCLUDES := \
     90 	$(libweaveCommonCIncludes) \
     91 	external/gmock/include \
     92 
     93 LOCAL_SHARED_LIBRARIES := $(libweaveSharedLibraries)
     94 LOCAL_STATIC_LIBRARIES := libgtest libgmock
     95 LOCAL_CLANG := true
     96 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
     97 
     98 LOCAL_SRC_FILES := $(WEAVE_TEST_SRC_FILES)
     99 
    100 include $(BUILD_STATIC_LIBRARY)
    101 
    102 # libweave
    103 # ========================================================
    104 include $(CLEAR_VARS)
    105 LOCAL_MODULE := libweave
    106 LOCAL_CPP_EXTENSION := $(libweaveCommonCppExtension)
    107 LOCAL_CFLAGS := $(libweaveCommonCFlags)
    108 LOCAL_CPPFLAGS := $(libweaveCommonCppFlags)
    109 LOCAL_C_INCLUDES := $(libweaveCommonCIncludes)
    110 LOCAL_SHARED_LIBRARIES := $(libweaveSharedLibraries)
    111 LOCAL_WHOLE_STATIC_LIBRARIES := libweave-common libweave-external
    112 LOCAL_CLANG := true
    113 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
    114 
    115 LOCAL_SRC_FILES :=
    116 
    117 include $(BUILD_SHARED_LIBRARY)
    118 
    119 # libweave_test
    120 # ========================================================
    121 include $(CLEAR_VARS)
    122 LOCAL_MODULE := libweave_test
    123 LOCAL_MODULE_TAGS := eng
    124 LOCAL_CPP_EXTENSION := $(libweaveCommonCppExtension)
    125 LOCAL_CFLAGS := $(libweaveCommonCFlags)
    126 LOCAL_CPPFLAGS := $(libweaveCommonCppFlags)
    127 LOCAL_C_INCLUDES := \
    128 	$(libweaveCommonCIncludes) \
    129 	external/gmock/include \
    130 
    131 LOCAL_SHARED_LIBRARIES := \
    132 	$(libweaveSharedLibraries) \
    133 
    134 LOCAL_STATIC_LIBRARIES := \
    135 	libweave-common \
    136 	libweave-external \
    137 	libweave-test \
    138 	libgtest libgmock \
    139 	libchrome_test_helpers \
    140 
    141 LOCAL_CLANG := true
    142 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
    143 
    144 LOCAL_SRC_FILES := \
    145 	$(WEAVE_UNITTEST_SRC_FILES) \
    146 	$(THIRD_PARTY_CHROMIUM_CRYPTO_UNITTEST_SRC_FILES)
    147 
    148 include $(BUILD_NATIVE_TEST)
    149