From dc1de0cd5602c7839ed1667aa7e37672c10fda32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ni=C3=B1o=20D=C3=ADaz?= Date: Mon, 24 Mar 2025 20:57:15 +0000 Subject: [PATCH] build: docs: Remove all outdated devkitARM makefiles They don't work. Even if they were updated, the code will require changes, as well as the examples. For now, it's better to remove the makefiles than to pretend we support devkitARM. --- Makefile.dkp | 124 ----- changelog.rst | 7 + examples/3dsprites/alpha/Makefile.dkp | 222 --------- examples/3dsprites/animation/Makefile.dkp | 222 --------- examples/3dsprites/basic/Makefile.dkp | 222 --------- examples/3dsprites/delete/Makefile.dkp | 222 --------- examples/3dsprites/rotscale/Makefile.dkp | 222 --------- examples/3dsprites/setlayer/Makefile.dkp | 222 --------- examples/3dsprites/setpriority/Makefile.dkp | 222 --------- examples/3dsprites/swappriority/Makefile.dkp | 222 --------- examples/collisions/barrels/Makefile.dkp | 222 --------- examples/collisions/pixels/Makefile.dkp | 222 --------- examples/collisions/tiles/Makefile.dkp | 222 --------- examples/demo/reveal/Makefile.dkp | 222 --------- examples/demo/water/Makefile.dkp | 222 --------- examples/demo/wave/Makefile.dkp | 222 --------- examples/demo/zoomx2/Makefile.dkp | 222 --------- examples/demo/zoomx3/Makefile.dkp | 222 --------- examples/graphics/affine/Makefile.dkp | 222 --------- examples/graphics/alpha/Makefile.dkp | 222 --------- examples/graphics/animatedbg/Makefile.dkp | 222 --------- examples/graphics/backbuffer/Makefile.dkp | 222 --------- examples/graphics/backbuffer2/Makefile.dkp | 222 --------- examples/graphics/backbuffer3/Makefile.dkp | 222 --------- examples/graphics/backbuffer4/Makefile.dkp | 222 --------- examples/graphics/bg/Makefile.dkp | 222 --------- examples/graphics/bg16bits/Makefile.dkp | 222 --------- examples/graphics/bg16bitsload/Makefile.dkp | 222 --------- examples/graphics/bg8bits/Makefile.dkp | 222 --------- examples/graphics/bgextpalette/Makefile.dkp | 222 --------- examples/graphics/bgmixed/Makefile.dkp | 222 --------- examples/graphics/bgpalette/Makefile.dkp | 222 --------- examples/graphics/imgdraw/Makefile.dkp | 222 --------- examples/graphics/sprite/Makefile.dkp | 222 --------- examples/graphics/spritepal/Makefile.dkp | 222 --------- .../graphics/sprites_all_sizes/Makefile.dkp | 222 --------- examples/graphics/tilechange/Makefile.dkp | 222 --------- examples/graphics/tileflip/Makefile.dkp | 222 --------- examples/media/bmpload/Makefile.dkp | 222 --------- examples/media/bmpscroll/Makefile.dkp | 222 --------- examples/misc/language/Makefile.dkp | 222 --------- examples/sound/rawsfx/Makefile.dkp | 222 --------- examples/text/text16/Makefile.dkp | 222 --------- examples/text/textcolor/Makefile.dkp | 222 --------- examples/text/textdemo/Makefile.dkp | 222 --------- examples/text/textdemo16/Makefile.dkp | 222 --------- examples/text/textscroll/Makefile.dkp | 222 --------- examples/wifi/udptalk/Makefile.dkp | 222 --------- readme.rst | 33 +- template/Makefile | 437 ++++++++++-------- template/Makefile.blocksds | 291 ------------ 51 files changed, 264 insertions(+), 10840 deletions(-) delete mode 100644 Makefile.dkp delete mode 100644 examples/3dsprites/alpha/Makefile.dkp delete mode 100644 examples/3dsprites/animation/Makefile.dkp delete mode 100644 examples/3dsprites/basic/Makefile.dkp delete mode 100644 examples/3dsprites/delete/Makefile.dkp delete mode 100644 examples/3dsprites/rotscale/Makefile.dkp delete mode 100644 examples/3dsprites/setlayer/Makefile.dkp delete mode 100644 examples/3dsprites/setpriority/Makefile.dkp delete mode 100644 examples/3dsprites/swappriority/Makefile.dkp delete mode 100644 examples/collisions/barrels/Makefile.dkp delete mode 100644 examples/collisions/pixels/Makefile.dkp delete mode 100644 examples/collisions/tiles/Makefile.dkp delete mode 100644 examples/demo/reveal/Makefile.dkp delete mode 100644 examples/demo/water/Makefile.dkp delete mode 100644 examples/demo/wave/Makefile.dkp delete mode 100644 examples/demo/zoomx2/Makefile.dkp delete mode 100644 examples/demo/zoomx3/Makefile.dkp delete mode 100644 examples/graphics/affine/Makefile.dkp delete mode 100644 examples/graphics/alpha/Makefile.dkp delete mode 100644 examples/graphics/animatedbg/Makefile.dkp delete mode 100644 examples/graphics/backbuffer/Makefile.dkp delete mode 100644 examples/graphics/backbuffer2/Makefile.dkp delete mode 100644 examples/graphics/backbuffer3/Makefile.dkp delete mode 100644 examples/graphics/backbuffer4/Makefile.dkp delete mode 100644 examples/graphics/bg/Makefile.dkp delete mode 100644 examples/graphics/bg16bits/Makefile.dkp delete mode 100644 examples/graphics/bg16bitsload/Makefile.dkp delete mode 100644 examples/graphics/bg8bits/Makefile.dkp delete mode 100644 examples/graphics/bgextpalette/Makefile.dkp delete mode 100644 examples/graphics/bgmixed/Makefile.dkp delete mode 100644 examples/graphics/bgpalette/Makefile.dkp delete mode 100644 examples/graphics/imgdraw/Makefile.dkp delete mode 100644 examples/graphics/sprite/Makefile.dkp delete mode 100644 examples/graphics/spritepal/Makefile.dkp delete mode 100644 examples/graphics/sprites_all_sizes/Makefile.dkp delete mode 100644 examples/graphics/tilechange/Makefile.dkp delete mode 100644 examples/graphics/tileflip/Makefile.dkp delete mode 100644 examples/media/bmpload/Makefile.dkp delete mode 100644 examples/media/bmpscroll/Makefile.dkp delete mode 100644 examples/misc/language/Makefile.dkp delete mode 100644 examples/sound/rawsfx/Makefile.dkp delete mode 100644 examples/text/text16/Makefile.dkp delete mode 100644 examples/text/textcolor/Makefile.dkp delete mode 100644 examples/text/textdemo/Makefile.dkp delete mode 100644 examples/text/textdemo16/Makefile.dkp delete mode 100644 examples/text/textscroll/Makefile.dkp delete mode 100644 examples/wifi/udptalk/Makefile.dkp delete mode 100644 template/Makefile.blocksds diff --git a/Makefile.dkp b/Makefile.dkp deleted file mode 100644 index e2351ae..0000000 --- a/Makefile.dkp +++ /dev/null @@ -1,124 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# DATA is a list of directories containing data files -# INCLUDES is a list of directories containing header files -#--------------------------------------------------------------------------------- -TARGET := nflib -BUILD := build -SOURCES := source -DATA := data -INCLUDES := include - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -mthumb -mthumb-interwork - -CFLAGS := -g -Wall -O2\ - -march=armv5te -mtune=arm946e-s \ - -fomit-frame-pointer -ffast-math \ - $(ARCH) - -CFLAGS += $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions - -ASFLAGS := -g $(ARCH) -march=armv5te -mtune=arm946e-s -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/lib/lib$(TARGET).a - -export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \ - $(foreach dir,$(DATA),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES := $(addsuffix .o,$(BINFILES)) \ - $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ - $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ - -I$(CURDIR)/$(BUILD) - -.PHONY: $(BUILD) clean all - -#--------------------------------------------------------------------------------- -all: $(BUILD) - -lib: - @[ -d $@ ] || mkdir -p $@ - -$(BUILD): lib - @[ -d $@ ] || mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) lib - -#--------------------------------------------------------------------------------- -else - -DEPENDS := $(OFILES:.o=.d) - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT) : $(OFILES) - -#--------------------------------------------------------------------------------- -%.bin.o : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - - --include $(DEPENDS) - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/changelog.rst b/changelog.rst index e48b638..e0149c9 100644 --- a/changelog.rst +++ b/changelog.rst @@ -1,3 +1,10 @@ +NightFox's Lib Ver. DEV +----------------------- + +- The devkitARM makefiles have been removed as they only work with old versions + of devkitARM, which aren't supported by its maintainers. The code and examples + of NFLib will probably need changes to work with current devkitARM. + NightFox's Lib Ver. 1.1.8 ------------------------- diff --git a/examples/3dsprites/alpha/Makefile.dkp b/examples/3dsprites/alpha/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/3dsprites/alpha/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/3dsprites/animation/Makefile.dkp b/examples/3dsprites/animation/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/3dsprites/animation/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/3dsprites/basic/Makefile.dkp b/examples/3dsprites/basic/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/3dsprites/basic/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/3dsprites/delete/Makefile.dkp b/examples/3dsprites/delete/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/3dsprites/delete/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/3dsprites/rotscale/Makefile.dkp b/examples/3dsprites/rotscale/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/3dsprites/rotscale/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/3dsprites/setlayer/Makefile.dkp b/examples/3dsprites/setlayer/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/3dsprites/setlayer/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/3dsprites/setpriority/Makefile.dkp b/examples/3dsprites/setpriority/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/3dsprites/setpriority/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/3dsprites/swappriority/Makefile.dkp b/examples/3dsprites/swappriority/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/3dsprites/swappriority/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/collisions/barrels/Makefile.dkp b/examples/collisions/barrels/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/collisions/barrels/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/collisions/pixels/Makefile.dkp b/examples/collisions/pixels/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/collisions/pixels/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/collisions/tiles/Makefile.dkp b/examples/collisions/tiles/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/collisions/tiles/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/demo/reveal/Makefile.dkp b/examples/demo/reveal/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/demo/reveal/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/demo/water/Makefile.dkp b/examples/demo/water/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/demo/water/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/demo/wave/Makefile.dkp b/examples/demo/wave/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/demo/wave/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/demo/zoomx2/Makefile.dkp b/examples/demo/zoomx2/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/demo/zoomx2/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/demo/zoomx3/Makefile.dkp b/examples/demo/zoomx3/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/demo/zoomx3/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/graphics/affine/Makefile.dkp b/examples/graphics/affine/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/graphics/affine/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/graphics/alpha/Makefile.dkp b/examples/graphics/alpha/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/graphics/alpha/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/graphics/animatedbg/Makefile.dkp b/examples/graphics/animatedbg/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/graphics/animatedbg/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/graphics/backbuffer/Makefile.dkp b/examples/graphics/backbuffer/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/graphics/backbuffer/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/graphics/backbuffer2/Makefile.dkp b/examples/graphics/backbuffer2/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/graphics/backbuffer2/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/graphics/backbuffer3/Makefile.dkp b/examples/graphics/backbuffer3/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/graphics/backbuffer3/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/graphics/backbuffer4/Makefile.dkp b/examples/graphics/backbuffer4/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/graphics/backbuffer4/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/graphics/bg/Makefile.dkp b/examples/graphics/bg/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/graphics/bg/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/graphics/bg16bits/Makefile.dkp b/examples/graphics/bg16bits/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/graphics/bg16bits/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/graphics/bg16bitsload/Makefile.dkp b/examples/graphics/bg16bitsload/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/graphics/bg16bitsload/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/graphics/bg8bits/Makefile.dkp b/examples/graphics/bg8bits/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/graphics/bg8bits/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/graphics/bgextpalette/Makefile.dkp b/examples/graphics/bgextpalette/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/graphics/bgextpalette/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/graphics/bgmixed/Makefile.dkp b/examples/graphics/bgmixed/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/graphics/bgmixed/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/graphics/bgpalette/Makefile.dkp b/examples/graphics/bgpalette/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/graphics/bgpalette/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/graphics/imgdraw/Makefile.dkp b/examples/graphics/imgdraw/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/graphics/imgdraw/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/graphics/sprite/Makefile.dkp b/examples/graphics/sprite/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/graphics/sprite/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/graphics/spritepal/Makefile.dkp b/examples/graphics/spritepal/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/graphics/spritepal/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/graphics/sprites_all_sizes/Makefile.dkp b/examples/graphics/sprites_all_sizes/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/graphics/sprites_all_sizes/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/graphics/tilechange/Makefile.dkp b/examples/graphics/tilechange/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/graphics/tilechange/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/graphics/tileflip/Makefile.dkp b/examples/graphics/tileflip/Makefile.dkp deleted file mode 100644 index c670c39..0000000 --- a/examples/graphics/tileflip/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.dkp - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/media/bmpload/Makefile.dkp b/examples/media/bmpload/Makefile.dkp deleted file mode 100644 index 6392f1d..0000000 --- a/examples/media/bmpload/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/media/bmpscroll/Makefile.dkp b/examples/media/bmpscroll/Makefile.dkp deleted file mode 100644 index 6392f1d..0000000 --- a/examples/media/bmpscroll/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/misc/language/Makefile.dkp b/examples/misc/language/Makefile.dkp deleted file mode 100644 index 6392f1d..0000000 --- a/examples/misc/language/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/sound/rawsfx/Makefile.dkp b/examples/sound/rawsfx/Makefile.dkp deleted file mode 100644 index 6392f1d..0000000 --- a/examples/sound/rawsfx/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/text/text16/Makefile.dkp b/examples/text/text16/Makefile.dkp deleted file mode 100644 index 6392f1d..0000000 --- a/examples/text/text16/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/text/textcolor/Makefile.dkp b/examples/text/textcolor/Makefile.dkp deleted file mode 100644 index 6392f1d..0000000 --- a/examples/text/textcolor/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/text/textdemo/Makefile.dkp b/examples/text/textdemo/Makefile.dkp deleted file mode 100644 index 6392f1d..0000000 --- a/examples/text/textdemo/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/text/textdemo16/Makefile.dkp b/examples/text/textdemo16/Makefile.dkp deleted file mode 100644 index 6392f1d..0000000 --- a/examples/text/textdemo16/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/text/textscroll/Makefile.dkp b/examples/text/textscroll/Makefile.dkp deleted file mode 100644 index 6392f1d..0000000 --- a/examples/text/textscroll/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include -DATA := data -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/examples/wifi/udptalk/Makefile.dkp b/examples/wifi/udptalk/Makefile.dkp deleted file mode 100644 index a76edf8..0000000 --- a/examples/wifi/udptalk/Makefile.dkp +++ /dev/null @@ -1,222 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- - -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org - -include $(DEVKITARM)/ds_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := include source -DATA := -GRAPHICS := -AUDIO := -ICON := - -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib - -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif - -LIBS := $(LIBS) -ldswifi9 -lnds9 - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- - -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) - -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) - -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) - -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) - -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp - endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif -endif - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) - -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) - -# need to build soundbank first -$(OFILES): $(SOUNDBANK) - -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h - -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) - -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* - -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/readme.rst b/readme.rst index 0691636..d9c2508 100644 --- a/readme.rst +++ b/readme.rst @@ -129,32 +129,7 @@ converted graphics to NitroFS so that your game can grow as much as you want. Setup instructions for devkitPro ================================ -**NOTE**: This option is untested. It may not work with the last version of -devkitARM. - -1. Clone this repository. Create a symbolic link to it inside the devkitPro - folder in your system, and call it ``nflib``. - - For example, in Linux, create a symlink so that ``/opt/devkitpro/nflib`` - points to the folder with NFlib: - - .. code:: bash - - ln -sT /path/to/nds_nflib /opt/devkitpro/nflib - - On Windows, the path should be ``C:\devkitpro\nflib``. - - If this doesn't work, copy the folder of NFlib to the devkitPro folder and - rename it to ``nflib``. - -2. Go to the ``nflib`` folder and type this on the terminal: - - .. code:: bash - - make -f Makefile.dkp - -3. That's it! Go to the folder of any of the examples and try to build it with: - - .. code:: bash - - make -f Makefile.dkp +**NOTE**: This option has been temporarily removed. The Makefiles that were +present in the repository were only valid in old versions of devkitARM, +unsupported by their maintainers. The code and examples will also need changes +to work with the new version of their libraries. diff --git a/template/Makefile b/template/Makefile index 8d87ac8..b896778 100644 --- a/template/Makefile +++ b/template/Makefile @@ -1,222 +1,291 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- +# SPDX-License-Identifier: CC0-1.0 +# +# SPDX-FileContributor: Antonio Niño Díaz, 2023-2024 -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif +export BLOCKSDS ?= /opt/blocksds/core +export BLOCKSDSEXT ?= /opt/blocksds/external -# These set the information text in the nds file -#GAME_TITLE := My Wonderful Homebrew -#GAME_SUBTITLE1 := built with devkitARM -#GAME_SUBTITLE2 := http://devitpro.org +export WONDERFUL_TOOLCHAIN ?= /opt/wonderful +ARM_NONE_EABI_PATH ?= $(WONDERFUL_TOOLCHAIN)/toolchain/gcc-arm-none-eabi/bin/ -include $(DEVKITARM)/ds_rules +# User config +# =========== -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -# DATA is a list of directories containing binary files embedded using bin2o -# GRAPHICS is a list of directories containing image files to be converted with grit -# AUDIO is a list of directories containing audio to be converted by maxmod -# ICON is the image used to create the game icon, leave blank to use default rule -# NITRO is a directory that will be accessible via NitroFS -#--------------------------------------------------------------------------------- -TARGET := $(shell basename $(CURDIR)) -BUILD := build -SOURCES := source -INCLUDES := -DATA := -GRAPHICS := -AUDIO := -ICON := +NAME := $(shell basename $(CURDIR)) +GAME_TITLE := $(shell basename $(CURDIR)).nds +GAME_SUBTITLE := NightFox’s lib example +GAME_AUTHOR := github.com/knightfox75/nds_nflib +GAME_ICON := $(BLOCKSDS)/sys/icon.bmp -# specify a directory which contains the nitro filesystem -# this is relative to the Makefile -NITRO := nitrofiles +# Source code paths +# ----------------- -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -marm -mthumb-interwork -march=armv5te -mtune=arm946e-s +SOURCEDIRS := source +INCLUDEDIRS := +GFXDIRS := +BINDIRS := +AUDIODIRS := +NITROFSDIR := nitrofiles -CFLAGS := -g -Wall -O3\ - $(ARCH) $(INCLUDE) -DARM9 -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) +# DLDI and internal SD slot of DSi +# -------------------------------- -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := -lnflib +# Root folder of the SD image +SDROOT := sdroot +# Name of the generated image it "DSi-1.sd" for no$gba in DSi mode +SDIMAGE := image.bin -# automatigically add libraries for NitroFS -ifneq ($(strip $(NITRO)),) -LIBS := $(LIBS) -lfilesystem -lfat -endif -# automagically add maxmod library -ifneq ($(strip $(AUDIO)),) -LIBS := $(LIBS) -lmm9 -endif +# Libraries +# --------- -LIBS := $(LIBS) -lnds9 +LIBS += -lnflib -ldswifi9 -lnds9 -lc +LIBDIRS += $(BLOCKSDSEXT)/nflib \ + $(BLOCKSDS)/libs/dswifi \ + $(BLOCKSDS)/libs/libnds -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nflib +# Build artifacts +# --------------- -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- +BUILDDIR := build/$(NAME) +ELF := build/$(NAME).elf +DUMP := build/$(NAME).dump +MAP := build/$(NAME).map +ROM := $(NAME).nds -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(CURDIR)/$(subst /,,$(dir $(ICON)))\ - $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\ - $(foreach dir,$(DATA),$(CURDIR)/$(dir))\ - $(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -# prepare NitroFS directory -ifneq ($(strip $(NITRO)),) - export NITRO_FILES := $(CURDIR)/$(NITRO) -endif - -# get audio list for maxmod -ifneq ($(strip $(AUDIO)),) - export MODFILES := $(foreach dir,$(notdir $(wildcard $(AUDIO)/*.*)),$(CURDIR)/$(AUDIO)/$(dir)) - - # place the soundbank file in NitroFS if using it - ifneq ($(strip $(NITRO)),) - export SOUNDBANK := $(NITRO_FILES)/soundbank.bin - - # otherwise, needs to be loaded from memory - else - export SOUNDBANK := soundbank.bin - BINFILES += $(SOUNDBANK) - endif -endif - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- +# If NITROFSDIR is set, the soundbank created by mmutil will be saved to NitroFS +SOUNDBANKINFODIR := $(BUILDDIR)/maxmod +ifeq ($(strip $(NITROFSDIR)),) + SOUNDBANKDIR := $(BUILDDIR)/maxmod else -#--------------------------------------------------------------------------------- - export LD := $(CXX) -#--------------------------------------------------------------------------------- + SOUNDBANKDIR := $(BUILDDIR)/maxmod_nitrofs endif -#--------------------------------------------------------------------------------- -export OFILES_BIN := $(addsuffix .o,$(BINFILES)) +# Tools +# ----- -export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) +PREFIX := $(ARM_NONE_EABI_PATH)arm-none-eabi- +CC := $(PREFIX)gcc +CXX := $(PREFIX)g++ +LD := $(PREFIX)gcc +OBJDUMP := $(PREFIX)objdump +MKDIR := mkdir +RM := rm -rf -export OFILES := $(PNGFILES:.png=.o) $(OFILES_BIN) $(OFILES_SOURCES) +# Verbose flag +# ------------ -export HFILES := $(PNGFILES:.png=.h) $(addsuffix .h,$(subst .,_,$(BINFILES))) +ifeq ($(VERBOSE),1) +V := +else +V := @ +endif -export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\ - $(foreach dir,$(LIBDIRS),-I$(dir)/include)\ - -I$(CURDIR)/$(BUILD) -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) +# Source files +# ------------ -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.bmp) - - ifneq (,$(findstring $(TARGET).bmp,$(icons))) - export GAME_ICON := $(CURDIR)/$(TARGET).bmp - else - ifneq (,$(findstring icon.bmp,$(icons))) - export GAME_ICON := $(CURDIR)/icon.bmp +ifneq ($(BINDIRS),) + SOURCES_BIN := $(shell find -L $(BINDIRS) -name "*.bin") + INCLUDEDIRS += $(addprefix $(BUILDDIR)/,$(BINDIRS)) +endif +ifneq ($(GFXDIRS),) + SOURCES_PNG := $(shell find -L $(GFXDIRS) -name "*.png") + INCLUDEDIRS += $(addprefix $(BUILDDIR)/,$(GFXDIRS)) +endif +ifneq ($(AUDIODIRS),) + SOURCES_AUDIO := $(shell find -L $(AUDIODIRS) -regex '.*\.\(it\|mod\|s3m\|wav\|xm\)') + ifneq ($(SOURCES_AUDIO),) + INCLUDEDIRS += $(SOUNDBANKINFODIR) endif - endif -else - ifeq ($(suffix $(ICON)), .grf) - export GAME_ICON := $(CURDIR)/$(ICON) - else - export GAME_ICON := $(CURDIR)/$(BUILD)/$(notdir $(basename $(ICON))).grf - endif endif -.PHONY: $(BUILD) clean +SOURCES_S := $(shell find -L $(SOURCEDIRS) -name "*.s") +SOURCES_C := $(shell find -L $(SOURCEDIRS) -name "*.c") +SOURCES_CPP := $(shell find -L $(SOURCEDIRS) -name "*.cpp") -#--------------------------------------------------------------------------------- -$(BUILD): - @mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile +# Compiler and linker flags +# ------------------------- + +ARCH := -mthumb -mcpu=arm946e-s+nofp + +SPECS := $(BLOCKSDS)/sys/crts/ds_arm9.specs + +WARNFLAGS := -Wall + +ifeq ($(SOURCES_CPP),) + LIBS += -lc +else + LIBS += -lstdc++ -lc +endif + +INCLUDEFLAGS := $(foreach path,$(INCLUDEDIRS),-I$(path)) \ + $(foreach path,$(LIBDIRS),-I$(path)/include) + +LIBDIRSFLAGS := $(foreach path,$(LIBDIRS),-L$(path)/lib) + +ASFLAGS += -x assembler-with-cpp $(INCLUDEFLAGS) $(DEFINES) \ + $(ARCH) -ffunction-sections -fdata-sections \ + -specs=$(SPECS) + +CFLAGS += -std=gnu17 $(WARNFLAGS) $(INCLUDEFLAGS) $(DEFINES) \ + $(ARCH) -O2 -ffunction-sections -fdata-sections \ + -specs=$(SPECS) + +CXXFLAGS += -std=gnu++17 $(WARNFLAGS) $(INCLUDEFLAGS) $(DEFINES) \ + $(ARCH) -O2 -ffunction-sections -fdata-sections \ + -fno-exceptions -fno-rtti \ + -specs=$(SPECS) + +LDFLAGS := $(ARCH) $(LIBDIRSFLAGS) -Wl,-Map,$(MAP) $(DEFINES) \ + -Wl,--start-group $(LIBS) -Wl,--end-group -specs=$(SPECS) + +# Intermediate build files +# ------------------------ + +OBJS_ASSETS := $(addsuffix .o,$(addprefix $(BUILDDIR)/,$(SOURCES_BIN))) \ + $(addsuffix .o,$(addprefix $(BUILDDIR)/,$(SOURCES_PNG))) + +HEADERS_ASSETS := $(patsubst %.bin,%_bin.h,$(addprefix $(BUILDDIR)/,$(SOURCES_BIN))) \ + $(patsubst %.png,%.h,$(addprefix $(BUILDDIR)/,$(SOURCES_PNG))) + +ifneq ($(SOURCES_AUDIO),) + ifeq ($(strip $(NITROFSDIR)),) + OBJS_ASSETS += $(SOUNDBANKDIR)/soundbank.c.o + endif + HEADERS_ASSETS += $(SOUNDBANKINFODIR)/soundbank.h +endif + +OBJS_SOURCES := $(addsuffix .o,$(addprefix $(BUILDDIR)/,$(SOURCES_S))) \ + $(addsuffix .o,$(addprefix $(BUILDDIR)/,$(SOURCES_C))) \ + $(addsuffix .o,$(addprefix $(BUILDDIR)/,$(SOURCES_CPP))) + +OBJS := $(OBJS_ASSETS) $(OBJS_SOURCES) + +DEPS := $(OBJS:.o=.d) + +# Targets +# ------- + +.PHONY: all clean dump dldipatch sdimage + +all: $(ROM) + +ifneq ($(strip $(NITROFSDIR)),) +# Additional arguments for ndstool +NDSTOOL_ARGS := -d $(NITROFSDIR) + +ifneq ($(SOURCES_AUDIO),) + NDSTOOL_ARGS += -d $(SOUNDBANKDIR) +endif + +# Make the NDS ROM depend on the filesystem only if it is needed +$(ROM): $(NITROFSDIR) +endif + +# Combine the title strings +ifeq ($(strip $(GAME_SUBTITLE)),) + GAME_FULL_TITLE := $(GAME_TITLE);$(GAME_AUTHOR) +else + GAME_FULL_TITLE := $(GAME_TITLE);$(GAME_SUBTITLE);$(GAME_AUTHOR) +endif + +$(ROM): $(ELF) + @echo " NDSTOOL $@" + $(V)$(BLOCKSDS)/tools/ndstool/ndstool -c $@ \ + -7 $(BLOCKSDS)/sys/default_arm7/arm7.elf -9 $(ELF) \ + -b $(GAME_ICON) "$(GAME_FULL_TITLE)" \ + $(NDSTOOL_ARGS) + +$(ELF): $(OBJS) + @echo " LD $@" + $(V)$(LD) -o $@ $(OBJS) $(LDFLAGS) + +$(DUMP): $(ELF) + @echo " OBJDUMP $@" + $(V)$(OBJDUMP) -h -C -S $< > $@ + +dump: $(DUMP) -#--------------------------------------------------------------------------------- clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(SOUNDBANK) + @echo " CLEAN" + $(V)$(RM) $(ROM) $(DUMP) build $(SDIMAGE) -#--------------------------------------------------------------------------------- -else +sdimage: + @echo " MKFATIMG $(SDIMAGE) $(SDROOT)" + $(V)$(BLOCKSDS)/tools/mkfatimg/mkfatimg -t $(SDROOT) $(SDIMAGE) -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).nds: $(OUTPUT).elf $(NITRO_FILES) $(GAME_ICON) -$(OUTPUT).elf: $(OFILES) +dldipatch: $(ROM) + @echo " DLDIPATCH $(ROM)" + $(V)$(BLOCKSDS)/tools/dldipatch/dldipatch patch \ + $(BLOCKSDS)/sys/dldi_r4/r4tf.dldi $(ROM) -# source files depend on generated headers -$(OFILES_SOURCES) : $(HFILES) +# Rules +# ----- -# need to build soundbank first -$(OFILES): $(SOUNDBANK) +$(BUILDDIR)/%.s.o : %.s + @echo " AS $<" + @$(MKDIR) -p $(@D) + $(V)$(CC) $(ASFLAGS) -MMD -MP -c -o $@ $< -#--------------------------------------------------------------------------------- -# rule to build solution from music files -#--------------------------------------------------------------------------------- -$(SOUNDBANK) : $(MODFILES) -#--------------------------------------------------------------------------------- - mmutil $^ -d -o$@ -hsoundbank.h +$(BUILDDIR)/%.c.o : %.c + @echo " CC $<" + @$(MKDIR) -p $(@D) + $(V)$(CC) $(CFLAGS) -MMD -MP -c -o $@ $< -#--------------------------------------------------------------------------------- -%.bin.o %_bin.h : %.bin -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - @$(bin2o) +$(BUILDDIR)/%.arm.c.o : %.arm.c + @echo " CC $<" + @$(MKDIR) -p $(@D) + $(V)$(CC) $(CFLAGS) -MMD -MP -marm -mlong-calls -c -o $@ $< -#--------------------------------------------------------------------------------- -# This rule creates assembly source files using grit -# grit takes an image file and a .grit describing how the file is to be processed -# add additional rules like this for each image extension -# you use in the graphics folders -#--------------------------------------------------------------------------------- -%.s %.h: %.png %.grit -#--------------------------------------------------------------------------------- - grit $< -fts -o$* +$(BUILDDIR)/%.cpp.o : %.cpp + @echo " CXX $<" + @$(MKDIR) -p $(@D) + $(V)$(CXX) $(CXXFLAGS) -MMD -MP -c -o $@ $< -#--------------------------------------------------------------------------------- -# Convert non-GRF game icon to GRF if needed -#--------------------------------------------------------------------------------- -$(GAME_ICON): $(notdir $(ICON)) -#--------------------------------------------------------------------------------- - @echo convert $(notdir $<) - @grit $< -g -gt -gB4 -gT FF00FF -m! -p -pe 16 -fh! -ftr +$(BUILDDIR)/%.arm.cpp.o : %.arm.cpp + @echo " CXX $<" + @$(MKDIR) -p $(@D) + $(V)$(CXX) $(CXXFLAGS) -MMD -MP -marm -mlong-calls -c -o $@ $< --include $(DEPSDIR)/*.d +$(BUILDDIR)/%.bin.o $(BUILDDIR)/%_bin.h : %.bin + @echo " BIN2C $<" + @$(MKDIR) -p $(@D) + $(V)$(BLOCKSDS)/tools/bin2c/bin2c $< $(@D) + $(V)$(CC) $(CFLAGS) -MMD -MP -c -o $(BUILDDIR)/$*.bin.o $(BUILDDIR)/$*_bin.c -#--------------------------------------------------------------------------------------- +$(BUILDDIR)/%.png.o $(BUILDDIR)/%.h : %.png %.grit + @echo " GRIT $<" + @$(MKDIR) -p $(@D) + $(V)$(BLOCKSDS)/tools/grit/grit $< -ftc -W1 -o$(BUILDDIR)/$* + $(V)$(CC) $(CFLAGS) -MMD -MP -c -o $(BUILDDIR)/$*.png.o $(BUILDDIR)/$*.c + $(V)touch $(BUILDDIR)/$*.png.o $(BUILDDIR)/$*.h + +ifneq ($(SOURCES_AUDIO),) + +$(SOUNDBANKINFODIR)/soundbank.h: $(SOURCES_AUDIO) + @echo " MMUTIL $^" + @$(MKDIR) -p $(SOUNDBANKDIR) + @$(MKDIR) -p $(SOUNDBANKINFODIR) + @$(BLOCKSDS)/tools/mmutil/mmutil $^ -d \ + -o$(SOUNDBANKDIR)/soundbank.bin -h$(SOUNDBANKINFODIR)/soundbank.h + +ifeq ($(strip $(NITROFSDIR)),) +$(SOUNDBANKDIR)/soundbank.c.o: $(SOUNDBANKINFODIR)/soundbank.h + @echo " BIN2C soundbank.bin" + $(V)$(BLOCKSDS)/tools/bin2c/bin2c $(SOUNDBANKDIR)/soundbank.bin \ + $(SOUNDBANKDIR) + @echo " CC.9 soundbank_bin.c" + $(V)$(CC) $(CFLAGS) -MMD -MP -c -o $(SOUNDBANKDIR)/soundbank.c.o \ + $(SOUNDBANKDIR)/soundbank_bin.c endif -#--------------------------------------------------------------------------------------- + +endif + +# All assets must be built before the source code +# ----------------------------------------------- + +$(SOURCES_S) $(SOURCES_C) $(SOURCES_CPP): $(HEADERS_ASSETS) + +# Include dependency files if they exist +# -------------------------------------- + +-include $(DEPS) diff --git a/template/Makefile.blocksds b/template/Makefile.blocksds deleted file mode 100644 index b896778..0000000 --- a/template/Makefile.blocksds +++ /dev/null @@ -1,291 +0,0 @@ -# SPDX-License-Identifier: CC0-1.0 -# -# SPDX-FileContributor: Antonio Niño Díaz, 2023-2024 - -export BLOCKSDS ?= /opt/blocksds/core -export BLOCKSDSEXT ?= /opt/blocksds/external - -export WONDERFUL_TOOLCHAIN ?= /opt/wonderful -ARM_NONE_EABI_PATH ?= $(WONDERFUL_TOOLCHAIN)/toolchain/gcc-arm-none-eabi/bin/ - -# User config -# =========== - -NAME := $(shell basename $(CURDIR)) -GAME_TITLE := $(shell basename $(CURDIR)).nds -GAME_SUBTITLE := NightFox’s lib example -GAME_AUTHOR := github.com/knightfox75/nds_nflib -GAME_ICON := $(BLOCKSDS)/sys/icon.bmp - -# Source code paths -# ----------------- - -SOURCEDIRS := source -INCLUDEDIRS := -GFXDIRS := -BINDIRS := -AUDIODIRS := -NITROFSDIR := nitrofiles - -# DLDI and internal SD slot of DSi -# -------------------------------- - -# Root folder of the SD image -SDROOT := sdroot -# Name of the generated image it "DSi-1.sd" for no$gba in DSi mode -SDIMAGE := image.bin - -# Libraries -# --------- - -LIBS += -lnflib -ldswifi9 -lnds9 -lc -LIBDIRS += $(BLOCKSDSEXT)/nflib \ - $(BLOCKSDS)/libs/dswifi \ - $(BLOCKSDS)/libs/libnds - -# Build artifacts -# --------------- - -BUILDDIR := build/$(NAME) -ELF := build/$(NAME).elf -DUMP := build/$(NAME).dump -MAP := build/$(NAME).map -ROM := $(NAME).nds - -# If NITROFSDIR is set, the soundbank created by mmutil will be saved to NitroFS -SOUNDBANKINFODIR := $(BUILDDIR)/maxmod -ifeq ($(strip $(NITROFSDIR)),) - SOUNDBANKDIR := $(BUILDDIR)/maxmod -else - SOUNDBANKDIR := $(BUILDDIR)/maxmod_nitrofs -endif - -# Tools -# ----- - -PREFIX := $(ARM_NONE_EABI_PATH)arm-none-eabi- -CC := $(PREFIX)gcc -CXX := $(PREFIX)g++ -LD := $(PREFIX)gcc -OBJDUMP := $(PREFIX)objdump -MKDIR := mkdir -RM := rm -rf - -# Verbose flag -# ------------ - -ifeq ($(VERBOSE),1) -V := -else -V := @ -endif - -# Source files -# ------------ - -ifneq ($(BINDIRS),) - SOURCES_BIN := $(shell find -L $(BINDIRS) -name "*.bin") - INCLUDEDIRS += $(addprefix $(BUILDDIR)/,$(BINDIRS)) -endif -ifneq ($(GFXDIRS),) - SOURCES_PNG := $(shell find -L $(GFXDIRS) -name "*.png") - INCLUDEDIRS += $(addprefix $(BUILDDIR)/,$(GFXDIRS)) -endif -ifneq ($(AUDIODIRS),) - SOURCES_AUDIO := $(shell find -L $(AUDIODIRS) -regex '.*\.\(it\|mod\|s3m\|wav\|xm\)') - ifneq ($(SOURCES_AUDIO),) - INCLUDEDIRS += $(SOUNDBANKINFODIR) - endif -endif - -SOURCES_S := $(shell find -L $(SOURCEDIRS) -name "*.s") -SOURCES_C := $(shell find -L $(SOURCEDIRS) -name "*.c") -SOURCES_CPP := $(shell find -L $(SOURCEDIRS) -name "*.cpp") - -# Compiler and linker flags -# ------------------------- - -ARCH := -mthumb -mcpu=arm946e-s+nofp - -SPECS := $(BLOCKSDS)/sys/crts/ds_arm9.specs - -WARNFLAGS := -Wall - -ifeq ($(SOURCES_CPP),) - LIBS += -lc -else - LIBS += -lstdc++ -lc -endif - -INCLUDEFLAGS := $(foreach path,$(INCLUDEDIRS),-I$(path)) \ - $(foreach path,$(LIBDIRS),-I$(path)/include) - -LIBDIRSFLAGS := $(foreach path,$(LIBDIRS),-L$(path)/lib) - -ASFLAGS += -x assembler-with-cpp $(INCLUDEFLAGS) $(DEFINES) \ - $(ARCH) -ffunction-sections -fdata-sections \ - -specs=$(SPECS) - -CFLAGS += -std=gnu17 $(WARNFLAGS) $(INCLUDEFLAGS) $(DEFINES) \ - $(ARCH) -O2 -ffunction-sections -fdata-sections \ - -specs=$(SPECS) - -CXXFLAGS += -std=gnu++17 $(WARNFLAGS) $(INCLUDEFLAGS) $(DEFINES) \ - $(ARCH) -O2 -ffunction-sections -fdata-sections \ - -fno-exceptions -fno-rtti \ - -specs=$(SPECS) - -LDFLAGS := $(ARCH) $(LIBDIRSFLAGS) -Wl,-Map,$(MAP) $(DEFINES) \ - -Wl,--start-group $(LIBS) -Wl,--end-group -specs=$(SPECS) - -# Intermediate build files -# ------------------------ - -OBJS_ASSETS := $(addsuffix .o,$(addprefix $(BUILDDIR)/,$(SOURCES_BIN))) \ - $(addsuffix .o,$(addprefix $(BUILDDIR)/,$(SOURCES_PNG))) - -HEADERS_ASSETS := $(patsubst %.bin,%_bin.h,$(addprefix $(BUILDDIR)/,$(SOURCES_BIN))) \ - $(patsubst %.png,%.h,$(addprefix $(BUILDDIR)/,$(SOURCES_PNG))) - -ifneq ($(SOURCES_AUDIO),) - ifeq ($(strip $(NITROFSDIR)),) - OBJS_ASSETS += $(SOUNDBANKDIR)/soundbank.c.o - endif - HEADERS_ASSETS += $(SOUNDBANKINFODIR)/soundbank.h -endif - -OBJS_SOURCES := $(addsuffix .o,$(addprefix $(BUILDDIR)/,$(SOURCES_S))) \ - $(addsuffix .o,$(addprefix $(BUILDDIR)/,$(SOURCES_C))) \ - $(addsuffix .o,$(addprefix $(BUILDDIR)/,$(SOURCES_CPP))) - -OBJS := $(OBJS_ASSETS) $(OBJS_SOURCES) - -DEPS := $(OBJS:.o=.d) - -# Targets -# ------- - -.PHONY: all clean dump dldipatch sdimage - -all: $(ROM) - -ifneq ($(strip $(NITROFSDIR)),) -# Additional arguments for ndstool -NDSTOOL_ARGS := -d $(NITROFSDIR) - -ifneq ($(SOURCES_AUDIO),) - NDSTOOL_ARGS += -d $(SOUNDBANKDIR) -endif - -# Make the NDS ROM depend on the filesystem only if it is needed -$(ROM): $(NITROFSDIR) -endif - -# Combine the title strings -ifeq ($(strip $(GAME_SUBTITLE)),) - GAME_FULL_TITLE := $(GAME_TITLE);$(GAME_AUTHOR) -else - GAME_FULL_TITLE := $(GAME_TITLE);$(GAME_SUBTITLE);$(GAME_AUTHOR) -endif - -$(ROM): $(ELF) - @echo " NDSTOOL $@" - $(V)$(BLOCKSDS)/tools/ndstool/ndstool -c $@ \ - -7 $(BLOCKSDS)/sys/default_arm7/arm7.elf -9 $(ELF) \ - -b $(GAME_ICON) "$(GAME_FULL_TITLE)" \ - $(NDSTOOL_ARGS) - -$(ELF): $(OBJS) - @echo " LD $@" - $(V)$(LD) -o $@ $(OBJS) $(LDFLAGS) - -$(DUMP): $(ELF) - @echo " OBJDUMP $@" - $(V)$(OBJDUMP) -h -C -S $< > $@ - -dump: $(DUMP) - -clean: - @echo " CLEAN" - $(V)$(RM) $(ROM) $(DUMP) build $(SDIMAGE) - -sdimage: - @echo " MKFATIMG $(SDIMAGE) $(SDROOT)" - $(V)$(BLOCKSDS)/tools/mkfatimg/mkfatimg -t $(SDROOT) $(SDIMAGE) - -dldipatch: $(ROM) - @echo " DLDIPATCH $(ROM)" - $(V)$(BLOCKSDS)/tools/dldipatch/dldipatch patch \ - $(BLOCKSDS)/sys/dldi_r4/r4tf.dldi $(ROM) - -# Rules -# ----- - -$(BUILDDIR)/%.s.o : %.s - @echo " AS $<" - @$(MKDIR) -p $(@D) - $(V)$(CC) $(ASFLAGS) -MMD -MP -c -o $@ $< - -$(BUILDDIR)/%.c.o : %.c - @echo " CC $<" - @$(MKDIR) -p $(@D) - $(V)$(CC) $(CFLAGS) -MMD -MP -c -o $@ $< - -$(BUILDDIR)/%.arm.c.o : %.arm.c - @echo " CC $<" - @$(MKDIR) -p $(@D) - $(V)$(CC) $(CFLAGS) -MMD -MP -marm -mlong-calls -c -o $@ $< - -$(BUILDDIR)/%.cpp.o : %.cpp - @echo " CXX $<" - @$(MKDIR) -p $(@D) - $(V)$(CXX) $(CXXFLAGS) -MMD -MP -c -o $@ $< - -$(BUILDDIR)/%.arm.cpp.o : %.arm.cpp - @echo " CXX $<" - @$(MKDIR) -p $(@D) - $(V)$(CXX) $(CXXFLAGS) -MMD -MP -marm -mlong-calls -c -o $@ $< - -$(BUILDDIR)/%.bin.o $(BUILDDIR)/%_bin.h : %.bin - @echo " BIN2C $<" - @$(MKDIR) -p $(@D) - $(V)$(BLOCKSDS)/tools/bin2c/bin2c $< $(@D) - $(V)$(CC) $(CFLAGS) -MMD -MP -c -o $(BUILDDIR)/$*.bin.o $(BUILDDIR)/$*_bin.c - -$(BUILDDIR)/%.png.o $(BUILDDIR)/%.h : %.png %.grit - @echo " GRIT $<" - @$(MKDIR) -p $(@D) - $(V)$(BLOCKSDS)/tools/grit/grit $< -ftc -W1 -o$(BUILDDIR)/$* - $(V)$(CC) $(CFLAGS) -MMD -MP -c -o $(BUILDDIR)/$*.png.o $(BUILDDIR)/$*.c - $(V)touch $(BUILDDIR)/$*.png.o $(BUILDDIR)/$*.h - -ifneq ($(SOURCES_AUDIO),) - -$(SOUNDBANKINFODIR)/soundbank.h: $(SOURCES_AUDIO) - @echo " MMUTIL $^" - @$(MKDIR) -p $(SOUNDBANKDIR) - @$(MKDIR) -p $(SOUNDBANKINFODIR) - @$(BLOCKSDS)/tools/mmutil/mmutil $^ -d \ - -o$(SOUNDBANKDIR)/soundbank.bin -h$(SOUNDBANKINFODIR)/soundbank.h - -ifeq ($(strip $(NITROFSDIR)),) -$(SOUNDBANKDIR)/soundbank.c.o: $(SOUNDBANKINFODIR)/soundbank.h - @echo " BIN2C soundbank.bin" - $(V)$(BLOCKSDS)/tools/bin2c/bin2c $(SOUNDBANKDIR)/soundbank.bin \ - $(SOUNDBANKDIR) - @echo " CC.9 soundbank_bin.c" - $(V)$(CC) $(CFLAGS) -MMD -MP -c -o $(SOUNDBANKDIR)/soundbank.c.o \ - $(SOUNDBANKDIR)/soundbank_bin.c -endif - -endif - -# All assets must be built before the source code -# ----------------------------------------------- - -$(SOURCES_S) $(SOURCES_C) $(SOURCES_CPP): $(HEADERS_ASSETS) - -# Include dependency files if they exist -# -------------------------------------- - --include $(DEPS)