HappyMonkey HappyMonkey - 5 months ago 24
Android Question

Compiling native android library with multiple c files using ndk build errors * No rule to make target

I am having an issue compiling a shared C library into a .so for android. I've copied all the .c and .h files into the jni folder. I posted a screenshot below to show the contents of the

Android.mk
file as well as the folder hierarchy.

Android.mk and Folder contents

below is the output of
ndk-build
run in the project root folder NTRUMLS

[kenway@jackdaw NTRUMLS]$ ndk-build
make: *** No rule to make target '/media/bigdata/Android/Sdk/ndk-bundle/build/core/crypto_hash_sha512.c', needed by 'obj/local/arm64-v8a/objs/ntrumls/crypto_hash_sha512.o'. Stop.


i checked for spaces and typo's. here's the contents of my Android.mk copied directly below.

include $(CLEAR_VARS)

LOCAL_ARM_MODE := arm
LOCAL_PATH := $(call my-dir)

LOCAL_MODULE := libntrumls
LOCAL_CFLAGS := -Werror
LOCAL_SRC_FILES := crypto_hash_sha512.c \
crypto_stream.c \
convert.c \
randombytes.c \
fastrandombytes.c \
pack.c \
pol.c \
params.c \
pqntrusign.c \
shred.c

LOCAL_LDLIBS := -llog

include $(BUILD_SHARED_LIBRARY)

Answer

Move

LOCAL_PATH := $(call my-dir)

to be the first statement of your Android.mk script.