Android.mk
author Sam Lantinga <slouken@libsdl.org>
Sat, 21 Oct 2017 14:40:31 -0700
changeset 823 bcd59adacdcc
parent 791 3b05140ef301
child 830 c292b484a95e
permissions -rw-r--r--
Fixed linker order so -lmingw32 comes before -lSDL2main
slouken@791
     1
MY_LOCAL_PATH := $(call my-dir)
slouken@791
     2
slouken@791
     3
include $(call all-subdir-makefiles)
slouken@791
     4
slouken@791
     5
LOCAL_PATH := $(MY_LOCAL_PATH)
slouken@491
     6
slouken@491
     7
include $(CLEAR_VARS)
slouken@491
     8
slouken@581
     9
LOCAL_MODULE := SDL2_mixer
slouken@491
    10
slouken@754
    11
# Enable this if you want to support loading FLAC music via libFLAC
slouken@754
    12
# The library path should be a relative path to this directory.
slouken@754
    13
SUPPORT_FLAC ?= true
slouken@754
    14
FLAC_LIBRARY_PATH := external/flac-1.3.2
slouken@754
    15
slouken@639
    16
# Enable this if you want to support loading MOD music via modplug
slouken@639
    17
# The library path should be a relative path to this directory.
slouken@672
    18
SUPPORT_MOD_MODPLUG ?= true
slouken@754
    19
MODPLUG_LIBRARY_PATH := external/libmodplug-0.8.9.0
slouken@493
    20
slouken@790
    21
# Enable this if you want to support loading MP3 music via mpg123
slouken@626
    22
# The library path should be a relative path to this directory.
slouken@790
    23
SUPPORT_MP3_MPG123 ?= true
slouken@790
    24
MPG123_LIBRARY_PATH := external/mpg123-1.25.6
slouken@626
    25
slouken@626
    26
# Enable this if you want to support loading OGG Vorbis music via Tremor
slouken@626
    27
# The library path should be a relative path to this directory.
slouken@672
    28
SUPPORT_OGG ?= true
slouken@754
    29
OGG_LIBRARY_PATH := external/libogg-1.3.2
slouken@626
    30
VORBIS_LIBRARY_PATH := external/libvorbisidec-1.2.1
slouken@626
    31
slouken@689
    32
# Enable this if you want to support TiMidity
slouken@689
    33
SUPPORT_TIMIDITY ?= true
slouken@689
    34
slouken@689
    35
LOCAL_C_INCLUDES := $(LOCAL_PATH) 
slouken@777
    36
LOCAL_CFLAGS := -DMUSIC_WAV
slouken@491
    37
slouken@685
    38
LOCAL_SRC_FILES := $(notdir $(filter-out %/playmus.c %/playwave.c, $(wildcard $(LOCAL_PATH)/*.c))) \
slouken@689
    39
slouken@491
    40
slouken@626
    41
LOCAL_LDLIBS :=
slouken@626
    42
LOCAL_STATIC_LIBRARIES :=
slouken@626
    43
LOCAL_SHARED_LIBRARIES := SDL2
slouken@626
    44
slouken@689
    45
ifeq ($(SUPPORT_TIMIDITY),true)
slouken@689
    46
	LOCAL_C_INCLUDES += $(LOCAL_PATH)/timidity
slouken@777
    47
	LOCAL_CFLAGS += -DMUSIC_MID -DMUSIC_MID_TIMIDITY
slouken@689
    48
	LOCAL_SRC_FILES += $(subst $(LOCAL_PATH)/,,$(wildcard $(LOCAL_PATH)/timidity/*.c))
slouken@689
    49
endif
slouken@689
    50
slouken@754
    51
ifeq ($(SUPPORT_FLAC),true)
slouken@754
    52
	LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(FLAC_LIBRARY_PATH)/include
slouken@777
    53
	LOCAL_CFLAGS += -DMUSIC_FLAC
slouken@754
    54
    LOCAL_SHARED_LIBRARIES += libFLAC
slouken@754
    55
endif
slouken@754
    56
slouken@639
    57
ifeq ($(SUPPORT_MOD_MODPLUG),true)
slouken@639
    58
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/src $(LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/src/libmodplug
slouken@777
    59
    LOCAL_CFLAGS += -DMUSIC_MOD_MODPLUG -DMODPLUG_HEADER="<modplug.h>" -DHAVE_SETENV -DHAVE_SINF
slouken@639
    60
    LOCAL_SRC_FILES += \
slouken@639
    61
        $(MODPLUG_LIBRARY_PATH)/src/fastmix.cpp \
slouken@639
    62
        $(MODPLUG_LIBRARY_PATH)/src/load_669.cpp \
slouken@639
    63
        $(MODPLUG_LIBRARY_PATH)/src/load_abc.cpp \
slouken@639
    64
        $(MODPLUG_LIBRARY_PATH)/src/load_amf.cpp \
slouken@639
    65
        $(MODPLUG_LIBRARY_PATH)/src/load_ams.cpp \
slouken@639
    66
        $(MODPLUG_LIBRARY_PATH)/src/load_dbm.cpp \
slouken@639
    67
        $(MODPLUG_LIBRARY_PATH)/src/load_dmf.cpp \
slouken@639
    68
        $(MODPLUG_LIBRARY_PATH)/src/load_dsm.cpp \
slouken@639
    69
        $(MODPLUG_LIBRARY_PATH)/src/load_far.cpp \
slouken@639
    70
        $(MODPLUG_LIBRARY_PATH)/src/load_it.cpp \
slouken@639
    71
        $(MODPLUG_LIBRARY_PATH)/src/load_j2b.cpp \
slouken@639
    72
        $(MODPLUG_LIBRARY_PATH)/src/load_mdl.cpp \
slouken@639
    73
        $(MODPLUG_LIBRARY_PATH)/src/load_med.cpp \
slouken@639
    74
        $(MODPLUG_LIBRARY_PATH)/src/load_mid.cpp \
slouken@639
    75
        $(MODPLUG_LIBRARY_PATH)/src/load_mod.cpp \
slouken@639
    76
        $(MODPLUG_LIBRARY_PATH)/src/load_mt2.cpp \
slouken@639
    77
        $(MODPLUG_LIBRARY_PATH)/src/load_mtm.cpp \
slouken@639
    78
        $(MODPLUG_LIBRARY_PATH)/src/load_okt.cpp \
slouken@639
    79
        $(MODPLUG_LIBRARY_PATH)/src/load_pat.cpp \
slouken@639
    80
        $(MODPLUG_LIBRARY_PATH)/src/load_psm.cpp \
slouken@639
    81
        $(MODPLUG_LIBRARY_PATH)/src/load_ptm.cpp \
slouken@639
    82
        $(MODPLUG_LIBRARY_PATH)/src/load_s3m.cpp \
slouken@639
    83
        $(MODPLUG_LIBRARY_PATH)/src/load_stm.cpp \
slouken@639
    84
        $(MODPLUG_LIBRARY_PATH)/src/load_ult.cpp \
slouken@639
    85
        $(MODPLUG_LIBRARY_PATH)/src/load_umx.cpp \
slouken@639
    86
        $(MODPLUG_LIBRARY_PATH)/src/load_wav.cpp \
slouken@639
    87
        $(MODPLUG_LIBRARY_PATH)/src/load_xm.cpp \
slouken@639
    88
        $(MODPLUG_LIBRARY_PATH)/src/mmcmp.cpp \
slouken@639
    89
        $(MODPLUG_LIBRARY_PATH)/src/modplug.cpp \
slouken@639
    90
        $(MODPLUG_LIBRARY_PATH)/src/snd_dsp.cpp \
slouken@639
    91
        $(MODPLUG_LIBRARY_PATH)/src/snd_flt.cpp \
slouken@639
    92
        $(MODPLUG_LIBRARY_PATH)/src/snd_fx.cpp \
slouken@639
    93
        $(MODPLUG_LIBRARY_PATH)/src/sndfile.cpp \
slouken@639
    94
        $(MODPLUG_LIBRARY_PATH)/src/sndmix.cpp
slouken@639
    95
endif
slouken@639
    96
slouken@790
    97
ifeq ($(SUPPORT_MP3_MPG123),true)
slouken@790
    98
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MPG123_LIBRARY_PATH)
slouken@790
    99
    LOCAL_CFLAGS += -DMUSIC_MP3_MPG123
slouken@791
   100
    LOCAL_SHARED_LIBRARIES += mpg123
slouken@626
   101
endif
slouken@626
   102
slouken@626
   103
ifeq ($(SUPPORT_OGG),true)
slouken@754
   104
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(OGG_LIBRARY_PATH)/android \
slouken@754
   105
                        $(LOCAL_PATH)/$(OGG_LIBRARY_PATH)/include \
slouken@754
   106
                        $(LOCAL_PATH)/$(VORBIS_LIBRARY_PATH)
slouken@777
   107
    LOCAL_CFLAGS += -DMUSIC_OGG -DOGG_USE_TREMOR -DOGG_HEADER="<ivorbisfile.h>"
slouken@671
   108
    ifeq ($(TARGET_ARCH_ABI),armeabi)
slouken@671
   109
	LOCAL_CFLAGS += -D_ARM_ASSEM_
slouken@671
   110
    endif
slouken@671
   111
    ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
slouken@671
   112
	LOCAL_CFLAGS += -D_ARM_ASSEM_
slouken@671
   113
    endif
slouken@626
   114
    LOCAL_SRC_FILES += \
slouken@626
   115
        $(VORBIS_LIBRARY_PATH)/mdct.c \
slouken@626
   116
        $(VORBIS_LIBRARY_PATH)/block.c \
slouken@626
   117
        $(VORBIS_LIBRARY_PATH)/window.c \
slouken@626
   118
        $(VORBIS_LIBRARY_PATH)/synthesis.c \
slouken@626
   119
        $(VORBIS_LIBRARY_PATH)/info.c \
slouken@626
   120
        $(VORBIS_LIBRARY_PATH)/floor1.c \
slouken@626
   121
        $(VORBIS_LIBRARY_PATH)/floor0.c \
slouken@626
   122
        $(VORBIS_LIBRARY_PATH)/vorbisfile.c \
slouken@626
   123
        $(VORBIS_LIBRARY_PATH)/res012.c \
slouken@626
   124
        $(VORBIS_LIBRARY_PATH)/mapping0.c \
slouken@626
   125
        $(VORBIS_LIBRARY_PATH)/registry.c \
slouken@626
   126
        $(VORBIS_LIBRARY_PATH)/codebook.c \
slouken@626
   127
        $(VORBIS_LIBRARY_PATH)/sharedbook.c \
slouken@626
   128
        $(OGG_LIBRARY_PATH)/src/framing.c \
slouken@626
   129
        $(OGG_LIBRARY_PATH)/src/bitwise.c
slouken@626
   130
endif
slouken@491
   131
slouken@643
   132
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_C_INCLUDES)
slouken@643
   133
slouken@673
   134
LOCAL_ARM_MODE := arm
slouken@673
   135
slouken@491
   136
include $(BUILD_SHARED_LIBRARY)