1# function to find all *.cpp files under a directory
2define all-cpp-files-under
3$(patsubst ./%,%, \
4  $(shell cd $(LOCAL_PATH) ; \
5          find $(1) -name "*.cpp" -and -not -name ".*") \
6 )
7endef
8
9
10LOCAL_PATH:= $(call my-dir)
11NFA := src/nfa
12NFC := src/nfc
13HAL := src/hal
14UDRV := src/udrv
15HALIMPL := halimpl/bcm2079x
16D_CFLAGS := -DANDROID -DBUILDCFG=1
17
18
19######################################
20# Build shared library system/lib/libnfc-nci.so for stack code.
21
22include $(CLEAR_VARS)
23LOCAL_PRELINK_MODULE := false
24LOCAL_ARM_MODE := arm
25LOCAL_MODULE := libnfc-nci
26LOCAL_MODULE_TAGS := optional
27LOCAL_SHARED_LIBRARIES := libhardware_legacy libcutils liblog libdl libstlport libhardware
28LOCAL_CFLAGS := $(D_CFLAGS)
29LOCAL_C_INCLUDES := external/stlport/stlport bionic/ bionic/libstdc++/include \
30    $(LOCAL_PATH)/src/include \
31    $(LOCAL_PATH)/src/gki/ulinux \
32    $(LOCAL_PATH)/src/gki/common \
33    $(LOCAL_PATH)/$(NFA)/include \
34    $(LOCAL_PATH)/$(NFA)/int \
35    $(LOCAL_PATH)/$(NFC)/include \
36    $(LOCAL_PATH)/$(NFC)/int \
37    $(LOCAL_PATH)/src/hal/include \
38    $(LOCAL_PATH)/src/hal/int \
39    $(LOCAL_PATH)/$(HALIMPL)/include
40LOCAL_SRC_FILES := \
41    $(call all-c-files-under, $(NFA)/ce $(NFA)/dm $(NFA)/ee) \
42    $(call all-c-files-under, $(NFA)/hci $(NFA)/int $(NFA)/p2p $(NFA)/rw $(NFA)/sys) \
43    $(call all-c-files-under, $(NFC)/int $(NFC)/llcp $(NFC)/nci $(NFC)/ndef $(NFC)/nfc $(NFC)/tags) \
44    $(call all-c-files-under, src/adaptation) \
45    $(call all-cpp-files-under, src/adaptation) \
46    $(call all-c-files-under, src/gki) \
47    $(HALIMPL)/adaptation/android_logmsg.cpp \
48    src/nfca_version.c
49include $(BUILD_SHARED_LIBRARY)
50
51
52######################################
53# Build shared library system/lib/hw/nfc_nci.*.so for Hardware Abstraction Layer.
54# Android's generic HAL (libhardware.so) dynamically loads this shared library.
55
56include $(CLEAR_VARS)
57LOCAL_MODULE := nfc_nci.bcm2079x.default
58LOCAL_MODULE_RELATIVE_PATH := hw
59LOCAL_SRC_FILES := $(call all-c-files-under, $(HALIMPL)) \
60    $(call all-cpp-files-under, $(HALIMPL)) \
61    src/adaptation/CrcChecksum.cpp \
62    src//nfca_version.c
63LOCAL_SHARED_LIBRARIES := liblog libcutils libhardware_legacy libstlport
64LOCAL_MODULE_TAGS := optional
65LOCAL_C_INCLUDES := external/stlport/stlport bionic/ bionic/libstdc++/include \
66    $(LOCAL_PATH)/$(HALIMPL)/include \
67    $(LOCAL_PATH)/$(HALIMPL)/gki/ulinux \
68    $(LOCAL_PATH)/$(HALIMPL)/gki/common \
69    $(LOCAL_PATH)/$(HAL)/include \
70    $(LOCAL_PATH)/$(HAL)/int \
71    $(LOCAL_PATH)/src/include \
72    $(LOCAL_PATH)/$(NFC)/include \
73    $(LOCAL_PATH)/$(NFA)/include \
74    $(LOCAL_PATH)/$(UDRV)/include
75LOCAL_CFLAGS := $(D_CFLAGS) -DNFC_HAL_TARGET=TRUE -DNFC_RW_ONLY=TRUE
76LOCAL_CPPFLAGS := $(LOCAL_CFLAGS)
77include $(BUILD_SHARED_LIBRARY)
78
79
80######################################
81include $(call all-makefiles-under,$(LOCAL_PATH))
82