0

I am building AOSP Kitkat (4.4) and trying to find the Android.mk file that defines the libnfc-nci module. The libnfc_nci_jni module depends on this local shared library (Android.mk included below) and I want to see the source that generates this .so file. I know that the nfc.h exists in /hardware/libhardware/include/hardware/nfc.h, but that is only the headers.

As far as I know, the available tools for searching android source code are cgrep, jgrep, and resgrep. However, (to my knowledge) these don't search Android.mk files. Is there a tool that I'm missing that I can use to find the directory that contains the module libnfc-nci?

Here is the Android.mk for libnfc_nci_jni (found in /packages/apps/Nfc/nci/jni/Android.mk)

VOB_COMPONENTS := external/libnfc-nci/src
NFA := $(VOB_COMPONENTS)/nfa
NFC := $(VOB_COMPONENTS)/nfc

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_PRELINK_MODULE := false

ifneq ($(NCI_VERSION),)
LOCAL_CFLAGS += -DNCI_VERSION=$(NCI_VERSION) -O0 -g
endif

LOCAL_CFLAGS += -Wall -Wextra

define all-cpp-files-under
$(patsubst ./%,%, \
  $(shell cd $(LOCAL_PATH) ; \
          find $(1) -name "*.cpp" -and -not -name ".*") \
 )
endef

LOCAL_SRC_FILES:= $(call all-cpp-files-under, .)

LOCAL_C_INCLUDES += \
    bionic \
    bionic/libstdc++ \
    external/stlport/stlport \
    external/libxml2/include \
    external/icu4c/common \
    frameworks/native/include \
    libcore/include \
    $(NFA)/include \
    $(NFA)/brcm \
    $(NFC)/include \
    $(NFC)/brcm \
    $(NFC)/int \
    $(VOB_COMPONENTS)/hal/include \
    $(VOB_COMPONENTS)/hal/int \
    $(VOB_COMPONENTS)/include \
    $(VOB_COMPONENTS)/gki/ulinux \
    $(VOB_COMPONENTS)/gki/common

LOCAL_SHARED_LIBRARIES := \
    libicuuc \
    libnativehelper \
    libcutils \
    libutils \
    liblog \
    libnfc-nci \
    libstlport

LOCAL_STATIC_LIBRARIES := libxml2

LOCAL_MODULE := libnfc_nci_jni
LOCAL_MODULE_TAGS := optional

include $(BUILD_SHARED_LIBRARY)

I am running Ubuntu 14.04

John Dempsey
  • 124
  • 7

2 Answers2

1

You should try : godir libnfc-nci It should give you options in case thete ae several such directories

EyalBellisha
  • 1,874
  • 19
  • 28
-1

I found libnfc-nci in /external/libnfc-nci after some more googling. It seems there is no better tool to search aosp for a module than google (unless you write your own script).

As Gabe Sechan noted, a grep solution is possible. Here is the command I used that seemed to do the trick (working directory is the root of AOSP).

grep -inIEr "LOCAL_MODULE := libnfc-nci" .
John Dempsey
  • 124
  • 7