Android.mk
author Sam Lantinga <slouken@libsdl.org>
Wed, 07 Nov 2018 07:47:50 -0800
changeset 924 9be60a9582a6
parent 862 fba113e1d189
permissions -rw-r--r--
The Debian maintainers aren't using these rules, so enable dynamic loading of shared libraries by default for the Steam Linux Runtime
slouken@830
     1
# Save the local path
slouken@862
     2
SDL_MIXER_LOCAL_PATH := $(call my-dir)
slouken@791
     3
slouken@791
     4
slouken@830
     5
# Enable this if you want to support loading FLAC music with libFLAC
slouken@830
     6
SUPPORT_FLAC ?= true
slouken@830
     7
FLAC_LIBRARY_PATH := external/flac-1.3.2
slouken@830
     8
slouken@830
     9
# Enable this if you want to support loading OGG Vorbis music via Tremor
slouken@830
    10
SUPPORT_OGG ?= true
slouken@830
    11
OGG_LIBRARY_PATH := external/libogg-1.3.2
slouken@830
    12
VORBIS_LIBRARY_PATH := external/libvorbisidec-1.2.1
slouken@830
    13
slouken@830
    14
# Enable this if you want to support loading MP3 music via MPG123
slouken@830
    15
SUPPORT_MP3_MPG123 ?= true
slouken@830
    16
MPG123_LIBRARY_PATH := external/mpg123-1.25.6
slouken@830
    17
slouken@830
    18
# Enable this if you want to support loading MOD music via modplug
slouken@830
    19
SUPPORT_MOD_MODPLUG ?= true
slouken@830
    20
MODPLUG_LIBRARY_PATH := external/libmodplug-0.8.9.0
slouken@830
    21
slouken@830
    22
# Enable this if you want to support TiMidity
slouken@841
    23
SUPPORT_MID_TIMIDITY ?= true
slouken@830
    24
TIMIDITY_LIBRARY_PATH := timidity
slouken@830
    25
slouken@830
    26
slouken@830
    27
# Build the library
slouken@830
    28
ifeq ($(SUPPORT_FLAC),true)
slouken@862
    29
    include $(SDL_MIXER_LOCAL_PATH)/$(FLAC_LIBRARY_PATH)/Android.mk
slouken@830
    30
endif
slouken@830
    31
slouken@830
    32
# Build the library
slouken@830
    33
ifeq ($(SUPPORT_OGG),true)
slouken@862
    34
    include $(SDL_MIXER_LOCAL_PATH)/$(OGG_LIBRARY_PATH)/Android.mk
slouken@862
    35
    include $(SDL_MIXER_LOCAL_PATH)/$(VORBIS_LIBRARY_PATH)/Android.mk
slouken@830
    36
endif
slouken@830
    37
slouken@830
    38
# Build the library
slouken@830
    39
ifeq ($(SUPPORT_MP3_MPG123),true)
slouken@862
    40
    include $(SDL_MIXER_LOCAL_PATH)/$(MPG123_LIBRARY_PATH)/Android.mk
slouken@830
    41
endif
slouken@830
    42
slouken@830
    43
# Build the library
slouken@830
    44
ifeq ($(SUPPORT_MOD_MODPLUG),true)
slouken@862
    45
    include $(SDL_MIXER_LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/Android.mk
slouken@830
    46
endif
slouken@830
    47
slouken@830
    48
# Build the library
slouken@841
    49
ifeq ($(SUPPORT_MID_TIMIDITY),true)
slouken@862
    50
    include $(SDL_MIXER_LOCAL_PATH)/$(TIMIDITY_LIBRARY_PATH)/Android.mk
slouken@830
    51
endif
slouken@830
    52
slouken@830
    53
slouken@830
    54
# Restore local path
slouken@862
    55
LOCAL_PATH := $(SDL_MIXER_LOCAL_PATH)
slouken@491
    56
slouken@491
    57
include $(CLEAR_VARS)
slouken@491
    58
slouken@581
    59
LOCAL_MODULE := SDL2_mixer
slouken@491
    60
slouken@685
    61
LOCAL_SRC_FILES := $(notdir $(filter-out %/playmus.c %/playwave.c, $(wildcard $(LOCAL_PATH)/*.c))) \
slouken@689
    62
slouken@836
    63
LOCAL_CFLAGS :=
slouken@626
    64
LOCAL_LDLIBS :=
slouken@626
    65
LOCAL_STATIC_LIBRARIES :=
slouken@626
    66
LOCAL_SHARED_LIBRARIES := SDL2
slouken@626
    67
slouken@754
    68
ifeq ($(SUPPORT_FLAC),true)
slouken@837
    69
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(FLAC_LIBRARY_PATH)/include
slouken@837
    70
    LOCAL_CFLAGS += -DMUSIC_FLAC
slouken@830
    71
    LOCAL_STATIC_LIBRARIES += libFLAC
slouken@754
    72
endif
slouken@754
    73
slouken@830
    74
ifeq ($(SUPPORT_OGG),true)
slouken@830
    75
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(OGG_LIBRARY_PATH)/include
slouken@830
    76
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(VORBIS_LIBRARY_PATH)
slouken@830
    77
    LOCAL_CFLAGS += -DMUSIC_OGG -DOGG_USE_TREMOR -DOGG_HEADER="<ivorbisfile.h>"
slouken@837
    78
    LOCAL_STATIC_LIBRARIES += ogg vorbisidec
slouken@639
    79
endif
slouken@639
    80
slouken@830
    81
# This needs to be a shared library to comply with the LGPL license
slouken@790
    82
ifeq ($(SUPPORT_MP3_MPG123),true)
slouken@790
    83
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MPG123_LIBRARY_PATH)
slouken@790
    84
    LOCAL_CFLAGS += -DMUSIC_MP3_MPG123
slouken@791
    85
    LOCAL_SHARED_LIBRARIES += mpg123
slouken@626
    86
endif
slouken@626
    87
slouken@830
    88
ifeq ($(SUPPORT_MOD_MODPLUG),true)
slouken@830
    89
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/src
slouken@830
    90
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/src/libmodplug
slouken@830
    91
    LOCAL_CFLAGS += -DMUSIC_MOD_MODPLUG -DMODPLUG_HEADER="<modplug.h>"
slouken@837
    92
    LOCAL_STATIC_LIBRARIES += modplug
slouken@830
    93
endif
slouken@830
    94
slouken@841
    95
ifeq ($(SUPPORT_MID_TIMIDITY),true)
slouken@837
    96
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(TIMIDITY_LIBRARY_PATH)
slouken@837
    97
    LOCAL_CFLAGS += -DMUSIC_MID_TIMIDITY
slouken@837
    98
    LOCAL_STATIC_LIBRARIES += timidity
slouken@626
    99
endif
slouken@491
   100
slouken@836
   101
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)
slouken@643
   102
slouken@491
   103
include $(BUILD_SHARED_LIBRARY)