Makefile.ds
author Sam Lantinga <slouken@libsdl.org>
Sat, 12 Feb 2011 11:36:56 -0800
changeset 5270 7aba0406c273
parent 3647 c5925cd41955
child 5271 73f8030f0c72
permissions -rw-r--r--
Frank Zago to sdl

The following patch fixes some of the bitrot for the Nintendo DS port.
The support is still basic at the moment, but it allows to run the "general"
test under the current head of tree (parent: 5269:11bd1585efb5 tip).
Most of the patch is mine, but I integrated a couple changes that John
Magnotti posted on Feb 1st.
slouken@2735
     1
slouken@2735
     2
#LibSDL 1.3 porting and enhancements by Darren Alton (lifning)
slouken@2735
     3
#LibSDL 1.2.9 DS porting by Troy Davis(GPF)
slouken@2735
     4
slouken@2735
     5
ifeq ($(strip $(DEVKITPRO)),)
slouken@2735
     6
$(error "Please set DEVKITPRO in your environment (available from http://www.devkitpro.org). export DEVKITPRO=<path to>devkitPro")
slouken@2735
     7
endif
slouken@2735
     8
ifeq ($(strip $(DEVKITARM)),)
slouken@2735
     9
DEVKITARM = $(DEVKITPRO)/devkitARM
slouken@2735
    10
endif
slouken@2735
    11
PATH := $(PATH):$(DEVKITARM)/bin
slouken@2735
    12
slouken@2735
    13
CC = arm-eabi-gcc
slouken@2735
    14
AR = arm-eabi-ar
slouken@2735
    15
RANLIB = arm-eabi-ranlib
slouken@2735
    16
slouken@2735
    17
#ifdef GL
slouken@2735
    18
#DEFS += -DSDL_VIDEO_OPENGL=1
slouken@2735
    19
#TARGET = libSDL_gl.a
slouken@2735
    20
#else
slouken@2735
    21
TARGET = libSDL.a
slouken@2735
    22
#endif
slouken@2735
    23
slouken@2735
    24
#CFLAGS=$(DEFS) -Iinclude
slouken@5270
    25
CFLAGS	=	-mthumb -mthumb-interwork \
slouken@5270
    26
		-march=armv5te -mtune=arm946e-s \
slouken@5270
    27
		-O2 -Wall -Wwrite-strings -Wpointer-arith  \
slouken@5270
    28
		-DARM9 -D__NDS__ -I$(DEVKITPRO)/libnds/include -DENABLE_NDS -DNO_SIGNAL_H -DDISABLE_THREADS -DPACKAGE=\"SDL\" -DVERSION=\"1.3\" -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 \
slouken@5270
    29
		-Iinclude -Isrc -Isrc/audio -Isrc/cdrom -Isrc/endian -Isrc/events -Isrc/joystick -Isrc/thread/nds -Isrc/thread -Isrc/timer -Isrc/video
slouken@2735
    30
slouken@2735
    31
#src/audio/disk/SDL_diskaudio.c \
slouken@2735
    32
#src/audio/dummy/SDL_dummyaudio.c \
slouken@2735
    33
slouken@2735
    34
SRCS = \
slouken@2735
    35
src/SDL.c \
slouken@5270
    36
src/SDL_assert.c \
slouken@2735
    37
src/SDL_compat.c \
slouken@2735
    38
src/SDL_error.c \
slouken@2735
    39
src/SDL_fatal.c \
slouken@5270
    40
src/SDL_hints.c \
slouken@5270
    41
src/SDL_log.c \
slouken@5270
    42
src/atomic/nds/SDL_atomic.c \
slouken@5270
    43
src/atomic/SDL_atomic.c \
slouken@2735
    44
src/audio/SDL_audio.c \
slouken@2735
    45
src/audio/SDL_audiocvt.c \
slouken@2735
    46
src/audio/SDL_audiodev.c \
slouken@2735
    47
src/audio/SDL_audiotypecvt.c \
slouken@2735
    48
src/audio/SDL_mixer.c \
slouken@2735
    49
src/audio/SDL_mixer_MMX.c \
slouken@2735
    50
src/audio/SDL_mixer_MMX_VC.c \
slouken@5270
    51
src/audio/SDL_mixer_m68k.c \
slouken@2735
    52
src/audio/SDL_wave.c \
slouken@5270
    53
src/audio/nds/SDL_ndsaudio.c \
slouken@2735
    54
src/cpuinfo/SDL_cpuinfo.c \
slouken@2735
    55
src/events/SDL_events.c \
slouken@2735
    56
src/events/SDL_keyboard.c \
slouken@2735
    57
src/events/SDL_mouse.c \
slouken@2735
    58
src/events/SDL_quit.c \
slouken@5270
    59
src/events/SDL_touch.c \
slouken@2735
    60
src/events/SDL_windowevents.c \
slouken@5270
    61
src/events/nds/SDL_ndsgesture.c \
slouken@2735
    62
src/file/SDL_rwops.c \
slouken@5270
    63
src/haptic/SDL_haptic.c \
slouken@5270
    64
src/haptic/nds/SDL_syshaptic.c \
slouken@5270
    65
src/joystick/SDL_joystick.c \
slouken@5270
    66
src/joystick/nds/SDL_sysjoystick.c \
icculus@3170
    67
src/power/SDL_power.c \
icculus@3170
    68
src/power/nds/SDL_syspower.c \
slouken@5270
    69
src/render/SDL_render.c \
slouken@5270
    70
src/render/SDL_yuv_sw.c \
slouken@5270
    71
src/render/software/SDL_render_sw.c \
slouken@5270
    72
src/render/software/SDL_blendpoint.c \
slouken@5270
    73
src/render/software/SDL_drawline.c \
slouken@5270
    74
src/render/software/SDL_blendline.c \
slouken@5270
    75
src/render/software/SDL_blendfillrect.c \
slouken@5270
    76
src/render/software/SDL_drawpoint.c \
slouken@2735
    77
src/stdlib/SDL_getenv.c \
slouken@2735
    78
src/stdlib/SDL_iconv.c \
slouken@2735
    79
src/stdlib/SDL_malloc.c \
slouken@2735
    80
src/stdlib/SDL_qsort.c \
slouken@2735
    81
src/stdlib/SDL_stdlib.c \
slouken@2735
    82
src/stdlib/SDL_string.c \
slouken@2735
    83
src/thread/SDL_thread.c \
slouken@2735
    84
src/thread/nds/SDL_syscond.c \
slouken@2735
    85
src/thread/nds/SDL_sysmutex.c \
slouken@2735
    86
src/thread/nds/SDL_syssem.c \
slouken@2735
    87
src/thread/nds/SDL_systhread.c \
slouken@5270
    88
src/timer/SDL_timer.c \
slouken@2735
    89
src/timer/nds/SDL_systimer.c \
slouken@5270
    90
src/video/SDL_RLEaccel.c \
slouken@5270
    91
src/video/SDL_blit.c \
slouken@5270
    92
src/video/SDL_blit_0.c \
slouken@5270
    93
src/video/SDL_blit_1.c \
slouken@5270
    94
src/video/SDL_blit_A.c \
slouken@5270
    95
src/video/SDL_blit_N.c \
slouken@5270
    96
src/video/SDL_blit_auto.c \
slouken@5270
    97
src/video/SDL_blit_copy.c \
slouken@5270
    98
src/video/SDL_blit_slow.c \
slouken@5270
    99
src/video/SDL_bmp.c \
slouken@5270
   100
src/video/SDL_fillrect.c \
slouken@5270
   101
src/video/SDL_pixels.c \
slouken@5270
   102
src/video/SDL_rect.c \
slouken@5270
   103
src/video/SDL_stretch.c \
slouken@5270
   104
src/video/SDL_surface.c \
slouken@5270
   105
src/video/SDL_video.c \
slouken@5270
   106
src/video/dummy/SDL_nullevents.c \
slouken@5270
   107
src/video/dummy/SDL_nullvideo.c \
slouken@2735
   108
src/video/nds/SDL_ndsevents.c \
slouken@2735
   109
src/video/nds/SDL_ndsrender.c \
slouken@2735
   110
src/video/nds/SDL_ndsvideo.c \
slouken@2735
   111
slouken@2735
   112
OBJS = $(SRCS:.c=.o)
slouken@2735
   113
slouken@2735
   114
TEST = \
slouken@2735
   115
test/nds-test-progs/general/general.nds \
slouken@2735
   116
test/nds-test-progs/sprite/sprite.nds \
slouken@2735
   117
test/nds-test-progs/sprite2/sprite2.nds \
slouken@2735
   118
slouken@2735
   119
slouken@5270
   120
all: $(TARGET) install nds_test
slouken@2735
   121
slouken@2735
   122
$(TARGET): copy_config \
slouken@2735
   123
	$(OBJS)
slouken@2735
   124
	$(AR) rc $(TARGET) $(OBJS)
slouken@2735
   125
	-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
slouken@2735
   126
slouken@2735
   127
install: $(TARGET)
slouken@2735
   128
	@cp libSDL.a $(DEVKITPRO)/libnds/lib/
slouken@2735
   129
	@mkdir -p $(DEVKITPRO)/libnds/include/SDL/
slouken@2735
   130
	@cp include/*.h $(DEVKITPRO)/libnds/include/SDL/
slouken@2735
   131
slouken@2735
   132
nds_test:
slouken@5270
   133
	$(MAKE) -C test/nds-test-progs/general
slouken@5270
   134
#	$(MAKE) -C test/nds-test-progs/sprite
slouken@5270
   135
#	$(MAKE) -C test/nds-test-progs/sprite2
slouken@2735
   136
slouken@2735
   137
copy_config:
slouken@2735
   138
	@cp include/SDL_config.h.default include/SDL_config.h
slouken@2735
   139
slouken@2735
   140
clean:
slouken@2735
   141
	rm -f include/SDL_config.h $(OBJS)
slouken@2735
   142