forked from libsdl-org/SDL_mixer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Android.mk
135 lines (101 loc) · 3.74 KB
/
Android.mk
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Save the local path
SDL_MIXER_LOCAL_PATH := $(call my-dir)
# Enable this if you want to support loading WAV music
SUPPORT_WAV ?= true
# Enable this if you want to support loading FLAC music with libFLAC
SUPPORT_FLAC ?= true
FLAC_LIBRARY_PATH := external/flac-1.3.3
# Enable this if you want to support loading OGG Vorbis music via Tremor
SUPPORT_OGG ?= true
OGG_LIBRARY_PATH := external/libogg-1.3.2
VORBIS_LIBRARY_PATH := external/libvorbisidec-1.2.1
# Enable this if you want to support loading MP3 music via MPG123
SUPPORT_MP3_MPG123 ?= true
MPG123_LIBRARY_PATH := external/mpg123-1.25.13
# Enable this if you want to support loading MOD music via modplug
SUPPORT_MOD_MODPLUG ?= true
MODPLUG_LIBRARY_PATH := external/libmodplug-0.8.9.0
# Enable this if you want to support TiMidity
SUPPORT_MID_TIMIDITY ?= true
TIMIDITY_LIBRARY_PATH := src/codecs/timidity
# Build the library
ifeq ($(SUPPORT_FLAC),true)
include $(SDL_MIXER_LOCAL_PATH)/$(FLAC_LIBRARY_PATH)/Android.mk
endif
# Build the library
ifeq ($(SUPPORT_OGG),true)
include $(SDL_MIXER_LOCAL_PATH)/$(OGG_LIBRARY_PATH)/Android.mk
include $(SDL_MIXER_LOCAL_PATH)/$(VORBIS_LIBRARY_PATH)/Android.mk
endif
# Build the library
ifeq ($(SUPPORT_MP3_MPG123),true)
include $(SDL_MIXER_LOCAL_PATH)/$(MPG123_LIBRARY_PATH)/Android.mk
endif
# Build the library
ifeq ($(SUPPORT_MOD_MODPLUG),true)
include $(SDL_MIXER_LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/Android.mk
endif
# Build the library
ifeq ($(SUPPORT_MID_TIMIDITY),true)
include $(SDL_MIXER_LOCAL_PATH)/$(TIMIDITY_LIBRARY_PATH)/Android.mk
endif
# Restore local path
LOCAL_PATH := $(SDL_MIXER_LOCAL_PATH)
include $(CLEAR_VARS)
LOCAL_MODULE := SDL2_mixer
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include \
$(LOCAL_PATH)/src/ \
$(LOCAL_PATH)/src/codecs \
LOCAL_SRC_FILES := \
$(subst $(LOCAL_PATH)/,, \
$(wildcard $(LOCAL_PATH)/src/*.c) \
$(wildcard $(LOCAL_PATH)/src/codecs/*.c) \
)
LOCAL_CFLAGS :=
LOCAL_LDLIBS :=
LOCAL_STATIC_LIBRARIES :=
LOCAL_SHARED_LIBRARIES := SDL2
ifeq ($(SUPPORT_WAV),true)
LOCAL_CFLAGS += -DMUSIC_WAV
endif
ifeq ($(SUPPORT_FLAC),true)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(FLAC_LIBRARY_PATH)/include
LOCAL_CFLAGS += -DMUSIC_FLAC
LOCAL_STATIC_LIBRARIES += libFLAC
endif
ifeq ($(SUPPORT_OGG),true)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(OGG_LIBRARY_PATH)/include
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(VORBIS_LIBRARY_PATH)
LOCAL_CFLAGS += -DMUSIC_OGG -DOGG_USE_TREMOR -DOGG_HEADER="<ivorbisfile.h>"
LOCAL_STATIC_LIBRARIES += ogg vorbisidec
endif
# This needs to be a shared library to comply with the LGPL license
ifeq ($(SUPPORT_MP3_MPG123),true)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MPG123_LIBRARY_PATH)
LOCAL_CFLAGS += -DMUSIC_MP3_MPG123
LOCAL_SHARED_LIBRARIES += mpg123
endif
ifeq ($(SUPPORT_MOD_MODPLUG),true)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/src
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/src/libmodplug
LOCAL_CFLAGS += -DMUSIC_MOD_MODPLUG -DMODPLUG_HEADER="<modplug.h>"
LOCAL_STATIC_LIBRARIES += modplug
endif
ifeq ($(SUPPORT_MID_TIMIDITY),true)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(TIMIDITY_LIBRARY_PATH)
LOCAL_CFLAGS += -DMUSIC_MID_TIMIDITY
LOCAL_STATIC_LIBRARIES += timidity
endif
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/include
include $(BUILD_SHARED_LIBRARY)
###########################
#
# SDL2_mixer static library
#
###########################
LOCAL_MODULE := SDL2_mixer_static
LOCAL_MODULE_FILENAME := libSDL2_mixer
LOCAL_LDLIBS :=
LOCAL_EXPORT_LDLIBS :=
include $(BUILD_STATIC_LIBRARY)