Makefile.ds
author Sam Lantinga <slouken@libsdl.org>
Wed, 16 Feb 2011 02:37:09 -0800
changeset 5310 a9945ce48999
parent 5301 248c5c7d6e29
child 5423 b69fa50e80d7
permissions -rw-r--r--
Made it possible to build SDL from a fresh checkout without any additional steps.

The trick is that if you're using configure and you don't want to have SDL_config.h and SDL_revision.h to show up as modified, you need to configure and build from a separate directory.

You also need to include SDL_revision.h directly if you want to use the SDL_REVISION constant, as a side effect of these changes.
slouken@2735
     1
slouken@5289
     2
#LibSDL 1.3 porting and enhancements by Darren Alton (lifning)
slouken@5289
     3
#LibSDL 1.2.9 DS porting by Troy Davis(GPF)
slouken@5289
     4
slouken@5289
     5
ifeq ($(strip $(DEVKITPRO)),)
slouken@5289
     6
$(error "Please set DEVKITPRO in your environment (available from http://www.devkitpro.org). export DEVKITPRO=<path to>devkitPro")
slouken@5289
     7
endif
slouken@5289
     8
ifeq ($(strip $(DEVKITARM)),)
slouken@2735
     9
DEVKITARM = $(DEVKITPRO)/devkitARM
slouken@5289
    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@5301
    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 -Iinclude
slouken@2735
    29
slouken@2735
    30
#src/audio/disk/SDL_diskaudio.c \
slouken@2735
    31
#src/audio/dummy/SDL_dummyaudio.c \
slouken@2735
    32
slouken@2735
    33
SRCS = \
slouken@2735
    34
src/SDL.c \
slouken@5270
    35
src/SDL_assert.c \
slouken@2735
    36
src/SDL_compat.c \
slouken@2735
    37
src/SDL_error.c \
slouken@2735
    38
src/SDL_fatal.c \
slouken@5270
    39
src/SDL_hints.c \
slouken@5270
    40
src/SDL_log.c \
slouken@5270
    41
src/atomic/SDL_atomic.c \
slouken@5289
    42
src/atomic/SDL_spinlock.c \
slouken@2735
    43
src/audio/SDL_audio.c \
slouken@2735
    44
src/audio/SDL_audiocvt.c \
slouken@2735
    45
src/audio/SDL_audiodev.c \
slouken@2735
    46
src/audio/SDL_audiotypecvt.c \
slouken@2735
    47
src/audio/SDL_mixer.c \
slouken@2735
    48
src/audio/SDL_mixer_MMX.c \
slouken@2735
    49
src/audio/SDL_mixer_MMX_VC.c \
slouken@5270
    50
src/audio/SDL_mixer_m68k.c \
slouken@2735
    51
src/audio/SDL_wave.c \
slouken@5270
    52
src/audio/nds/SDL_ndsaudio.c \
slouken@2735
    53
src/cpuinfo/SDL_cpuinfo.c \
slouken@2735
    54
src/events/SDL_events.c \
slouken@2735
    55
src/events/SDL_keyboard.c \
slouken@2735
    56
src/events/SDL_mouse.c \
slouken@2735
    57
src/events/SDL_quit.c \
slouken@5270
    58
src/events/SDL_touch.c \
slouken@2735
    59
src/events/SDL_windowevents.c \
slouken@5270
    60
src/events/nds/SDL_ndsgesture.c \
slouken@2735
    61
src/file/SDL_rwops.c \
slouken@5270
    62
src/haptic/SDL_haptic.c \
slouken@5270
    63
src/haptic/nds/SDL_syshaptic.c \
slouken@5270
    64
src/joystick/SDL_joystick.c \
slouken@5270
    65
src/joystick/nds/SDL_sysjoystick.c \
icculus@3170
    66
src/power/SDL_power.c \
icculus@3170
    67
src/power/nds/SDL_syspower.c \
slouken@5270
    68
src/render/SDL_render.c \
slouken@5270
    69
src/render/SDL_yuv_sw.c \
slouken@5270
    70
src/render/software/SDL_render_sw.c \
slouken@5270
    71
src/render/software/SDL_blendpoint.c \
slouken@5270
    72
src/render/software/SDL_drawline.c \
slouken@5270
    73
src/render/software/SDL_blendline.c \
slouken@5270
    74
src/render/software/SDL_blendfillrect.c \
slouken@5270
    75
src/render/software/SDL_drawpoint.c \
slouken@2735
    76
src/stdlib/SDL_getenv.c \
slouken@2735
    77
src/stdlib/SDL_iconv.c \
slouken@2735
    78
src/stdlib/SDL_malloc.c \
slouken@2735
    79
src/stdlib/SDL_qsort.c \
slouken@2735
    80
src/stdlib/SDL_stdlib.c \
slouken@2735
    81
src/stdlib/SDL_string.c \
slouken@2735
    82
src/thread/SDL_thread.c \
slouken@2735
    83
src/thread/nds/SDL_syscond.c \
slouken@2735
    84
src/thread/nds/SDL_sysmutex.c \
slouken@2735
    85
src/thread/nds/SDL_syssem.c \
slouken@2735
    86
src/thread/nds/SDL_systhread.c \
slouken@5270
    87
src/timer/SDL_timer.c \
slouken@2735
    88
src/timer/nds/SDL_systimer.c \
slouken@5270
    89
src/video/SDL_RLEaccel.c \
slouken@5270
    90
src/video/SDL_blit.c \
slouken@5270
    91
src/video/SDL_blit_0.c \
slouken@5270
    92
src/video/SDL_blit_1.c \
slouken@5270
    93
src/video/SDL_blit_A.c \
slouken@5270
    94
src/video/SDL_blit_N.c \
slouken@5270
    95
src/video/SDL_blit_auto.c \
slouken@5270
    96
src/video/SDL_blit_copy.c \
slouken@5270
    97
src/video/SDL_blit_slow.c \
slouken@5270
    98
src/video/SDL_bmp.c \
slouken@5270
    99
src/video/SDL_fillrect.c \
slouken@5270
   100
src/video/SDL_pixels.c \
slouken@5270
   101
src/video/SDL_rect.c \
slouken@5270
   102
src/video/SDL_stretch.c \
slouken@5270
   103
src/video/SDL_surface.c \
slouken@5270
   104
src/video/SDL_video.c \
slouken@5270
   105
src/video/dummy/SDL_nullevents.c \
slouken@5270
   106
src/video/dummy/SDL_nullvideo.c \
slouken@2735
   107
src/video/nds/SDL_ndsevents.c \
slouken@2735
   108
src/video/nds/SDL_ndsrender.c \
slouken@2735
   109
src/video/nds/SDL_ndsvideo.c \
slouken@2735
   110
slouken@2735
   111
OBJS = $(SRCS:.c=.o)
slouken@2735
   112
slouken@2735
   113
TEST = \
slouken@2735
   114
test/nds-test-progs/general/general.nds \
slouken@2735
   115
test/nds-test-progs/sprite/sprite.nds \
slouken@2735
   116
test/nds-test-progs/sprite2/sprite2.nds \
slouken@2735
   117
slouken@2735
   118
slouken@5270
   119
all: $(TARGET) install nds_test
slouken@2735
   120
slouken@5289
   121
# That file must be compiled in arm mode, not thumb mode.
slouken@5289
   122
src/atomic/SDL_spinlock.o: src/atomic/SDL_spinlock.c
slouken@5289
   123
	$(CC) $(CFLAGS) -mno-thumb -o $@ -c $^
slouken@5289
   124
slouken@5310
   125
$(TARGET): $(OBJS)
slouken@2735
   126
	$(AR) rc $(TARGET) $(OBJS)
slouken@2735
   127
	-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
slouken@2735
   128
slouken@2735
   129
install: $(TARGET)
slouken@2735
   130
	@cp libSDL.a $(DEVKITPRO)/libnds/lib/
slouken@2735
   131
	@mkdir -p $(DEVKITPRO)/libnds/include/SDL/
slouken@2735
   132
	@cp include/*.h $(DEVKITPRO)/libnds/include/SDL/
slouken@2735
   133
slouken@2735
   134
nds_test:
slouken@5270
   135
	$(MAKE) -C test/nds-test-progs/general
slouken@5270
   136
#	$(MAKE) -C test/nds-test-progs/sprite
slouken@5270
   137
#	$(MAKE) -C test/nds-test-progs/sprite2
slouken@2735
   138
slouken@2735
   139
clean:
slouken@5310
   140
	rm -f $(OBJS)