This repository has been archived by the owner on Jan 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Android.mk
103 lines (78 loc) · 2.93 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
# Save the local path
MY_LOCAL_PATH := $(call my-dir)
# Enable this if you want to support loading FLAC music with libFLAC
SUPPORT_FLAC ?= true
FLAC_LIBRARY_PATH := external/flac-1.3.2
# 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.6
# 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 := timidity
# Build the library
ifeq ($(SUPPORT_FLAC),true)
include $(MY_LOCAL_PATH)/$(FLAC_LIBRARY_PATH)/Android.mk
endif
# Build the library
ifeq ($(SUPPORT_OGG),true)
include $(MY_LOCAL_PATH)/$(OGG_LIBRARY_PATH)/Android.mk
include $(MY_LOCAL_PATH)/$(VORBIS_LIBRARY_PATH)/Android.mk
endif
# Build the library
ifeq ($(SUPPORT_MP3_MPG123),true)
include $(MY_LOCAL_PATH)/$(MPG123_LIBRARY_PATH)/Android.mk
endif
# Build the library
ifeq ($(SUPPORT_MOD_MODPLUG),true)
include $(MY_LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/Android.mk
endif
# Build the library
ifeq ($(SUPPORT_MID_TIMIDITY),true)
include $(MY_LOCAL_PATH)/$(TIMIDITY_LIBRARY_PATH)/Android.mk
endif
# Restore local path
LOCAL_PATH := $(MY_LOCAL_PATH)
include $(CLEAR_VARS)
LOCAL_MODULE := SDL2_mixer
LOCAL_SRC_FILES := $(notdir $(filter-out %/playmus.c %/playwave.c, $(wildcard $(LOCAL_PATH)/*.c))) \
LOCAL_CFLAGS :=
LOCAL_LDLIBS :=
LOCAL_STATIC_LIBRARIES :=
LOCAL_SHARED_LIBRARIES := SDL2
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 $(BUILD_SHARED_LIBRARY)