2
0

Makefile 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834
  1. # build options
  2. OS := $(shell uname)
  3. # compile with GPROF
  4. # GPROF = 1
  5. # build for build platform
  6. API = 14
  7. APP_PLATFORM = android-$(API)
  8. ANDR_ROOT = $(shell pwd)
  9. PROJ_ROOT = $(shell realpath $(ANDR_ROOT)/../..)
  10. APP_ROOT = $(ANDR_ROOT)/src/main
  11. GAMES_TO_COPY = minetest_game
  12. MODS_TO_COPY =
  13. VERSION_MAJOR := $(shell cat $(PROJ_ROOT)/CMakeLists.txt | \
  14. grep ^set\(VERSION_MAJOR\ | sed 's/)/ /' | cut -f2 -d' ')
  15. VERSION_MINOR := $(shell cat $(PROJ_ROOT)/CMakeLists.txt | \
  16. grep ^set\(VERSION_MINOR\ | sed 's/)/ /' | cut -f2 -d' ')
  17. VERSION_PATCH := $(shell cat $(PROJ_ROOT)/CMakeLists.txt | \
  18. grep ^set\(VERSION_PATCH\ | sed 's/)/ /' | cut -f2 -d' ')
  19. ################################################################################
  20. # toolchain config for arm new processors
  21. ################################################################################
  22. TARGET_HOST = arm-linux
  23. TARGET_ABI = armeabi-v7a
  24. TARGET_LIBDIR = armeabi-v7a
  25. TARGET_TOOLCHAIN = arm-linux-androideabi-
  26. TARGET_CFLAGS_ADDON = -mfloat-abi=softfp -mfpu=vfpv3 -O3 -D__ANDROID_API__=$(API)
  27. TARGET_CXXFLAGS_ADDON = $(TARGET_CFLAGS_ADDON)
  28. TARGET_ARCH = armv7
  29. CROSS_PREFIX = arm-linux-androideabi-
  30. COMPILER_VERSION = 4.9
  31. HAVE_LEVELDB = 0
  32. ################################################################################
  33. # toolchain config for little endian mips
  34. ################################################################################
  35. #TARGET_HOST = mipsel-linux
  36. #TARGET_ABI = mips
  37. #TARGET_LIBDIR = mips
  38. #TARGET_TOOLCHAIN = mipsel-linux-android-
  39. #TARGET_ARCH = mips32
  40. #CROSS_PREFIX = mipsel-linux-android-
  41. #COMPILER_VERSION = 4.9
  42. #HAVE_LEVELDB = 0
  43. ################################################################################
  44. # toolchain config for x86
  45. ################################################################################
  46. #TARGET_HOST = x86-linux
  47. #TARGET_ABI = x86
  48. #TARGET_LIBDIR = x86
  49. #TARGET_TOOLCHAIN = x86-
  50. #CROSS_PREFIX = i686-linux-android-
  51. #TARGET_ARCH = x86
  52. #COMPILER_VERSION = 4.9
  53. #HAVE_LEVELDB = 0
  54. ################################################################################
  55. ASSETS_TIMESTAMP = deps/assets_timestamp
  56. LEVELDB_DIR = $(ANDR_ROOT)/deps/leveldb/
  57. LEVELDB_LIB = $(LEVELDB_DIR)libleveldb.a
  58. LEVELDB_TIMESTAMP = $(LEVELDB_DIR)/timestamp
  59. LEVELDB_TIMESTAMP_INT = $(ANDR_ROOT)/deps/leveldb_timestamp
  60. LEVELDB_URL_GIT = https://github.com/google/leveldb
  61. LEVELDB_COMMIT = 2d0320a458d0e6a20fff46d5f80b18bfdcce7018
  62. OPENAL_DIR = $(ANDR_ROOT)/deps/openal-soft/
  63. OPENAL_LIB = $(OPENAL_DIR)libs/$(TARGET_ABI)/libopenal.so
  64. OPENAL_TIMESTAMP = $(OPENAL_DIR)/timestamp
  65. OPENAL_TIMESTAMP_INT = $(ANDR_ROOT)/deps/openal_timestamp
  66. OPENAL_URL_GIT = https://github.com/apportable/openal-soft
  67. OGG_DIR = $(ANDR_ROOT)/deps/libvorbis-libogg-android/
  68. OGG_LIB = $(OGG_DIR)libs/$(TARGET_ABI)/libogg.so
  69. VORBIS_LIB = $(OGG_DIR)libs/$(TARGET_ABI)/libogg.so
  70. OGG_TIMESTAMP = $(OGG_DIR)timestamp
  71. OGG_TIMESTAMP_INT = $(ANDR_ROOT)/deps/ogg_timestamp
  72. OGG_URL_GIT = https://github.com/vincentjames501/libvorbis-libogg-android
  73. IRRLICHT_REVISION = 5145
  74. IRRLICHT_DIR = $(ANDR_ROOT)/deps/irrlicht/
  75. IRRLICHT_LIB = $(IRRLICHT_DIR)lib/Android/libIrrlicht.a
  76. IRRLICHT_TIMESTAMP = $(IRRLICHT_DIR)timestamp
  77. IRRLICHT_TIMESTAMP_INT = $(ANDR_ROOT)/deps/irrlicht_timestamp
  78. IRRLICHT_URL_SVN = https://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@$(IRRLICHT_REVISION)
  79. OPENSSL_VERSION = 1.0.2k
  80. OPENSSL_BASEDIR = openssl-$(OPENSSL_VERSION)
  81. OPENSSL_DIR = $(ANDR_ROOT)/deps/$(OPENSSL_BASEDIR)/
  82. OPENSSL_LIB = $(OPENSSL_DIR)/libssl.so.1.0.0
  83. OPENSSL_TIMESTAMP = $(OPENSSL_DIR)timestamp
  84. OPENSSL_TIMESTAMP_INT = $(ANDR_ROOT)/deps/openssl_timestamp
  85. OPENSSL_URL = https://www.openssl.org/source/openssl-$(OPENSSL_VERSION).tar.gz
  86. CURL_VERSION = 7.54.0
  87. CURL_DIR = $(ANDR_ROOT)/deps/curl-$(CURL_VERSION)
  88. CURL_LIB = $(CURL_DIR)/lib/.libs/libcurl.a
  89. CURL_TIMESTAMP = $(CURL_DIR)/timestamp
  90. CURL_TIMESTAMP_INT = $(ANDR_ROOT)/deps/curl_timestamp
  91. CURL_URL_HTTP = https://curl.haxx.se/download/curl-${CURL_VERSION}.tar.bz2
  92. GMP_VERSION = 6.1.2
  93. GMP_DIR = $(ANDR_ROOT)/deps/gmp-$(GMP_VERSION)
  94. GMP_LIB = $(GMP_DIR)/usr/lib/libgmp.so
  95. GMP_TIMESTAMP = $(GMP_DIR)/timestamp
  96. GMP_TIMESTAMP_INT = $(ANDR_ROOT)/deps/gmp_timestamp
  97. GMP_URL_HTTP = https://gmplib.org/download/gmp/gmp-$(GMP_VERSION).tar.bz2
  98. FREETYPE_DIR = $(ANDR_ROOT)/deps/freetype2-android/
  99. FREETYPE_LIB = $(FREETYPE_DIR)/Android/obj/local/$(TARGET_ABI)/libfreetype2-static.a
  100. FREETYPE_TIMESTAMP = $(FREETYPE_DIR)timestamp
  101. FREETYPE_TIMESTAMP_INT = $(ANDR_ROOT)/deps/freetype_timestamp
  102. FREETYPE_URL_GIT = https://github.com/cdave1/freetype2-android
  103. ICONV_VERSION = 1.14
  104. ICONV_DIR = $(ANDR_ROOT)/deps/libiconv/
  105. ICONV_LIB = $(ICONV_DIR)/lib/.libs/libiconv.so
  106. ICONV_TIMESTAMP = $(ICONV_DIR)timestamp
  107. ICONV_TIMESTAMP_INT = $(ANDR_ROOT)/deps/iconv_timestamp
  108. ICONV_URL_HTTP = https://ftp.gnu.org/pub/gnu/libiconv/libiconv-$(ICONV_VERSION).tar.gz
  109. SQLITE3_FOLDER = sqlite-amalgamation-3180000
  110. SQLITE3_URL = https://www.sqlite.org/2017/$(SQLITE3_FOLDER).zip
  111. ANDROID_SDK = $(shell grep '^sdk\.dir' local.properties | sed 's/^.*=[[:space:]]*//')
  112. ANDROID_NDK = $(shell grep '^ndk\.dir' local.properties | sed 's/^.*=[[:space:]]*//')
  113. #use interim target variable to switch leveldb on or off
  114. ifeq ($(HAVE_LEVELDB),1)
  115. LEVELDB_TARGET = $(LEVELDB_LIB)
  116. endif
  117. .PHONY : debug release reconfig delconfig \
  118. leveldb_download clean_leveldb leveldb\
  119. irrlicht_download clean_irrlicht irrlicht \
  120. clean_assets assets sqlite3_download \
  121. freetype_download clean_freetype freetype \
  122. apk clean_apk \
  123. clean_all clean prep_srcdir \
  124. install_debug install_release envpaths all \
  125. $(ASSETS_TIMESTAMP) $(LEVELDB_TIMESTAMP) \
  126. $(OPENAL_TIMESTAMP) $(OGG_TIMESTAMP) \
  127. $(IRRLICHT_TIMESTAMP) $(CURL_TIMESTAMP) \
  128. $(OPENSSL_TIMESTAMP) \
  129. $(ANDR_ROOT)/jni/src/android_version.h \
  130. $(ANDR_ROOT)/jni/src/android_version_githash.h
  131. debug : local.properties
  132. export NDEBUG=; \
  133. export BUILD_TYPE=debug; \
  134. $(MAKE) apk
  135. all : debug release
  136. release : local.properties
  137. @export NDEBUG=1; \
  138. export BUILD_TYPE=release; \
  139. $(MAKE) apk
  140. reconfig: delconfig
  141. @$(MAKE) local.properties
  142. delconfig:
  143. $(RM) local.properties
  144. local.properties:
  145. @echo "Please specify path of ANDROID NDK"; \
  146. echo "e.g. $$HOME/Android/ndk-r11c/"; \
  147. read ANDROID_NDK ; \
  148. if [ ! -d $$ANDROID_NDK ] ; then \
  149. echo "$$ANDROID_NDK is not a valid folder"; \
  150. exit 1; \
  151. fi; \
  152. echo "ndk.dir = $$ANDROID_NDK" > local.properties; \
  153. echo "Please specify path of ANDROID SDK"; \
  154. echo "e.g. $$HOME/Android/sdk/"; \
  155. read SDKFLDR ; \
  156. if [ ! -d $$SDKFLDR ] ; then \
  157. echo "$$SDKFLDR is not a valid folder"; \
  158. exit 1; \
  159. fi; \
  160. echo "sdk.dir = $$SDKFLDR" >> local.properties;
  161. $(OPENAL_TIMESTAMP) : openal_download
  162. @LAST_MODIF=$$(find ${OPENAL_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
  163. if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
  164. touch ${OPENAL_TIMESTAMP}; \
  165. fi
  166. openal_download :
  167. @if [ ! -d ${OPENAL_DIR} ] ; then \
  168. echo "openal sources missing, downloading..."; \
  169. mkdir -p ${ANDR_ROOT}/deps; \
  170. cd ${ANDR_ROOT}/deps ; \
  171. git clone ${OPENAL_URL_GIT} || exit 1; \
  172. fi
  173. openal : $(OPENAL_LIB)
  174. $(OPENAL_LIB): $(OPENAL_TIMESTAMP)
  175. + @REFRESH=0; \
  176. if [ ! -e ${OPENAL_TIMESTAMP_INT} ] ; then \
  177. REFRESH=1; \
  178. fi; \
  179. if [ ${OPENAL_TIMESTAMP} -nt ${OPENAL_TIMESTAMP_INT} ] ; then \
  180. REFRESH=1; \
  181. fi; \
  182. if [ $$REFRESH -ne 0 ] ; then \
  183. echo "changed timestamp for openal detected building..."; \
  184. cd ${OPENAL_DIR}; \
  185. export APP_PLATFORM=${APP_PLATFORM}; \
  186. export TARGET_ABI=${TARGET_ABI}; \
  187. ${ANDROID_NDK}/ndk-build NDEBUG=${NDEBUG} \
  188. NDK_APPLICATION_MK=${ANDR_ROOT}/jni/Deps.mk || exit 1; \
  189. touch ${OPENAL_TIMESTAMP}; \
  190. touch ${OPENAL_TIMESTAMP_INT}; \
  191. else \
  192. echo "nothing to be done for openal"; \
  193. fi
  194. clean_openal :
  195. $(RM) -rf ${OPENAL_DIR}
  196. $(OGG_TIMESTAMP) : ogg_download
  197. @LAST_MODIF=$$(find ${OGG_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
  198. if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
  199. touch ${OGG_TIMESTAMP}; \
  200. fi
  201. ogg_download :
  202. @if [ ! -d ${OGG_DIR} ] ; then \
  203. echo "ogg sources missing, downloading..."; \
  204. mkdir -p ${ANDR_ROOT}/deps; \
  205. cd ${ANDR_ROOT}/deps ; \
  206. git clone ${OGG_URL_GIT}|| exit 1; \
  207. cd libvorbis-libogg-android ; \
  208. patch -p1 < ${ANDR_ROOT}/patches/libvorbis-libogg-fpu.patch || exit 1; \
  209. fi
  210. ogg : $(OGG_LIB)
  211. $(OGG_LIB): $(OGG_TIMESTAMP)
  212. + @REFRESH=0; \
  213. if [ ! -e ${OGG_TIMESTAMP_INT} ] ; then \
  214. echo "${OGG_TIMESTAMP_INT} doesn't exist"; \
  215. REFRESH=1; \
  216. fi; \
  217. if [ ${OGG_TIMESTAMP} -nt ${OGG_TIMESTAMP_INT} ] ; then \
  218. REFRESH=1; \
  219. fi; \
  220. if [ $$REFRESH -ne 0 ] ; then \
  221. echo "changed timestamp for ogg detected building..."; \
  222. cd ${OGG_DIR}; \
  223. export APP_PLATFORM=${APP_PLATFORM}; \
  224. export TARGET_ABI=${TARGET_ABI}; \
  225. ${ANDROID_NDK}/ndk-build NDEBUG=${NDEBUG} \
  226. NDK_APPLICATION_MK=${ANDR_ROOT}/jni/Deps.mk || exit 1; \
  227. touch ${OGG_TIMESTAMP}; \
  228. touch ${OGG_TIMESTAMP_INT}; \
  229. else \
  230. echo "nothing to be done for libogg/libvorbis"; \
  231. fi
  232. clean_ogg :
  233. $(RM) -rf ${OGG_DIR}
  234. $(OPENSSL_TIMESTAMP) : openssl_download
  235. @LAST_MODIF=$$(find ${OPENSSL_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
  236. if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
  237. touch ${OPENSSL_TIMESTAMP}; \
  238. fi
  239. openssl_download :
  240. @if [ ! -d ${OPENSSL_DIR} ] ; then \
  241. echo "openssl sources missing, downloading..."; \
  242. mkdir -p ${ANDR_ROOT}/deps; \
  243. cd ${ANDR_ROOT}/deps ; \
  244. wget ${OPENSSL_URL} || exit 1; \
  245. tar -xzf ${OPENSSL_BASEDIR}.tar.gz; \
  246. cd ${OPENSSL_BASEDIR}; \
  247. patch -p1 < ${ANDR_ROOT}/patches/openssl_arch.patch; \
  248. fi
  249. openssl : $(OPENSSL_LIB)
  250. $(OPENSSL_LIB): $(OPENSSL_TIMESTAMP) $(GMP_LIB)
  251. @REFRESH=0; \
  252. if [ ! -e ${OPENSSL_TIMESTAMP_INT} ] ; then \
  253. echo "${OPENSSL_TIMESTAMP_INT} doesn't exist"; \
  254. REFRESH=1; \
  255. fi; \
  256. if [ ${OPENSSL_TIMESTAMP} -nt ${OPENSSL_TIMESTAMP_INT} ] ; then \
  257. REFRESH=1; \
  258. fi; \
  259. if [ $$REFRESH -ne 0 ] ; then \
  260. echo "changed timestamp for openssl detected building..."; \
  261. cd ${OPENSSL_DIR}; \
  262. ln -s ${OPENSSL_DIR} ../openssl; \
  263. export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-openssl; \
  264. ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
  265. --toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \
  266. --platform=${APP_PLATFORM} \
  267. --install-dir=$${TOOLCHAIN}; \
  268. export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \
  269. CC=${CROSS_PREFIX}gcc ./Configure enable-gmp -DL_ENDIAN -I${GMP_DIR} -L${GMP_DIR}/usr/lib android-${TARGET_ARCH};\
  270. CC=${CROSS_PREFIX}gcc ANDROID_DEV=/tmp/ndk-${TARGET_HOST} make depend; \
  271. CC=${CROSS_PREFIX}gcc ANDROID_DEV=/tmp/ndk-${TARGET_HOST} make build_libs; \
  272. touch ${OPENSSL_TIMESTAMP}; \
  273. touch ${OPENSSL_TIMESTAMP_INT}; \
  274. $(RM) -rf $${TOOLCHAIN}; \
  275. else \
  276. echo "nothing to be done for openssl"; \
  277. fi
  278. clean_openssl :
  279. $(RM) -rf ${OPENSSL_DIR}; \
  280. $(RM) -rf $(ANDR_ROOT)/deps/${OPENSSL_BASEDIR}.tar.gz; \
  281. $(RM) -rf $(ANDR_ROOT)/deps/openssl
  282. $(LEVELDB_TIMESTAMP) : leveldb_download
  283. @LAST_MODIF=$$(find ${LEVELDB_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
  284. if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
  285. touch ${LEVELDB_TIMESTAMP}; \
  286. fi
  287. leveldb_download :
  288. @if [ ! -d ${LEVELDB_DIR} ] ; then \
  289. echo "leveldb sources missing, downloading..."; \
  290. mkdir -p ${ANDR_ROOT}/deps; \
  291. cd ${ANDR_ROOT}/deps ; \
  292. git clone ${LEVELDB_URL_GIT} || exit 1; \
  293. cd ${LEVELDB_DIR} || exit 1; \
  294. git checkout ${LEVELDB_COMMIT} || exit 1; \
  295. fi
  296. leveldb : $(LEVELDB_LIB)
  297. ifeq ($(HAVE_LEVELDB),1)
  298. $(LEVELDB_LIB): $(LEVELDB_TIMESTAMP)
  299. @REFRESH=0; \
  300. if [ ! -e ${LEVELDB_TIMESTAMP_INT} ] ; then \
  301. REFRESH=1; \
  302. fi; \
  303. if [ ${LEVELDB_TIMESTAMP} -nt ${LEVELDB_TIMESTAMP_INT} ] ; then \
  304. REFRESH=1; \
  305. fi; \
  306. if [ $$REFRESH -ne 0 ] ; then \
  307. echo "changed timestamp for leveldb detected building..."; \
  308. cd deps/leveldb; \
  309. export CROSS_PREFIX=${CROSS_PREFIX}; \
  310. export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-leveldb; \
  311. ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
  312. --toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \
  313. --platform=${APP_PLATFORM} \
  314. --install-dir=$${TOOLCHAIN}; \
  315. export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \
  316. export CC=${CROSS_PREFIX}gcc; \
  317. export CXX=${CROSS_PREFIX}g++; \
  318. export CFLAGS="$${CFLAGS} ${TARGET_CFLAGS_ADDON}"; \
  319. export CPPFLAGS="$${CPPFLAGS} ${TARGET_CXXFLAGS_ADDON}"; \
  320. export LDFLAGS="$${LDFLAGS} ${TARGET_LDFLAGS_ADDON}"; \
  321. export TARGET_OS=OS_ANDROID_CROSSCOMPILE; \
  322. $(MAKE) || exit 1; \
  323. touch ${LEVELDB_TIMESTAMP}; \
  324. touch ${LEVELDB_TIMESTAMP_INT}; \
  325. $(RM) -rf $${TOOLCHAIN}; \
  326. else \
  327. echo "nothing to be done for leveldb"; \
  328. fi
  329. endif
  330. clean_leveldb :
  331. $(RM) -rf deps/leveldb
  332. $(FREETYPE_TIMESTAMP) : freetype_download
  333. @LAST_MODIF=$$(find ${FREETYPE_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
  334. if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
  335. touch ${FREETYPE_TIMESTAMP}; \
  336. fi
  337. freetype_download :
  338. @if [ ! -d ${FREETYPE_DIR} ] ; then \
  339. echo "freetype sources missing, downloading..."; \
  340. mkdir -p ${ANDR_ROOT}/deps; \
  341. cd deps; \
  342. git clone ${FREETYPE_URL_GIT} || exit 1; \
  343. fi
  344. freetype : $(FREETYPE_LIB)
  345. $(FREETYPE_LIB) : $(FREETYPE_TIMESTAMP)
  346. + @REFRESH=0; \
  347. if [ ! -e ${FREETYPE_TIMESTAMP_INT} ] ; then \
  348. REFRESH=1; \
  349. fi; \
  350. if [ ! -e ${FREETYPE_LIB} ] ; then \
  351. REFRESH=1; \
  352. fi; \
  353. if [ ${FREETYPE_TIMESTAMP} -nt ${FREETYPE_TIMESTAMP_INT} ] ; then \
  354. REFRESH=1; \
  355. fi; \
  356. if [ $$REFRESH -ne 0 ] ; then \
  357. mkdir -p ${FREETYPE_DIR}; \
  358. echo "changed timestamp for freetype detected building..."; \
  359. cd ${FREETYPE_DIR}/Android/jni; \
  360. export APP_PLATFORM=${APP_PLATFORM}; \
  361. export TARGET_ABI=${TARGET_ABI}; \
  362. ${ANDROID_NDK}/ndk-build NDEBUG=${NDEBUG} \
  363. NDK_APPLICATION_MK=${ANDR_ROOT}/jni/Deps.mk || exit 1; \
  364. touch ${FREETYPE_TIMESTAMP}; \
  365. touch ${FREETYPE_TIMESTAMP_INT}; \
  366. else \
  367. echo "nothing to be done for freetype"; \
  368. fi
  369. clean_freetype :
  370. $(RM) -rf ${FREETYPE_DIR}
  371. $(ICONV_TIMESTAMP) : iconv_download
  372. @LAST_MODIF=$$(find ${ICONV_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
  373. if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
  374. touch ${ICONV_TIMESTAMP}; \
  375. fi
  376. iconv_download :
  377. @if [ ! -d ${ICONV_DIR} ] ; then \
  378. echo "iconv sources missing, downloading..."; \
  379. mkdir -p ${ANDR_ROOT}/deps; \
  380. cd ${ANDR_ROOT}/deps; \
  381. wget ${ICONV_URL_HTTP} || exit 1; \
  382. tar -xzf libiconv-${ICONV_VERSION}.tar.gz || exit 1; \
  383. rm libiconv-${ICONV_VERSION}.tar.gz; \
  384. ln -s libiconv-${ICONV_VERSION} libiconv; \
  385. cd ${ICONV_DIR}; \
  386. patch -p1 < ${ANDR_ROOT}/patches/libiconv_android.patch; \
  387. patch -p1 < ${ANDR_ROOT}/patches/libiconv_stdio.patch; \
  388. fi
  389. iconv : $(ICONV_LIB)
  390. $(ICONV_LIB) : $(ICONV_TIMESTAMP)
  391. @REFRESH=0; \
  392. if [ ! -e ${ICONV_TIMESTAMP_INT} ] ; then \
  393. REFRESH=1; \
  394. fi; \
  395. if [ ! -e ${ICONV_LIB} ] ; then \
  396. REFRESH=1; \
  397. fi; \
  398. if [ ${ICONV_TIMESTAMP} -nt ${ICONV_TIMESTAMP_INT} ] ; then \
  399. REFRESH=1; \
  400. fi; \
  401. if [ $$REFRESH -ne 0 ] ; then \
  402. mkdir -p ${ICONV_DIR}; \
  403. echo "changed timestamp for iconv detected building..."; \
  404. cd ${ICONV_DIR}; \
  405. \
  406. export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-iconv; \
  407. ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
  408. --toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \
  409. --platform=${APP_PLATFORM} \
  410. --install-dir=$${TOOLCHAIN}; \
  411. export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \
  412. export CFLAGS="$${CFLAGS} ${TARGET_CFLAGS_ADDON}"; \
  413. export CC=${CROSS_PREFIX}gcc; \
  414. export CXX=${CROSS_PREFIX}g++; \
  415. export TARGET_OS=OS_ANDROID_CROSSCOMPILE; \
  416. ./configure --host=${TARGET_HOST} || exit 1; \
  417. sed -i 's/LIBICONV_VERSION_INFO) /LIBICONV_VERSION_INFO) -avoid-version /g' lib/Makefile; \
  418. grep "iconv_LDFLAGS" src/Makefile; \
  419. $(MAKE) -s || exit 1; \
  420. touch ${ICONV_TIMESTAMP}; \
  421. touch ${ICONV_TIMESTAMP_INT}; \
  422. rm -rf ${TOOLCHAIN}; \
  423. else \
  424. echo "nothing to be done for iconv"; \
  425. fi
  426. clean_iconv :
  427. $(RM) -rf ${ICONV_DIR}
  428. #Note: Texturehack patch is required for gpu's not supporting color format
  429. # correctly. Known bad GPU:
  430. # -geforce on emulator
  431. # -Vivante Corporation GC1000 core (e.g. Galaxy Tab 3)
  432. irrlicht_download :
  433. @if [ ! -d "deps/irrlicht" ] ; then \
  434. echo "irrlicht sources missing, downloading..."; \
  435. mkdir -p ${ANDR_ROOT}/deps; \
  436. cd deps; \
  437. svn co ${IRRLICHT_URL_SVN} irrlicht || exit 1; \
  438. cd irrlicht; \
  439. patch -p1 < ${ANDR_ROOT}/patches/irrlicht-touchcount.patch || exit 1; \
  440. patch -p1 < ${ANDR_ROOT}/patches/irrlicht-back_button.patch || exit 1; \
  441. patch -p1 < ${ANDR_ROOT}/patches/irrlicht-texturehack.patch || exit 1; \
  442. patch -p1 < ${ANDR_ROOT}/patches/irrlicht-native_activity.patch || exit 1; \
  443. fi
  444. $(IRRLICHT_TIMESTAMP) : irrlicht_download
  445. @LAST_MODIF=$$(find ${IRRLICHT_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
  446. if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
  447. touch ${IRRLICHT_TIMESTAMP}; \
  448. fi
  449. irrlicht : $(IRRLICHT_LIB)
  450. $(IRRLICHT_LIB): $(IRRLICHT_TIMESTAMP) $(FREETYPE_LIB)
  451. + @REFRESH=0; \
  452. if [ ! -e ${IRRLICHT_TIMESTAMP_INT} ] ; then \
  453. REFRESH=1; \
  454. fi; \
  455. if [ ! -e ${IRRLICHT_LIB} ] ; then \
  456. REFRESH=1; \
  457. fi; \
  458. if [ ${IRRLICHT_TIMESTAMP} -nt ${IRRLICHT_TIMESTAMP_INT} ] ; then \
  459. REFRESH=1; \
  460. fi; \
  461. if [ $$REFRESH -ne 0 ] ; then \
  462. mkdir -p ${IRRLICHT_DIR}; \
  463. echo "changed timestamp for irrlicht detected building..."; \
  464. cd deps/irrlicht/source/Irrlicht/Android; \
  465. export APP_PLATFORM=${APP_PLATFORM}; \
  466. export TARGET_ABI=${TARGET_ABI}; \
  467. ${ANDROID_NDK}/ndk-build NDEBUG=${NDEBUG} \
  468. NDK_APPLICATION_MK=${ANDR_ROOT}/jni/Irrlicht.mk || exit 1; \
  469. touch ${IRRLICHT_TIMESTAMP}; \
  470. touch ${IRRLICHT_TIMESTAMP_INT}; \
  471. else \
  472. echo "nothing to be done for irrlicht"; \
  473. fi
  474. clean_irrlicht :
  475. $(RM) -rf deps/irrlicht
  476. $(CURL_TIMESTAMP) : curl_download
  477. @LAST_MODIF=$$(find ${CURL_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
  478. if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
  479. touch ${CURL_TIMESTAMP}; \
  480. fi
  481. curl_download :
  482. @if [ ! -d "deps/curl-${CURL_VERSION}" ] ; then \
  483. echo "curl sources missing, downloading..."; \
  484. mkdir -p ${ANDR_ROOT}/deps; \
  485. cd deps; \
  486. wget ${CURL_URL_HTTP} || exit 1; \
  487. tar -xjf curl-${CURL_VERSION}.tar.bz2 || exit 1; \
  488. rm curl-${CURL_VERSION}.tar.bz2; \
  489. ln -s curl-${CURL_VERSION} curl; \
  490. fi
  491. curl : $(CURL_LIB)
  492. $(CURL_LIB): $(CURL_TIMESTAMP) $(OPENSSL_LIB)
  493. @REFRESH=0; \
  494. if [ ! -e ${CURL_TIMESTAMP_INT} ] ; then \
  495. REFRESH=1; \
  496. fi; \
  497. if [ ! -e ${CURL_LIB} ] ; then \
  498. REFRESH=1; \
  499. fi; \
  500. if [ ${CURL_TIMESTAMP} -nt ${CURL_TIMESTAMP_INT} ] ; then \
  501. REFRESH=1; \
  502. fi; \
  503. if [ $$REFRESH -ne 0 ] ; then \
  504. mkdir -p ${CURL_DIR}; \
  505. echo "changed timestamp for curl detected building..."; \
  506. cd deps/curl-${CURL_VERSION}; \
  507. export CROSS_PREFIX=${CROSS_PREFIX}; \
  508. export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-curl; \
  509. ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
  510. --toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \
  511. --platform=${APP_PLATFORM} \
  512. --install-dir=$${TOOLCHAIN}; \
  513. export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \
  514. export CC=${CROSS_PREFIX}gcc; \
  515. export CXX=${CROSS_PREFIX}g++; \
  516. export TARGET_OS=OS_ANDROID_CROSSCOMPILE; \
  517. export CPPFLAGS="$${CPPFLAGS} -I${OPENSSL_DIR}/include ${TARGET_CFLAGS_ADDON}"; \
  518. export CFLAGS="$${CFLAGS} ${TARGET_CFLAGS_ADDON}"; \
  519. export LDFLAGS="$${LDFLAGS} -L${OPENSSL_DIR} ${TARGET_LDFLAGS_ADDON}"; \
  520. ./configure --host=${TARGET_HOST} --disable-shared --enable-static --with-ssl; \
  521. $(MAKE) -s || exit 1; \
  522. touch ${CURL_TIMESTAMP}; \
  523. touch ${CURL_TIMESTAMP_INT}; \
  524. $(RM) -rf $${TOOLCHAIN}; \
  525. else \
  526. echo "nothing to be done for curl"; \
  527. fi
  528. clean_curl :
  529. $(RM) -rf deps/curl-${CURL_VERSION} \
  530. $(RM) -f deps/curl
  531. $(GMP_TIMESTAMP) : gmp_download
  532. @LAST_MODIF=$$(find ${GMP_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
  533. if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
  534. touch ${GMP_TIMESTAMP}; \
  535. fi
  536. gmp_download :
  537. @if [ ! -d "${GMP_DIR}" ] ; then \
  538. echo "gmp sources missing, downloading..."; \
  539. mkdir -p ${ANDR_ROOT}/deps; \
  540. cd deps; \
  541. wget ${GMP_URL_HTTP} || exit 1; \
  542. tar -xjf gmp-${GMP_VERSION}.tar.bz2 || exit 1; \
  543. rm gmp-${GMP_VERSION}.tar.bz2; \
  544. ln -s gmp-${GMP_VERSION} gmp; \
  545. fi
  546. gmp : $(GMP_LIB)
  547. $(GMP_LIB): $(GMP_TIMESTAMP)
  548. @REFRESH=0; \
  549. if [ ! -e ${GMP_TIMESTAMP_INT} ] ; then \
  550. REFRESH=1; \
  551. fi; \
  552. if [ ! -e ${GMP_LIB} ] ; then \
  553. REFRESH=1; \
  554. fi; \
  555. if [ ${GMP_TIMESTAMP} -nt ${GMP_TIMESTAMP_INT} ] ; then \
  556. REFRESH=1; \
  557. fi; \
  558. if [ $$REFRESH -ne 0 ] ; then \
  559. mkdir -p ${GMP_DIR}; \
  560. echo "changed timestamp for gmp detected building..."; \
  561. cd deps/gmp-${GMP_VERSION}; \
  562. export CROSS_PREFIX=${CROSS_PREFIX}; \
  563. export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-gmp; \
  564. ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
  565. --toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \
  566. --platform=${APP_PLATFORM} \
  567. --install-dir=$${TOOLCHAIN}; \
  568. export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \
  569. export CC=${CROSS_PREFIX}gcc; \
  570. export CXX=${CROSS_PREFIX}g++; \
  571. export LIBGMP_LDFLAGS="-avoid-version"; \
  572. export LIBGMPXX_LDFLAGS="-avoid-version"; \
  573. ./configure --disable-static --host=${TARGET_HOST} --prefix=/usr; \
  574. $(MAKE) install DESTDIR=/${GMP_DIR} || exit 1; \
  575. touch ${GMP_TIMESTAMP}; \
  576. touch ${GMP_TIMESTAMP_INT}; \
  577. $(RM) -rf $${TOOLCHAIN}; \
  578. else \
  579. echo "nothing to be done for gmp"; \
  580. fi
  581. clean_gmp:
  582. $(RM) -rf deps/gmp-${GMP_VERSION} \
  583. $(RM) -f deps/gmp
  584. sqlite3_download: deps/${SQLITE3_FOLDER}/sqlite3.c
  585. deps/${SQLITE3_FOLDER}/sqlite3.c :
  586. cd deps; \
  587. wget ${SQLITE3_URL}; \
  588. unzip ${SQLITE3_FOLDER}.zip; \
  589. ln -s ${SQLITE3_FOLDER} sqlite; \
  590. cd ${SQLITE3_FOLDER};
  591. clean_sqlite3:
  592. cd deps && $(RM) -rf ${SQLITE3_FOLDER} && $(RM) -f ${SQLITE3_FOLDER}.zip && \
  593. $(RM) -f sqlite
  594. $(ASSETS_TIMESTAMP) : $(IRRLICHT_LIB)
  595. @mkdir -p ${ANDR_ROOT}/deps; \
  596. for DIRNAME in {builtin,client,doc,fonts,games,mods,po,textures}; do \
  597. LAST_MODIF=$$(find ${PROJ_ROOT}/${DIRNAME} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
  598. if [ $$(basename $$LAST_MODIF) != "timestamp" ]; then \
  599. touch ${PROJ_ROOT}/${DIRNAME}/timestamp; \
  600. touch ${ASSETS_TIMESTAMP}; \
  601. echo ${DIRNAME} changed $$LAST_MODIF; \
  602. fi; \
  603. done; \
  604. LAST_MODIF=$$(find ${IRRLICHT_DIR}/media -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
  605. if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
  606. touch ${IRRLICHT_DIR}/media/timestamp; \
  607. touch ${ASSETS_TIMESTAMP}; \
  608. fi; \
  609. if [ ${PROJ_ROOT}/minetest.conf.example -nt ${ASSETS_TIMESTAMP} ] ; then \
  610. echo "conf changed"; \
  611. touch ${ASSETS_TIMESTAMP}; \
  612. fi; \
  613. if [ ${PROJ_ROOT}/README.txt -nt ${ASSETS_TIMESTAMP} ] ; then \
  614. touch ${ASSETS_TIMESTAMP}; \
  615. fi; \
  616. if [ ! -e $(ASSETS_TIMESTAMP) ] ; then \
  617. touch $(ASSETS_TIMESTAMP); \
  618. fi
  619. assets : $(ASSETS_TIMESTAMP)
  620. @REFRESH=0; \
  621. if [ ! -e ${ASSETS_TIMESTAMP}.old ] ; then \
  622. REFRESH=1; \
  623. fi; \
  624. if [ ${ASSETS_TIMESTAMP} -nt ${ASSETS_TIMESTAMP}.old ] ; then \
  625. REFRESH=1; \
  626. fi; \
  627. if [ ! -d ${APP_ROOT}/assets ] ; then \
  628. REFRESH=1; \
  629. fi; \
  630. if [ $$REFRESH -ne 0 ] ; then \
  631. echo "assets changed, refreshing..."; \
  632. $(MAKE) clean_assets; \
  633. mkdir -p ${APP_ROOT}/assets/Minetest; \
  634. cp ${PROJ_ROOT}/minetest.conf.example ${APP_ROOT}/assets/Minetest; \
  635. cp ${PROJ_ROOT}/README.txt ${APP_ROOT}/assets/Minetest; \
  636. cp -r ${PROJ_ROOT}/builtin ${APP_ROOT}/assets/Minetest; \
  637. mkdir -p ${APP_ROOT}/assets/Minetest/client; \
  638. cp -r ${PROJ_ROOT}/client/shaders ${APP_ROOT}/assets/Minetest/client; \
  639. cp ${PROJ_ROOT}/doc/lgpl-2.1.txt ${APP_ROOT}/assets/Minetest/LICENSE.txt; \
  640. mkdir -p ${APP_ROOT}/assets/Minetest/fonts; \
  641. cp -r ${PROJ_ROOT}/fonts/*.ttf ${APP_ROOT}/assets/Minetest/fonts/; \
  642. mkdir -p ${APP_ROOT}/assets/Minetest/games; \
  643. for game in ${GAMES_TO_COPY}; do \
  644. cp -r ${PROJ_ROOT}/games/$$game ${APP_ROOT}/assets/Minetest/games/; \
  645. done; \
  646. mkdir -p ${APP_ROOT}/assets/Minetest/mods; \
  647. for mod in ${MODS_TO_COPY}; do \
  648. cp -r ${PROJ_ROOT}/mods/$$mod ${APP_ROOT}/assets/Minetest/mods/; \
  649. done; \
  650. cp -r ${PROJ_ROOT}/po ${APP_ROOT}/assets/Minetest; \
  651. cp -r ${PROJ_ROOT}/textures ${APP_ROOT}/assets/Minetest; \
  652. mkdir -p ${APP_ROOT}/assets/Minetest/media; \
  653. cp -r ${IRRLICHT_DIR}/media/Shaders ${APP_ROOT}/assets/Minetest/media; \
  654. cd ${APP_ROOT}/assets || exit 1; \
  655. find . -name "timestamp" -exec rm {} \; ; \
  656. find . -name "*.blend" -exec rm {} \; ; \
  657. find . -name "*~" -exec rm {} \; ; \
  658. find . -type d -path "*.git" -exec rm -rf {} \; ; \
  659. find . -type d -path "*.svn" -exec rm -rf {} \; ; \
  660. find . -type f -path "*.gitignore" -exec rm -rf {} \; ; \
  661. ls -R | grep ":$$" | sed -e 's/:$$//' -e 's/\.//' -e 's/^\///' > "index.txt"; \
  662. find -L Minetest > filelist.txt; \
  663. cp ${ANDR_ROOT}/${ASSETS_TIMESTAMP} ${ANDR_ROOT}/${ASSETS_TIMESTAMP}.old; \
  664. else \
  665. echo "nothing to be done for assets"; \
  666. fi
  667. clean_assets :
  668. @$(RM) -r assets
  669. apk: local.properties assets $(ICONV_LIB) $(IRRLICHT_LIB) $(CURL_LIB) $(GMP_LIB) $(LEVELDB_TARGET) \
  670. $(OPENAL_LIB) $(OGG_LIB) prep_srcdir $(ANDR_ROOT)/jni/src/android_version.h \
  671. $(ANDR_ROOT)/jni/src/android_version_githash.h sqlite3_download
  672. + @export TARGET_LIBDIR=${TARGET_LIBDIR}; \
  673. export HAVE_LEVELDB=${HAVE_LEVELDB}; \
  674. export APP_PLATFORM=${APP_PLATFORM}; \
  675. export TARGET_ABI=${TARGET_ABI}; \
  676. ${ANDROID_NDK}/ndk-build || exit 1; \
  677. if [ ! -e ${APP_ROOT}/jniLibs ]; then \
  678. ln -s ${ANDR_ROOT}/libs ${APP_ROOT}/jniLibs || exit 1; \
  679. fi; \
  680. export VERSION_STR="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" && \
  681. export BUILD_TYPE_C=$$(echo "$${BUILD_TYPE}" | sed 's/./\U&/') && \
  682. ./gradlew assemble$$BUILD_TYPE_C && \
  683. echo "APK stored at: build/outputs/apk/Minetest-$$BUILD_TYPE.apk" && \
  684. echo "You can install it with \`make install_$$BUILD_TYPE\`"
  685. # These Intentionally doesn't depend on their respective build steps,
  686. # because it takes a while to verify that everything's up-to-date.
  687. install_debug:
  688. ${ANDROID_SDK}/platform-tools/adb install -r build/outputs/apk/Minetest-debug.apk
  689. install_release:
  690. ${ANDROID_SDK}/platform-tools/adb install -r build/outputs/apk/Minetest-release.apk
  691. prep_srcdir :
  692. @if [ ! -e ${ANDR_ROOT}/jni/src ]; then \
  693. ln -s ${PROJ_ROOT}/src ${ANDR_ROOT}/jni/src; \
  694. fi; \
  695. if [ ! -e ${ANDR_ROOT}/jni/lib ]; then \
  696. ln -s ${PROJ_ROOT}/lib ${ANDR_ROOT}/jni/lib; \
  697. fi
  698. clean_apk :
  699. ./gradlew clean
  700. clean_all :
  701. @$(MAKE) clean_apk; \
  702. $(MAKE) clean_assets clean_iconv clean_irrlicht clean_leveldb clean_curl \
  703. clean_openssl clean_openal clean_ogg clean_gmp; \
  704. sleep 1; \
  705. $(RM) -r gen libs obj deps bin Debug and_env
  706. $(ANDR_ROOT)/jni/src/android_version_githash.h : prep_srcdir
  707. @export VERSION_FILE=${ANDR_ROOT}/jni/src/android_version_githash.h; \
  708. export VERSION_FILE_NEW=$${VERSION_FILE}.new; \
  709. { \
  710. echo "#ifndef ANDROID_MT_VERSION_GITHASH_H"; \
  711. echo "#define ANDROID_MT_VERSION_GITHASH_H"; \
  712. export GITHASH=$$(git rev-parse --short=8 HEAD); \
  713. export VERSION_STR="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"; \
  714. echo "#define VERSION_GITHASH \"$$VERSION_STR-$$GITHASH-Android\""; \
  715. echo "#endif"; \
  716. } > "$${VERSION_FILE_NEW}"; \
  717. if ! cmp -s $${VERSION_FILE} $${VERSION_FILE_NEW}; then \
  718. echo "android_version_githash.h changed, updating..."; \
  719. mv "$${VERSION_FILE_NEW}" "$${VERSION_FILE}"; \
  720. else \
  721. rm "$${VERSION_FILE_NEW}"; \
  722. fi
  723. $(ANDR_ROOT)/jni/src/android_version.h : prep_srcdir
  724. @export VERSION_FILE=${ANDR_ROOT}/jni/src/android_version.h; \
  725. export VERSION_FILE_NEW=$${VERSION_FILE}.new; \
  726. { \
  727. echo "#ifndef ANDROID_MT_VERSION_H"; \
  728. echo "#define ANDROID_MT_VERSION_H"; \
  729. echo "#define VERSION_MAJOR ${VERSION_MAJOR}"; \
  730. echo "#define VERSION_MINOR ${VERSION_MINOR}"; \
  731. echo "#define VERSION_PATCH ${VERSION_PATCH}"; \
  732. echo "#define VERSION_STRING STR(VERSION_MAJOR) \".\" STR(VERSION_MINOR) \
  733. \".\" STR(VERSION_PATCH)"; \
  734. echo "#endif"; \
  735. } > $${VERSION_FILE_NEW}; \
  736. if ! cmp -s $${VERSION_FILE} $${VERSION_FILE_NEW}; then \
  737. echo "android_version.h changed, updating..."; \
  738. mv "$${VERSION_FILE_NEW}" "$${VERSION_FILE}"; \
  739. else \
  740. rm "$${VERSION_FILE_NEW}"; \
  741. fi
  742. clean : clean_apk clean_assets