1 LOCAL_PATH:= $(call my-dir) 2 3 CONFIG_DIRS := \ 4 $(LOCAL_PATH)/objs \ 5 $(LOCAL_PATH)/include \ 6 $(LOCAL_PATH) \ 7 8 CONFIG_INCLUDES := $(CONFIG_DIRS:%=-I%) 9 10 MY_CC := $(CC) 11 MY_LD := $(LD) 12 MY_CFLAGS := $(CFLAGS) $(CONFIG_INCLUDES) 13 MY_LDFLAGS := $(LDFLAGS) 14 15 include $(CLEAR_VARS) 16 17 LOCAL_NO_DEFAULT_COMPILER_FLAGS := true 18 LOCAL_CC := $(MY_CC) 19 LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) 20 LOCAL_LDFLAGS := $(MY_LDFLAGS) $(LOCAL_LDFLAGS) 21 22 LOCAL_MODULE := libSDL 23 24 LOCAL_SRC_FILES := 25 26 # the main src/ sources 27 # 28 SRCS := SDL.c \ 29 SDL_error.c \ 30 SDL_fatal.c \ 31 32 SRCS += events/SDL_active.c \ 33 events/SDL_events.c \ 34 events/SDL_expose.c \ 35 events/SDL_keyboard.c \ 36 events/SDL_mouse.c \ 37 events/SDL_quit.c \ 38 events/SDL_resize.c \ 39 40 SRCS += file/SDL_rwops.c 41 42 ifeq ($(CONFIG_LIBC),yes) 43 SRCS += stdlib/SDL_getenv.c \ 44 stdlib/SDL_iconv.c \ 45 stdlib/SDL_malloc.c \ 46 stdlib/SDL_qsort.c \ 47 stdlib/SDL_stdlib.c \ 48 stdlib/SDL_string.c 49 endif 50 51 ifeq ($(CONFIG_CPUINFO),yes) 52 SRCS += cpuinfo/SDL_cpuinfo.c 53 endif 54 55 LOCAL_SRC_FILES += $(SRCS:%=src/%) 56 57 # the Audio sources 58 # 59 SRCS := SDL_audio.c \ 60 SDL_audiocvt.c \ 61 SDL_audiodev.c \ 62 SDL_mixer.c \ 63 SDL_mixer_MMX.c \ 64 dummy/SDL_dummyaudio.c \ 65 66 ifeq ($(CONFIG_AUDIO_ALSA),yes) 67 SRCS += alsa/SDL_alsa_audio.c 68 endif 69 70 ifeq ($(CONFIG_AUDIO_ESD),yes) 71 SRCS += esd/SDL_esdaudio.c 72 endif 73 74 ifeq ($(CONFIG_AUDIO_OSS),yes) 75 SRCS += dsp/SDL_dspaudio.c \ 76 dma/SDL_dmaaudio.c 77 endif 78 79 ifeq ($(CONFIG_AUDIO_COREAUDIO),yes) 80 SRCS += macosx/SDL_coreaudio.c 81 endif 82 83 ifeq ($(CONFIG_AUDIO_WAVEOUT),yes) 84 SRCS += windib/SDL_dibaudio.c 85 endif 86 87 LOCAL_SRC_FILES += $(SRCS:%=src/audio/%) 88 89 # the LoadSO sources 90 # 91 92 SRCS := 93 94 ifeq ($(CONFIG_LOADSO_DLOPEN),yes) 95 SRCS += dlopen/SDL_sysloadso.c 96 endif 97 98 ifeq ($(CONFIG_LOADSO_DLCOMPAT),yes) 99 SRCS += macosx/SDL_dlcompat.c 100 endif 101 102 ifeq ($(CONFIG_LOADSO_WIN32),yes) 103 SRCS += win32/SDL_sysloadso.c 104 endif 105 106 LOCAL_SRC_FILES += $(SRCS:%=src/loadso/%) 107 108 # the Thread sources 109 # 110 111 SRCS := SDL_thread.c 112 113 ifeq ($(CONFIG_THREAD_PTHREAD),yes) 114 SRCS += pthread/SDL_syscond.c \ 115 pthread/SDL_sysmutex.c \ 116 pthread/SDL_syssem.c \ 117 pthread/SDL_systhread.c 118 endif 119 120 ifeq ($(CONFIG_THREAD_WIN32),yes) 121 SRCS += win32/SDL_sysmutex.c \ 122 win32/SDL_syssem.c \ 123 win32/SDL_systhread.c 124 endif 125 126 LOCAL_SRC_FILES += $(SRCS:%=src/thread/%) 127 128 # the Timer sources 129 # 130 131 SRCS := SDL_timer.c 132 133 ifeq ($(CONFIG_TIMER_UNIX),yes) 134 SRCS += unix/SDL_systimer.c 135 endif 136 137 ifeq ($(CONFIG_TIMER_WIN32),yes) 138 SRCS += win32/SDL_systimer.c 139 endif 140 141 LOCAL_SRC_FILES += $(SRCS:%=src/timer/%) 142 143 # the Video sources 144 # 145 146 SRCS := SDL_RLEaccel.c \ 147 SDL_blit.c \ 148 SDL_blit_0.c \ 149 SDL_blit_1.c \ 150 SDL_blit_A.c \ 151 SDL_blit_N.c \ 152 SDL_bmp.c \ 153 SDL_cursor.c \ 154 SDL_gamma.c \ 155 SDL_pixels.c \ 156 SDL_stretch.c \ 157 SDL_surface.c \ 158 SDL_video.c \ 159 SDL_yuv.c \ 160 SDL_yuv_mmx.c \ 161 SDL_yuv_sw.c \ 162 163 SRCS += dummy/SDL_nullevents.c \ 164 dummy/SDL_nullmouse.c \ 165 dummy/SDL_nullvideo.c 166 167 ifeq ($(CONFIG_VIDEO_WINDIB),yes) 168 SRCS += windib/SDL_dibevents.c \ 169 windib/SDL_dibvideo.c \ 170 wincommon/SDL_sysevents.c \ 171 wincommon/SDL_sysmouse.c \ 172 wincommon/SDL_syswm.c \ 173 wincommon/SDL_wingl.c 174 endif 175 176 ifeq ($(CONFIG_VIDEO_QUARTZ),yes) 177 SRCS += quartz/SDL_QuartzGL.m \ 178 quartz/SDL_QuartzVideo.m \ 179 quartz/SDL_QuartzWM.m \ 180 quartz/SDL_QuartzWindow.m \ 181 quartz/SDL_QuartzYUV.m \ 182 quartz/SDL_QuartzEvents.m \ 183 maccommon/SDL_macevents.c \ 184 maccommon/SDL_macgl.c \ 185 maccommon/SDL_macmouse.c \ 186 maccommon/SDL_macwm.c 187 endif 188 189 ifeq ($(CONFIG_VIDEO_X11),yes) 190 SRCS += x11/SDL_x11dyn.c \ 191 x11/SDL_x11dga.c \ 192 x11/SDL_x11events.c \ 193 x11/SDL_x11gamma.c \ 194 x11/SDL_x11gl.c \ 195 x11/SDL_x11image.c \ 196 x11/SDL_x11modes.c \ 197 x11/SDL_x11mouse.c \ 198 x11/SDL_x11video.c \ 199 x11/SDL_x11wm.c \ 200 x11/SDL_x11yuv.c 201 endif 202 203 ifeq ($(CONFIG_VIDEO_X11_DGAMOUSE),yes) 204 SRCS += x11/SDL_x11dga.c 205 endif 206 207 ifeq ($(CONFIG_VIDEO_X11_XME),yes) 208 SRCS += Xext/XME/xme.c 209 endif 210 211 ifeq ($(CONFIG_VIDEO_X11_XINERAMA),yes) 212 SRCS += Xext/Xinerama/Xinerama.c 213 endif 214 215 ifeq ($(CONFIG_VIDEO_X11_XV),yes) 216 SRCS += Xext/Xv/Xv.c 217 endif 218 219 LOCAL_SRC_FILES += $(SRCS:%=src/video/%) 220 221 include $(BUILD_HOST_STATIC_LIBRARY) 222 223 ## Build libSDLmain 224 ## 225 226 include $(CLEAR_VARS) 227 228 LOCAL_NO_DEFAULT_COMPILER_FLAGS := true 229 LOCAL_CC := $(MY_CC) 230 LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) 231 LOCAL_LDFLAGS := $(MY_LDFLAGS) $(LOCAL_LDFLAGS) 232 233 LOCAL_MODULE := libSDLmain 234 235 SRCS := 236 237 ifeq ($(CONFIG_MAIN_DUMMY),yes) 238 SRCS += dummy/SDL_dummy_main.c 239 endif 240 241 ifeq ($(CONFIG_MAIN_MACOSX),yes) 242 SRCS += macosx/SDLMain.m 243 endif 244 245 ifeq ($(HOST_OS),windows) 246 SRCS += win32/SDL_win32_main.c 247 endif 248 249 LOCAL_SRC_FILES := $(SRCS:%=src/main/%) 250 251 include $(BUILD_HOST_STATIC_LIBRARY) 252 253 # handle installation of generated files 254 # 255 256 SDL_HEADERS := \ 257 SDL.h \ 258 SDL_active.h \ 259 SDL_audio.h \ 260 SDL_byteorder.h \ 261 SDL_cdrom.h \ 262 SDL_copying.h \ 263 SDL_cpuinfo.h \ 264 SDL_endian.h \ 265 SDL_error.h \ 266 SDL_events.h \ 267 SDL_getenv.h \ 268 SDL_joystick.h \ 269 SDL_keyboard.h \ 270 SDL_keysym.h \ 271 SDL_loadso.h \ 272 SDL_main.h \ 273 SDL_mouse.h \ 274 SDL_mutex.h \ 275 SDL_name.h \ 276 SDL_opengl.h \ 277 SDL_platform.h \ 278 SDL_quit.h \ 279 SDL_rwops.h \ 280 SDL_stdinc.h \ 281 SDL_syswm.h \ 282 SDL_thread.h \ 283 SDL_timer.h \ 284 SDL_types.h \ 285 SDL_version.h \ 286 SDL_video.h \ 287 begin_code.h \ 288 close_code.h \ 289 290 291 $(foreach target,$(INSTALL_TARGETS),\ 292 $(eval $(call install-target,objs/sdl-config,$(target)/bin/sdl-config)) \ 293 $(eval $(call install-target,objs/SDL_config.h,$(target)/include/SDL/SDL_config.h)) \ 294 $(eval $(call install-target,objs/libSDL.a,$(target)/lib/libSDL.a)) \ 295 $(eval $(call install-target,objs/libSDLmain.a,$(target)/lib/libSDLmain.a)) \ 296 $(foreach header,$(SDL_HEADERS), \ 297 $(eval $(call install-target,include/$(header),$(target)/include/SDL/$(header))) \ 298 ) \ 299 ) 300