forked from libsdl-org/SDL_mixer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAndroid.mk
154 lines (114 loc) · 4.13 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# 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 via dr_flac
SUPPORT_FLAC_DRFLAC ?= true
# Enable this if you want to support loading FLAC music with libFLAC
SUPPORT_FLAC_LIBFLAC ?= false
FLAC_LIBRARY_PATH := external/flac
# Enable this if you want to support loading OGG Vorbis music via stb_vorbis
SUPPORT_OGG_STB ?= true
# Enable this if you want to support loading OGG Vorbis music via Tremor
SUPPORT_OGG ?= false
OGG_LIBRARY_PATH := external/ogg
VORBIS_LIBRARY_PATH := external/tremor
# Enable this if you want to support loading MP3 music via dr_mp3
SUPPORT_MP3_DRMP3 ?= true
# Enable this if you want to support loading MP3 music via MPG123
SUPPORT_MP3_MPG123 ?= false
MPG123_LIBRARY_PATH := external/mpg123
# Enable this if you want to support loading MOD music via XMP-lite
SUPPORT_MOD_XMP ?= false
XMP_LIBRARY_PATH := external/libxmp
# Enable this if you want to support TiMidity
SUPPORT_MID_TIMIDITY ?= false
TIMIDITY_LIBRARY_PATH := src/codecs/timidity
# Build the library
ifeq ($(SUPPORT_FLAC_LIBFLAC),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_XMP),true)
include $(SDL_MIXER_LOCAL_PATH)/$(XMP_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 := SDL3_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 := SDL3
ifeq ($(SUPPORT_WAV),true)
LOCAL_CFLAGS += -DMUSIC_WAV
endif
ifeq ($(SUPPORT_FLAC_DRFLAC),true)
LOCAL_CFLAGS += -DMUSIC_FLAC_DRFLAC
endif
ifeq ($(SUPPORT_FLAC_LIBFLAC),true)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(FLAC_LIBRARY_PATH)/include
LOCAL_CFLAGS += -DMUSIC_FLAC_LIBFLAC
LOCAL_STATIC_LIBRARIES += libFLAC
endif
ifeq ($(SUPPORT_OGG_STB),true)
LOCAL_CFLAGS += -DMUSIC_OGG -DOGG_USE_STB
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
ifeq ($(SUPPORT_MP3_DRMP3),true)
LOCAL_CFLAGS += -DMUSIC_MP3_DRMP3
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_XMP),true)
LOCAL_CFLAGS += -DMUSIC_MOD_XMP -DLIBXMP_HEADER=\"../external/libxmp/include/xmp.h\"
LOCAL_STATIC_LIBRARIES += xmp
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 $(LOCAL_PATH)/include/SDL3
include $(BUILD_SHARED_LIBRARY)
###########################
#
# SDL3_mixer static library
#
###########################
LOCAL_MODULE := SDL3_mixer_static
LOCAL_MODULE_FILENAME := libSDL3_mixer
LOCAL_LDLIBS :=
LOCAL_EXPORT_LDLIBS :=
include $(BUILD_STATIC_LIBRARY)