Android.mk
author Sam Lantinga <slouken@libsdl.org>
Sat, 12 Jan 2019 12:12:43 -0800
changeset 12533 eb22f5f6d5a5
parent 12439 3a0793e5e134
child 12534 682d9b5ecbed
permissions -rwxr-xr-x
Fixed compiler warning
     1 LOCAL_PATH := $(call my-dir)
     2 
     3 ###########################
     4 #
     5 # SDL shared library
     6 #
     7 ###########################
     8 
     9 include $(CLEAR_VARS)
    10 
    11 LOCAL_MODULE := SDL2
    12 
    13 LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
    14 
    15 LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
    16 
    17 LOCAL_SRC_FILES := \
    18 	$(subst $(LOCAL_PATH)/,, \
    19 	$(wildcard $(LOCAL_PATH)/src/*.c) \
    20 	$(wildcard $(LOCAL_PATH)/src/audio/*.c) \
    21 	$(wildcard $(LOCAL_PATH)/src/audio/android/*.c) \
    22 	$(wildcard $(LOCAL_PATH)/src/audio/dummy/*.c) \
    23 	$(LOCAL_PATH)/src/atomic/SDL_atomic.c.arm \
    24 	$(LOCAL_PATH)/src/atomic/SDL_spinlock.c.arm \
    25 	$(wildcard $(LOCAL_PATH)/src/core/android/*.c) \
    26 	$(wildcard $(LOCAL_PATH)/src/cpuinfo/*.c) \
    27 	$(wildcard $(LOCAL_PATH)/src/dynapi/*.c) \
    28 	$(wildcard $(LOCAL_PATH)/src/events/*.c) \
    29 	$(wildcard $(LOCAL_PATH)/src/file/*.c) \
    30 	$(wildcard $(LOCAL_PATH)/src/haptic/*.c) \
    31 	$(wildcard $(LOCAL_PATH)/src/haptic/android/*.c) \
    32 	$(wildcard $(LOCAL_PATH)/src/joystick/*.c) \
    33 	$(wildcard $(LOCAL_PATH)/src/joystick/android/*.c) \
    34 	$(wildcard $(LOCAL_PATH)/src/joystick/hidapi/*.c) \
    35 	$(wildcard $(LOCAL_PATH)/src/loadso/dlopen/*.c) \
    36 	$(wildcard $(LOCAL_PATH)/src/power/*.c) \
    37 	$(wildcard $(LOCAL_PATH)/src/power/android/*.c) \
    38 	$(wildcard $(LOCAL_PATH)/src/filesystem/android/*.c) \
    39 	$(wildcard $(LOCAL_PATH)/src/sensor/*.c) \
    40 	$(wildcard $(LOCAL_PATH)/src/sensor/android/*.c) \
    41 	$(wildcard $(LOCAL_PATH)/src/render/*.c) \
    42 	$(wildcard $(LOCAL_PATH)/src/render/*/*.c) \
    43 	$(wildcard $(LOCAL_PATH)/src/stdlib/*.c) \
    44 	$(wildcard $(LOCAL_PATH)/src/thread/*.c) \
    45 	$(wildcard $(LOCAL_PATH)/src/thread/pthread/*.c) \
    46 	$(wildcard $(LOCAL_PATH)/src/timer/*.c) \
    47 	$(wildcard $(LOCAL_PATH)/src/timer/unix/*.c) \
    48 	$(wildcard $(LOCAL_PATH)/src/video/*.c) \
    49 	$(wildcard $(LOCAL_PATH)/src/video/android/*.c) \
    50 	$(wildcard $(LOCAL_PATH)/src/video/yuv2rgb/*.c) \
    51 	$(wildcard $(LOCAL_PATH)/src/test/*.c))
    52 
    53 LOCAL_SHARED_LIBRARIES := hidapi
    54 
    55 LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES
    56 LOCAL_CFLAGS += \
    57 	-Wall -Wextra \
    58 	-Wdocumentation \
    59 	-Wdocumentation-unknown-command \
    60 	-Wmissing-prototypes \
    61 	-Wunreachable-code-break \
    62 	-Wunneeded-internal-declaration \
    63 	-Wmissing-variable-declarations \
    64 	-Wfloat-conversion \
    65 	-Wshorten-64-to-32 \
    66 	-Wunreachable-code-return
    67 
    68 # Warnings we haven't fixed (yet)
    69 LOCAL_CFLAGS += -Wno-unused-parameter -Wno-sign-compare
    70  
    71 
    72 LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -llog -landroid
    73 
    74 ifeq ($(NDK_DEBUG),1)
    75     cmd-strip :=
    76 endif
    77 
    78 LOCAL_STATIC_LIBRARIES := cpufeatures
    79 
    80 include $(BUILD_SHARED_LIBRARY)
    81 
    82 ###########################
    83 #
    84 # SDL static library
    85 #
    86 ###########################
    87 
    88 LOCAL_MODULE := SDL2_static
    89 
    90 LOCAL_MODULE_FILENAME := libSDL2
    91 
    92 LOCAL_LDLIBS := 
    93 LOCAL_EXPORT_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -llog -landroid
    94 
    95 include $(BUILD_STATIC_LIBRARY)
    96 
    97 ###########################
    98 #
    99 # SDL main static library
   100 #
   101 ###########################
   102 
   103 include $(CLEAR_VARS)
   104 
   105 LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
   106 
   107 LOCAL_MODULE := SDL2_main
   108 
   109 LOCAL_MODULE_FILENAME := libSDL2main
   110 
   111 include $(BUILD_STATIC_LIBRARY)
   112 
   113 ###########################
   114 #
   115 # hidapi library
   116 #
   117 ###########################
   118 
   119 include $(CLEAR_VARS)
   120 
   121 LOCAL_CPPFLAGS += -std=c++11
   122 
   123 LOCAL_SRC_FILES := src/hidapi/android/hid.cpp
   124 
   125 LOCAL_MODULE := libhidapi
   126 LOCAL_LDLIBS := -llog
   127 
   128 include $(BUILD_SHARED_LIBRARY)
   129 
   130 $(call import-module,android/cpufeatures)
   131