summaryrefslogtreecommitdiffstats
path: root/make/custom/nds.cfg
blob: 004496e75ea3ccca6943cd2038d6646da8a8749f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
##
## Config file for Nintendo DS BSP.
##
## $Id$
##

include $(RTEMS_ROOT)/make/custom/default.cfg

RTEMS_CPU=arm
RTEMS_CPU_MODEL=arm9tdmi

# This is the actual bsp directory used during the build process.
RTEMS_BSP_FAMILY=nds

#  This contains the compiler options necessary to select the CPU model
#  and (hopefully) optimize for it.
#
CPU_CFLAGS = -mcpu=$(RTEMS_CPU_MODEL) -msoft-float -mstructure-size-boundary=8
# CPU_CFLAGS += -mthumb-interwork ## -D __THUMB_INTERWORK__ -mthumb

# optimize flag: typically -O2
#CFLAGS_OPTIMIZE_V = -O0 -ggdb
CFLAGS_OPTIMIZE_V = -O2
#CFLAGS_OPTIMIZE_V = -Os

NDSTOOL = $(PROJECT_TOOLS)/ndstool

ifeq ($(RTEMS_MAKEFILE_PATH),)
	COPROC_ELF_PATH = $(abs_builddir)/../../../lib/libbsp/arm/nds/
else
	COPROC_ELF_PATH = $(RTEMS_MAKEFILE_PATH)/lib
endif

define bsp-post-link
	$(default-bsp-post-link)
	$(OBJCOPY) -O binary $(basename $@).exe $(basename $@).bin
	$(NDSTOOL) -c $(basename $@).nds -9 $(basename $@).bin \
	    -7 $(COPROC_ELF_PATH)/coproc.bin
	rm -f $(basename $@).bin
endef