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_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
24LOCAL_ARM_MODE := arm
25LOCAL_MODULE := libnfc-nci
26LOCAL_MODULE_TAGS := optional
27LOCAL_SHARED_LIBRARIES := libhardware_legacy libcutils liblog libdl libhardware
28LOCAL_CFLAGS := $(D_CFLAGS)
29LOCAL_C_INCLUDES := \
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_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
58LOCAL_MODULE := nfc_nci.bcm2079x.default
59LOCAL_MODULE_RELATIVE_PATH := hw
60LOCAL_SRC_FILES := $(call all-c-files-under, $(HALIMPL)) \
61    $(call all-cpp-files-under, $(HALIMPL)) \
62    src/adaptation/CrcChecksum.cpp \
63    src//nfca_version.c
64LOCAL_SHARED_LIBRARIES := liblog libcutils libhardware_legacy
65LOCAL_MODULE_TAGS := optional
66LOCAL_C_INCLUDES := \
67    $(LOCAL_PATH)/$(HALIMPL)/include \
68    $(LOCAL_PATH)/$(HALIMPL)/gki/ulinux \
69    $(LOCAL_PATH)/$(HALIMPL)/gki/common \
70    $(LOCAL_PATH)/$(HAL)/include \
71    $(LOCAL_PATH)/$(HAL)/int \
72    $(LOCAL_PATH)/src/include \
73    $(LOCAL_PATH)/$(NFC)/include \
74    $(LOCAL_PATH)/$(NFA)/include \
75    $(LOCAL_PATH)/$(UDRV)/include
76LOCAL_CFLAGS := $(D_CFLAGS) -DNFC_HAL_TARGET=TRUE -DNFC_RW_ONLY=TRUE
77LOCAL_CPPFLAGS := $(LOCAL_CFLAGS)
78include $(BUILD_SHARED_LIBRARY)
79
80
81######################################
82include $(call all-makefiles-under,$(LOCAL_PATH))
83