Android.mk
author Ozkan Sezer <sezeroz@gmail.com>
Wed, 11 Sep 2019 20:20:50 +0300
changeset 949 59d490dfd5c8
parent 939 10f93ce11bf4
permissions -rw-r--r--
import fix for #3733 from SDL tree - Makefile sleeps 3s if configure is outdated
     1 # Save the local path
     2 SDL_MIXER_LOCAL_PATH := $(call my-dir)
     3 
     4 # Enable this if you want to support loading FLAC music with libFLAC
     5 SUPPORT_FLAC ?= true
     6 FLAC_LIBRARY_PATH := external/flac-1.3.2
     7 
     8 # Enable this if you want to support loading OGG Vorbis music via Tremor
     9 SUPPORT_OGG ?= true
    10 OGG_LIBRARY_PATH := external/libogg-1.3.2
    11 VORBIS_LIBRARY_PATH := external/libvorbisidec-1.2.1
    12 
    13 # Enable this if you want to support loading MP3 music via MPG123
    14 SUPPORT_MP3_MPG123 ?= true
    15 MPG123_LIBRARY_PATH := external/mpg123-1.25.12
    16 
    17 # Enable this if you want to support loading MOD music via modplug
    18 SUPPORT_MOD_MODPLUG ?= true
    19 MODPLUG_LIBRARY_PATH := external/libmodplug-0.8.9.0
    20 
    21 # Enable this if you want to support TiMidity
    22 SUPPORT_MID_TIMIDITY ?= true
    23 TIMIDITY_LIBRARY_PATH := timidity
    24 
    25 
    26 # Build the library
    27 ifeq ($(SUPPORT_FLAC),true)
    28     include $(SDL_MIXER_LOCAL_PATH)/$(FLAC_LIBRARY_PATH)/Android.mk
    29 endif
    30 
    31 # Build the library
    32 ifeq ($(SUPPORT_OGG),true)
    33     include $(SDL_MIXER_LOCAL_PATH)/$(OGG_LIBRARY_PATH)/Android.mk
    34     include $(SDL_MIXER_LOCAL_PATH)/$(VORBIS_LIBRARY_PATH)/Android.mk
    35 endif
    36 
    37 # Build the library
    38 ifeq ($(SUPPORT_MP3_MPG123),true)
    39     include $(SDL_MIXER_LOCAL_PATH)/$(MPG123_LIBRARY_PATH)/Android.mk
    40 endif
    41 
    42 # Build the library
    43 ifeq ($(SUPPORT_MOD_MODPLUG),true)
    44     include $(SDL_MIXER_LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/Android.mk
    45 endif
    46 
    47 # Build the library
    48 ifeq ($(SUPPORT_MID_TIMIDITY),true)
    49     include $(SDL_MIXER_LOCAL_PATH)/$(TIMIDITY_LIBRARY_PATH)/Android.mk
    50 endif
    51 
    52 
    53 # Restore local path
    54 LOCAL_PATH := $(SDL_MIXER_LOCAL_PATH)
    55 
    56 include $(CLEAR_VARS)
    57 
    58 LOCAL_MODULE := SDL2_mixer
    59 
    60 LOCAL_SRC_FILES := $(notdir $(filter-out %/playmus.c %/playwave.c, $(wildcard $(LOCAL_PATH)/*.c))) \
    61 
    62 LOCAL_CFLAGS :=
    63 LOCAL_LDLIBS :=
    64 LOCAL_STATIC_LIBRARIES :=
    65 LOCAL_SHARED_LIBRARIES := SDL2
    66 
    67 ifeq ($(SUPPORT_FLAC),true)
    68     LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(FLAC_LIBRARY_PATH)/include
    69     LOCAL_CFLAGS += -DMUSIC_FLAC
    70     LOCAL_STATIC_LIBRARIES += libFLAC
    71 endif
    72 
    73 ifeq ($(SUPPORT_OGG),true)
    74     LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(OGG_LIBRARY_PATH)/include
    75     LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(VORBIS_LIBRARY_PATH)
    76     LOCAL_CFLAGS += -DMUSIC_OGG -DOGG_USE_TREMOR -DOGG_HEADER="<ivorbisfile.h>"
    77     LOCAL_STATIC_LIBRARIES += ogg vorbisidec
    78 endif
    79 
    80 # This needs to be a shared library to comply with the LGPL license
    81 ifeq ($(SUPPORT_MP3_MPG123),true)
    82     LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MPG123_LIBRARY_PATH)
    83     LOCAL_CFLAGS += -DMUSIC_MP3_MPG123
    84     LOCAL_SHARED_LIBRARIES += mpg123
    85 endif
    86 
    87 ifeq ($(SUPPORT_MOD_MODPLUG),true)
    88     LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/src
    89     LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/src/libmodplug
    90     LOCAL_CFLAGS += -DMUSIC_MOD_MODPLUG -DMODPLUG_HEADER="<modplug.h>"
    91     LOCAL_STATIC_LIBRARIES += modplug
    92 endif
    93 
    94 ifeq ($(SUPPORT_MID_TIMIDITY),true)
    95     LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(TIMIDITY_LIBRARY_PATH)
    96     LOCAL_CFLAGS += -DMUSIC_MID_TIMIDITY
    97     LOCAL_STATIC_LIBRARIES += timidity
    98 endif
    99 
   100 LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)
   101 
   102 include $(BUILD_SHARED_LIBRARY)