Makefile.ds
branchSDL-1.2
changeset 3976 8582c6a5ca16
equal deleted inserted replaced
3975:e85e65aec22f 3976:8582c6a5ca16
       
     1 #LibSDL 1.2.12
       
     2 #DS porting by Troy Davis(GPF)
       
     3 
       
     4 
       
     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
       
    11 
       
    12 
       
    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)
       
    14 
       
    15 OBJS = $(SRCS:.c=.o) 
       
    16 	
       
    17 
       
    18 SUBDIRS=
       
    19 
       
    20 CC=arm-eabi-gcc
       
    21 CXX=arm-eabi-g++ 
       
    22 LDSHARED=$(CXX)
       
    23 AR=arm-eabi-ar rc
       
    24 RANLIB=arm-eabi-ranlib 
       
    25 
       
    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
       
    30 
       
    31 CXXFLAGS += $(CFLAGS)
       
    32 
       
    33 all: $(DEVKITPRO)/libnds/lib/libSDL.a       
       
    34 
       
    35 
       
    36 $(DEVKITPRO)/libnds/lib/libSDL.a:		$(OBJS)
       
    37 	$(AR) $@ $(OBJS)
       
    38 	-@ ($(RANLIB) $@ || true) >/dev/null 2>&1 	
       
    39 
       
    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
       
    50 
       
    51 
       
    52 subdirs: $(patsubst %, _dir_%, $(SUBDIRS))
       
    53 
       
    54 $(patsubst %, _dir_%, $(SUBDIRS)):
       
    55 	$(MAKE) -C $(patsubst _dir_%, %, $@)
       
    56 
       
    57 clean_subdirs: $(patsubst %, _clean_dir_%, $(SUBDIRS))
       
    58 
       
    59 $(patsubst %, _clean_dir_%, $(SUBDIRS)):
       
    60 	$(MAKE) -C $(patsubst _clean_dir_%, %, $@) clean
       
    61 
       
    62 #include $(DEVKITARM)/ds_rules
       
    63