Makefile.ds
author Sam Lantinga <slouken@libsdl.org>
Mon, 11 Aug 2008 04:39:24 +0000
branchgsoc2008_nds
changeset 2684 a4f143d187dd
parent 2680 4135aa9c5645
child 2696 0b395a60deff
permissions -rw-r--r--
Improved devkitPrO message in Makefile.ds and set better environment variable defaults
dalton@2670
     1
dalton@2670
     2
#LibSDL 1.3 porting and enhancements by Darren Alton (lifning)
dalton@2670
     3
#LibSDL 1.2.9 DS porting by Troy Davis(GPF)
dalton@2670
     4
slouken@2684
     5
ifeq ($(strip $(DEVKITPRO)),)
slouken@2684
     6
$(error "Please set DEVKITPRO in your environment (available from http://www.devkitpro.org). export DEVKITPRO=<path to>devkitPro")
slouken@2684
     7
endif
dalton@2670
     8
ifeq ($(strip $(DEVKITARM)),)
slouken@2684
     9
DEVKITARM = $(DEVKITPRO)/devkitARM
dalton@2670
    10
endif
slouken@2684
    11
PATH := $(PATH):$(DEVKITARM)/bin
dalton@2670
    12
dalton@2670
    13
CC = arm-eabi-gcc
dalton@2670
    14
AR = arm-eabi-ar
dalton@2670
    15
RANLIB = arm-eabi-ranlib
dalton@2670
    16
dalton@2670
    17
#ifdef GL
dalton@2670
    18
#DEFS += -DSDL_VIDEO_OPENGL=1
dalton@2670
    19
#TARGET = libSDL_gl.a
dalton@2670
    20
#else
dalton@2670
    21
TARGET = libSDL.a
dalton@2670
    22
#endif
dalton@2670
    23
dalton@2670
    24
#CFLAGS=$(DEFS) -Iinclude
dalton@2670
    25
CFLAGS	=	-mthumb -mthumb-interwork \
dalton@2670
    26
		-march=armv5te -mtune=arm946e-s \
dalton@2670
    27
		-O2 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
dalton@2670
    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 \
dalton@2670
    29
		-Iinclude -Isrc -Isrc/audio -Isrc/cdrom -Isrc/endian -Isrc/events -Isrc/joystick -Isrc/thread/nds -Isrc/thread -Isrc/timer -Isrc/video
dalton@2670
    30
dalton@2670
    31
SRCS = \
dalton@2670
    32
src/SDL.c \
dalton@2670
    33
src/SDL_compat.c \
dalton@2670
    34
src/SDL_error.c \
dalton@2670
    35
src/SDL_fatal.c \
dalton@2670
    36
src/audio/disk/SDL_diskaudio.c \
dalton@2670
    37
src/audio/dummy/SDL_dummyaudio.c \
dalton@2680
    38
src/audio/nds/SDL_ndsaudio.c \
dalton@2670
    39
src/audio/SDL_audio.c \
dalton@2670
    40
src/audio/SDL_audiocvt.c \
dalton@2670
    41
src/audio/SDL_audiodev.c \
dalton@2670
    42
src/audio/SDL_audiotypecvt.c \
dalton@2670
    43
src/audio/SDL_mixer.c \
dalton@2670
    44
src/audio/SDL_mixer_m68k.c \
dalton@2670
    45
src/audio/SDL_mixer_MMX.c \
dalton@2670
    46
src/audio/SDL_mixer_MMX_VC.c \
dalton@2670
    47
src/audio/SDL_wave.c \
dalton@2670
    48
src/cdrom/dummy/SDL_syscdrom.c \
dalton@2670
    49
src/cdrom/SDL_cdrom.c \
dalton@2670
    50
src/cpuinfo/SDL_cpuinfo.c \
dalton@2670
    51
src/events/SDL_events.c \
dalton@2670
    52
src/events/SDL_keyboard.c \
dalton@2670
    53
src/events/SDL_mouse.c \
dalton@2670
    54
src/events/SDL_quit.c \
dalton@2670
    55
src/events/SDL_windowevents.c \
dalton@2670
    56
src/file/SDL_rwops.c \
dalton@2673
    57
src/joystick/nds/SDL_sysjoystick.c \
dalton@2670
    58
src/joystick/SDL_joystick.c \
dalton@2670
    59
src/stdlib/SDL_getenv.c \
dalton@2670
    60
src/stdlib/SDL_iconv.c \
dalton@2670
    61
src/stdlib/SDL_malloc.c \
dalton@2670
    62
src/stdlib/SDL_qsort.c \
dalton@2670
    63
src/stdlib/SDL_stdlib.c \
dalton@2670
    64
src/stdlib/SDL_string.c \
dalton@2670
    65
src/thread/SDL_thread.c \
dalton@2670
    66
src/thread/nds/SDL_syscond.c \
dalton@2670
    67
src/thread/nds/SDL_sysmutex.c \
dalton@2670
    68
src/thread/nds/SDL_syssem.c \
dalton@2670
    69
src/thread/nds/SDL_systhread.c \
dalton@2670
    70
src/timer/dummy/SDL_systimer.c \
dalton@2670
    71
src/timer/SDL_timer.c \
dalton@2670
    72
src/video/nds/SDL_ndsevents.c \
dalton@2670
    73
src/video/nds/SDL_ndsrender.c \
dalton@2670
    74
src/video/nds/SDL_ndsvideo.c \
dalton@2674
    75
src/video/dummy/SDL_nullevents.c \
dalton@2674
    76
src/video/dummy/SDL_nullrender.c \
dalton@2674
    77
src/video/dummy/SDL_nullvideo.c \
dalton@2670
    78
src/video/SDL_blit_0.c \
dalton@2670
    79
src/video/SDL_blit_1.c \
dalton@2670
    80
src/video/SDL_blit_A.c \
dalton@2670
    81
src/video/SDL_blit_auto.c \
dalton@2670
    82
src/video/SDL_blit.c \
dalton@2670
    83
src/video/SDL_blit_copy.c \
dalton@2670
    84
src/video/SDL_blit_N.c \
dalton@2670
    85
src/video/SDL_blit_slow.c \
dalton@2670
    86
src/video/SDL_bmp.c \
dalton@2670
    87
src/video/SDL_fill.c \
dalton@2670
    88
src/video/SDL_gamma.c \
dalton@2670
    89
src/video/SDL_pixels.c \
dalton@2670
    90
src/video/SDL_rect.c \
dalton@2670
    91
src/video/SDL_renderer_gl.c \
dalton@2670
    92
src/video/SDL_renderer_sw.c \
dalton@2670
    93
src/video/SDL_RLEaccel.c \
dalton@2670
    94
src/video/SDL_stretch.c \
dalton@2670
    95
src/video/SDL_surface.c \
dalton@2670
    96
src/video/SDL_video.c \
dalton@2670
    97
src/video/SDL_yuv_mmx.c \
dalton@2670
    98
src/video/SDL_yuv_sw.c \
dalton@2670
    99
dalton@2670
   100
OBJS = $(SRCS:.c=.o)
dalton@2670
   101
dalton@2670
   102
TEST = \
dalton@2670
   103
	test/checkkeys.c \
dalton@2670
   104
	test/graywin.c \
dalton@2670
   105
	test/loopwave.c \
dalton@2670
   106
	test/testalpha.c \
dalton@2670
   107
	test/testbitmap.c \
dalton@2670
   108
	test/testcdrom.c \
dalton@2670
   109
	test/testerror.c \
dalton@2670
   110
	test/testgamma.c \
dalton@2670
   111
	test/testgl.c \
dalton@2670
   112
	test/testhread.c \
dalton@2670
   113
	test/testjoystick.c \
dalton@2670
   114
	test/testkeys.c \
dalton@2670
   115
	test/testlock.c \
dalton@2670
   116
	test/testoverlay.c \
dalton@2670
   117
	test/testpalette.c \
dalton@2670
   118
	test/testsem.c \
dalton@2670
   119
	test/testsprite.c \
dalton@2670
   120
	test/testtimer.c \
dalton@2670
   121
	test/testtypes.c \
dalton@2670
   122
	test/testver.c \
dalton@2670
   123
	test/testvidinfo.c \
dalton@2670
   124
	test/testwin.c \
dalton@2670
   125
	test/testwm.c \
dalton@2670
   126
	test/threadwin.c \
dalton@2670
   127
	test/torturethread.c \
dalton@2670
   128
dalton@2670
   129
all: $(TARGET)
dalton@2670
   130
dalton@2670
   131
$(TARGET): copy_config \
dalton@2670
   132
	$(OBJS)
dalton@2670
   133
	$(AR) rc $(TARGET) $(OBJS)
dalton@2670
   134
	-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
dalton@2670
   135
dalton@2670
   136
install: $(TARGET)
dalton@2670
   137
	@cp libSDL.a $(DEVKITPRO)/libnds/lib/
dalton@2673
   138
	@mkdir -p $(DEVKITPRO)/libnds/include/SDL/
dalton@2673
   139
	@cp include/*.h $(DEVKITPRO)/libnds/include/SDL/
dalton@2670
   140
dalton@2670
   141
copy_config:
dalton@2670
   142
	@cp include/SDL_config.h.default include/SDL_config.h
dalton@2670
   143
dalton@2670
   144
clean:
dalton@2670
   145
	rm -f include/SDL_config.h $(OBJS)
dalton@2670
   146