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