Makefile.ds
author Sam Lantinga <slouken@libsdl.org>
Sun, 06 Mar 2011 21:12:19 -0800
changeset 5423 b69fa50e80d7
parent 5310 a9945ce48999
child 5428 cff5d3cd5777
permissions -rw-r--r--
a Nintendo ds update Frank Zago to SDL For those interested, here's a snapshot of the current port. I did away with most of the previous attempt which was based of the sprite engine, because the support is limited to 128 64x64 sprites. Instead I'm using the gl engine. The drawback is that either the frame buffer or the gl engine can be used because there's not that much video memory on a DS. With minimal changes to their code, it can now run the following tests: , testspriteminimal, testscale and testsprite2. The last 2 only run under the emulator for some reason. The tests are not included in this patch for size reason. In 16 bits mode, the 16th bit indicated transparency/opacity. If 0, the color is not displayed. So I had to patch a few core file to set that bit to 1. See patch for src/video/SDL_RLEaccel.c and src/video/SDL_blit.h. Is that ok, or is there a better way ? The nds also doesn't support windowed mode, so I force the fullscreen in src/video/SDL_video.c. Is that ok, or is there a better way ? To get a smaller library, I also tried to not compile the software renderer when the hardware renderer is compiled in, and define SDL_NO_COMPAT; however the compilation eventually fails in SDL_surface.c because SDL_SRCCOLORKEY is defined in SDL_compat.h. Is SDL_NO_COMPAT only for application and not SDL itself ?
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5423
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
     1
#---------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
     2
.SUFFIXES:
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
     3
#---------------------------------------------------------------------------------
5289
1916a9e9714d Frank Zago to SDL
Sam Lantinga <slouken@libsdl.org>
parents: 5271
diff changeset
     4
1916a9e9714d Frank Zago to SDL
Sam Lantinga <slouken@libsdl.org>
parents: 5271
diff changeset
     5
ifeq ($(strip $(DEVKITARM)),)
5423
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
     6
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
5289
1916a9e9714d Frank Zago to SDL
Sam Lantinga <slouken@libsdl.org>
parents: 5271
diff changeset
     7
endif
5423
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
     8
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
     9
include $(DEVKITARM)/ds_rules
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    10
5423
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    11
#---------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    12
# TARGET is the name of the output
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    13
# BUILD is the directory where object files & intermediate files will be placed
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    14
# SOURCES is a list of directories containing source code
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    15
# DATA is a list of directories containing data files
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    16
# INCLUDES is a list of directories containing header files
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    17
#---------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    18
TARGET		:=	$(shell basename $(CURDIR))
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    19
BUILD		:=	src
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    20
SOURCES		:=	source
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    21
DATA		:=	data
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    22
INCLUDES	:=	include
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    23
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    24
#---------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    25
# options for code generation
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    26
#---------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    27
ARCH	:=	-mthumb -mthumb-interwork \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    28
		-D__NDS__ -DENABLE_NDS -DNO_SIGNAL_H -DDISABLE_THREADS -DPACKAGE=\"SDL\" \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    29
		 -DVERSION=\"1.3\" -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1  
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    30
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    31
CFLAGS	:=	-g -Wall -O2\
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    32
		-march=armv5te -mtune=arm946e-s \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    33
		-fomit-frame-pointer -ffast-math \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    34
		$(ARCH)
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    35
5423
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    36
CFLAGS	+=	$(INCLUDE) -DARM9
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    37
CXXFLAGS	:= $(CFLAGS) -fno-rtti -fno-exceptions
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    38
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    39
ASFLAGS	:=	-g $(ARCH) -march=armv5te -mtune=arm946e-s
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    40
LDFLAGS	=	-specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    41
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    42
# Set to 0 to use a framer buffer, or 1 to use the hardware
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    43
# renderer. Alas, both cannot be used at the same time for lack of
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    44
# display/texture memory.
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    45
USE_HW_RENDERER := 1
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    46
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    47
ifeq ($(USE_HW_RENDERER),1)
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    48
CFLAGS += -DUSE_HW_RENDERER
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    49
else
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    50
endif
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    51
5423
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    52
#---------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    53
# list of directories containing libraries, this must be the top level containing
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    54
# include and lib
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    55
#---------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    56
LIBDIRS	:=	$(LIBNDS)
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    57
5423
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    58
#---------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    59
# no real need to edit anything past this point unless you need to add additional
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    60
# rules for different file extensions
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    61
#---------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    62
ifneq ($(BUILD),$(notdir $(CURDIR)))
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    63
#---------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    64
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    65
export OUTPUT	:=	$(CURDIR)/lib/lib$(TARGET).a
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    66
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    67
export VPATH	:=	$(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    68
			$(foreach dir,$(DATA),$(CURDIR)/$(dir))
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    69
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    70
export DEPSDIR	:=	$(CURDIR)/$(BUILD)
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    71
5423
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    72
CFILES		:=	\
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    73
			SDL.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    74
			SDL_assert.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    75
			SDL_compat.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    76
			SDL_error.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    77
			SDL_fatal.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    78
			SDL_hints.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    79
			SDL_log.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    80
			atomic/SDL_atomic.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    81
			atomic/SDL_spinlock.arm.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    82
			audio/SDL_audio.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    83
			audio/SDL_audiocvt.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    84
			audio/SDL_audiodev.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    85
			audio/SDL_audiotypecvt.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    86
			audio/SDL_mixer.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    87
			audio/SDL_mixer_MMX.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    88
			audio/SDL_mixer_MMX_VC.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    89
			audio/SDL_mixer_m68k.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    90
			audio/SDL_wave.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    91
			audio/nds/SDL_ndsaudio.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    92
			cpuinfo/SDL_cpuinfo.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    93
			events/SDL_events.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    94
			events/SDL_keyboard.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    95
			events/SDL_mouse.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    96
			events/SDL_quit.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    97
			events/SDL_touch.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    98
			events/SDL_windowevents.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
    99
			events/nds/SDL_ndsgesture.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   100
			file/SDL_rwops.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   101
			haptic/SDL_haptic.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   102
			haptic/nds/SDL_syshaptic.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   103
			joystick/SDL_joystick.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   104
			joystick/nds/SDL_sysjoystick.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   105
			power/SDL_power.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   106
			power/nds/SDL_syspower.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   107
			render/SDL_render.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   108
			render/SDL_yuv_sw.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   109
			render/software/SDL_blendfillrect.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   110
			render/software/SDL_blendline.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   111
			render/software/SDL_blendpoint.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   112
			render/software/SDL_drawline.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   113
			render/software/SDL_drawpoint.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   114
			render/software/SDL_render_sw.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   115
			stdlib/SDL_getenv.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   116
			stdlib/SDL_iconv.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   117
			stdlib/SDL_malloc.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   118
			stdlib/SDL_qsort.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   119
			stdlib/SDL_stdlib.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   120
			stdlib/SDL_string.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   121
			thread/SDL_thread.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   122
			thread/nds/SDL_syscond.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   123
			thread/nds/SDL_sysmutex.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   124
			thread/nds/SDL_syssem.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   125
			thread/nds/SDL_systhread.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   126
			timer/SDL_timer.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   127
			timer/nds/SDL_systimer.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   128
			video/SDL_RLEaccel.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   129
			video/SDL_blit.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   130
			video/SDL_blit_0.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   131
			video/SDL_blit_1.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   132
			video/SDL_blit_A.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   133
			video/SDL_blit_N.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   134
			video/SDL_blit_auto.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   135
			video/SDL_blit_copy.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   136
			video/SDL_blit_slow.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   137
			video/SDL_bmp.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   138
			video/SDL_clipboard.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   139
			video/SDL_fillrect.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   140
			video/SDL_pixels.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   141
			video/SDL_rect.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   142
			video/SDL_stretch.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   143
			video/SDL_surface.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   144
			video/SDL_video.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   145
			video/nds/SDL_ndsevents.c \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   146
			video/nds/SDL_ndsvideo.c
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   147
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   148
5423
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   149
ifeq ($(USE_HW_RENDERER),1)
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   150
# Ideally we should be able to not include the SW renderer at set
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   151
# SDL_NO_COMPAT. However that breaks the build.
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   152
CFILES +=	render/nds/SDL_ndsrender.c
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   153
else
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   154
endif
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   155
5423
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   156
#CPPFILES	:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   157
#SFILES		:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   158
#BINFILES	:=	$(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
5289
1916a9e9714d Frank Zago to SDL
Sam Lantinga <slouken@libsdl.org>
parents: 5271
diff changeset
   159
5423
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   160
#---------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   161
# use CXX for linking C++ projects, CC for standard C
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   162
#---------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   163
ifeq ($(strip $(CPPFILES)),)
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   164
#---------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   165
	export LD	:=	$(CC)
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   166
#---------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   167
else
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   168
#---------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   169
	export LD	:=	$(CXX)
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   170
#---------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   171
endif
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   172
#---------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   173
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   174
export OFILES	:=	$(addsuffix .o,$(BINFILES)) \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   175
			$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   176
5423
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   177
export INCLUDE	:=	$(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   178
			$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   179
			-I$(CURDIR)/$(BUILD)
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   180
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   181
.PHONY: $(BUILD) clean all
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   182
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   183
#---------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   184
all: arm_only $(BUILD) install nds_test
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   185
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   186
lib:
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   187
	@[ -d $@ ] || mkdir -p $@
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   188
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   189
$(BUILD): lib
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   190
	@[ -d $@ ] || mkdir -p $@
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   191
	@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.ds -s
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   192
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   193
install: $(BUILD)
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   194
	@cp $(OUTPUT) $(DEVKITPRO)/libnds/lib/
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   195
	@mkdir -p $(DEVKITPRO)/libnds/include/SDL/
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   196
	@cp include/*.h $(DEVKITPRO)/libnds/include/SDL/
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   197
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   198
nds_test:
5423
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   199
	$(MAKE) -C test/nds-test-progs
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   200
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   201
tags:
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   202
	etags $(SRCS)
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   203
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   204
# This file must be compiled with the ARM instruction set, not
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   205
# thumb. Use devkitpro way of doing things.
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   206
arm_only: src/atomic/SDL_spinlock.arm.c
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   207
src/atomic/SDL_spinlock.arm.c: src/atomic/SDL_spinlock.c
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   208
	@cp $< $@
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   209
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   210
#---------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   211
clean:
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   212
	@echo clean ...
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   213
	@cd src; rm -fr $(OFILES) $(OFILES:.o=.d) lib
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   214
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   215
#---------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   216
else
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   217
5423
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   218
DEPENDS	:=	$(OFILES:.o=.d)
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   219
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   220
#---------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   221
# main targets
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   222
#---------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   223
$(OUTPUT)	:	$(OFILES)
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   224
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   225
#---------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   226
%.bin.o	:	%.bin
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   227
#---------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   228
	@echo $(notdir $<)
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   229
	@$(bin2o)
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   230
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   231
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   232
-include $(DEPENDS)
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   233
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   234
#---------------------------------------------------------------------------------------
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   235
endif
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5310
diff changeset
   236
#---------------------------------------------------------------------------------------