summaryrefslogtreecommitdiff
path: root/jni/mkxp.mk
blob: 6b53fcae5c0f0433de362a96565fada025cc91fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
include $(CLEAR_VARS)
LOCAL_MODULE := mkxp
# NOTE: SHARED_FLUID doesn't actually mean shared, but stops mkxp from dlopening fluid
# #     disabled for now since fluidsynth build is broken
LOCAL_CPPFLAGS := -DGLES2_HEADER -DHAVE_NANOSLEEP
# -DSHARED_FLUID
LOCAL_C_INCLUDES := jni/mkxp/src jni/mkxp/shader jni/mkxp/assets \
   jni/boost/unordered/include jni/boost/tuple/include
LOCAL_CPP_EXTENSION = .cpp
LOCAL_SRC_FILES := $(sort $(subst \
   jni/mkxp/binding-mri/binding-mri.cpp, \
   jni/mkxp/binding-mri/binding-mri-extended.cpp, \
   $(wildcard jni/mkxp/src/*.cpp jni/mkxp/binding-mri/*.cpp)) \
   jni/mkxp/binding-mri/win32-binding.cpp)

LOCAL_STATIC_LIBRARIES := sigc++ boost_program_options ruby vorbis ogg OpenAL \
                          libintl libglib-2.0 libgthread-2.0 fluidsynth physfs pixman \
                          SDL2_static SDL2_ttf_static SDL2_sound_static SDL2_image_static \
                          iconv freetype
LOCAL_SHARED_LIBRARIES := compat
LOCAL_LDLIBS := -lz -ldl -lm -lOpenSLES

%.xxd: % | jni/mkxp.xxd.sh
        sh $| $^ $@

jni/mkxp/binding-mri/win32-binding.cpp: jni/mkxp.win32-binding.cpp
        cat $< > $@

jni/mkxp/binding-mri/binding-mri-extended.cpp: jni/mkxp/binding-mri/binding-mri.cpp jni/mkxp/binding-mri/win32-binding.cpp
        sed 's/mriBindingInit();/mriBindingInit();win32BindingInit();/;s/fileIntBindingInit();/fileIntBindingInit();void win32BindingInit();/' $< > $@

jni/mkxp/assets/liberation.ttf.xxd: support/mplus-1c-regular.ttf
        mv $< assets/liberation.ttf
        xxd -i assets/liberation.ttf $@
        mv assets/liberation.ttf $<

mkxp: $(addsuffix .xxd,$(filter-out %.xxd,$(wildcard jni/mkxp/assets/*))) \
      $(addsuffix .xxd,$(filter-out %.xxd,$(wildcard jni/mkxp/shader/*)))
include $(BUILD_SHARED_LIBRARY)