gnychis
gnychis

Reputation: 7555

how to run a shell command at the END of the Android.mk build process?

I am trying to copy a file from libs/arm/eabi in to res/raw at the end of the NDK build process using Android.mk

From some searching, I found that you can run a shell command to copy the file, like this:

$(shell cp $(LOCAL_PATH)/../../libs/armeabi/pcapd res/raw)

However, even if I put this at the end of my top-most Android.mk, it always tries to run this command first. How can I get it to run this after the build completes?

Upvotes: 3

Views: 4608

Answers (2)

Gungnir
Gungnir

Reputation: 359

You can add to your Android.mk before #include $(BUILD_EXECUTABLE):

LOCAL_POST_INSTALL_CMD := \
         cp $(LOCAL_PATH)/../../libs/armeabi/pcapd res/raw

Upvotes: 3

ognian
ognian

Reputation: 11541

Write a makefile that calls ndk-build and then your shell line. Build your project by executing make

Upvotes: 1

Related Questions