Added some android build stuff
authorPaul Hunkin <paul@bieh.net>
Sun, 23 May 2010 15:18:16 +1200
changeset 4700cf23d9b8e606
parent 4699 925008931501
child 4701 d40bb3165d2b
Added some android build stuff
Makefile.android
include/SDL_config_android.h
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Makefile.android	Sun May 23 15:18:16 2010 +1200
     1.3 @@ -0,0 +1,51 @@
     1.4 +# Makefile to build the SDL library
     1.5 +
     1.6 +ANDROID_NDK=/home/paul/Projects/gsoc/sdk/android-ndk-r4
     1.7 +TOOLS_PATH=$(ANDROID_NDK)/build/prebuilt/linux-x86/arm-eabi-4.2.1/bin
     1.8 +ANDROID_INCLUDES = 	-I$(ANDROID_NDK)/build/platforms/android-4/common/include \
     1.9 +					-I$(ANDROID_NDK)/build/platforms/android-4/arch-arm/usr/include 
    1.10 +INCLUDE = -I./include
    1.11 +CFLAGS  = -g -O2 $(INCLUDE) $(ANDROID_INCLUDES) -DANDROID -static
    1.12 +
    1.13 +AR	= $(TOOLS_PATH)/arm-eabi-ar
    1.14 +RANLIB	= $(TOOLS_PATH)/arm-eabi-ranlib
    1.15 +CC = $(TOOLS_PATH)/arm-eabi-gcc
    1.16 +
    1.17 +
    1.18 +CONFIG_H = include/SDL_config.h
    1.19 +TARGET  = libSDL.a
    1.20 +SOURCES = \
    1.21 +	src/*.c \
    1.22 +	src/audio/*.c \
    1.23 +	src/cpuinfo/*.c \
    1.24 +	src/events/*.c \
    1.25 +	src/file/*.c \
    1.26 +	src/joystick/*.c \
    1.27 +	src/haptic/*.c \
    1.28 +	src/stdlib/*.c \
    1.29 +	src/thread/*.c \
    1.30 +	src/timer/*.c \
    1.31 +	src/video/*.c \
    1.32 +	src/power/*.c \
    1.33 +	src/audio/dummy/*.c \
    1.34 +	src/video/dummy/*.c \
    1.35 +	src/joystick/dummy/*.c \
    1.36 +	src/haptic/dummy/*.c \
    1.37 +	src/atomic/dummy/*.c \
    1.38 +	src/thread/generic/*.c \
    1.39 +	src/timer/dummy/*.c \
    1.40 +	src/loadso/dummy/*.c \
    1.41 +
    1.42 +OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
    1.43 +
    1.44 +all: $(TARGET)
    1.45 +
    1.46 +$(TARGET): $(CONFIG_H) $(OBJECTS)
    1.47 +	$(AR) crv $@ $^
    1.48 +	$(RANLIB) $@
    1.49 +
    1.50 +$(CONFIG_H):
    1.51 +	cp $(CONFIG_H).default $(CONFIG_H)
    1.52 +
    1.53 +clean:
    1.54 +	rm -f $(TARGET) $(OBJECTS)
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/include/SDL_config_android.h	Sun May 23 15:18:16 2010 +1200
     2.3 @@ -0,0 +1,72 @@
     2.4 +/*
     2.5 +    SDL - Simple DirectMedia Layer
     2.6 +    Copyright (C) 1997-2010 Sam Lantinga
     2.7 +
     2.8 +    This library is free software; you can redistribute it and/or
     2.9 +    modify it under the terms of the GNU Lesser General Public
    2.10 +    License as published by the Free Software Foundation; either
    2.11 +    version 2.1 of the License, or (at your option) any later version.
    2.12 +
    2.13 +    This library is distributed in the hope that it will be useful,
    2.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    2.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    2.16 +    Lesser General Public License for more details.
    2.17 +
    2.18 +    You should have received a copy of the GNU Lesser General Public
    2.19 +    License along with this library; if not, write to the Free Software
    2.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    2.21 +
    2.22 +    Sam Lantinga
    2.23 +    slouken@libsdl.org
    2.24 +*/
    2.25 +
    2.26 +#ifndef _SDL_config_android_h
    2.27 +#define _SDL_config_android_h
    2.28 +
    2.29 +#include "SDL_platform.h"
    2.30 +
    2.31 +/**
    2.32 + *  \file SDL_config_android.h
    2.33 + *  
    2.34 + *  This is a configuration that can be used to build SDL for Android
    2.35 + */
    2.36 +
    2.37 +#include <stdarg.h>
    2.38 +
    2.39 +/*
    2.40 +typedef signed char int8_t;
    2.41 +typedef unsigned char uint8_t;
    2.42 +typedef signed short int16_t;
    2.43 +typedef unsigned short uint16_t;
    2.44 +typedef signed int int32_t;
    2.45 +typedef unsigned int uint32_t;
    2.46 +*/
    2.47 +
    2.48 +#define SIZEOF_VOIDP 4
    2.49 +
    2.50 +typedef unsigned int size_t;
    2.51 +//typedef unsigned long uintptr_t;
    2.52 +
    2.53 +#define SDL_AUDIO_DRIVER_DUMMY	1
    2.54 +
    2.55 +#define SDL_CDROM_DISABLED 1
    2.56 +
    2.57 +#define SDL_HAPTIC_DISABLED 1
    2.58 +
    2.59 +#define SDL_JOYSTICK_DISABLED 1
    2.60 +
    2.61 +#define SDL_LOADSO_DISABLED 1
    2.62 +
    2.63 +#define SDL_THREADS_DISABLED 1
    2.64 +
    2.65 +#define SDL_TIMERS_DISABLED	1
    2.66 +
    2.67 +#define SDL_TIMER_UNIX 1
    2.68 +
    2.69 +#define SDL_VIDEO_DRIVER_DUMMY 1
    2.70 +
    2.71 +#define HAVE_STDIO_H 1
    2.72 +#define HAVE_SYS_TYPES_H 1
    2.73 +
    2.74 +#endif /* _SDL_config_minimal_h */
    2.75 +