blob: e0cdb8fcefc6f061b1f70f8d182cef2e4a71c4dc [file] [log] [blame]
Puneet Mishrab6393452015-11-11 17:34:44 +00001ifeq ($(strip $(TARGET_USES_NQ_NFC)),true)
nxpandroidc7611652015-09-23 16:42:05 +05302LOCAL_PATH:= $(call my-dir)
3include $(CLEAR_VARS)
4NFA := src/nfa
5NFC := src/nfc
6HAL := src/hal
7UDRV := src/udrv
8
nxpandroidcdd30442016-05-27 17:26:18 +05309D_CFLAGS := -DANDROID -DBUILDCFG=1 \
10 -Wno-deprecated-register \
11 -Wno-unused-parameter \
nxpandroidc7611652015-09-23 16:42:05 +053012
nxpandroid6154b732016-01-14 20:39:23 +053013#Enable NXP Specific
nxpandroid25862ca2015-11-06 18:43:02 +053014D_CFLAGS += -DNXP_EXTNS=TRUE
Rohit Rangwani99cb5622016-10-14 17:13:01 +053015D_CFLAGS += -DNFC_NXP_STAT_DUAL_UICC_EXT_SWITCH=FALSE
nxpandroid6154b732016-01-14 20:39:23 +053016D_CFLAGS += -DNFC_NXP_AID_MAX_SIZE_DYN=TRUE
nxpandroidcdd30442016-05-27 17:26:18 +053017
18#Enable HCE-F specific
19D_CFLAGS += -DNXP_NFCC_HCE_F=TRUE
20
nxpandroidc7611652015-09-23 16:42:05 +053021#variables for NFC_NXP_CHIP_TYPE
22PN547C2 := 1
23PN548C2 := 2
nxpandroidcdd30442016-05-27 17:26:18 +053024PN551 := 3
nxpandroid3e4012e2016-08-01 19:09:55 +053025PN553 := 4
Gaurav Singhal73ba0f82017-07-18 15:38:16 +053026PN557 := 5
nxpandroidc7611652015-09-23 16:42:05 +053027
28ifeq ($(PN547C2),1)
29D_CFLAGS += -DPN547C2=1
30endif
31ifeq ($(PN548C2),2)
32D_CFLAGS += -DPN548C2=2
33endif
nxpandroidcdd30442016-05-27 17:26:18 +053034ifeq ($(PN551),3)
35D_CFLAGS += -DPN551=3
36endif
nxpandroid3e4012e2016-08-01 19:09:55 +053037ifeq ($(PN553),4)
38D_CFLAGS += -DPN553=4
39endif
Gaurav Singhal73ba0f82017-07-18 15:38:16 +053040ifeq ($(PN557),5)
41D_CFLAGS += -DPN557=5
42endif
nxpandroidc7611652015-09-23 16:42:05 +053043
44#### Select the JCOP OS Version ####
nxpandroidcdd30442016-05-27 17:26:18 +053045JCOP_VER_3_1 := 1
46JCOP_VER_3_2 := 2
47JCOP_VER_3_3 := 3
nxpandroid70cccc72016-11-18 19:58:22 +053048JCOP_VER_4_0 := 4
nxpandroidc7611652015-09-23 16:42:05 +053049
nxpandroidcdd30442016-05-27 17:26:18 +053050LOCAL_CFLAGS += -DJCOP_VER_3_1=$(JCOP_VER_3_1)
nxpandroidc7611652015-09-23 16:42:05 +053051LOCAL_CFLAGS += -DJCOP_VER_3_2=$(JCOP_VER_3_2)
nxpandroid6154b732016-01-14 20:39:23 +053052LOCAL_CFLAGS += -DJCOP_VER_3_3=$(JCOP_VER_3_3)
nxpandroid70cccc72016-11-18 19:58:22 +053053LOCAL_CFLAGS += -DJCOP_VER_4_0=$(JCOP_VER_4_0)
nxpandroidc7611652015-09-23 16:42:05 +053054
Puneet Mishra3f9537a2015-11-23 16:57:02 +000055NFC_NXP_ESE:= TRUE
nxpandroidc7611652015-09-23 16:42:05 +053056ifeq ($(NFC_NXP_ESE),TRUE)
57LOCAL_CFLAGS += -DNFC_NXP_ESE=TRUE
nxpandroid70cccc72016-11-18 19:58:22 +053058LOCAL_CFLAGS += -DNFC_NXP_ESE_VER=$(JCOP_VER_4_0)
nxpandroidc7611652015-09-23 16:42:05 +053059else
nxpandroiddacfb3b2016-08-25 20:27:04 +053060LOCAL_CFLAGS += -DNFC_NXP_ESE=FALSE
nxpandroidc7611652015-09-23 16:42:05 +053061endif
62
63#### Select the CHIP ####
Rohit Rangwanibe0dd332016-10-21 12:55:26 +053064ifeq ($(strip $(NQ3XX_PRESENT)),true)
Gaurav Singhal73ba0f82017-07-18 15:38:16 +053065NXP_CHIP_TYPE := $(PN557)
Rohit Rangwanibe0dd332016-10-21 12:55:26 +053066else
Gaurav Singhal85866802016-06-15 20:10:36 +053067NXP_CHIP_TYPE := $(PN548C2)
Rohit Rangwanibe0dd332016-10-21 12:55:26 +053068endif
nxpandroid6154b732016-01-14 20:39:23 +053069
70ifeq ($(NXP_CHIP_TYPE),$(PN547C2))
71D_CFLAGS += -DNFC_NXP_CHIP_TYPE=PN547C2
72else ifeq ($(NXP_CHIP_TYPE),$(PN548C2))
nxpandroidc7611652015-09-23 16:42:05 +053073D_CFLAGS += -DNFC_NXP_CHIP_TYPE=PN548C2
nxpandroidcdd30442016-05-27 17:26:18 +053074else ifeq ($(NXP_CHIP_TYPE),$(PN551))
75D_CFLAGS += -DNFC_NXP_CHIP_TYPE=PN551
nxpandroid3e4012e2016-08-01 19:09:55 +053076else ifeq ($(NXP_CHIP_TYPE),$(PN553))
77D_CFLAGS += -DNFC_NXP_CHIP_TYPE=PN553
Gaurav Singhal73ba0f82017-07-18 15:38:16 +053078else ifeq ($(NXP_CHIP_TYPE),$(PN557))
79D_CFLAGS += -DNFC_NXP_CHIP_TYPE=PN557
nxpandroid6154b732016-01-14 20:39:23 +053080endif
nxpandroidc7611652015-09-23 16:42:05 +053081
82#Gemalto SE support
83D_CFLAGS += -DGEMALTO_SE_SUPPORT
84D_CFLAGS += -DNXP_UICC_ENABLE
nxpandroid70cccc72016-11-18 19:58:22 +053085ifeq ($(NXP_CHIP_TYPE),$(PN553))
nxpandroid3e4012e2016-08-01 19:09:55 +053086D_CFLAGS += -DJCOP_WA_ENABLE=FALSE
nxpandroid70cccc72016-11-18 19:58:22 +053087else
88D_CFLAGS += -DJCOP_WA_ENABLE=TRUE
89endif
nxpandroid6154b732016-01-14 20:39:23 +053090
91#Routing Entries optimization
92D_CFLAGS += -DNFC_NXP_LISTEN_ROUTE_TBL_OPTIMIZATION=TRUE
nxpandroidc7611652015-09-23 16:42:05 +053093######################################
94# Build shared library system/lib/libnfc-nci.so for stack code.
95
nxpandroidc7611652015-09-23 16:42:05 +053096LOCAL_ARM_MODE := arm
nxpandroid70cccc72016-11-18 19:58:22 +053097ifeq (true,$(TARGET_IS_64_BIT))
98LOCAL_MULTILIB := 64
99else
100LOCAL_MULTILIB := 32
101endif
Puneet Mishrab6393452015-11-11 17:34:44 +0000102LOCAL_MODULE := libnqnfc-nci
nxpandroidc7611652015-09-23 16:42:05 +0530103LOCAL_MODULE_TAGS := optional
Puneet Mishrab6393452015-11-11 17:34:44 +0000104LOCAL_MODULE_OWNER := nxp
nxpandroid25862ca2015-11-06 18:43:02 +0530105LOCAL_SHARED_LIBRARIES := libhardware_legacy libcutils liblog libdl libhardware
nxpandroidc7611652015-09-23 16:42:05 +0530106LOCAL_CFLAGS += $(D_CFLAGS)
nxpandroid25862ca2015-11-06 18:43:02 +0530107LOCAL_C_INCLUDES := $(LOCAL_PATH)/src/include \
nxpandroidc7611652015-09-23 16:42:05 +0530108 $(LOCAL_PATH)/src/gki/ulinux \
109 $(LOCAL_PATH)/src/gki/common \
110 $(LOCAL_PATH)/$(NFA)/include \
111 $(LOCAL_PATH)/$(NFA)/int \
112 $(LOCAL_PATH)/$(NFC)/include \
113 $(LOCAL_PATH)/$(NFC)/int \
114 $(LOCAL_PATH)/src/hal/include \
115 $(LOCAL_PATH)/src/hal/int \
Martijn Coenen634b0e92016-09-06 16:05:25 +0200116 $(LOCAL_PATH)/$(HALIMPL)/include \
117 system/libhwbinder/include
118
119# Treble configuration
Gaurav Singhal8ff8a782017-05-09 08:38:03 +0530120LOCAL_SHARED_LIBRARIES += libhidlbase libhidltransport libhwbinder libutils android.hardware.nfc@1.0 vendor.nxp.hardware.nfc@1.0
nxpandroidc7611652015-09-23 16:42:05 +0530121LOCAL_SRC_FILES := \
122 $(call all-c-files-under, $(NFA)/ce $(NFA)/dm $(NFA)/ee) \
123 $(call all-c-files-under, $(NFA)/hci $(NFA)/int $(NFA)/p2p $(NFA)/rw $(NFA)/sys) \
124 $(call all-c-files-under, $(NFC)/int $(NFC)/llcp $(NFC)/nci $(NFC)/ndef $(NFC)/nfc $(NFC)/tags) \
125 $(call all-c-files-under, src/adaptation) \
126 $(call all-cpp-files-under, src/adaptation) \
127 $(call all-c-files-under, src/gki) \
128 src/nfca_version.c
129include $(BUILD_SHARED_LIBRARY)
130
131
132######################################
133include $(call all-makefiles-under,$(LOCAL_PATH))
Puneet Mishrab6393452015-11-11 17:34:44 +0000134endif