1# Copyright 2015 The Android Open Source Project
2#
3LOCAL_PATH := $(call my-dir)
4
5common_cflags := -Wall -Werror -O3
6
7common_c_includes := \
8    $(LOCAL_PATH)/include \
9    external/fec \
10    system/extras/ext4_utils \
11    system/extras/squashfs_utils
12
13common_src_files := \
14    fec_open.cpp \
15    fec_read.cpp \
16    fec_verity.cpp \
17    fec_process.cpp
18
19common_static_libraries := \
20    libmincrypt \
21    libcrypto_static \
22    libcutils \
23    libbase
24
25include $(CLEAR_VARS)
26LOCAL_CFLAGS := $(common_cflags)
27LOCAL_C_INCLUDES := $(common_c_includes)
28LOCAL_CLANG := true
29LOCAL_SANITIZE := integer
30LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
31LOCAL_MODULE := libfec
32LOCAL_SRC_FILES := $(common_src_files)
33LOCAL_STATIC_LIBRARIES := \
34    libfec_rs \
35    libext4_utils_static \
36    libsquashfs_utils \
37    libcutils \
38    $(common_static_libraries)
39include $(BUILD_STATIC_LIBRARY)
40
41include $(CLEAR_VARS)
42LOCAL_CFLAGS := $(common_cflags) -D_GNU_SOURCE -DFEC_NO_KLOG
43LOCAL_C_INCLUDES := $(common_c_includes)
44LOCAL_CLANG := true
45ifeq ($(HOST_OS),linux)
46LOCAL_SANITIZE := integer
47endif
48LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
49LOCAL_MODULE := libfec_host
50LOCAL_SRC_FILES := $(common_src_files)
51LOCAL_STATIC_LIBRARIES := \
52    libfec_rs_host \
53    libext4_utils_host \
54    libsquashfs_utils_host \
55    $(common_static_libraries)
56include $(BUILD_HOST_STATIC_LIBRARY)
57
58include $(LOCAL_PATH)/test/Android.mk
59