Using VPATH with ndk-build

382 views Asked by At

Currently trying to port a Makefile to an Android.mk file such that I can build a shared library with ndk-build

I can't seem to get VPATH to do anything though.

e.g.

# File: Android.mk
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE    := example

MY_API_SRCS = \
    core/src/destroy.c \
    core/src/initialise.c \
    core/src/loadLibrary.c \
    core/src/loadSettings.c \
    core/src/processPulses.c

works fine, but trying to strip out the directory part and specify a VPATH instead doesn't, e.g.

# File: Android.mk
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE    := example

VPATH := $(LOCAL_PATH)/core/src

MY_API_SRCS = \
    destroy.c \
    initialise.c \
    loadLibrary.c \
    loadSettings.c \
    processPulses.c

I get a no such file or directory error when running ndk-build

Am I right in thinking you should be able to use standard GNU Make syntax in an Android.mk file? Not sure why this isn't working...

1

There are 1 answers

3
Infinity On

You have a backslash there on your VPATH :p