Martijn Coenen | 5c65c3a | 2013-03-27 13:23:36 -0700 | [diff] [blame] | 1 | # function to find all *.cpp files under a directory |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 2 | define all-cpp-files-under |
| 3 | $(patsubst ./%,%, \ |
| 4 | $(shell cd $(LOCAL_PATH) ; \ |
| 5 | find $(1) -name "*.cpp" -and -not -name ".*") \ |
| 6 | ) |
| 7 | endef |
| 8 | |
| 9 | |
| 10 | LOCAL_PATH:= $(call my-dir) |
Martijn Coenen | 5c65c3a | 2013-03-27 13:23:36 -0700 | [diff] [blame] | 11 | NFA := src/nfa |
| 12 | NFC := src/nfc |
| 13 | HAL := src/hal |
| 14 | UDRV := src/udrv |
| 15 | HALIMPL := halimpl/bcm2079x |
| 16 | D_CFLAGS := -DANDROID -DBUILDCFG=1 |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 17 | |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 18 | |
Martijn Coenen | 5c65c3a | 2013-03-27 13:23:36 -0700 | [diff] [blame] | 19 | ###################################### |
| 20 | # Build shared library system/lib/libnfc-nci.so for stack code. |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 21 | |
| 22 | include $(CLEAR_VARS) |
| 23 | LOCAL_PRELINK_MODULE := false |
| 24 | LOCAL_ARM_MODE := arm |
Martijn Coenen | 5c65c3a | 2013-03-27 13:23:36 -0700 | [diff] [blame] | 25 | LOCAL_MODULE := libnfc-nci |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 26 | LOCAL_MODULE_TAGS := optional |
Ying Wang | 878a04b | 2013-04-09 21:49:35 -0700 | [diff] [blame] | 27 | LOCAL_SHARED_LIBRARIES := libhardware_legacy libcutils liblog libdl libstlport libhardware |
Martijn Coenen | 5c65c3a | 2013-03-27 13:23:36 -0700 | [diff] [blame] | 28 | LOCAL_CFLAGS := $(D_CFLAGS) |
| 29 | LOCAL_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_SRC_FILES := \ |
| 40 | $(call all-c-files-under, $(NFA)/ce $(NFA)/dm $(NFA)/ee) \ |
| 41 | $(call all-c-files-under, $(NFA)/hci $(NFA)/int $(NFA)/p2p $(NFA)/rw $(NFA)/sys) \ |
| 42 | $(call all-c-files-under, $(NFC)/int $(NFC)/llcp $(NFC)/nci $(NFC)/ndef $(NFC)/nfc $(NFC)/tags) \ |
| 43 | $(call all-c-files-under, src/adaptation) \ |
| 44 | $(call all-cpp-files-under, src/adaptation) \ |
| 45 | $(call all-c-files-under, src/gki) \ |
| 46 | src/nfca_version.c |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 47 | include $(BUILD_SHARED_LIBRARY) |
| 48 | |
Martijn Coenen | 5c65c3a | 2013-03-27 13:23:36 -0700 | [diff] [blame] | 49 | |
| 50 | ###################################### |
| 51 | # Build shared library system/lib/hw/nfc_nci.*.so for Hardware Abstraction Layer. |
| 52 | # Android's generic HAL (libhardware.so) dynamically loads this shared library. |
| 53 | |
| 54 | include $(CLEAR_VARS) |
| 55 | LOCAL_MODULE := nfc_nci.$(TARGET_DEVICE) |
| 56 | LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw |
| 57 | LOCAL_SRC_FILES := $(call all-c-files-under, $(HALIMPL)) \ |
| 58 | $(call all-cpp-files-under, $(HALIMPL)) |
| 59 | LOCAL_SHARED_LIBRARIES := liblog libcutils libhardware_legacy libstlport |
| 60 | LOCAL_MODULE_TAGS := optional |
| 61 | LOCAL_C_INCLUDES := external/stlport/stlport bionic/ bionic/libstdc++/include \ |
| 62 | $(LOCAL_PATH)/$(HALIMPL)/include \ |
| 63 | $(LOCAL_PATH)/$(HALIMPL)/gki/ulinux \ |
| 64 | $(LOCAL_PATH)/$(HALIMPL)/gki/common \ |
| 65 | $(LOCAL_PATH)/$(HAL)/include \ |
| 66 | $(LOCAL_PATH)/$(HAL)/int \ |
| 67 | $(LOCAL_PATH)/src/include \ |
| 68 | $(LOCAL_PATH)/$(NFC)/include \ |
| 69 | $(LOCAL_PATH)/$(NFA)/include \ |
| 70 | $(LOCAL_PATH)/$(UDRV)/include |
| 71 | LOCAL_CFLAGS := $(D_CFLAGS) -DNFC_HAL_TARGET=TRUE -DNFC_RW_ONLY=TRUE |
| 72 | LOCAL_CPPFLAGS := $(LOCAL_CFLAGS) |
| 73 | include $(BUILD_SHARED_LIBRARY) |
| 74 | |
| 75 | |
| 76 | ###################################### |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 77 | include $(call all-makefiles-under,$(LOCAL_PATH)) |