Targets genererate their own firmware
[yari.git] / shared / SDL-1.2 / Makefile.ds
blobdf3d14652c6ec2a6ad13e3f8cb8dcc9aa85586c1
1 #LibSDL 1.2.12
2 #DS porting by Troy Davis(GPF)
5 ifeq ($(strip $(DEVKITPRO)),)
6 $(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>devkitPro)
7 endif
8 ifeq ($(strip $(DEVKITARM)),)
9 DEVKITARM := $(DEVKITPRO)/devkitARM
10 endif
13 SRCS = $(shell echo ./src/*.c ./src/audio/*.c ./src/cdrom/*.c ./src/cpuinfo/*.c ./src/events/*.c ./src/file/*.c ./src/stdlib/*.c ./src/thread/*.c ./src/timer/*.c ./src/video/*.c ./src/joystick/*.c ./src/joystick/nds/*.c ./src/cdrom/dummy/*.c ./src/thread/generic/*.c ./src/timer/nds/*.c ./src/loadso/dummy/*.c ./src/audio/dummy/*.c ./src/audio/nds/*.c ./src/video/dummy/*.c ./src/video/nds/*.c)
15 OBJS = $(SRCS:.c=.o) 
16         
18 SUBDIRS=
20 CC=arm-eabi-gcc
21 CXX=arm-eabi-g++ 
22 LDSHARED=$(CXX)
23 AR=arm-eabi-ar rc
24 RANLIB=arm-eabi-ranlib 
26 CFLAGS  =       -mthumb -mthumb-interwork \
27                 -march=armv5te -mtune=arm946e-s \
28                 -O2 -Wall -Wwrite-strings -Wpointer-arith \
29                 -DARM9 -D__NDS__ -I$(DEVKITPRO)/libnds/include -Iinclude
31 CXXFLAGS += $(CFLAGS)
33 all: $(DEVKITPRO)/libnds/lib/libSDL.a       
36 $(DEVKITPRO)/libnds/lib/libSDL.a:               $(OBJS)
37         $(AR) $@ $(OBJS)
38         -@ ($(RANLIB) $@ || true) >/dev/null 2>&1       
40 clean: 
41         find . -name "*.o" |xargs rm -f
42         find . -name "*.d" |xargs rm -f
43         -rm -f *.elf
44         -rm -f *.nds
45         -rm -f *.gba
46         -rm -f *.arm9
47         -rm -f *.map
48         -rm -f *.img
49         -rm -Rf *.d
52 subdirs: $(patsubst %, _dir_%, $(SUBDIRS))
54 $(patsubst %, _dir_%, $(SUBDIRS)):
55         $(MAKE) -C $(patsubst _dir_%, %, $@)
57 clean_subdirs: $(patsubst %, _clean_dir_%, $(SUBDIRS))
59 $(patsubst %, _clean_dir_%, $(SUBDIRS)):
60         $(MAKE) -C $(patsubst _clean_dir_%, %, $@) clean
62 #include $(DEVKITARM)/ds_rules