You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

408 lines
15 KiB

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