はじめに
2013/05/21 にリリースされた Android NDK toolchain r8e の Makefile にバグがあり、ndk-build clean でエラーになります。その問題の解決方法です。
元ネタはこちら。
- Correcting a Bug in the Latest Google NDK r8e
- http://www.appcelerator.com/blog/2013/03/correcting-a-bug-in-the-latest-google-ndk-r8e/
- PSA: Android NDK r8e is out!
- https://groups.google.com/forum/?fromgroups=#!topic/android-ndk/3wIbb-h3nDU
現象
ndk-build clean を実行すると以下のようなシェルスクリプトのシンタックスエラーが発生する。
Clean: cpufeatures [armeabi-v7a]
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `rm -rf (TARGET_OBJS)'
make: *** [clean-cpufeatures-armeabi-v7a] Error 2
解決方法
android-ndk/build/core/build-binary.mk の 49 行目を変更してください。
-$(cleantarget): PRIVATE_CLEAN_FILES := ($(my)OBJS)
+$(cleantarget): PRIVATE_CLEAN_FILES := $($(my)OBJS)
おわりに
現時点での最新版は r9b なのでそちらを利用した方が良いです。
開発環境を変えられないとか、諸事情で r8e を使い続けている方の助けになれば幸いです。