Android.mk 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. LOCAL_PATH := $(call my-dir)/..
  2. #LOCAL_ADDRESS_SANITIZER:=true
  3. include $(CLEAR_VARS)
  4. LOCAL_MODULE := Irrlicht
  5. LOCAL_SRC_FILES := deps/irrlicht/lib/Android/libIrrlicht.a
  6. include $(PREBUILT_STATIC_LIBRARY)
  7. ifeq ($(HAVE_LEVELDB), 1)
  8. include $(CLEAR_VARS)
  9. LOCAL_MODULE := LevelDB
  10. LOCAL_SRC_FILES := deps/leveldb/libleveldb.a
  11. include $(PREBUILT_STATIC_LIBRARY)
  12. endif
  13. include $(CLEAR_VARS)
  14. LOCAL_MODULE := curl
  15. LOCAL_SRC_FILES := deps/curl/lib/.libs/libcurl.a
  16. include $(PREBUILT_STATIC_LIBRARY)
  17. include $(CLEAR_VARS)
  18. LOCAL_MODULE := freetype
  19. LOCAL_SRC_FILES := deps/freetype2-android/Android/obj/local/$(TARGET_ARCH_ABI)/libfreetype2-static.a
  20. include $(PREBUILT_STATIC_LIBRARY)
  21. include $(CLEAR_VARS)
  22. LOCAL_MODULE := iconv
  23. LOCAL_SRC_FILES := deps/libiconv/lib/.libs/libiconv.so
  24. include $(PREBUILT_SHARED_LIBRARY)
  25. include $(CLEAR_VARS)
  26. LOCAL_MODULE := openal
  27. LOCAL_SRC_FILES := deps/openal-soft/libs/$(TARGET_LIBDIR)/libopenal.so
  28. include $(PREBUILT_SHARED_LIBRARY)
  29. include $(CLEAR_VARS)
  30. LOCAL_MODULE := ogg
  31. LOCAL_SRC_FILES := deps/libvorbis-libogg-android/libs/$(TARGET_LIBDIR)/libogg.so
  32. include $(PREBUILT_SHARED_LIBRARY)
  33. include $(CLEAR_VARS)
  34. LOCAL_MODULE := vorbis
  35. LOCAL_SRC_FILES := deps/libvorbis-libogg-android/libs/$(TARGET_LIBDIR)/libvorbis.so
  36. include $(PREBUILT_SHARED_LIBRARY)
  37. include $(CLEAR_VARS)
  38. LOCAL_MODULE := ssl
  39. LOCAL_SRC_FILES := deps/openssl/libssl.a
  40. include $(PREBUILT_STATIC_LIBRARY)
  41. include $(CLEAR_VARS)
  42. LOCAL_MODULE := crypto
  43. LOCAL_SRC_FILES := deps/openssl/libcrypto.a
  44. include $(PREBUILT_STATIC_LIBRARY)
  45. include $(CLEAR_VARS)
  46. LOCAL_MODULE := minetest
  47. LOCAL_CPP_FEATURES += exceptions
  48. ifdef GPROF
  49. GPROF_DEF=-DGPROF
  50. endif
  51. LOCAL_CFLAGS := -D_IRR_ANDROID_PLATFORM_ \
  52. -DHAVE_TOUCHSCREENGUI \
  53. -DUSE_CURL=1 \
  54. -DUSE_SOUND=1 \
  55. -DUSE_FREETYPE=1 \
  56. -DUSE_LEVELDB=$(HAVE_LEVELDB) \
  57. $(GPROF_DEF) \
  58. -pipe -fstrict-aliasing
  59. ifndef NDEBUG
  60. LOCAL_CFLAGS += -g -D_DEBUG -O0 -fno-omit-frame-pointer
  61. else
  62. LOCAL_CFLAGS += -O3
  63. endif
  64. ifdef GPROF
  65. PROFILER_LIBS := android-ndk-profiler
  66. LOCAL_CFLAGS += -pg
  67. endif
  68. # LOCAL_CFLAGS += -fsanitize=address
  69. # LOCAL_LDFLAGS += -fsanitize=address
  70. ifeq ($(TARGET_ARCH_ABI),x86)
  71. LOCAL_CFLAGS += -fno-stack-protector
  72. endif
  73. LOCAL_C_INCLUDES := \
  74. jni/src \
  75. jni/src/script \
  76. jni/lib/gmp \
  77. jni/lib/lua/src \
  78. jni/lib/jsoncpp \
  79. jni/src/cguittfont \
  80. deps/irrlicht/include \
  81. deps/libiconv/include \
  82. deps/freetype2-android/include \
  83. deps/curl/include \
  84. deps/openal-soft/jni/OpenAL/include \
  85. deps/libvorbis-libogg-android/jni/include \
  86. deps/leveldb/include \
  87. deps/sqlite/
  88. LOCAL_SRC_FILES := \
  89. jni/src/ban.cpp \
  90. jni/src/camera.cpp \
  91. jni/src/cavegen.cpp \
  92. jni/src/chat.cpp \
  93. jni/src/client.cpp \
  94. jni/src/clientenvironment.cpp \
  95. jni/src/clientiface.cpp \
  96. jni/src/clientmap.cpp \
  97. jni/src/clientmedia.cpp \
  98. jni/src/clientobject.cpp \
  99. jni/src/clouds.cpp \
  100. jni/src/collision.cpp \
  101. jni/src/content_abm.cpp \
  102. jni/src/content_cao.cpp \
  103. jni/src/content_cso.cpp \
  104. jni/src/content_mapblock.cpp \
  105. jni/src/content_mapnode.cpp \
  106. jni/src/content_nodemeta.cpp \
  107. jni/src/content_sao.cpp \
  108. jni/src/convert_json.cpp \
  109. jni/src/craftdef.cpp \
  110. jni/src/database-dummy.cpp \
  111. jni/src/database-files.cpp \
  112. jni/src/database-sqlite3.cpp \
  113. jni/src/database.cpp \
  114. jni/src/debug.cpp \
  115. jni/src/defaultsettings.cpp \
  116. jni/src/drawscene.cpp \
  117. jni/src/dungeongen.cpp \
  118. jni/src/emerge.cpp \
  119. jni/src/environment.cpp \
  120. jni/src/face_position_cache.cpp \
  121. jni/src/filecache.cpp \
  122. jni/src/filesys.cpp \
  123. jni/src/fontengine.cpp \
  124. jni/src/game.cpp \
  125. jni/src/genericobject.cpp \
  126. jni/src/gettext.cpp \
  127. jni/src/guiChatConsole.cpp \
  128. jni/src/guiEngine.cpp \
  129. jni/src/guiFileSelectMenu.cpp \
  130. jni/src/guiFormSpecMenu.cpp \
  131. jni/src/guiKeyChangeMenu.cpp \
  132. jni/src/guiPasswordChange.cpp \
  133. jni/src/guiTable.cpp \
  134. jni/src/guiscalingfilter.cpp \
  135. jni/src/guiVolumeChange.cpp \
  136. jni/src/httpfetch.cpp \
  137. jni/src/hud.cpp \
  138. jni/src/imagefilters.cpp \
  139. jni/src/intlGUIEditBox.cpp \
  140. jni/src/inventory.cpp \
  141. jni/src/inventorymanager.cpp \
  142. jni/src/itemdef.cpp \
  143. jni/src/itemstackmetadata.cpp \
  144. jni/src/keycode.cpp \
  145. jni/src/light.cpp \
  146. jni/src/localplayer.cpp \
  147. jni/src/log.cpp \
  148. jni/src/main.cpp \
  149. jni/src/map.cpp \
  150. jni/src/map_settings_manager.cpp \
  151. jni/src/mapblock.cpp \
  152. jni/src/mapblock_mesh.cpp \
  153. jni/src/mapgen.cpp \
  154. jni/src/mapgen_flat.cpp \
  155. jni/src/mapgen_fractal.cpp \
  156. jni/src/mapgen_singlenode.cpp \
  157. jni/src/mapgen_v5.cpp \
  158. jni/src/mapgen_v6.cpp \
  159. jni/src/mapgen_v7.cpp \
  160. jni/src/mapgen_valleys.cpp \
  161. jni/src/mapnode.cpp \
  162. jni/src/mapsector.cpp \
  163. jni/src/mesh.cpp \
  164. jni/src/mesh_generator_thread.cpp \
  165. jni/src/metadata.cpp \
  166. jni/src/mg_biome.cpp \
  167. jni/src/mg_decoration.cpp \
  168. jni/src/mg_ore.cpp \
  169. jni/src/mg_schematic.cpp \
  170. jni/src/minimap.cpp \
  171. jni/src/mods.cpp \
  172. jni/src/nameidmapping.cpp \
  173. jni/src/nodedef.cpp \
  174. jni/src/nodemetadata.cpp \
  175. jni/src/nodetimer.cpp \
  176. jni/src/noise.cpp \
  177. jni/src/objdef.cpp \
  178. jni/src/object_properties.cpp \
  179. jni/src/particles.cpp \
  180. jni/src/pathfinder.cpp \
  181. jni/src/player.cpp \
  182. jni/src/porting_android.cpp \
  183. jni/src/porting.cpp \
  184. jni/src/profiler.cpp \
  185. jni/src/quicktune.cpp \
  186. jni/src/raycast.cpp \
  187. jni/src/reflowscan.cpp \
  188. jni/src/remoteplayer.cpp \
  189. jni/src/rollback.cpp \
  190. jni/src/rollback_interface.cpp \
  191. jni/src/serialization.cpp \
  192. jni/src/server.cpp \
  193. jni/src/serverenvironment.cpp \
  194. jni/src/serverlist.cpp \
  195. jni/src/serverobject.cpp \
  196. jni/src/shader.cpp \
  197. jni/src/sky.cpp \
  198. jni/src/socket.cpp \
  199. jni/src/sound.cpp \
  200. jni/src/sound_openal.cpp \
  201. jni/src/staticobject.cpp \
  202. jni/src/subgame.cpp \
  203. jni/src/tileanimation.cpp \
  204. jni/src/tool.cpp \
  205. jni/src/treegen.cpp \
  206. jni/src/version.cpp \
  207. jni/src/voxel.cpp \
  208. jni/src/voxelalgorithms.cpp \
  209. jni/src/util/areastore.cpp \
  210. jni/src/util/auth.cpp \
  211. jni/src/util/base64.cpp \
  212. jni/src/util/directiontables.cpp \
  213. jni/src/util/enriched_string.cpp \
  214. jni/src/util/numeric.cpp \
  215. jni/src/util/pointedthing.cpp \
  216. jni/src/util/serialize.cpp \
  217. jni/src/util/sha1.cpp \
  218. jni/src/util/string.cpp \
  219. jni/src/util/srp.cpp \
  220. jni/src/util/timetaker.cpp \
  221. jni/src/unittest/test.cpp \
  222. jni/src/unittest/test_collision.cpp \
  223. jni/src/unittest/test_compression.cpp \
  224. jni/src/unittest/test_connection.cpp \
  225. jni/src/unittest/test_filepath.cpp \
  226. jni/src/unittest/test_inventory.cpp \
  227. jni/src/unittest/test_map_settings_manager.cpp \
  228. jni/src/unittest/test_mapnode.cpp \
  229. jni/src/unittest/test_nodedef.cpp \
  230. jni/src/unittest/test_noderesolver.cpp \
  231. jni/src/unittest/test_noise.cpp \
  232. jni/src/unittest/test_objdef.cpp \
  233. jni/src/unittest/test_profiler.cpp \
  234. jni/src/unittest/test_random.cpp \
  235. jni/src/unittest/test_schematic.cpp \
  236. jni/src/unittest/test_serialization.cpp \
  237. jni/src/unittest/test_settings.cpp \
  238. jni/src/unittest/test_socket.cpp \
  239. jni/src/unittest/test_utilities.cpp \
  240. jni/src/unittest/test_voxelalgorithms.cpp \
  241. jni/src/unittest/test_voxelmanipulator.cpp \
  242. jni/src/touchscreengui.cpp \
  243. jni/src/database-leveldb.cpp \
  244. jni/src/settings.cpp \
  245. jni/src/wieldmesh.cpp \
  246. jni/src/client/clientlauncher.cpp \
  247. jni/src/client/inputhandler.cpp \
  248. jni/src/client/tile.cpp \
  249. jni/src/client/joystick_controller.cpp \
  250. jni/src/irrlicht_changes/static_text.cpp
  251. # intentionally kept out (we already build openssl itself): jni/src/util/sha256.c
  252. # Network
  253. LOCAL_SRC_FILES += \
  254. jni/src/network/connection.cpp \
  255. jni/src/network/networkpacket.cpp \
  256. jni/src/network/clientopcodes.cpp \
  257. jni/src/network/clientpackethandler.cpp \
  258. jni/src/network/serveropcodes.cpp \
  259. jni/src/network/serverpackethandler.cpp \
  260. # lua api
  261. LOCAL_SRC_FILES += \
  262. jni/src/script/common/c_content.cpp \
  263. jni/src/script/common/c_converter.cpp \
  264. jni/src/script/common/c_internal.cpp \
  265. jni/src/script/common/c_types.cpp \
  266. jni/src/script/cpp_api/s_async.cpp \
  267. jni/src/script/cpp_api/s_base.cpp \
  268. jni/src/script/cpp_api/s_client.cpp \
  269. jni/src/script/cpp_api/s_entity.cpp \
  270. jni/src/script/cpp_api/s_env.cpp \
  271. jni/src/script/cpp_api/s_inventory.cpp \
  272. jni/src/script/cpp_api/s_item.cpp \
  273. jni/src/script/cpp_api/s_mainmenu.cpp \
  274. jni/src/script/cpp_api/s_node.cpp \
  275. jni/src/script/cpp_api/s_nodemeta.cpp \
  276. jni/src/script/cpp_api/s_player.cpp \
  277. jni/src/script/cpp_api/s_security.cpp \
  278. jni/src/script/cpp_api/s_server.cpp \
  279. jni/src/script/lua_api/l_areastore.cpp \
  280. jni/src/script/lua_api/l_base.cpp \
  281. jni/src/script/lua_api/l_camera.cpp \
  282. jni/src/script/lua_api/l_client.cpp \
  283. jni/src/script/lua_api/l_craft.cpp \
  284. jni/src/script/lua_api/l_env.cpp \
  285. jni/src/script/lua_api/l_inventory.cpp \
  286. jni/src/script/lua_api/l_item.cpp \
  287. jni/src/script/lua_api/l_itemstackmeta.cpp\
  288. jni/src/script/lua_api/l_localplayer.cpp \
  289. jni/src/script/lua_api/l_mainmenu.cpp \
  290. jni/src/script/lua_api/l_mapgen.cpp \
  291. jni/src/script/lua_api/l_metadata.cpp \
  292. jni/src/script/lua_api/l_minimap.cpp \
  293. jni/src/script/lua_api/l_nodemeta.cpp \
  294. jni/src/script/lua_api/l_nodetimer.cpp \
  295. jni/src/script/lua_api/l_noise.cpp \
  296. jni/src/script/lua_api/l_object.cpp \
  297. jni/src/script/lua_api/l_particles.cpp \
  298. jni/src/script/lua_api/l_rollback.cpp \
  299. jni/src/script/lua_api/l_server.cpp \
  300. jni/src/script/lua_api/l_settings.cpp \
  301. jni/src/script/lua_api/l_sound.cpp \
  302. jni/src/script/lua_api/l_http.cpp \
  303. jni/src/script/lua_api/l_storage.cpp \
  304. jni/src/script/lua_api/l_util.cpp \
  305. jni/src/script/lua_api/l_vmanip.cpp \
  306. jni/src/script/scripting_client.cpp \
  307. jni/src/script/scripting_server.cpp \
  308. jni/src/script/scripting_mainmenu.cpp
  309. #freetype2 support
  310. LOCAL_SRC_FILES += jni/src/cguittfont/xCGUITTFont.cpp
  311. # GMP
  312. LOCAL_SRC_FILES += jni/lib/gmp/mini-gmp.c
  313. # Lua
  314. LOCAL_SRC_FILES += \
  315. jni/lib/lua/src/lapi.c \
  316. jni/lib/lua/src/lauxlib.c \
  317. jni/lib/lua/src/lbaselib.c \
  318. jni/lib/lua/src/lcode.c \
  319. jni/lib/lua/src/ldblib.c \
  320. jni/lib/lua/src/ldebug.c \
  321. jni/lib/lua/src/ldo.c \
  322. jni/lib/lua/src/ldump.c \
  323. jni/lib/lua/src/lfunc.c \
  324. jni/lib/lua/src/lgc.c \
  325. jni/lib/lua/src/linit.c \
  326. jni/lib/lua/src/liolib.c \
  327. jni/lib/lua/src/llex.c \
  328. jni/lib/lua/src/lmathlib.c \
  329. jni/lib/lua/src/lmem.c \
  330. jni/lib/lua/src/loadlib.c \
  331. jni/lib/lua/src/lobject.c \
  332. jni/lib/lua/src/lopcodes.c \
  333. jni/lib/lua/src/loslib.c \
  334. jni/lib/lua/src/lparser.c \
  335. jni/lib/lua/src/lstate.c \
  336. jni/lib/lua/src/lstring.c \
  337. jni/lib/lua/src/lstrlib.c \
  338. jni/lib/lua/src/ltable.c \
  339. jni/lib/lua/src/ltablib.c \
  340. jni/lib/lua/src/ltm.c \
  341. jni/lib/lua/src/lundump.c \
  342. jni/lib/lua/src/lvm.c \
  343. jni/lib/lua/src/lzio.c \
  344. jni/lib/lua/src/print.c
  345. # SQLite3
  346. LOCAL_SRC_FILES += deps/sqlite/sqlite3.c
  347. # Threading
  348. LOCAL_SRC_FILES += \
  349. jni/src/threading/event.cpp \
  350. jni/src/threading/mutex.cpp \
  351. jni/src/threading/semaphore.cpp \
  352. jni/src/threading/thread.cpp
  353. # JSONCPP
  354. LOCAL_SRC_FILES += jni/lib/jsoncpp/jsoncpp.cpp
  355. LOCAL_SHARED_LIBRARIES := iconv openal ogg vorbis
  356. LOCAL_STATIC_LIBRARIES := Irrlicht freetype curl ssl crypto android_native_app_glue $(PROFILER_LIBS)
  357. ifeq ($(HAVE_LEVELDB), 1)
  358. LOCAL_STATIC_LIBRARIES += LevelDB
  359. endif
  360. LOCAL_LDLIBS := -lEGL -llog -lGLESv1_CM -lGLESv2 -lz -landroid
  361. include $(BUILD_SHARED_LIBRARY)
  362. # at the end of Android.mk
  363. ifdef GPROF
  364. $(call import-module,android-ndk-profiler)
  365. endif
  366. $(call import-module,android/native_app_glue)