Android.mk 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  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 += -fexpensive-optimizations -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 jni/src/sqlite \
  79. jni/src/script \
  80. jni/src/lua/src \
  81. jni/src/json \
  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/areastore.cpp \
  94. jni/src/ban.cpp \
  95. jni/src/camera.cpp \
  96. jni/src/cavegen.cpp \
  97. jni/src/chat.cpp \
  98. jni/src/client.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_abm.cpp \
  106. jni/src/content_cao.cpp \
  107. jni/src/content_cso.cpp \
  108. jni/src/content_mapblock.cpp \
  109. jni/src/content_mapnode.cpp \
  110. jni/src/content_nodemeta.cpp \
  111. jni/src/content_sao.cpp \
  112. jni/src/convert_json.cpp \
  113. jni/src/craftdef.cpp \
  114. jni/src/database-dummy.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/drawscene.cpp \
  120. jni/src/dungeongen.cpp \
  121. jni/src/emerge.cpp \
  122. jni/src/environment.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/guiFileSelectMenu.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/keycode.cpp \
  146. jni/src/light.cpp \
  147. jni/src/localplayer.cpp \
  148. jni/src/log.cpp \
  149. jni/src/main.cpp \
  150. jni/src/map.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/mg_biome.cpp \
  165. jni/src/mg_decoration.cpp \
  166. jni/src/mg_ore.cpp \
  167. jni/src/mg_schematic.cpp \
  168. jni/src/minimap.cpp \
  169. jni/src/mods.cpp \
  170. jni/src/nameidmapping.cpp \
  171. jni/src/nodedef.cpp \
  172. jni/src/nodemetadata.cpp \
  173. jni/src/nodetimer.cpp \
  174. jni/src/noise.cpp \
  175. jni/src/objdef.cpp \
  176. jni/src/object_properties.cpp \
  177. jni/src/particles.cpp \
  178. jni/src/pathfinder.cpp \
  179. jni/src/player.cpp \
  180. jni/src/porting_android.cpp \
  181. jni/src/porting.cpp \
  182. jni/src/profiler.cpp \
  183. jni/src/quicktune.cpp \
  184. jni/src/rollback.cpp \
  185. jni/src/rollback_interface.cpp \
  186. jni/src/serialization.cpp \
  187. jni/src/server.cpp \
  188. jni/src/serverlist.cpp \
  189. jni/src/serverobject.cpp \
  190. jni/src/shader.cpp \
  191. jni/src/sky.cpp \
  192. jni/src/socket.cpp \
  193. jni/src/sound.cpp \
  194. jni/src/sound_openal.cpp \
  195. jni/src/staticobject.cpp \
  196. jni/src/subgame.cpp \
  197. jni/src/tool.cpp \
  198. jni/src/treegen.cpp \
  199. jni/src/version.cpp \
  200. jni/src/voxel.cpp \
  201. jni/src/voxelalgorithms.cpp \
  202. jni/src/util/auth.cpp \
  203. jni/src/util/base64.cpp \
  204. jni/src/util/directiontables.cpp \
  205. jni/src/util/numeric.cpp \
  206. jni/src/util/pointedthing.cpp \
  207. jni/src/util/serialize.cpp \
  208. jni/src/util/sha1.cpp \
  209. jni/src/util/string.cpp \
  210. jni/src/util/srp.cpp \
  211. jni/src/util/timetaker.cpp \
  212. jni/src/unittest/test.cpp \
  213. jni/src/unittest/test_collision.cpp \
  214. jni/src/unittest/test_compression.cpp \
  215. jni/src/unittest/test_connection.cpp \
  216. jni/src/unittest/test_filepath.cpp \
  217. jni/src/unittest/test_inventory.cpp \
  218. jni/src/unittest/test_mapnode.cpp \
  219. jni/src/unittest/test_nodedef.cpp \
  220. jni/src/unittest/test_noderesolver.cpp \
  221. jni/src/unittest/test_noise.cpp \
  222. jni/src/unittest/test_objdef.cpp \
  223. jni/src/unittest/test_profiler.cpp \
  224. jni/src/unittest/test_random.cpp \
  225. jni/src/unittest/test_schematic.cpp \
  226. jni/src/unittest/test_serialization.cpp \
  227. jni/src/unittest/test_settings.cpp \
  228. jni/src/unittest/test_socket.cpp \
  229. jni/src/unittest/test_utilities.cpp \
  230. jni/src/unittest/test_voxelalgorithms.cpp \
  231. jni/src/unittest/test_voxelmanipulator.cpp \
  232. jni/src/touchscreengui.cpp \
  233. jni/src/database-leveldb.cpp \
  234. jni/src/settings.cpp \
  235. jni/src/wieldmesh.cpp \
  236. jni/src/client/clientlauncher.cpp \
  237. jni/src/client/tile.cpp
  238. # intentionally kept out (we already build openssl itself): jni/src/util/sha256.c
  239. # Network
  240. LOCAL_SRC_FILES += \
  241. jni/src/network/connection.cpp \
  242. jni/src/network/networkpacket.cpp \
  243. jni/src/network/clientopcodes.cpp \
  244. jni/src/network/clientpackethandler.cpp \
  245. jni/src/network/serveropcodes.cpp \
  246. jni/src/network/serverpackethandler.cpp \
  247. # lua api
  248. LOCAL_SRC_FILES += \
  249. jni/src/script/common/c_content.cpp \
  250. jni/src/script/common/c_converter.cpp \
  251. jni/src/script/common/c_internal.cpp \
  252. jni/src/script/common/c_types.cpp \
  253. jni/src/script/cpp_api/s_async.cpp \
  254. jni/src/script/cpp_api/s_base.cpp \
  255. jni/src/script/cpp_api/s_entity.cpp \
  256. jni/src/script/cpp_api/s_env.cpp \
  257. jni/src/script/cpp_api/s_inventory.cpp \
  258. jni/src/script/cpp_api/s_item.cpp \
  259. jni/src/script/cpp_api/s_mainmenu.cpp \
  260. jni/src/script/cpp_api/s_node.cpp \
  261. jni/src/script/cpp_api/s_nodemeta.cpp \
  262. jni/src/script/cpp_api/s_player.cpp \
  263. jni/src/script/cpp_api/s_security.cpp \
  264. jni/src/script/cpp_api/s_server.cpp \
  265. jni/src/script/lua_api/l_areastore.cpp \
  266. jni/src/script/lua_api/l_base.cpp \
  267. jni/src/script/lua_api/l_craft.cpp \
  268. jni/src/script/lua_api/l_env.cpp \
  269. jni/src/script/lua_api/l_inventory.cpp \
  270. jni/src/script/lua_api/l_item.cpp \
  271. jni/src/script/lua_api/l_mainmenu.cpp \
  272. jni/src/script/lua_api/l_mapgen.cpp \
  273. jni/src/script/lua_api/l_nodemeta.cpp \
  274. jni/src/script/lua_api/l_nodetimer.cpp \
  275. jni/src/script/lua_api/l_noise.cpp \
  276. jni/src/script/lua_api/l_object.cpp \
  277. jni/src/script/lua_api/l_particles.cpp \
  278. jni/src/script/lua_api/l_rollback.cpp \
  279. jni/src/script/lua_api/l_server.cpp \
  280. jni/src/script/lua_api/l_settings.cpp \
  281. jni/src/script/lua_api/l_util.cpp \
  282. jni/src/script/lua_api/l_vmanip.cpp \
  283. jni/src/script/scripting_game.cpp \
  284. jni/src/script/scripting_mainmenu.cpp
  285. #freetype2 support
  286. LOCAL_SRC_FILES += \
  287. jni/src/cguittfont/xCGUITTFont.cpp
  288. # lua
  289. LOCAL_SRC_FILES += \
  290. jni/src/lua/src/lapi.c \
  291. jni/src/lua/src/lauxlib.c \
  292. jni/src/lua/src/lbaselib.c \
  293. jni/src/lua/src/lcode.c \
  294. jni/src/lua/src/ldblib.c \
  295. jni/src/lua/src/ldebug.c \
  296. jni/src/lua/src/ldo.c \
  297. jni/src/lua/src/ldump.c \
  298. jni/src/lua/src/lfunc.c \
  299. jni/src/lua/src/lgc.c \
  300. jni/src/lua/src/linit.c \
  301. jni/src/lua/src/liolib.c \
  302. jni/src/lua/src/llex.c \
  303. jni/src/lua/src/lmathlib.c \
  304. jni/src/lua/src/lmem.c \
  305. jni/src/lua/src/loadlib.c \
  306. jni/src/lua/src/lobject.c \
  307. jni/src/lua/src/lopcodes.c \
  308. jni/src/lua/src/loslib.c \
  309. jni/src/lua/src/lparser.c \
  310. jni/src/lua/src/lstate.c \
  311. jni/src/lua/src/lstring.c \
  312. jni/src/lua/src/lstrlib.c \
  313. jni/src/lua/src/ltable.c \
  314. jni/src/lua/src/ltablib.c \
  315. jni/src/lua/src/ltm.c \
  316. jni/src/lua/src/lundump.c \
  317. jni/src/lua/src/lvm.c \
  318. jni/src/lua/src/lzio.c \
  319. jni/src/lua/src/print.c
  320. # SQLite3
  321. LOCAL_SRC_FILES += deps/sqlite/sqlite3.c
  322. # Threading
  323. LOCAL_SRC_FILES += \
  324. jni/src/threading/event.cpp \
  325. jni/src/threading/mutex.cpp \
  326. jni/src/threading/semaphore.cpp \
  327. jni/src/threading/thread.cpp
  328. # JSONCPP
  329. LOCAL_SRC_FILES += jni/src/json/jsoncpp.cpp
  330. LOCAL_SHARED_LIBRARIES := iconv openal ogg vorbis gmp
  331. LOCAL_STATIC_LIBRARIES := Irrlicht freetype curl ssl crypto android_native_app_glue $(PROFILER_LIBS)
  332. ifeq ($(HAVE_LEVELDB), 1)
  333. LOCAL_STATIC_LIBRARIES += LevelDB
  334. endif
  335. LOCAL_LDLIBS := -lEGL -llog -lGLESv1_CM -lGLESv2 -lz -landroid
  336. include $(BUILD_SHARED_LIBRARY)
  337. # at the end of Android.mk
  338. ifdef GPROF
  339. $(call import-module,android-ndk-profiler)
  340. endif
  341. $(call import-module,android/native_app_glue)