ProxSpace/devkitARM/ds_rules
2016-10-31 22:04:38 +01:00

54 lines
1.6 KiB
Text

ifeq ($(strip $(DEVKITPRO)),)
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>devkitPro)
endif
include $(DEVKITARM)/base_rules
PORTLIBS := $(PORTLIBS_PATH)/nds $(PORTLIBS_PATH)/armv5te
LIBNDS := $(DEVKITPRO)/libnds
ifeq ($(strip $(GAME_TITLE)),)
GAME_TITLE := $(notdir $(OUTPUT))
endif
ifeq ($(strip $(GAME_SUBTITLE1)),)
GAME_SUBTITLE1 := built with devkitARM
endif
ifeq ($(strip $(GAME_SUBTITLE2)),)
GAME_SUBTITLE2 := http://devkitpro.org
endif
ifeq ($(strip $(GAME_ICON)),)
GAME_ICON := $(DEVKITPRO)/libnds/icon.bmp
endif
ifneq ($(strip $(NITRO_FILES)),)
_ADDFILES := -d $(NITRO_FILES)
endif
#---------------------------------------------------------------------------------
%.nds: %.arm9
@ndstool -c $@ -9 $< -b $(GAME_ICON) "$(GAME_TITLE);$(GAME_SUBTITLE1);$(GAME_SUBTITLE2)" $(_ADDFILES)
@echo built ... $(notdir $@)
#---------------------------------------------------------------------------------
%.nds: %.elf
@ndstool -c $@ -9 $< -b $(GAME_ICON) "$(GAME_TITLE);$(GAME_SUBTITLE1);$(GAME_SUBTITLE2)" $(_ADDFILES)
@echo built ... $(notdir $@)
#---------------------------------------------------------------------------------
%.arm9: %.elf
@$(OBJCOPY) -O binary $< $@
@echo built ... $(notdir $@)
#---------------------------------------------------------------------------------
%.arm7: %.elf
@$(OBJCOPY) -O binary $< $@
@echo built ... $(notdir $@)
#---------------------------------------------------------------------------------
%.elf:
@echo linking $(notdir $@)
@$(LD) $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@