mirror of
https://github.com/AntonioND/nitro-engine.git
synced 2025-06-19 00:55:38 -04:00
Compare commits
44 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8932de1fff | ||
![]() |
86955bc0a0 | ||
![]() |
6e1dca996c | ||
![]() |
02f3cd7012 | ||
![]() |
926bb4f361 | ||
![]() |
f6b0200be3 | ||
![]() |
d42cb2c08e | ||
![]() |
d52a92812e | ||
![]() |
cb2e62f953 | ||
![]() |
5a10679dfb | ||
![]() |
b67c60d5f0 | ||
![]() |
fff1a65647 | ||
![]() |
efbf4b6546 | ||
![]() |
dd20800334 | ||
![]() |
39117696aa | ||
![]() |
459d8f8960 | ||
![]() |
e5ae245674 | ||
![]() |
8a18dfa586 | ||
![]() |
de9ca58286 | ||
![]() |
446e27110e | ||
![]() |
09c3712431 | ||
![]() |
a6738a9ab5 | ||
![]() |
afdd56eda4 | ||
![]() |
fe6e4a0dcc | ||
![]() |
4642bdf982 | ||
![]() |
26823c024f | ||
![]() |
5a4824f461 | ||
![]() |
de16a59722 | ||
![]() |
4115a62800 | ||
![]() |
88d1b489f6 | ||
![]() |
7d13c2d637 | ||
![]() |
5dda97fe52 | ||
![]() |
c2af70fe15 | ||
![]() |
dce5e99f0f | ||
![]() |
1c752174e9 | ||
![]() |
935f7eb084 | ||
![]() |
0f92fc9da7 | ||
![]() |
3f4bfbdb25 | ||
![]() |
b52b704000 | ||
![]() |
902314a2ac | ||
![]() |
3ba35ba48e | ||
![]() |
381e4071ac | ||
![]() |
ccb3739f98 | ||
![]() |
230a65541e |
79
.github/workflows/build.yml
vendored
Normal file
79
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
#
|
||||||
|
# SPDX-FileContributor: Antonio Niño Díaz, 2025
|
||||||
|
|
||||||
|
name: Documentation
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
paths-ignore:
|
||||||
|
- '**.rst'
|
||||||
|
- 'examples'
|
||||||
|
- 'licenses'
|
||||||
|
- 'Makefile*'
|
||||||
|
- 'source*'
|
||||||
|
- 'tests'
|
||||||
|
- 'tools'
|
||||||
|
workflow_dispatch:
|
||||||
|
repository_dispatch:
|
||||||
|
types: [run_build]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
generate_website:
|
||||||
|
name: Generate website
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: true
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone project
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: 'master'
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get install doxygen
|
||||||
|
|
||||||
|
- name: Build documentation
|
||||||
|
run: |
|
||||||
|
cd documentation
|
||||||
|
bash generate.sh
|
||||||
|
|
||||||
|
# Create tarball with everything to upload to GitHub pages
|
||||||
|
cd html
|
||||||
|
tar -cvf ../../repo.tar ./*
|
||||||
|
|
||||||
|
- name: Upload repo artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: github-pages
|
||||||
|
path: repo.tar
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
publish_repo:
|
||||||
|
name: Publish website with GitHub pages
|
||||||
|
if: contains(github.ref,'refs/heads/master')
|
||||||
|
needs: [generate_website]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
environment:
|
||||||
|
name: github-pages
|
||||||
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Setup Pages
|
||||||
|
uses: actions/configure-pages@v5
|
||||||
|
|
||||||
|
- name: Deploy to GitHub Pages
|
||||||
|
id: deployment
|
||||||
|
uses: actions/deploy-pages@v4
|
146
Makefile
146
Makefile
@ -1,139 +1,23 @@
|
|||||||
#---------------------------------------------------------------------------------
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
.SUFFIXES:
|
#
|
||||||
#---------------------------------------------------------------------------------
|
# SPDX-FileContributor: Antonio Niño Díaz, 2024
|
||||||
|
|
||||||
ifeq ($(strip $(DEVKITARM)),)
|
# Tools
|
||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
# -----
|
||||||
endif
|
|
||||||
|
|
||||||
include $(DEVKITARM)/ds_rules
|
MAKE := make
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
# Targets
|
||||||
# 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
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
SOURCES := source source/dsma source/libdsf
|
|
||||||
DATA := data
|
|
||||||
INCLUDES := include source/libdsf
|
|
||||||
|
|
||||||
ifeq ($(NE_DEBUG),1)
|
.PHONY: all install clean
|
||||||
TARGET := NE_debug
|
|
||||||
BUILD := build_debug
|
|
||||||
else
|
|
||||||
TARGET := NE
|
|
||||||
BUILD := build_release
|
|
||||||
endif
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
all:
|
||||||
# options for code generation
|
$(MAKE) -f Makefile.blocksds
|
||||||
#---------------------------------------------------------------------------------
|
$(MAKE) -f Makefile.blocksds NE_DEBUG=1
|
||||||
ARCH := -mthumb -mthumb-interwork
|
|
||||||
|
|
||||||
CFLAGS := -g -Wall -O2\
|
install: all
|
||||||
-march=armv5te -mtune=arm946e-s \
|
$(MAKE) -f Makefile.blocksds install
|
||||||
-fomit-frame-pointer -ffast-math \
|
|
||||||
$(ARCH) -Wno-address-of-packed-member
|
|
||||||
|
|
||||||
ifeq ($(NE_DEBUG),1)
|
|
||||||
CFLAGS += -DNE_DEBUG
|
|
||||||
endif
|
|
||||||
|
|
||||||
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)
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# any extra libraries we wish to link with the project
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
LIBS :=
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
clean:
|
clean:
|
||||||
@echo clean ...
|
$(MAKE) -f Makefile.blocksds clean
|
||||||
@rm -fr build_debug build_release lib
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
else
|
|
||||||
|
|
||||||
DEPENDS := $(OFILES:.o=.d)
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# main targets
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
$(OUTPUT) : $(OFILES)
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
%.bin.o : %.bin
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
@echo $(notdir $<)
|
|
||||||
@$(bin2o)
|
|
||||||
|
|
||||||
|
|
||||||
-include $(DEPENDS)
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------------
|
|
||||||
endif
|
|
||||||
#---------------------------------------------------------------------------------------
|
|
||||||
|
@ -49,7 +49,7 @@ ARCHIVE := lib/lib$(NAME).a
|
|||||||
PREFIX := $(ARM_NONE_EABI_PATH)arm-none-eabi-
|
PREFIX := $(ARM_NONE_EABI_PATH)arm-none-eabi-
|
||||||
CC := $(PREFIX)gcc
|
CC := $(PREFIX)gcc
|
||||||
CXX := $(PREFIX)g++
|
CXX := $(PREFIX)g++
|
||||||
AR := ar
|
AR := $(PREFIX)ar
|
||||||
MKDIR := mkdir
|
MKDIR := mkdir
|
||||||
RM := rm -rf
|
RM := rm -rf
|
||||||
CP := cp
|
CP := cp
|
||||||
@ -92,16 +92,16 @@ WARNFLAGS := -Wall -Wno-address-of-packed-member
|
|||||||
INCLUDEFLAGS := $(foreach path,$(INCLUDEDIRS),-I$(path)) \
|
INCLUDEFLAGS := $(foreach path,$(INCLUDEDIRS),-I$(path)) \
|
||||||
$(foreach path,$(LIBDIRS),-I$(path)/include)
|
$(foreach path,$(LIBDIRS),-I$(path)/include)
|
||||||
|
|
||||||
ASFLAGS += -x assembler-with-cpp $(DEFINES) $(ARCH) \
|
ASFLAGS += -g -x assembler-with-cpp $(DEFINES) $(ARCH) \
|
||||||
-mthumb -mthumb-interwork $(INCLUDEFLAGS) \
|
-mthumb -mthumb-interwork $(INCLUDEFLAGS) \
|
||||||
-ffunction-sections -fdata-sections
|
-ffunction-sections -fdata-sections
|
||||||
|
|
||||||
CFLAGS += -std=gnu11 $(WARNFLAGS) $(DEFINES) $(ARCH) \
|
CFLAGS += -g -std=gnu11 $(WARNFLAGS) $(DEFINES) $(ARCH) \
|
||||||
-mthumb -mthumb-interwork $(INCLUDEFLAGS) -O2 \
|
-mthumb -mthumb-interwork $(INCLUDEFLAGS) -O2 \
|
||||||
-ffunction-sections -fdata-sections \
|
-ffunction-sections -fdata-sections \
|
||||||
-fomit-frame-pointer
|
-fomit-frame-pointer
|
||||||
|
|
||||||
CXXFLAGS += -std=gnu++14 $(WARNFLAGS) $(DEFINES) $(ARCH) \
|
CXXFLAGS += -g -std=gnu++14 $(WARNFLAGS) $(DEFINES) $(ARCH) \
|
||||||
-mthumb -mthumb-interwork $(INCLUDEFLAGS) -O2 \
|
-mthumb -mthumb-interwork $(INCLUDEFLAGS) -O2 \
|
||||||
-ffunction-sections -fdata-sections \
|
-ffunction-sections -fdata-sections \
|
||||||
-fno-exceptions -fno-rtti \
|
-fno-exceptions -fno-rtti \
|
||||||
@ -147,6 +147,7 @@ install: all
|
|||||||
$(V)$(CP) -r tools/img2ds/*.py $(BLOCKSDSEXT)/$(INSTALLNAME)/tools/img2ds
|
$(V)$(CP) -r tools/img2ds/*.py $(BLOCKSDSEXT)/$(INSTALLNAME)/tools/img2ds
|
||||||
$(V)$(CP) -r tools/md5_to_dsma/*.py $(BLOCKSDSEXT)/$(INSTALLNAME)/tools/md5_to_dsma
|
$(V)$(CP) -r tools/md5_to_dsma/*.py $(BLOCKSDSEXT)/$(INSTALLNAME)/tools/md5_to_dsma
|
||||||
$(V)$(CP) -r tools/obj2dl/*.py $(BLOCKSDSEXT)/$(INSTALLNAME)/tools/obj2dl
|
$(V)$(CP) -r tools/obj2dl/*.py $(BLOCKSDSEXT)/$(INSTALLNAME)/tools/obj2dl
|
||||||
|
$(V)$(CP) -r licenses $(BLOCKSDSEXT)/$(INSTALLNAME)/
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@echo " CLEAN"
|
@echo " CLEAN"
|
||||||
|
@ -1,6 +1,55 @@
|
|||||||
Changelog
|
Changelog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
Version 0.15.3 (2025-03-26)
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
- 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 Nitro Engine will probably need changes to work with current devkitARM.
|
||||||
|
- The GRF files used in an example have been updated, they were built before the
|
||||||
|
format was changed.
|
||||||
|
- The build scripts for assets have been modified to use the value of the
|
||||||
|
environment variables ``BLOCKSDS`` and ``BLOCKSDSEXT`` if they are found.
|
||||||
|
- Build library with debug symbols to help debug applications that use it.
|
||||||
|
|
||||||
|
Version 0.15.2 (2025-01-15)
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
- Fix `ar` binary used to build the library.
|
||||||
|
- Update documentation.
|
||||||
|
- Fix build of examples in devkitARM.
|
||||||
|
- Improve setup instructions.
|
||||||
|
|
||||||
|
Version 0.15.1 (2024-12-23)
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
- Install licenses with the rest of the library.
|
||||||
|
- Clarify some comments in examples.
|
||||||
|
|
||||||
|
Version 0.15.0 (2024-12-01)
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
- Allow users to specify the transformation matrix of a model manually.
|
||||||
|
- Fix a devkitARM Makefile in an example.
|
||||||
|
|
||||||
|
Version 0.14.0 (2024-09-10)
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
- Use ``stdint.h`` types instead of libnds types.
|
||||||
|
- Update BlocksDS makefiles.
|
||||||
|
- Update libdsf to v0.1.3.
|
||||||
|
- Fix some memory leaks/use-after-free bugs in the RichText module.
|
||||||
|
|
||||||
|
Version 0.13.0 (2024-06-08)
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
- Define BlocksDS as the main toolchain to use with Nitro Engine.
|
||||||
|
- Simplify build and installation instructions of the library.
|
||||||
|
- Update ``md5_2_dsma`` to correctly export the base animation of models.
|
||||||
|
- Stop using ``NE_RGB5`` in the examples, this format is discouraged.
|
||||||
|
- Optimize copy of ``NE_RGB5`` textures to VRAM.
|
||||||
|
|
||||||
Version 0.12.0 (2024-03-30)
|
Version 0.12.0 (2024-03-30)
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Doxyfile 1.9.4
|
# Doxyfile 1.9.8
|
||||||
|
|
||||||
# This file describes the settings to be used by the documentation system
|
# This file describes the settings to be used by the documentation system
|
||||||
# doxygen (www.doxygen.org) for a project.
|
# doxygen (www.doxygen.org) for a project.
|
||||||
@ -19,7 +19,8 @@
|
|||||||
# configuration file:
|
# configuration file:
|
||||||
# doxygen -x [configFile]
|
# doxygen -x [configFile]
|
||||||
# Use doxygen to compare the used configuration file with the template
|
# Use doxygen to compare the used configuration file with the template
|
||||||
# configuration file without replacing the environment variables:
|
# configuration file without replacing the environment variables or CMake type
|
||||||
|
# replacement variables:
|
||||||
# doxygen -x_noenv [configFile]
|
# doxygen -x_noenv [configFile]
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
@ -47,7 +48,7 @@ PROJECT_NAME = "Nitro Engine"
|
|||||||
# could be handy for archiving the generated documentation or if some version
|
# could be handy for archiving the generated documentation or if some version
|
||||||
# control system is used.
|
# control system is used.
|
||||||
|
|
||||||
PROJECT_NUMBER = 0.11.0
|
PROJECT_NUMBER = 0.15.3
|
||||||
|
|
||||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||||
# for a project that appears at the top of each page and should give viewer a
|
# for a project that appears at the top of each page and should give viewer a
|
||||||
@ -85,7 +86,7 @@ CREATE_SUBDIRS = NO
|
|||||||
# level increment doubles the number of directories, resulting in 4096
|
# level increment doubles the number of directories, resulting in 4096
|
||||||
# directories at level 8 which is the default and also the maximum value. The
|
# directories at level 8 which is the default and also the maximum value. The
|
||||||
# sub-directories are organized in 2 levels, the first level always has a fixed
|
# sub-directories are organized in 2 levels, the first level always has a fixed
|
||||||
# numer of 16 directories.
|
# number of 16 directories.
|
||||||
# Minimum value: 0, maximum value: 8, default value: 8.
|
# Minimum value: 0, maximum value: 8, default value: 8.
|
||||||
# This tag requires that the tag CREATE_SUBDIRS is set to YES.
|
# This tag requires that the tag CREATE_SUBDIRS is set to YES.
|
||||||
|
|
||||||
@ -362,6 +363,17 @@ MARKDOWN_SUPPORT = YES
|
|||||||
|
|
||||||
TOC_INCLUDE_HEADINGS = 0
|
TOC_INCLUDE_HEADINGS = 0
|
||||||
|
|
||||||
|
# The MARKDOWN_ID_STYLE tag can be used to specify the algorithm used to
|
||||||
|
# generate identifiers for the Markdown headings. Note: Every identifier is
|
||||||
|
# unique.
|
||||||
|
# Possible values are: DOXYGEN use a fixed 'autotoc_md' string followed by a
|
||||||
|
# sequence number starting at 0 and GITHUB use the lower case version of title
|
||||||
|
# with any whitespace replaced by '-' and punctuation characters removed.
|
||||||
|
# The default value is: DOXYGEN.
|
||||||
|
# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
|
||||||
|
|
||||||
|
MARKDOWN_ID_STYLE = DOXYGEN
|
||||||
|
|
||||||
# When enabled doxygen tries to link words that correspond to documented
|
# When enabled doxygen tries to link words that correspond to documented
|
||||||
# classes, or namespaces to their corresponding documentation. Such a link can
|
# classes, or namespaces to their corresponding documentation. Such a link can
|
||||||
# be prevented in individual cases by putting a % sign in front of the word or
|
# be prevented in individual cases by putting a % sign in front of the word or
|
||||||
@ -486,6 +498,14 @@ LOOKUP_CACHE_SIZE = 0
|
|||||||
|
|
||||||
NUM_PROC_THREADS = 1
|
NUM_PROC_THREADS = 1
|
||||||
|
|
||||||
|
# If the TIMESTAMP tag is set different from NO then each generated page will
|
||||||
|
# contain the date or date and time when the page was generated. Setting this to
|
||||||
|
# NO can help when comparing the output of multiple runs.
|
||||||
|
# Possible values are: YES, NO, DATETIME and DATE.
|
||||||
|
# The default value is: NO.
|
||||||
|
|
||||||
|
TIMESTAMP = NO
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Build related configuration options
|
# Build related configuration options
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
@ -567,7 +587,8 @@ HIDE_UNDOC_MEMBERS = YES
|
|||||||
# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
|
# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
|
||||||
# undocumented classes that are normally visible in the class hierarchy. If set
|
# undocumented classes that are normally visible in the class hierarchy. If set
|
||||||
# to NO, these classes will be included in the various overviews. This option
|
# to NO, these classes will be included in the various overviews. This option
|
||||||
# has no effect if EXTRACT_ALL is enabled.
|
# will also hide undocumented C++ concepts if enabled. This option has no effect
|
||||||
|
# if EXTRACT_ALL is enabled.
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
|
|
||||||
HIDE_UNDOC_CLASSES = YES
|
HIDE_UNDOC_CLASSES = YES
|
||||||
@ -605,7 +626,8 @@ INTERNAL_DOCS = NO
|
|||||||
# Windows (including Cygwin) and MacOS, users should typically set this option
|
# Windows (including Cygwin) and MacOS, users should typically set this option
|
||||||
# to NO, whereas on Linux or other Unix flavors it should typically be set to
|
# to NO, whereas on Linux or other Unix flavors it should typically be set to
|
||||||
# YES.
|
# YES.
|
||||||
# The default value is: system dependent.
|
# Possible values are: SYSTEM, NO and YES.
|
||||||
|
# The default value is: SYSTEM.
|
||||||
|
|
||||||
CASE_SENSE_NAMES = YES
|
CASE_SENSE_NAMES = YES
|
||||||
|
|
||||||
@ -857,11 +879,26 @@ WARN_IF_INCOMPLETE_DOC = YES
|
|||||||
|
|
||||||
WARN_NO_PARAMDOC = YES
|
WARN_NO_PARAMDOC = YES
|
||||||
|
|
||||||
|
# If WARN_IF_UNDOC_ENUM_VAL option is set to YES, doxygen will warn about
|
||||||
|
# undocumented enumeration values. If set to NO, doxygen will accept
|
||||||
|
# undocumented enumeration values. If EXTRACT_ALL is set to YES then this flag
|
||||||
|
# will automatically be disabled.
|
||||||
|
# The default value is: NO.
|
||||||
|
|
||||||
|
WARN_IF_UNDOC_ENUM_VAL = NO
|
||||||
|
|
||||||
# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
|
# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
|
||||||
# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS
|
# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS
|
||||||
# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but
|
# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but
|
||||||
# at the end of the doxygen process doxygen will return with a non-zero status.
|
# at the end of the doxygen process doxygen will return with a non-zero status.
|
||||||
# Possible values are: NO, YES and FAIL_ON_WARNINGS.
|
# If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS_PRINT then doxygen behaves
|
||||||
|
# like FAIL_ON_WARNINGS but in case no WARN_LOGFILE is defined doxygen will not
|
||||||
|
# write the warning messages in between other messages but write them at the end
|
||||||
|
# of a run, in case a WARN_LOGFILE is defined the warning messages will be
|
||||||
|
# besides being in the defined file also be shown at the end of a run, unless
|
||||||
|
# the WARN_LOGFILE is defined as - i.e. standard output (stdout) in that case
|
||||||
|
# the behavior will remain as with the setting FAIL_ON_WARNINGS.
|
||||||
|
# Possible values are: NO, YES, FAIL_ON_WARNINGS and FAIL_ON_WARNINGS_PRINT.
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
|
|
||||||
WARN_AS_ERROR = NO
|
WARN_AS_ERROR = NO
|
||||||
@ -914,10 +951,21 @@ INPUT = ../source \
|
|||||||
# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
|
# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
|
||||||
# documentation (see:
|
# documentation (see:
|
||||||
# https://www.gnu.org/software/libiconv/) for the list of possible encodings.
|
# https://www.gnu.org/software/libiconv/) for the list of possible encodings.
|
||||||
|
# See also: INPUT_FILE_ENCODING
|
||||||
# The default value is: UTF-8.
|
# The default value is: UTF-8.
|
||||||
|
|
||||||
INPUT_ENCODING = UTF-8
|
INPUT_ENCODING = UTF-8
|
||||||
|
|
||||||
|
# This tag can be used to specify the character encoding of the source files
|
||||||
|
# that doxygen parses The INPUT_FILE_ENCODING tag can be used to specify
|
||||||
|
# character encoding on a per file pattern basis. Doxygen will compare the file
|
||||||
|
# name with each pattern and apply the encoding instead of the default
|
||||||
|
# INPUT_ENCODING) if there is a match. The character encodings are a list of the
|
||||||
|
# form: pattern=encoding (like *.php=ISO-8859-1). See cfg_input_encoding
|
||||||
|
# "INPUT_ENCODING" for further information on supported encodings.
|
||||||
|
|
||||||
|
INPUT_FILE_ENCODING =
|
||||||
|
|
||||||
# If the value of the INPUT tag contains directories, you can use the
|
# If the value of the INPUT tag contains directories, you can use the
|
||||||
# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
|
# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
|
||||||
# *.h) to filter out the source-files in the directories.
|
# *.h) to filter out the source-files in the directories.
|
||||||
@ -929,12 +977,12 @@ INPUT_ENCODING = UTF-8
|
|||||||
# Note the list of default checked file patterns might differ from the list of
|
# Note the list of default checked file patterns might differ from the list of
|
||||||
# default file extension mappings.
|
# default file extension mappings.
|
||||||
#
|
#
|
||||||
# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
|
# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cxxm,
|
||||||
# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
|
# *.cpp, *.cppm, *.c++, *.c++m, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl,
|
||||||
# *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml,
|
# *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, *.h++, *.ixx, *.l, *.cs, *.d, *.php,
|
||||||
# *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C
|
# *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be
|
||||||
# comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd,
|
# provided as doxygen C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
|
||||||
# *.vhdl, *.ucf, *.qsf and *.ice.
|
# *.f18, *.f, *.for, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice.
|
||||||
|
|
||||||
FILE_PATTERNS = *.c \
|
FILE_PATTERNS = *.c \
|
||||||
*.h
|
*.h
|
||||||
@ -975,9 +1023,6 @@ EXCLUDE_PATTERNS =
|
|||||||
# output. The symbol name can be a fully qualified name, a word, or if the
|
# output. The symbol name can be a fully qualified name, a word, or if the
|
||||||
# wildcard * is used, a substring. Examples: ANamespace, AClass,
|
# wildcard * is used, a substring. Examples: ANamespace, AClass,
|
||||||
# ANamespace::AClass, ANamespace::*Test
|
# ANamespace::AClass, ANamespace::*Test
|
||||||
#
|
|
||||||
# Note that the wildcards are matched against the file with absolute path, so to
|
|
||||||
# exclude all test directories use the pattern */test/*
|
|
||||||
|
|
||||||
EXCLUDE_SYMBOLS =
|
EXCLUDE_SYMBOLS =
|
||||||
|
|
||||||
@ -1022,6 +1067,11 @@ IMAGE_PATH =
|
|||||||
# code is scanned, but not when the output code is generated. If lines are added
|
# code is scanned, but not when the output code is generated. If lines are added
|
||||||
# or removed, the anchors will not be placed correctly.
|
# or removed, the anchors will not be placed correctly.
|
||||||
#
|
#
|
||||||
|
# Note that doxygen will use the data processed and written to standard output
|
||||||
|
# for further processing, therefore nothing else, like debug statements or used
|
||||||
|
# commands (so in case of a Windows batch file always use @echo OFF), should be
|
||||||
|
# written to standard output.
|
||||||
|
#
|
||||||
# Note that for custom extensions or not directly supported extensions you also
|
# Note that for custom extensions or not directly supported extensions you also
|
||||||
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
|
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
|
||||||
# properly processed by doxygen.
|
# properly processed by doxygen.
|
||||||
@ -1063,6 +1113,15 @@ FILTER_SOURCE_PATTERNS =
|
|||||||
|
|
||||||
USE_MDFILE_AS_MAINPAGE =
|
USE_MDFILE_AS_MAINPAGE =
|
||||||
|
|
||||||
|
# The Fortran standard specifies that for fixed formatted Fortran code all
|
||||||
|
# characters from position 72 are to be considered as comment. A common
|
||||||
|
# extension is to allow longer lines before the automatic comment starts. The
|
||||||
|
# setting FORTRAN_COMMENT_AFTER will also make it possible that longer lines can
|
||||||
|
# be processed before the automatic comment starts.
|
||||||
|
# Minimum value: 7, maximum value: 10000, default value: 72.
|
||||||
|
|
||||||
|
FORTRAN_COMMENT_AFTER = 72
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Configuration options related to source browsing
|
# Configuration options related to source browsing
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
@ -1200,10 +1259,11 @@ CLANG_DATABASE_PATH =
|
|||||||
|
|
||||||
ALPHABETICAL_INDEX = YES
|
ALPHABETICAL_INDEX = YES
|
||||||
|
|
||||||
# In case all classes in a project start with a common prefix, all classes will
|
# The IGNORE_PREFIX tag can be used to specify a prefix (or a list of prefixes)
|
||||||
# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
|
# that should be ignored while generating the index headers. The IGNORE_PREFIX
|
||||||
# can be used to specify a prefix (or a list of prefixes) that should be ignored
|
# tag works for classes, function and member names. The entity will be placed in
|
||||||
# while generating the index headers.
|
# the alphabetical list under the first letter of the entity name that remains
|
||||||
|
# after removing the prefix.
|
||||||
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
|
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
|
||||||
|
|
||||||
IGNORE_PREFIX =
|
IGNORE_PREFIX =
|
||||||
@ -1282,7 +1342,12 @@ HTML_STYLESHEET =
|
|||||||
# Doxygen will copy the style sheet files to the output directory.
|
# Doxygen will copy the style sheet files to the output directory.
|
||||||
# Note: The order of the extra style sheet files is of importance (e.g. the last
|
# Note: The order of the extra style sheet files is of importance (e.g. the last
|
||||||
# style sheet in the list overrules the setting of the previous ones in the
|
# style sheet in the list overrules the setting of the previous ones in the
|
||||||
# list). For an example see the documentation.
|
# list).
|
||||||
|
# Note: Since the styling of scrollbars can currently not be overruled in
|
||||||
|
# Webkit/Chromium, the styling will be left out of the default doxygen.css if
|
||||||
|
# one or more extra stylesheets have been specified. So if scrollbar
|
||||||
|
# customization is desired it has to be added explicitly. For an example see the
|
||||||
|
# documentation.
|
||||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||||
|
|
||||||
HTML_EXTRA_STYLESHEET =
|
HTML_EXTRA_STYLESHEET =
|
||||||
@ -1297,6 +1362,19 @@ HTML_EXTRA_STYLESHEET =
|
|||||||
|
|
||||||
HTML_EXTRA_FILES =
|
HTML_EXTRA_FILES =
|
||||||
|
|
||||||
|
# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output
|
||||||
|
# should be rendered with a dark or light theme.
|
||||||
|
# Possible values are: LIGHT always generate light mode output, DARK always
|
||||||
|
# generate dark mode output, AUTO_LIGHT automatically set the mode according to
|
||||||
|
# the user preference, use light mode if no preference is set (the default),
|
||||||
|
# AUTO_DARK automatically set the mode according to the user preference, use
|
||||||
|
# dark mode if no preference is set and TOGGLE allow to user to switch between
|
||||||
|
# light and dark mode via a button.
|
||||||
|
# The default value is: AUTO_LIGHT.
|
||||||
|
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||||
|
|
||||||
|
HTML_COLORSTYLE = AUTO_LIGHT
|
||||||
|
|
||||||
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
|
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
|
||||||
# will adjust the colors in the style sheet and background images according to
|
# will adjust the colors in the style sheet and background images according to
|
||||||
# this color. Hue is specified as an angle on a color-wheel, see
|
# this color. Hue is specified as an angle on a color-wheel, see
|
||||||
@ -1327,15 +1405,6 @@ HTML_COLORSTYLE_SAT = 100
|
|||||||
|
|
||||||
HTML_COLORSTYLE_GAMMA = 80
|
HTML_COLORSTYLE_GAMMA = 80
|
||||||
|
|
||||||
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
|
|
||||||
# page will contain the date and time when the page was generated. Setting this
|
|
||||||
# to YES can help to show when doxygen was last run and thus if the
|
|
||||||
# documentation is up to date.
|
|
||||||
# The default value is: NO.
|
|
||||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
|
||||||
|
|
||||||
HTML_TIMESTAMP = NO
|
|
||||||
|
|
||||||
# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
|
# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
|
||||||
# documentation will contain a main index with vertical navigation menus that
|
# documentation will contain a main index with vertical navigation menus that
|
||||||
# are dynamically created via JavaScript. If disabled, the navigation index will
|
# are dynamically created via JavaScript. If disabled, the navigation index will
|
||||||
@ -1355,6 +1424,13 @@ HTML_DYNAMIC_MENUS = YES
|
|||||||
|
|
||||||
HTML_DYNAMIC_SECTIONS = NO
|
HTML_DYNAMIC_SECTIONS = NO
|
||||||
|
|
||||||
|
# If the HTML_CODE_FOLDING tag is set to YES then classes and functions can be
|
||||||
|
# dynamically folded and expanded in the generated HTML source code.
|
||||||
|
# The default value is: YES.
|
||||||
|
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||||
|
|
||||||
|
HTML_CODE_FOLDING = YES
|
||||||
|
|
||||||
# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
|
# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
|
||||||
# shown in the various tree structured indices initially; the user can expand
|
# shown in the various tree structured indices initially; the user can expand
|
||||||
# and collapse entries dynamically later on. Doxygen will expand the tree to
|
# and collapse entries dynamically later on. Doxygen will expand the tree to
|
||||||
@ -1485,6 +1561,16 @@ BINARY_TOC = NO
|
|||||||
|
|
||||||
TOC_EXPAND = NO
|
TOC_EXPAND = NO
|
||||||
|
|
||||||
|
# The SITEMAP_URL tag is used to specify the full URL of the place where the
|
||||||
|
# generated documentation will be placed on the server by the user during the
|
||||||
|
# deployment of the documentation. The generated sitemap is called sitemap.xml
|
||||||
|
# and placed on the directory specified by HTML_OUTPUT. In case no SITEMAP_URL
|
||||||
|
# is specified no sitemap is generated. For information about the sitemap
|
||||||
|
# protocol see https://www.sitemaps.org
|
||||||
|
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||||
|
|
||||||
|
SITEMAP_URL =
|
||||||
|
|
||||||
# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
|
# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
|
||||||
# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
|
# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
|
||||||
# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
|
# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
|
||||||
@ -1660,17 +1746,6 @@ HTML_FORMULA_FORMAT = png
|
|||||||
|
|
||||||
FORMULA_FONTSIZE = 10
|
FORMULA_FONTSIZE = 10
|
||||||
|
|
||||||
# Use the FORMULA_TRANSPARENT tag to determine whether or not the images
|
|
||||||
# generated for formulas are transparent PNGs. Transparent PNGs are not
|
|
||||||
# supported properly for IE 6.0, but are supported on all modern browsers.
|
|
||||||
#
|
|
||||||
# Note that when changing this option you need to delete any form_*.png files in
|
|
||||||
# the HTML output directory before the changes have effect.
|
|
||||||
# The default value is: YES.
|
|
||||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
|
||||||
|
|
||||||
FORMULA_TRANSPARENT = YES
|
|
||||||
|
|
||||||
# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands
|
# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands
|
||||||
# to create new LaTeX commands to be used in formulas as building blocks. See
|
# to create new LaTeX commands to be used in formulas as building blocks. See
|
||||||
# the section "Including formulas" for details.
|
# the section "Including formulas" for details.
|
||||||
@ -1984,9 +2059,16 @@ PDF_HYPERLINKS = YES
|
|||||||
|
|
||||||
USE_PDFLATEX = YES
|
USE_PDFLATEX = YES
|
||||||
|
|
||||||
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
|
# The LATEX_BATCHMODE tag signals the behavior of LaTeX in case of an error.
|
||||||
# command to the generated LaTeX files. This will instruct LaTeX to keep running
|
# Possible values are: NO same as ERROR_STOP, YES same as BATCH, BATCH In batch
|
||||||
# if errors occur, instead of asking the user for help.
|
# mode nothing is printed on the terminal, errors are scrolled as if <return> is
|
||||||
|
# hit at every error; missing files that TeX tries to input or request from
|
||||||
|
# keyboard input (\read on a not open input stream) cause the job to abort,
|
||||||
|
# NON_STOP In nonstop mode the diagnostic message will appear on the terminal,
|
||||||
|
# but there is no possibility of user interaction just like in batch mode,
|
||||||
|
# SCROLL In scroll mode, TeX will stop only for missing files to input or if
|
||||||
|
# keyboard input is necessary and ERROR_STOP In errorstop mode, TeX will stop at
|
||||||
|
# each error, asking for user intervention.
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
||||||
|
|
||||||
@ -2007,14 +2089,6 @@ LATEX_HIDE_INDICES = NO
|
|||||||
|
|
||||||
LATEX_BIB_STYLE = plain
|
LATEX_BIB_STYLE = plain
|
||||||
|
|
||||||
# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
|
|
||||||
# page will contain the date and time when the page was generated. Setting this
|
|
||||||
# to NO can help when comparing the output of multiple runs.
|
|
||||||
# The default value is: NO.
|
|
||||||
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
|
||||||
|
|
||||||
LATEX_TIMESTAMP = NO
|
|
||||||
|
|
||||||
# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute)
|
# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute)
|
||||||
# path from which the emoji images will be read. If a relative path is entered,
|
# path from which the emoji images will be read. If a relative path is entered,
|
||||||
# it will be relative to the LATEX_OUTPUT directory. If left blank the
|
# it will be relative to the LATEX_OUTPUT directory. If left blank the
|
||||||
@ -2180,13 +2254,39 @@ DOCBOOK_OUTPUT = docbook
|
|||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
|
# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
|
||||||
# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures
|
# AutoGen Definitions (see https://autogen.sourceforge.net/) file that captures
|
||||||
# the structure of the code including all documentation. Note that this feature
|
# the structure of the code including all documentation. Note that this feature
|
||||||
# is still experimental and incomplete at the moment.
|
# is still experimental and incomplete at the moment.
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
|
|
||||||
GENERATE_AUTOGEN_DEF = NO
|
GENERATE_AUTOGEN_DEF = NO
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration options related to Sqlite3 output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# If the GENERATE_SQLITE3 tag is set to YES doxygen will generate a Sqlite3
|
||||||
|
# database with symbols found by doxygen stored in tables.
|
||||||
|
# The default value is: NO.
|
||||||
|
|
||||||
|
GENERATE_SQLITE3 = NO
|
||||||
|
|
||||||
|
# The SQLITE3_OUTPUT tag is used to specify where the Sqlite3 database will be
|
||||||
|
# put. If a relative path is entered the value of OUTPUT_DIRECTORY will be put
|
||||||
|
# in front of it.
|
||||||
|
# The default directory is: sqlite3.
|
||||||
|
# This tag requires that the tag GENERATE_SQLITE3 is set to YES.
|
||||||
|
|
||||||
|
SQLITE3_OUTPUT = sqlite3
|
||||||
|
|
||||||
|
# The SQLITE3_OVERWRITE_DB tag is set to YES, the existing doxygen_sqlite3.db
|
||||||
|
# database file will be recreated with each doxygen run. If set to NO, doxygen
|
||||||
|
# will warn if an a database file is already found and not modify it.
|
||||||
|
# The default value is: YES.
|
||||||
|
# This tag requires that the tag GENERATE_SQLITE3 is set to YES.
|
||||||
|
|
||||||
|
SQLITE3_RECREATE_DB = YES
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Configuration options related to the Perl module output
|
# Configuration options related to the Perl module output
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
@ -2329,15 +2429,15 @@ TAGFILES =
|
|||||||
|
|
||||||
GENERATE_TAGFILE =
|
GENERATE_TAGFILE =
|
||||||
|
|
||||||
# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
|
# If the ALLEXTERNALS tag is set to YES, all external classes and namespaces
|
||||||
# the class index. If set to NO, only the inherited external classes will be
|
# will be listed in the class and namespace index. If set to NO, only the
|
||||||
# listed.
|
# inherited external classes will be listed.
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
|
|
||||||
ALLEXTERNALS = NO
|
ALLEXTERNALS = NO
|
||||||
|
|
||||||
# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
|
# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
|
||||||
# in the modules index. If set to NO, only the current project's groups will be
|
# in the topic index. If set to NO, only the current project's groups will be
|
||||||
# listed.
|
# listed.
|
||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
|
|
||||||
@ -2351,16 +2451,9 @@ EXTERNAL_GROUPS = YES
|
|||||||
EXTERNAL_PAGES = YES
|
EXTERNAL_PAGES = YES
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Configuration options related to the dot tool
|
# Configuration options related to diagram generator tools
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
# You can include diagrams made with dia in doxygen documentation. Doxygen will
|
|
||||||
# then run dia to produce the diagram and insert it in the documentation. The
|
|
||||||
# DIA_PATH tag allows you to specify the directory where the dia binary resides.
|
|
||||||
# If left empty dia is assumed to be found in the default search path.
|
|
||||||
|
|
||||||
DIA_PATH =
|
|
||||||
|
|
||||||
# If set to YES the inheritance and collaboration graphs will hide inheritance
|
# If set to YES the inheritance and collaboration graphs will hide inheritance
|
||||||
# and usage relations if the target is undocumented or is not a class.
|
# and usage relations if the target is undocumented or is not a class.
|
||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
@ -2369,7 +2462,7 @@ HIDE_UNDOC_RELATIONS = YES
|
|||||||
|
|
||||||
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
|
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
|
||||||
# available from the path. This tool is part of Graphviz (see:
|
# available from the path. This tool is part of Graphviz (see:
|
||||||
# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
|
# https://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
|
||||||
# Bell Labs. The other options in this section have no effect if this option is
|
# Bell Labs. The other options in this section have no effect if this option is
|
||||||
# set to NO
|
# set to NO
|
||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
@ -2386,37 +2479,51 @@ HAVE_DOT = NO
|
|||||||
|
|
||||||
DOT_NUM_THREADS = 0
|
DOT_NUM_THREADS = 0
|
||||||
|
|
||||||
# When you want a differently looking font in the dot files that doxygen
|
# DOT_COMMON_ATTR is common attributes for nodes, edges and labels of
|
||||||
# generates you can specify the font name using DOT_FONTNAME. You need to make
|
# subgraphs. When you want a differently looking font in the dot files that
|
||||||
# sure dot is able to find the font, which can be done by putting it in a
|
# doxygen generates you can specify fontname, fontcolor and fontsize attributes.
|
||||||
# standard location or by setting the DOTFONTPATH environment variable or by
|
# For details please see <a href=https://graphviz.org/doc/info/attrs.html>Node,
|
||||||
# setting DOT_FONTPATH to the directory containing the font.
|
# Edge and Graph Attributes specification</a> You need to make sure dot is able
|
||||||
# The default value is: Helvetica.
|
# to find the font, which can be done by putting it in a standard location or by
|
||||||
|
# setting the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
|
||||||
|
# directory containing the font. Default graphviz fontsize is 14.
|
||||||
|
# The default value is: fontname=Helvetica,fontsize=10.
|
||||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||||
|
|
||||||
DOT_FONTNAME = FreeSans
|
DOT_COMMON_ATTR = "fontname=FreeSans,fontsize=10"
|
||||||
|
|
||||||
# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
|
# DOT_EDGE_ATTR is concatenated with DOT_COMMON_ATTR. For elegant style you can
|
||||||
# dot graphs.
|
# add 'arrowhead=open, arrowtail=open, arrowsize=0.5'. <a
|
||||||
# Minimum value: 4, maximum value: 24, default value: 10.
|
# href=https://graphviz.org/doc/info/arrows.html>Complete documentation about
|
||||||
|
# arrows shapes.</a>
|
||||||
|
# The default value is: labelfontname=Helvetica,labelfontsize=10.
|
||||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||||
|
|
||||||
DOT_FONTSIZE = 10
|
DOT_EDGE_ATTR = "labelfontname=FreeSans,labelfontsize=10"
|
||||||
|
|
||||||
# By default doxygen will tell dot to use the default font as specified with
|
# DOT_NODE_ATTR is concatenated with DOT_COMMON_ATTR. For view without boxes
|
||||||
# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
|
# around nodes set 'shape=plain' or 'shape=plaintext' <a
|
||||||
# the path where dot can find it using this tag.
|
# href=https://www.graphviz.org/doc/info/shapes.html>Shapes specification</a>
|
||||||
|
# The default value is: shape=box,height=0.2,width=0.4.
|
||||||
|
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||||
|
|
||||||
|
DOT_NODE_ATTR = "shape=box,height=0.2,width=0.4"
|
||||||
|
|
||||||
|
# You can set the path where dot can find font specified with fontname in
|
||||||
|
# DOT_COMMON_ATTR and others dot attributes.
|
||||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||||
|
|
||||||
DOT_FONTPATH =
|
DOT_FONTPATH =
|
||||||
|
|
||||||
# If the CLASS_GRAPH tag is set to YES (or GRAPH) then doxygen will generate a
|
# If the CLASS_GRAPH tag is set to YES or GRAPH or BUILTIN then doxygen will
|
||||||
# graph for each documented class showing the direct and indirect inheritance
|
# generate a graph for each documented class showing the direct and indirect
|
||||||
# relations. In case HAVE_DOT is set as well dot will be used to draw the graph,
|
# inheritance relations. In case the CLASS_GRAPH tag is set to YES or GRAPH and
|
||||||
# otherwise the built-in generator will be used. If the CLASS_GRAPH tag is set
|
# HAVE_DOT is enabled as well, then dot will be used to draw the graph. In case
|
||||||
# to TEXT the direct and indirect inheritance relations will be shown as texts /
|
# the CLASS_GRAPH tag is set to YES and HAVE_DOT is disabled or if the
|
||||||
# links.
|
# CLASS_GRAPH tag is set to BUILTIN, then the built-in generator will be used.
|
||||||
# Possible values are: NO, YES, TEXT and GRAPH.
|
# If the CLASS_GRAPH tag is set to TEXT the direct and indirect inheritance
|
||||||
|
# relations will be shown as texts / links.
|
||||||
|
# Possible values are: NO, YES, TEXT, GRAPH and BUILTIN.
|
||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
|
|
||||||
CLASS_GRAPH = TEXT
|
CLASS_GRAPH = TEXT
|
||||||
@ -2424,15 +2531,21 @@ CLASS_GRAPH = TEXT
|
|||||||
# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
|
# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
|
||||||
# graph for each documented class showing the direct and indirect implementation
|
# graph for each documented class showing the direct and indirect implementation
|
||||||
# dependencies (inheritance, containment, and class references variables) of the
|
# dependencies (inheritance, containment, and class references variables) of the
|
||||||
# class with other documented classes.
|
# class with other documented classes. Explicit enabling a collaboration graph,
|
||||||
|
# when COLLABORATION_GRAPH is set to NO, can be accomplished by means of the
|
||||||
|
# command \collaborationgraph. Disabling a collaboration graph can be
|
||||||
|
# accomplished by means of the command \hidecollaborationgraph.
|
||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||||
|
|
||||||
COLLABORATION_GRAPH = YES
|
COLLABORATION_GRAPH = YES
|
||||||
|
|
||||||
# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
|
# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
|
||||||
# groups, showing the direct groups dependencies. See also the chapter Grouping
|
# groups, showing the direct groups dependencies. Explicit enabling a group
|
||||||
# in the manual.
|
# dependency graph, when GROUP_GRAPHS is set to NO, can be accomplished by means
|
||||||
|
# of the command \groupgraph. Disabling a directory graph can be accomplished by
|
||||||
|
# means of the command \hidegroupgraph. See also the chapter Grouping in the
|
||||||
|
# manual.
|
||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||||
|
|
||||||
@ -2492,7 +2605,9 @@ TEMPLATE_RELATIONS = NO
|
|||||||
# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
|
# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
|
||||||
# YES then doxygen will generate a graph for each documented file showing the
|
# YES then doxygen will generate a graph for each documented file showing the
|
||||||
# direct and indirect include dependencies of the file with other documented
|
# direct and indirect include dependencies of the file with other documented
|
||||||
# files.
|
# files. Explicit enabling an include graph, when INCLUDE_GRAPH is is set to NO,
|
||||||
|
# can be accomplished by means of the command \includegraph. Disabling an
|
||||||
|
# include graph can be accomplished by means of the command \hideincludegraph.
|
||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||||
|
|
||||||
@ -2501,7 +2616,10 @@ INCLUDE_GRAPH = YES
|
|||||||
# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
|
# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
|
||||||
# set to YES then doxygen will generate a graph for each documented file showing
|
# set to YES then doxygen will generate a graph for each documented file showing
|
||||||
# the direct and indirect include dependencies of the file with other documented
|
# the direct and indirect include dependencies of the file with other documented
|
||||||
# files.
|
# files. Explicit enabling an included by graph, when INCLUDED_BY_GRAPH is set
|
||||||
|
# to NO, can be accomplished by means of the command \includedbygraph. Disabling
|
||||||
|
# an included by graph can be accomplished by means of the command
|
||||||
|
# \hideincludedbygraph.
|
||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||||
|
|
||||||
@ -2541,7 +2659,10 @@ GRAPHICAL_HIERARCHY = YES
|
|||||||
# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
|
# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
|
||||||
# dependencies a directory has on other directories in a graphical way. The
|
# dependencies a directory has on other directories in a graphical way. The
|
||||||
# dependency relations are determined by the #include relations between the
|
# dependency relations are determined by the #include relations between the
|
||||||
# files in the directories.
|
# files in the directories. Explicit enabling a directory graph, when
|
||||||
|
# DIRECTORY_GRAPH is set to NO, can be accomplished by means of the command
|
||||||
|
# \directorygraph. Disabling a directory graph can be accomplished by means of
|
||||||
|
# the command \hidedirectorygraph.
|
||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||||
|
|
||||||
@ -2557,7 +2678,7 @@ DIR_GRAPH_MAX_DEPTH = 1
|
|||||||
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
|
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
|
||||||
# generated by dot. For an explanation of the image formats see the section
|
# generated by dot. For an explanation of the image formats see the section
|
||||||
# output formats in the documentation of the dot tool (Graphviz (see:
|
# output formats in the documentation of the dot tool (Graphviz (see:
|
||||||
# http://www.graphviz.org/)).
|
# https://www.graphviz.org/)).
|
||||||
# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
|
# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
|
||||||
# to make the SVG files visible in IE 9+ (other browsers do not have this
|
# to make the SVG files visible in IE 9+ (other browsers do not have this
|
||||||
# requirement).
|
# requirement).
|
||||||
@ -2595,11 +2716,12 @@ DOT_PATH =
|
|||||||
|
|
||||||
DOTFILE_DIRS =
|
DOTFILE_DIRS =
|
||||||
|
|
||||||
# The MSCFILE_DIRS tag can be used to specify one or more directories that
|
# You can include diagrams made with dia in doxygen documentation. Doxygen will
|
||||||
# contain msc files that are included in the documentation (see the \mscfile
|
# then run dia to produce the diagram and insert it in the documentation. The
|
||||||
# command).
|
# DIA_PATH tag allows you to specify the directory where the dia binary resides.
|
||||||
|
# If left empty dia is assumed to be found in the default search path.
|
||||||
|
|
||||||
MSCFILE_DIRS =
|
DIA_PATH =
|
||||||
|
|
||||||
# The DIAFILE_DIRS tag can be used to specify one or more directories that
|
# The DIAFILE_DIRS tag can be used to specify one or more directories that
|
||||||
# contain dia files that are included in the documentation (see the \diafile
|
# contain dia files that are included in the documentation (see the \diafile
|
||||||
@ -2649,18 +2771,6 @@ DOT_GRAPH_MAX_NODES = 50
|
|||||||
|
|
||||||
MAX_DOT_GRAPH_DEPTH = 1000
|
MAX_DOT_GRAPH_DEPTH = 1000
|
||||||
|
|
||||||
# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
|
|
||||||
# background. This is disabled by default, because dot on Windows does not seem
|
|
||||||
# to support this out of the box.
|
|
||||||
#
|
|
||||||
# Warning: Depending on the platform used, enabling this option may lead to
|
|
||||||
# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
|
|
||||||
# read).
|
|
||||||
# The default value is: NO.
|
|
||||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
|
||||||
|
|
||||||
DOT_TRANSPARENT = YES
|
|
||||||
|
|
||||||
# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
|
# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
|
||||||
# files in one run (i.e. multiple -o and -T options on the command line). This
|
# files in one run (i.e. multiple -o and -T options on the command line). This
|
||||||
# makes dot run faster, but since only newer versions of dot (>1.8.10) support
|
# makes dot run faster, but since only newer versions of dot (>1.8.10) support
|
||||||
@ -2688,3 +2798,19 @@ GENERATE_LEGEND = YES
|
|||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
|
|
||||||
DOT_CLEANUP = YES
|
DOT_CLEANUP = YES
|
||||||
|
|
||||||
|
# You can define message sequence charts within doxygen comments using the \msc
|
||||||
|
# command. If the MSCGEN_TOOL tag is left empty (the default), then doxygen will
|
||||||
|
# use a built-in version of mscgen tool to produce the charts. Alternatively,
|
||||||
|
# the MSCGEN_TOOL tag can also specify the name an external tool. For instance,
|
||||||
|
# specifying prog as the value, doxygen will call the tool as prog -T
|
||||||
|
# <outfile_format> -o <outputfile> <inputfile>. The external tool should support
|
||||||
|
# output file formats "png", "eps", "svg", and "ismap".
|
||||||
|
|
||||||
|
MSCGEN_TOOL =
|
||||||
|
|
||||||
|
# The MSCFILE_DIRS tag can be used to specify one or more directories that
|
||||||
|
# contain msc files that are included in the documentation (see the \mscfile
|
||||||
|
# command).
|
||||||
|
|
||||||
|
MSCFILE_DIRS =
|
||||||
|
@ -1,5 +1,25 @@
|
|||||||
SUBDIRS:= `ls`
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
#
|
||||||
|
# SPDX-FileContributor: Antonio Niño Díaz, 2023-2024
|
||||||
|
|
||||||
|
.PHONY: all clean
|
||||||
|
|
||||||
|
MAKE := make
|
||||||
|
|
||||||
all:
|
all:
|
||||||
@for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i || { exit 1;} fi; done;
|
@for i in `ls`; do \
|
||||||
|
if test -e $$i/Makefile ; then \
|
||||||
|
cd $$i; \
|
||||||
|
$(MAKE) --no-print-directory || exit 1 ; \
|
||||||
|
cd ..; \
|
||||||
|
fi; \
|
||||||
|
done;
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i clean || { exit 1;} fi; done;
|
@for i in `ls`; do \
|
||||||
|
if test -e $$i/Makefile ; then \
|
||||||
|
cd $$i; \
|
||||||
|
$(MAKE) clean --no-print-directory || exit 1 ; \
|
||||||
|
cd ..; \
|
||||||
|
fi; \
|
||||||
|
done;
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
# SPDX-License-Identifier: CC0-1.0
|
|
||||||
#
|
|
||||||
# SPDX-FileContributor: Antonio Niño Díaz, 2023
|
|
||||||
|
|
||||||
.PHONY: all clean
|
|
||||||
|
|
||||||
MAKE := make
|
|
||||||
|
|
||||||
all:
|
|
||||||
@for i in `ls`; do \
|
|
||||||
if test -e $$i/Makefile.blocksds ; then \
|
|
||||||
cd $$i; \
|
|
||||||
$(MAKE) -f Makefile.blocksds --no-print-directory || { exit 1;}; \
|
|
||||||
cd ..; \
|
|
||||||
fi; \
|
|
||||||
done;
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@for i in `ls`; do \
|
|
||||||
if test -e $$i/Makefile.blocksds ; then \
|
|
||||||
cd $$i; \
|
|
||||||
$(MAKE) -f Makefile.blocksds clean --no-print-directory || { exit 1;}; \
|
|
||||||
cd ..; \
|
|
||||||
fi; \
|
|
||||||
done;
|
|
@ -1,220 +1,6 @@
|
|||||||
#---------------------------------------------------------------------------------
|
# This is a minimal makefile only used for the examples. If you want a makefile
|
||||||
.SUFFIXES:
|
# for your project, take one from the templates inside examples/templates.
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ifeq ($(strip $(DEVKITARM)),)
|
GFXDIRS := graphics
|
||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(DEVKITARM)/ds_rules
|
include ../../Makefile.example
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 :=
|
|
||||||
GRAPHICS := graphics
|
|
||||||
AUDIO :=
|
|
||||||
ICON :=
|
|
||||||
|
|
||||||
# specify a directory which contains the nitro filesystem
|
|
||||||
# this is relative to the Makefile
|
|
||||||
NITRO :=
|
|
||||||
|
|
||||||
# These set the information text in the nds file
|
|
||||||
GAME_TITLE := $(shell basename $(CURDIR))
|
|
||||||
GAME_SUBTITLE1 := Nitro Engine example
|
|
||||||
GAME_SUBTITLE2 := github.com/AntonioND/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := -lNE -lfat -lnds9
|
|
||||||
|
|
||||||
# automatigically add libraries for NitroFS
|
|
||||||
ifneq ($(strip $(NITRO)),)
|
|
||||||
LIBS := -lfilesystem -lfat $(LIBS)
|
|
||||||
endif
|
|
||||||
# automagically add maxmod library
|
|
||||||
ifneq ($(strip $(AUDIO)),)
|
|
||||||
LIBS := -lmm9 $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# list of directories containing libraries, this must be the top level containing
|
|
||||||
# include and lib
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 $(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
|
|
||||||
#---------------------------------------------------------------------------------------
|
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
# This is a minimal makefile only used for the examples. If you want a makefile
|
|
||||||
# for your project, take one from the templates inside examples/templates.
|
|
||||||
|
|
||||||
GFXDIRS := graphics
|
|
||||||
|
|
||||||
include ../../Makefile.example.blocksds
|
|
@ -1,220 +1,6 @@
|
|||||||
#---------------------------------------------------------------------------------
|
# This is a minimal makefile only used for the examples. If you want a makefile
|
||||||
.SUFFIXES:
|
# for your project, take one from the templates inside examples/templates.
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ifeq ($(strip $(DEVKITARM)),)
|
GFXDIRS := graphics
|
||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(DEVKITARM)/ds_rules
|
include ../../Makefile.example
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 :=
|
|
||||||
GRAPHICS := graphics
|
|
||||||
AUDIO :=
|
|
||||||
ICON :=
|
|
||||||
|
|
||||||
# specify a directory which contains the nitro filesystem
|
|
||||||
# this is relative to the Makefile
|
|
||||||
NITRO :=
|
|
||||||
|
|
||||||
# These set the information text in the nds file
|
|
||||||
GAME_TITLE := $(shell basename $(CURDIR))
|
|
||||||
GAME_SUBTITLE1 := Nitro Engine example
|
|
||||||
GAME_SUBTITLE2 := github.com/AntonioND/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := -lNE -lfat -lnds9
|
|
||||||
|
|
||||||
# automatigically add libraries for NitroFS
|
|
||||||
ifneq ($(strip $(NITRO)),)
|
|
||||||
LIBS := -lfilesystem -lfat $(LIBS)
|
|
||||||
endif
|
|
||||||
# automagically add maxmod library
|
|
||||||
ifneq ($(strip $(AUDIO)),)
|
|
||||||
LIBS := -lmm9 $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# list of directories containing libraries, this must be the top level containing
|
|
||||||
# include and lib
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 $(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
|
|
||||||
#---------------------------------------------------------------------------------------
|
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
# This is a minimal makefile only used for the examples. If you want a makefile
|
|
||||||
# for your project, take one from the templates inside examples/templates.
|
|
||||||
|
|
||||||
GFXDIRS := graphics
|
|
||||||
|
|
||||||
include ../../Makefile.example.blocksds
|
|
@ -1,220 +1,4 @@
|
|||||||
#---------------------------------------------------------------------------------
|
# This is a minimal makefile only used for the examples. If you want a makefile
|
||||||
.SUFFIXES:
|
# for your project, take one from the templates inside examples/templates.
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ifeq ($(strip $(DEVKITARM)),)
|
include ../../Makefile.example
|
||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>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
|
|
||||||
# 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 :=
|
|
||||||
|
|
||||||
# These set the information text in the nds file
|
|
||||||
GAME_TITLE := $(shell basename $(CURDIR))
|
|
||||||
GAME_SUBTITLE1 := Nitro Engine example
|
|
||||||
GAME_SUBTITLE2 := github.com/AntonioND/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := -lNE -lfat -lnds9
|
|
||||||
|
|
||||||
# automatigically add libraries for NitroFS
|
|
||||||
ifneq ($(strip $(NITRO)),)
|
|
||||||
LIBS := -lfilesystem -lfat $(LIBS)
|
|
||||||
endif
|
|
||||||
# automagically add maxmod library
|
|
||||||
ifneq ($(strip $(AUDIO)),)
|
|
||||||
LIBS := -lmm9 $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# list of directories containing libraries, this must be the top level containing
|
|
||||||
# include and lib
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 $(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
|
|
||||||
#---------------------------------------------------------------------------------------
|
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
# This is a minimal makefile only used for the examples. If you want a makefile
|
|
||||||
# for your project, take one from the templates inside examples/templates.
|
|
||||||
|
|
||||||
include ../../Makefile.example.blocksds
|
|
@ -1,220 +1,6 @@
|
|||||||
#---------------------------------------------------------------------------------
|
# This is a minimal makefile only used for the examples. If you want a makefile
|
||||||
.SUFFIXES:
|
# for your project, take one from the templates inside examples/templates.
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ifeq ($(strip $(DEVKITARM)),)
|
GFXDIRS := graphics
|
||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(DEVKITARM)/ds_rules
|
include ../../Makefile.example
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 :=
|
|
||||||
GRAPHICS := graphics
|
|
||||||
AUDIO :=
|
|
||||||
ICON :=
|
|
||||||
|
|
||||||
# specify a directory which contains the nitro filesystem
|
|
||||||
# this is relative to the Makefile
|
|
||||||
NITRO :=
|
|
||||||
|
|
||||||
# These set the information text in the nds file
|
|
||||||
GAME_TITLE := $(shell basename $(CURDIR))
|
|
||||||
GAME_SUBTITLE1 := Nitro Engine example
|
|
||||||
GAME_SUBTITLE2 := github.com/AntonioND/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := -lNE -lfat -lnds9
|
|
||||||
|
|
||||||
# automatigically add libraries for NitroFS
|
|
||||||
ifneq ($(strip $(NITRO)),)
|
|
||||||
LIBS := -lfilesystem -lfat $(LIBS)
|
|
||||||
endif
|
|
||||||
# automagically add maxmod library
|
|
||||||
ifneq ($(strip $(AUDIO)),)
|
|
||||||
LIBS := -lmm9 $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# list of directories containing libraries, this must be the top level containing
|
|
||||||
# include and lib
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 $(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
|
|
||||||
#---------------------------------------------------------------------------------------
|
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
# This is a minimal makefile only used for the examples. If you want a makefile
|
|
||||||
# for your project, take one from the templates inside examples/templates.
|
|
||||||
|
|
||||||
GFXDIRS := graphics
|
|
||||||
|
|
||||||
include ../../Makefile.example.blocksds
|
|
@ -1,20 +1,28 @@
|
|||||||
SUBDIRS:= $(shell ls)
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
#
|
||||||
|
# SPDX-FileContributor: Antonio Niño Díaz, 2023-2024
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
.PHONY: all clean
|
||||||
all: examples
|
|
||||||
#-------------------------------------------------------------------------------
|
MAKE := make
|
||||||
@rm -fr build-all
|
|
||||||
|
all:
|
||||||
|
@for i in `ls`; do \
|
||||||
|
if test -e $$i/Makefile ; then \
|
||||||
|
cd $$i; \
|
||||||
|
$(MAKE) --no-print-directory || exit 1 ; \
|
||||||
|
cd ..; \
|
||||||
|
fi; \
|
||||||
|
done;
|
||||||
@mkdir -p build-all
|
@mkdir -p build-all
|
||||||
@find . -name "*.nds" -not -path build-all -exec cp -fv {} build-all \;
|
@find . -name "*.nds" -not -path build-all -exec cp -fv {} build-all \;
|
||||||
|
|
||||||
# TODO: The previous target tries to copy the files from build-all into
|
|
||||||
# themselves. Exclude them correctly.
|
|
||||||
|
|
||||||
examples:
|
|
||||||
@for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i || { exit 1;} fi; done;
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
|
||||||
clean:
|
clean:
|
||||||
#-------------------------------------------------------------------------------
|
@for i in `ls`; do \
|
||||||
|
if test -e $$i/Makefile ; then \
|
||||||
|
cd $$i; \
|
||||||
|
$(MAKE) clean --no-print-directory || exit 1 ; \
|
||||||
|
cd ..; \
|
||||||
|
fi; \
|
||||||
|
done;
|
||||||
@rm -fr build-all
|
@rm -fr build-all
|
||||||
@for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i clean || { exit 1;} fi; done;
|
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
# SPDX-License-Identifier: CC0-1.0
|
|
||||||
#
|
|
||||||
# SPDX-FileContributor: Antonio Niño Díaz, 2023
|
|
||||||
|
|
||||||
.PHONY: all clean
|
|
||||||
|
|
||||||
MAKE := make
|
|
||||||
|
|
||||||
all:
|
|
||||||
@for i in `ls`; do \
|
|
||||||
if test -e $$i/Makefile.blocksds ; then \
|
|
||||||
$(MAKE) -C $$i -f Makefile.blocksds --no-print-directory || { exit 1;} \
|
|
||||||
fi; \
|
|
||||||
done;
|
|
||||||
@rm -fr build-all
|
|
||||||
@mkdir -p build-all
|
|
||||||
@find . -name "*.nds" -not -path build-all -exec cp -fv {} build-all \;
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@for i in `ls`; do \
|
|
||||||
if test -e $$i/Makefile.blocksds ; then \
|
|
||||||
$(MAKE) -C $$i -f Makefile.blocksds clean --no-print-directory || { exit 1;} \
|
|
||||||
fi; \
|
|
||||||
done;
|
|
||||||
@rm -fr build-all
|
|
@ -51,18 +51,18 @@ LIBDIRS += $(BLOCKSDSEXT)/nitro-engine \
|
|||||||
# Build artifacts
|
# Build artifacts
|
||||||
# ---------------
|
# ---------------
|
||||||
|
|
||||||
BUILDDIR := build
|
BUILDDIR := build/$(NAME)
|
||||||
ELF := build/$(NAME).elf
|
ELF := build/$(NAME).elf
|
||||||
DUMP := build/$(NAME).dump
|
DUMP := build/$(NAME).dump
|
||||||
MAP := build/$(NAME).map
|
MAP := build/$(NAME).map
|
||||||
ROM := $(NAME).nds
|
ROM := $(NAME).nds
|
||||||
|
|
||||||
# If NITROFSDIR is set, the output of mmutil will be placed in that directory
|
# If NITROFSDIR is set, the soundbank created by mmutil will be saved to NitroFS
|
||||||
SOUNDBANKINFODIR := $(BUILDDIR)/maxmod
|
SOUNDBANKINFODIR := $(BUILDDIR)/maxmod
|
||||||
ifeq ($(strip $(NITROFSDIR)),)
|
ifeq ($(strip $(NITROFSDIR)),)
|
||||||
SOUNDBANKDIR := $(BUILDDIR)/maxmod
|
SOUNDBANKDIR := $(BUILDDIR)/maxmod
|
||||||
else
|
else
|
||||||
SOUNDBANKDIR := $(NITROFSDIR)
|
SOUNDBANKDIR := $(BUILDDIR)/maxmod_nitrofs
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Tools
|
# Tools
|
||||||
@ -131,16 +131,16 @@ ASFLAGS += -x assembler-with-cpp $(INCLUDEFLAGS) $(DEFINES) \
|
|||||||
$(ARCH) -ffunction-sections -fdata-sections \
|
$(ARCH) -ffunction-sections -fdata-sections \
|
||||||
-specs=$(SPECS)
|
-specs=$(SPECS)
|
||||||
|
|
||||||
CFLAGS += -std=gnu11 $(WARNFLAGS) $(INCLUDEFLAGS) $(DEFINES) \
|
CFLAGS += -std=gnu17 $(WARNFLAGS) $(INCLUDEFLAGS) $(DEFINES) \
|
||||||
$(ARCH) -O2 -ffunction-sections -fdata-sections \
|
$(ARCH) -O2 -ffunction-sections -fdata-sections \
|
||||||
-specs=$(SPECS)
|
-specs=$(SPECS)
|
||||||
|
|
||||||
CXXFLAGS += -std=gnu++14 $(WARNFLAGS) $(INCLUDEFLAGS) $(DEFINES) \
|
CXXFLAGS += -std=gnu++17 $(WARNFLAGS) $(INCLUDEFLAGS) $(DEFINES) \
|
||||||
$(ARCH) -O2 -ffunction-sections -fdata-sections \
|
$(ARCH) -O2 -ffunction-sections -fdata-sections \
|
||||||
-fno-exceptions -fno-rtti \
|
-fno-exceptions -fno-rtti \
|
||||||
-specs=$(SPECS)
|
-specs=$(SPECS)
|
||||||
|
|
||||||
LDFLAGS := $(ARCH) $(LIBDIRSFLAGS) -Wl,-Map,$(MAP) \
|
LDFLAGS := $(ARCH) $(LIBDIRSFLAGS) -Wl,-Map,$(MAP) $(DEFINES) \
|
||||||
-Wl,--start-group $(LIBS) -Wl,--end-group -specs=$(SPECS)
|
-Wl,--start-group $(LIBS) -Wl,--end-group -specs=$(SPECS)
|
||||||
|
|
||||||
# Intermediate build files
|
# Intermediate build files
|
||||||
@ -178,6 +178,10 @@ ifneq ($(strip $(NITROFSDIR)),)
|
|||||||
# Additional arguments for ndstool
|
# Additional arguments for ndstool
|
||||||
NDSTOOL_ARGS := -d $(NITROFSDIR)
|
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
|
# Make the NDS ROM depend on the filesystem only if it is needed
|
||||||
$(ROM): $(NITROFSDIR)
|
$(ROM): $(NITROFSDIR)
|
||||||
endif
|
endif
|
||||||
@ -208,8 +212,7 @@ dump: $(DUMP)
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
@echo " CLEAN"
|
@echo " CLEAN"
|
||||||
$(V)$(RM) $(ROM) $(DUMP) $(BUILDDIR) $(SDIMAGE) \
|
$(V)$(RM) $(ROM) $(DUMP) build $(SDIMAGE)
|
||||||
$(SOUNDBANKDIR)/soundbank.bin
|
|
||||||
|
|
||||||
sdimage:
|
sdimage:
|
||||||
@echo " MKFATIMG $(SDIMAGE) $(SDROOT)"
|
@echo " MKFATIMG $(SDIMAGE) $(SDROOT)"
|
||||||
@ -259,12 +262,14 @@ $(BUILDDIR)/%.png.o $(BUILDDIR)/%.h : %.png %.grit
|
|||||||
@$(MKDIR) -p $(@D)
|
@$(MKDIR) -p $(@D)
|
||||||
$(V)$(BLOCKSDS)/tools/grit/grit $< -ftc -W1 -o$(BUILDDIR)/$*
|
$(V)$(BLOCKSDS)/tools/grit/grit $< -ftc -W1 -o$(BUILDDIR)/$*
|
||||||
$(V)$(CC) $(CFLAGS) -MMD -MP -c -o $(BUILDDIR)/$*.png.o $(BUILDDIR)/$*.c
|
$(V)$(CC) $(CFLAGS) -MMD -MP -c -o $(BUILDDIR)/$*.png.o $(BUILDDIR)/$*.c
|
||||||
|
$(V)touch $(BUILDDIR)/$*.png.o $(BUILDDIR)/$*.h
|
||||||
|
|
||||||
ifneq ($(SOURCES_AUDIO),)
|
ifneq ($(SOURCES_AUDIO),)
|
||||||
|
|
||||||
$(SOUNDBANKINFODIR)/soundbank.h: $(SOURCES_AUDIO)
|
$(SOUNDBANKINFODIR)/soundbank.h: $(SOURCES_AUDIO)
|
||||||
@echo " MMUTIL $^"
|
@echo " MMUTIL $^"
|
||||||
@$(MKDIR) -p $(@D)
|
@$(MKDIR) -p $(SOUNDBANKDIR)
|
||||||
|
@$(MKDIR) -p $(SOUNDBANKINFODIR)
|
||||||
@$(BLOCKSDS)/tools/mmutil/mmutil $^ -d \
|
@$(BLOCKSDS)/tools/mmutil/mmutil $^ -d \
|
||||||
-o$(SOUNDBANKDIR)/soundbank.bin -h$(SOUNDBANKINFODIR)/soundbank.h
|
-o$(SOUNDBANKDIR)/soundbank.bin -h$(SOUNDBANKINFODIR)/soundbank.h
|
||||||
|
|
@ -1,5 +1,25 @@
|
|||||||
SUBDIRS:= `ls`
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
#
|
||||||
|
# SPDX-FileContributor: Antonio Niño Díaz, 2023-2024
|
||||||
|
|
||||||
|
.PHONY: all clean
|
||||||
|
|
||||||
|
MAKE := make
|
||||||
|
|
||||||
all:
|
all:
|
||||||
@for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i || { exit 1;} fi; done;
|
@for i in `ls`; do \
|
||||||
|
if test -e $$i/Makefile ; then \
|
||||||
|
cd $$i; \
|
||||||
|
$(MAKE) --no-print-directory || exit 1 ; \
|
||||||
|
cd ..; \
|
||||||
|
fi; \
|
||||||
|
done;
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i clean || { exit 1;} fi; done;
|
@for i in `ls`; do \
|
||||||
|
if test -e $$i/Makefile ; then \
|
||||||
|
cd $$i; \
|
||||||
|
$(MAKE) clean --no-print-directory || exit 1 ; \
|
||||||
|
cd ..; \
|
||||||
|
fi; \
|
||||||
|
done;
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
# SPDX-License-Identifier: CC0-1.0
|
|
||||||
#
|
|
||||||
# SPDX-FileContributor: Antonio Niño Díaz, 2023
|
|
||||||
|
|
||||||
.PHONY: all clean
|
|
||||||
|
|
||||||
MAKE := make
|
|
||||||
|
|
||||||
all:
|
|
||||||
@for i in `ls`; do \
|
|
||||||
if test -e $$i/Makefile.blocksds ; then \
|
|
||||||
cd $$i; \
|
|
||||||
$(MAKE) -f Makefile.blocksds --no-print-directory || { exit 1;}; \
|
|
||||||
cd ..; \
|
|
||||||
fi; \
|
|
||||||
done;
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@for i in `ls`; do \
|
|
||||||
if test -e $$i/Makefile.blocksds ; then \
|
|
||||||
cd $$i; \
|
|
||||||
$(MAKE) -f Makefile.blocksds clean --no-print-directory || { exit 1;}; \
|
|
||||||
cd ..; \
|
|
||||||
fi; \
|
|
||||||
done;
|
|
@ -1,220 +1,7 @@
|
|||||||
#---------------------------------------------------------------------------------
|
# This is a minimal makefile only used for the examples. If you want a makefile
|
||||||
.SUFFIXES:
|
# for your project, take one from the templates inside examples/templates.
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ifeq ($(strip $(DEVKITARM)),)
|
BINDIRS := data
|
||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
GFXDIRS := graphics
|
||||||
endif
|
|
||||||
|
|
||||||
include $(DEVKITARM)/ds_rules
|
include ../../Makefile.example
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := graphics
|
|
||||||
AUDIO :=
|
|
||||||
ICON :=
|
|
||||||
|
|
||||||
# specify a directory which contains the nitro filesystem
|
|
||||||
# this is relative to the Makefile
|
|
||||||
NITRO :=
|
|
||||||
|
|
||||||
# These set the information text in the nds file
|
|
||||||
GAME_TITLE := $(shell basename $(CURDIR))
|
|
||||||
GAME_SUBTITLE1 := Nitro Engine example
|
|
||||||
GAME_SUBTITLE2 := github.com/AntonioND/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := -lNE -lfat -lnds9
|
|
||||||
|
|
||||||
# automatigically add libraries for NitroFS
|
|
||||||
ifneq ($(strip $(NITRO)),)
|
|
||||||
LIBS := -lfilesystem -lfat $(LIBS)
|
|
||||||
endif
|
|
||||||
# automagically add maxmod library
|
|
||||||
ifneq ($(strip $(AUDIO)),)
|
|
||||||
LIBS := -lmm9 $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# list of directories containing libraries, this must be the top level containing
|
|
||||||
# include and lib
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 $(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
|
|
||||||
#---------------------------------------------------------------------------------------
|
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
# This is a minimal makefile only used for the examples. If you want a makefile
|
|
||||||
# for your project, take one from the templates inside examples/templates.
|
|
||||||
|
|
||||||
BINDIRS := data
|
|
||||||
GFXDIRS := graphics
|
|
||||||
|
|
||||||
include ../../Makefile.example.blocksds
|
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
NITRO_ENGINE=../../..
|
||||||
ASSETS=$NITRO_ENGINE/examples/assets
|
ASSETS=$NITRO_ENGINE/examples/assets
|
||||||
TOOLS=$NITRO_ENGINE/tools
|
TOOLS=$NITRO_ENGINE/tools
|
||||||
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
||||||
|
Binary file not shown.
@ -64,7 +64,7 @@ int main(int argc, char *argv[])
|
|||||||
NE_ModelLoadStaticMesh(Scene.Model3, sphere_bin);
|
NE_ModelLoadStaticMesh(Scene.Model3, sphere_bin);
|
||||||
|
|
||||||
// Load texture
|
// Load texture
|
||||||
NE_MaterialTexLoad(Material, NE_RGB5, 256, 256, NE_TEXGEN_TEXCOORD,
|
NE_MaterialTexLoad(Material, NE_A1RGB5, 256, 256, NE_TEXGEN_TEXCOORD,
|
||||||
textureBitmap);
|
textureBitmap);
|
||||||
|
|
||||||
// Assign the same material to every model object.
|
// Assign the same material to every model object.
|
||||||
|
@ -1,220 +1,6 @@
|
|||||||
#---------------------------------------------------------------------------------
|
# This is a minimal makefile only used for the examples. If you want a makefile
|
||||||
.SUFFIXES:
|
# for your project, take one from the templates inside examples/templates.
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ifeq ($(strip $(DEVKITARM)),)
|
BINDIRS := data
|
||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(DEVKITARM)/ds_rules
|
include ../../Makefile.example
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 :=
|
|
||||||
|
|
||||||
# These set the information text in the nds file
|
|
||||||
GAME_TITLE := $(shell basename $(CURDIR))
|
|
||||||
GAME_SUBTITLE1 := Nitro Engine example
|
|
||||||
GAME_SUBTITLE2 := github.com/AntonioND/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := -lNE -lfat -lnds9
|
|
||||||
|
|
||||||
# automatigically add libraries for NitroFS
|
|
||||||
ifneq ($(strip $(NITRO)),)
|
|
||||||
LIBS := -lfilesystem -lfat $(LIBS)
|
|
||||||
endif
|
|
||||||
# automagically add maxmod library
|
|
||||||
ifneq ($(strip $(AUDIO)),)
|
|
||||||
LIBS := -lmm9 $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# list of directories containing libraries, this must be the top level containing
|
|
||||||
# include and lib
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 $(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
|
|
||||||
#---------------------------------------------------------------------------------------
|
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
# This is a minimal makefile only used for the examples. If you want a makefile
|
|
||||||
# for your project, take one from the templates inside examples/templates.
|
|
||||||
|
|
||||||
BINDIRS := data
|
|
||||||
|
|
||||||
include ../../Makefile.example.blocksds
|
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
NITRO_ENGINE=../../..
|
||||||
ASSETS=$NITRO_ENGINE/examples/assets
|
ASSETS=$NITRO_ENGINE/examples/assets
|
||||||
TOOLS=$NITRO_ENGINE/tools
|
TOOLS=$NITRO_ENGINE/tools
|
||||||
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
||||||
|
Binary file not shown.
@ -1,220 +1,6 @@
|
|||||||
#---------------------------------------------------------------------------------
|
# This is a minimal makefile only used for the examples. If you want a makefile
|
||||||
.SUFFIXES:
|
# for your project, take one from the templates inside examples/templates.
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ifeq ($(strip $(DEVKITARM)),)
|
BINDIRS := data
|
||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(DEVKITARM)/ds_rules
|
include ../../Makefile.example
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 :=
|
|
||||||
|
|
||||||
# These set the information text in the nds file
|
|
||||||
GAME_TITLE := $(shell basename $(CURDIR))
|
|
||||||
GAME_SUBTITLE1 := Nitro Engine example
|
|
||||||
GAME_SUBTITLE2 := github.com/AntonioND/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := -lNE -lfat -lnds9
|
|
||||||
|
|
||||||
# automatigically add libraries for NitroFS
|
|
||||||
ifneq ($(strip $(NITRO)),)
|
|
||||||
LIBS := -lfilesystem -lfat $(LIBS)
|
|
||||||
endif
|
|
||||||
# automagically add maxmod library
|
|
||||||
ifneq ($(strip $(AUDIO)),)
|
|
||||||
LIBS := -lmm9 $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# list of directories containing libraries, this must be the top level containing
|
|
||||||
# include and lib
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 $(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
|
|
||||||
#---------------------------------------------------------------------------------------
|
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
# This is a minimal makefile only used for the examples. If you want a makefile
|
|
||||||
# for your project, take one from the templates inside examples/templates.
|
|
||||||
|
|
||||||
BINDIRS := data
|
|
||||||
|
|
||||||
include ../../Makefile.example.blocksds
|
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
NITRO_ENGINE=../../..
|
||||||
ASSETS=$NITRO_ENGINE/examples/assets
|
ASSETS=$NITRO_ENGINE/examples/assets
|
||||||
TOOLS=$NITRO_ENGINE/tools
|
TOOLS=$NITRO_ENGINE/tools
|
||||||
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -1,220 +1,7 @@
|
|||||||
#---------------------------------------------------------------------------------
|
# This is a minimal makefile only used for the examples. If you want a makefile
|
||||||
.SUFFIXES:
|
# for your project, take one from the templates inside examples/templates.
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ifeq ($(strip $(DEVKITARM)),)
|
BINDIRS := data
|
||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
GFXDIRS := graphics
|
||||||
endif
|
|
||||||
|
|
||||||
include $(DEVKITARM)/ds_rules
|
include ../../Makefile.example
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := graphics
|
|
||||||
AUDIO :=
|
|
||||||
ICON :=
|
|
||||||
|
|
||||||
# specify a directory which contains the nitro filesystem
|
|
||||||
# this is relative to the Makefile
|
|
||||||
NITRO :=
|
|
||||||
|
|
||||||
# These set the information text in the nds file
|
|
||||||
GAME_TITLE := $(shell basename $(CURDIR))
|
|
||||||
GAME_SUBTITLE1 := Nitro Engine example
|
|
||||||
GAME_SUBTITLE2 := github.com/AntonioND/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := -lNE -lfat -lnds9
|
|
||||||
|
|
||||||
# automatigically add libraries for NitroFS
|
|
||||||
ifneq ($(strip $(NITRO)),)
|
|
||||||
LIBS := -lfilesystem -lfat $(LIBS)
|
|
||||||
endif
|
|
||||||
# automagically add maxmod library
|
|
||||||
ifneq ($(strip $(AUDIO)),)
|
|
||||||
LIBS := -lmm9 $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# list of directories containing libraries, this must be the top level containing
|
|
||||||
# include and lib
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 $(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
|
|
||||||
#---------------------------------------------------------------------------------------
|
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
# This is a minimal makefile only used for the examples. If you want a makefile
|
|
||||||
# for your project, take one from the templates inside examples/templates.
|
|
||||||
|
|
||||||
BINDIRS := data
|
|
||||||
GFXDIRS := graphics
|
|
||||||
|
|
||||||
include ../../Makefile.example.blocksds
|
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
NITRO_ENGINE=../../..
|
||||||
ASSETS=$NITRO_ENGINE/examples/assets
|
ASSETS=$NITRO_ENGINE/examples/assets
|
||||||
TOOLS=$NITRO_ENGINE/tools
|
TOOLS=$NITRO_ENGINE/tools
|
||||||
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
||||||
|
Binary file not shown.
@ -62,7 +62,7 @@ int main(int argc, char *argv[])
|
|||||||
// Load mesh from RAM and assign it to a model
|
// Load mesh from RAM and assign it to a model
|
||||||
NE_ModelLoadStaticMesh(Scene.Model, teapot_bin);
|
NE_ModelLoadStaticMesh(Scene.Model, teapot_bin);
|
||||||
// Load teapot texture from RAM and assign it to a material
|
// Load teapot texture from RAM and assign it to a material
|
||||||
NE_MaterialTexLoad(Material, NE_RGB5, 256, 256,
|
NE_MaterialTexLoad(Material, NE_A1RGB5, 256, 256,
|
||||||
NE_TEXGEN_TEXCOORD | NE_TEXTURE_WRAP_S | NE_TEXTURE_WRAP_T,
|
NE_TEXGEN_TEXCOORD | NE_TEXTURE_WRAP_S | NE_TEXTURE_WRAP_T,
|
||||||
teapotBitmap);
|
teapotBitmap);
|
||||||
|
|
||||||
|
@ -1,220 +1,7 @@
|
|||||||
#---------------------------------------------------------------------------------
|
# This is a minimal makefile only used for the examples. If you want a makefile
|
||||||
.SUFFIXES:
|
# for your project, take one from the templates inside examples/templates.
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ifeq ($(strip $(DEVKITARM)),)
|
BINDIRS := data
|
||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
GFXDIRS := graphics
|
||||||
endif
|
|
||||||
|
|
||||||
include $(DEVKITARM)/ds_rules
|
include ../../Makefile.example
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := graphics
|
|
||||||
AUDIO :=
|
|
||||||
ICON :=
|
|
||||||
|
|
||||||
# specify a directory which contains the nitro filesystem
|
|
||||||
# this is relative to the Makefile
|
|
||||||
NITRO :=
|
|
||||||
|
|
||||||
# These set the information text in the nds file
|
|
||||||
GAME_TITLE := $(shell basename $(CURDIR))
|
|
||||||
GAME_SUBTITLE1 := Nitro Engine example
|
|
||||||
GAME_SUBTITLE2 := github.com/AntonioND/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := -lNE -lfat -lnds9
|
|
||||||
|
|
||||||
# automatigically add libraries for NitroFS
|
|
||||||
ifneq ($(strip $(NITRO)),)
|
|
||||||
LIBS := -lfilesystem -lfat $(LIBS)
|
|
||||||
endif
|
|
||||||
# automagically add maxmod library
|
|
||||||
ifneq ($(strip $(AUDIO)),)
|
|
||||||
LIBS := -lmm9 $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# list of directories containing libraries, this must be the top level containing
|
|
||||||
# include and lib
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 $(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
|
|
||||||
#---------------------------------------------------------------------------------------
|
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
# This is a minimal makefile only used for the examples. If you want a makefile
|
|
||||||
# for your project, take one from the templates inside examples/templates.
|
|
||||||
|
|
||||||
BINDIRS := data
|
|
||||||
GFXDIRS := graphics
|
|
||||||
|
|
||||||
include ../../Makefile.example.blocksds
|
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
NITRO_ENGINE=../../..
|
||||||
ASSETS=$NITRO_ENGINE/examples/assets
|
ASSETS=$NITRO_ENGINE/examples/assets
|
||||||
TOOLS=$NITRO_ENGINE/tools
|
TOOLS=$NITRO_ENGINE/tools
|
||||||
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
||||||
|
Binary file not shown.
@ -1,220 +1,7 @@
|
|||||||
#---------------------------------------------------------------------------------
|
# This is a minimal makefile only used for the examples. If you want a makefile
|
||||||
.SUFFIXES:
|
# for your project, take one from the templates inside examples/templates.
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ifeq ($(strip $(DEVKITARM)),)
|
BINDIRS := data
|
||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
GFXDIRS := graphics
|
||||||
endif
|
|
||||||
|
|
||||||
include $(DEVKITARM)/ds_rules
|
include ../../Makefile.example
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := graphics
|
|
||||||
AUDIO :=
|
|
||||||
ICON :=
|
|
||||||
|
|
||||||
# specify a directory which contains the nitro filesystem
|
|
||||||
# this is relative to the Makefile
|
|
||||||
NITRO :=
|
|
||||||
|
|
||||||
# These set the information text in the nds file
|
|
||||||
GAME_TITLE := $(shell basename $(CURDIR))
|
|
||||||
GAME_SUBTITLE1 := Nitro Engine example
|
|
||||||
GAME_SUBTITLE2 := github.com/AntonioND/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := -lNE -lfat -lnds9
|
|
||||||
|
|
||||||
# automatigically add libraries for NitroFS
|
|
||||||
ifneq ($(strip $(NITRO)),)
|
|
||||||
LIBS := -lfilesystem -lfat $(LIBS)
|
|
||||||
endif
|
|
||||||
# automagically add maxmod library
|
|
||||||
ifneq ($(strip $(AUDIO)),)
|
|
||||||
LIBS := -lmm9 $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# list of directories containing libraries, this must be the top level containing
|
|
||||||
# include and lib
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 $(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
|
|
||||||
#---------------------------------------------------------------------------------------
|
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
# This is a minimal makefile only used for the examples. If you want a makefile
|
|
||||||
# for your project, take one from the templates inside examples/templates.
|
|
||||||
|
|
||||||
BINDIRS := data
|
|
||||||
GFXDIRS := graphics
|
|
||||||
|
|
||||||
include ../../Makefile.example.blocksds
|
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
NITRO_ENGINE=../../..
|
||||||
ASSETS=$NITRO_ENGINE/examples/assets
|
ASSETS=$NITRO_ENGINE/examples/assets
|
||||||
TOOLS=$NITRO_ENGINE/tools
|
TOOLS=$NITRO_ENGINE/tools
|
||||||
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
||||||
|
@ -207,7 +207,7 @@ int main(int argc, char *argv[])
|
|||||||
NE_ModelLoadStaticMesh(Scene.Teapot, teapot_bin);
|
NE_ModelLoadStaticMesh(Scene.Teapot, teapot_bin);
|
||||||
|
|
||||||
// Load teapot texture from RAM and assign it to a material
|
// Load teapot texture from RAM and assign it to a material
|
||||||
NE_MaterialTexLoad(Scene.Material, NE_RGB5, 256, 256,
|
NE_MaterialTexLoad(Scene.Material, NE_A1RGB5, 256, 256,
|
||||||
NE_TEXGEN_TEXCOORD | NE_TEXTURE_WRAP_S | NE_TEXTURE_WRAP_T,
|
NE_TEXGEN_TEXCOORD | NE_TEXTURE_WRAP_S | NE_TEXTURE_WRAP_T,
|
||||||
teapotBitmap);
|
teapotBitmap);
|
||||||
|
|
||||||
|
@ -1,5 +1,25 @@
|
|||||||
SUBDIRS:= `ls`
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
#
|
||||||
|
# SPDX-FileContributor: Antonio Niño Díaz, 2023-2024
|
||||||
|
|
||||||
|
.PHONY: all clean
|
||||||
|
|
||||||
|
MAKE := make
|
||||||
|
|
||||||
all:
|
all:
|
||||||
@for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i || { exit 1;} fi; done;
|
@for i in `ls`; do \
|
||||||
|
if test -e $$i/Makefile ; then \
|
||||||
|
cd $$i; \
|
||||||
|
$(MAKE) --no-print-directory || exit 1 ; \
|
||||||
|
cd ..; \
|
||||||
|
fi; \
|
||||||
|
done;
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i clean || { exit 1;} fi; done;
|
@for i in `ls`; do \
|
||||||
|
if test -e $$i/Makefile ; then \
|
||||||
|
cd $$i; \
|
||||||
|
$(MAKE) clean --no-print-directory || exit 1 ; \
|
||||||
|
cd ..; \
|
||||||
|
fi; \
|
||||||
|
done;
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
# SPDX-License-Identifier: CC0-1.0
|
|
||||||
#
|
|
||||||
# SPDX-FileContributor: Antonio Niño Díaz, 2023
|
|
||||||
|
|
||||||
.PHONY: all clean
|
|
||||||
|
|
||||||
MAKE := make
|
|
||||||
|
|
||||||
all:
|
|
||||||
@for i in `ls`; do \
|
|
||||||
if test -e $$i/Makefile.blocksds ; then \
|
|
||||||
cd $$i; \
|
|
||||||
$(MAKE) -f Makefile.blocksds --no-print-directory || { exit 1;}; \
|
|
||||||
cd ..; \
|
|
||||||
fi; \
|
|
||||||
done;
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@for i in `ls`; do \
|
|
||||||
if test -e $$i/Makefile.blocksds ; then \
|
|
||||||
cd $$i; \
|
|
||||||
$(MAKE) -f Makefile.blocksds clean --no-print-directory || { exit 1;}; \
|
|
||||||
cd ..; \
|
|
||||||
fi; \
|
|
||||||
done;
|
|
@ -1,220 +1,7 @@
|
|||||||
#---------------------------------------------------------------------------------
|
# This is a minimal makefile only used for the examples. If you want a makefile
|
||||||
.SUFFIXES:
|
# for your project, take one from the templates inside examples/templates.
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ifeq ($(strip $(DEVKITARM)),)
|
BINDIRS := data
|
||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
GFXDIRS := graphics
|
||||||
endif
|
|
||||||
|
|
||||||
include $(DEVKITARM)/ds_rules
|
include ../../Makefile.example
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := graphics
|
|
||||||
AUDIO :=
|
|
||||||
ICON :=
|
|
||||||
|
|
||||||
# specify a directory which contains the nitro filesystem
|
|
||||||
# this is relative to the Makefile
|
|
||||||
NITRO :=
|
|
||||||
|
|
||||||
# These set the information text in the nds file
|
|
||||||
GAME_TITLE := $(shell basename $(CURDIR))
|
|
||||||
GAME_SUBTITLE1 := Nitro Engine example
|
|
||||||
GAME_SUBTITLE2 := github.com/AntonioND/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := -lNE -lfat -lnds9
|
|
||||||
|
|
||||||
# automatigically add libraries for NitroFS
|
|
||||||
ifneq ($(strip $(NITRO)),)
|
|
||||||
LIBS := -lfilesystem -lfat $(LIBS)
|
|
||||||
endif
|
|
||||||
# automagically add maxmod library
|
|
||||||
ifneq ($(strip $(AUDIO)),)
|
|
||||||
LIBS := -lmm9 $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# list of directories containing libraries, this must be the top level containing
|
|
||||||
# include and lib
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 $(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
|
|
||||||
#---------------------------------------------------------------------------------------
|
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
# This is a minimal makefile only used for the examples. If you want a makefile
|
|
||||||
# for your project, take one from the templates inside examples/templates.
|
|
||||||
|
|
||||||
BINDIRS := data
|
|
||||||
GFXDIRS := graphics
|
|
||||||
|
|
||||||
include ../../Makefile.example.blocksds
|
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
NITRO_ENGINE=../../..
|
||||||
ASSETS=$NITRO_ENGINE/examples/assets
|
ASSETS=$NITRO_ENGINE/examples/assets
|
||||||
TOOLS=$NITRO_ENGINE/tools
|
TOOLS=$NITRO_ENGINE/tools
|
||||||
MD5_TO_DSMA=$TOOLS/md5_to_dsma/md5_to_dsma.py
|
MD5_TO_DSMA=$TOOLS/md5_to_dsma/md5_to_dsma.py
|
||||||
|
@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
BINDIRS := data
|
BINDIRS := data
|
||||||
|
|
||||||
include ../../Makefile.example.blocksds
|
include ../../Makefile.example
|
13
examples/loading/assign_transform_matrix/assets.sh
Normal file
13
examples/loading/assign_transform_matrix/assets.sh
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
NITRO_ENGINE=../../..
|
||||||
|
ASSETS=$NITRO_ENGINE/examples/assets
|
||||||
|
TOOLS=$NITRO_ENGINE/tools
|
||||||
|
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
||||||
|
|
||||||
|
mkdir -p data
|
||||||
|
|
||||||
|
python3 $OBJ2DL \
|
||||||
|
--input $ASSETS/sphere.obj \
|
||||||
|
--output data/sphere.bin \
|
||||||
|
--texture 32 32
|
BIN
examples/loading/assign_transform_matrix/data/sphere.bin
Normal file
BIN
examples/loading/assign_transform_matrix/data/sphere.bin
Normal file
Binary file not shown.
105
examples/loading/assign_transform_matrix/source/main.c
Normal file
105
examples/loading/assign_transform_matrix/source/main.c
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
// SPDX-License-Identifier: CC0-1.0
|
||||||
|
//
|
||||||
|
// SPDX-FileContributor: Antonio Niño Díaz, 2008-2024
|
||||||
|
//
|
||||||
|
// This file is part of Nitro Engine
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
#include <NEMain.h>
|
||||||
|
|
||||||
|
#include "sphere_bin.h"
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
NE_Camera *Camera;
|
||||||
|
NE_Model *ModelWithoutMatrix;
|
||||||
|
NE_Model *ModelWithMatrix;
|
||||||
|
} SceneData;
|
||||||
|
|
||||||
|
void Draw3DScene(void *arg)
|
||||||
|
{
|
||||||
|
SceneData *Scene = arg;
|
||||||
|
|
||||||
|
NE_CameraUse(Scene->Camera);
|
||||||
|
|
||||||
|
NE_ModelDraw(Scene->ModelWithoutMatrix);
|
||||||
|
NE_ModelDraw(Scene->ModelWithMatrix);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
SceneData Scene = { 0 };
|
||||||
|
|
||||||
|
irqEnable(IRQ_HBLANK);
|
||||||
|
irqSet(IRQ_VBLANK, NE_VBLFunc);
|
||||||
|
irqSet(IRQ_HBLANK, NE_HBLFunc);
|
||||||
|
|
||||||
|
// Init Nitro Engine.
|
||||||
|
NE_Init3D();
|
||||||
|
// libnds uses VRAM_C for the text console, reserve A and B only
|
||||||
|
NE_TextureSystemReset(0, 0, NE_VRAM_AB);
|
||||||
|
// Init console in non-3D screen
|
||||||
|
consoleDemoInit();
|
||||||
|
|
||||||
|
// Allocate space for everything.
|
||||||
|
Scene.ModelWithoutMatrix = NE_ModelCreate(NE_Static);
|
||||||
|
Scene.ModelWithMatrix = NE_ModelCreate(NE_Static);
|
||||||
|
|
||||||
|
Scene.Camera = NE_CameraCreate();
|
||||||
|
|
||||||
|
// Setup camera
|
||||||
|
NE_CameraSet(Scene.Camera,
|
||||||
|
0, 0, 3,
|
||||||
|
0, 0, 0,
|
||||||
|
0, 1, 0);
|
||||||
|
|
||||||
|
// Load models
|
||||||
|
NE_ModelLoadStaticMesh(Scene.ModelWithoutMatrix, sphere_bin);
|
||||||
|
NE_ModelLoadStaticMesh(Scene.ModelWithMatrix, sphere_bin);
|
||||||
|
|
||||||
|
// Set up light
|
||||||
|
NE_LightSet(0, NE_Yellow, 0, -0.5, -0.5);
|
||||||
|
|
||||||
|
// Set start coordinates/rotation of the models
|
||||||
|
NE_ModelSetCoord(Scene.ModelWithoutMatrix, -1, 0, 0);
|
||||||
|
|
||||||
|
// Transformation matrix we are going to use for a model. Note that this
|
||||||
|
// matrix is transposed compared to what most 3D documentation describes.
|
||||||
|
m4x3 matrix = {{
|
||||||
|
// 3x3 transformation
|
||||||
|
inttof32(1), 0, 0,
|
||||||
|
0, inttof32(1), 0,
|
||||||
|
0, 0, inttof32(1),
|
||||||
|
// Translation vector
|
||||||
|
inttof32(2), 0, 0
|
||||||
|
}};
|
||||||
|
|
||||||
|
int translation = inttof32(2);
|
||||||
|
|
||||||
|
printf("The right ball uses a matrix\n"
|
||||||
|
"assigned by the user, the left\n"
|
||||||
|
"one has rotation managed by\n"
|
||||||
|
"Nitro Engine.");
|
||||||
|
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
NE_WaitForVBL(0);
|
||||||
|
|
||||||
|
// Rotate the first model
|
||||||
|
NE_ModelRotate(Scene.ModelWithoutMatrix, -1, 2, 1);
|
||||||
|
|
||||||
|
// Update matrix manually
|
||||||
|
translation += floattof32(0.05);
|
||||||
|
if (translation > inttof32(3))
|
||||||
|
translation = inttof32(1);
|
||||||
|
matrix.m[9] = translation;
|
||||||
|
|
||||||
|
// Assign matrix again
|
||||||
|
NE_ModelSetMatrix(Scene.ModelWithMatrix, &matrix);
|
||||||
|
|
||||||
|
// Draw scene
|
||||||
|
NE_ProcessArg(Draw3DScene, &Scene);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
@ -1,220 +1,6 @@
|
|||||||
#---------------------------------------------------------------------------------
|
# This is a minimal makefile only used for the examples. If you want a makefile
|
||||||
.SUFFIXES:
|
# for your project, take one from the templates inside examples/templates.
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ifeq ($(strip $(DEVKITARM)),)
|
BINDIRS := data
|
||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(DEVKITARM)/ds_rules
|
include ../../Makefile.example
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 :=
|
|
||||||
|
|
||||||
# These set the information text in the nds file
|
|
||||||
GAME_TITLE := $(shell basename $(CURDIR))
|
|
||||||
GAME_SUBTITLE1 := Nitro Engine example
|
|
||||||
GAME_SUBTITLE2 := github.com/AntonioND/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := -lNE -lfat -lnds9
|
|
||||||
|
|
||||||
# automatigically add libraries for NitroFS
|
|
||||||
ifneq ($(strip $(NITRO)),)
|
|
||||||
LIBS := -lfilesystem -lfat $(LIBS)
|
|
||||||
endif
|
|
||||||
# automagically add maxmod library
|
|
||||||
ifneq ($(strip $(AUDIO)),)
|
|
||||||
LIBS := -lmm9 $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# list of directories containing libraries, this must be the top level containing
|
|
||||||
# include and lib
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 $(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
|
|
||||||
#---------------------------------------------------------------------------------------
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
NITRO_ENGINE=../../..
|
||||||
ASSETS=$NITRO_ENGINE/examples/assets
|
ASSETS=$NITRO_ENGINE/examples/assets
|
||||||
TOOLS=$NITRO_ENGINE/tools
|
TOOLS=$NITRO_ENGINE/tools
|
||||||
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
||||||
|
Binary file not shown.
@ -1,220 +1,6 @@
|
|||||||
#---------------------------------------------------------------------------------
|
# This is a minimal makefile only used for the examples. If you want a makefile
|
||||||
.SUFFIXES:
|
# for your project, take one from the templates inside examples/templates.
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ifeq ($(strip $(DEVKITARM)),)
|
BINDIRS := data
|
||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(DEVKITARM)/ds_rules
|
include ../../Makefile.example
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 :=
|
|
||||||
|
|
||||||
# These set the information text in the nds file
|
|
||||||
GAME_TITLE := $(shell basename $(CURDIR))
|
|
||||||
GAME_SUBTITLE1 := Nitro Engine example
|
|
||||||
GAME_SUBTITLE2 := github.com/AntonioND/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := -lNE -lfat -lnds9
|
|
||||||
|
|
||||||
# automatigically add libraries for NitroFS
|
|
||||||
ifneq ($(strip $(NITRO)),)
|
|
||||||
LIBS := -lfilesystem -lfat $(LIBS)
|
|
||||||
endif
|
|
||||||
# automagically add maxmod library
|
|
||||||
ifneq ($(strip $(AUDIO)),)
|
|
||||||
LIBS := -lmm9 $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# list of directories containing libraries, this must be the top level containing
|
|
||||||
# include and lib
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 $(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
|
|
||||||
#---------------------------------------------------------------------------------------
|
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
# This is a minimal makefile only used for the examples. If you want a makefile
|
|
||||||
# for your project, take one from the templates inside examples/templates.
|
|
||||||
|
|
||||||
BINDIRS := data
|
|
||||||
|
|
||||||
include ../../Makefile.example.blocksds
|
|
@ -3,14 +3,16 @@
|
|||||||
rm -rf data
|
rm -rf data
|
||||||
mkdir -p data
|
mkdir -p data
|
||||||
|
|
||||||
|
BLOCKSDSEXT="${BLOCKSDSEXT:-/opt/blocksds/external/}"
|
||||||
|
|
||||||
# ptexconv can be obtained here: https://github.com/Garhoogin/ptexconv/
|
# ptexconv can be obtained here: https://github.com/Garhoogin/ptexconv/
|
||||||
|
|
||||||
/opt/blocksds/external/ptexconv/ptexconv \
|
$BLOCKSDSEXT/ptexconv/ptexconv \
|
||||||
-gt -ob -k FF00FF -v -f tex4x4 \
|
-gt -ob -k FF00FF -v -f tex4x4 \
|
||||||
-o data/grill \
|
-o data/grill \
|
||||||
assets/grill.png
|
assets/grill.png
|
||||||
|
|
||||||
/opt/blocksds/external/ptexconv/ptexconv \
|
$BLOCKSDSEXT/ptexconv/ptexconv \
|
||||||
-gt -ob -k FF00FF -v -f tex4x4 \
|
-gt -ob -k FF00FF -v -f tex4x4 \
|
||||||
-o data/landscape \
|
-o data/landscape \
|
||||||
assets/landscape.jpg
|
assets/landscape.jpg
|
||||||
|
@ -1,220 +1,6 @@
|
|||||||
#---------------------------------------------------------------------------------
|
# This is a minimal makefile only used for the examples. If you want a makefile
|
||||||
.SUFFIXES:
|
# for your project, take one from the templates inside examples/templates.
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ifeq ($(strip $(DEVKITARM)),)
|
NITROFSDIR := nitrofiles
|
||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(DEVKITARM)/ds_rules
|
include ../../Makefile.example
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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
|
|
||||||
|
|
||||||
# These set the information text in the nds file
|
|
||||||
GAME_TITLE := $(shell basename $(CURDIR))
|
|
||||||
GAME_SUBTITLE1 := Nitro Engine example
|
|
||||||
GAME_SUBTITLE2 := github.com/AntonioND/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := -lNE -lfat -lnds9
|
|
||||||
|
|
||||||
# automatigically add libraries for NitroFS
|
|
||||||
ifneq ($(strip $(NITRO)),)
|
|
||||||
LIBS := -lfilesystem -lfat $(LIBS)
|
|
||||||
endif
|
|
||||||
# automagically add maxmod library
|
|
||||||
ifneq ($(strip $(AUDIO)),)
|
|
||||||
LIBS := -lmm9 $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# list of directories containing libraries, this must be the top level containing
|
|
||||||
# include and lib
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 $(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
|
|
||||||
#---------------------------------------------------------------------------------------
|
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
NITRO_ENGINE=../../..
|
||||||
ASSETS=$NITRO_ENGINE/examples/assets
|
ASSETS=$NITRO_ENGINE/examples/assets
|
||||||
TOOLS=$NITRO_ENGINE/tools
|
TOOLS=$NITRO_ENGINE/tools
|
||||||
MD5_TO_DSMA=$TOOLS/md5_to_dsma/md5_to_dsma.py
|
MD5_TO_DSMA=$TOOLS/md5_to_dsma/md5_to_dsma.py
|
||||||
GRIT=grit
|
BLOCKSDS="${BLOCKSDS:-/opt/blocksds/core/}"
|
||||||
|
GRIT=$BLOCKSDS/tools/grit/grit
|
||||||
|
|
||||||
rm -rf nitrofiles
|
rm -rf nitrofiles
|
||||||
mkdir -p nitrofiles
|
mkdir -p nitrofiles
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
|
|
||||||
//{{BLOCK(texture)
|
|
||||||
|
|
||||||
//======================================================================
|
|
||||||
//
|
|
||||||
// texture, 256x256@16,
|
|
||||||
// Alphabit on.
|
|
||||||
// + bitmap not compressed
|
|
||||||
// Total size: 131072 = 131072
|
|
||||||
//
|
|
||||||
// Time-stamp: 2024-01-27, 18:07:12
|
|
||||||
// Exported by Cearn's GBA Image Transmogrifier, v0.9.2
|
|
||||||
// ( http://www.coranac.com/projects/#grit )
|
|
||||||
//
|
|
||||||
//======================================================================
|
|
||||||
|
|
||||||
#ifndef GRIT_TEXTURE_H
|
|
||||||
#define GRIT_TEXTURE_H
|
|
||||||
|
|
||||||
#define textureBitmapLen 131072
|
|
||||||
extern const unsigned int textureBitmap[32768];
|
|
||||||
|
|
||||||
#endif // GRIT_TEXTURE_H
|
|
||||||
|
|
||||||
//}}BLOCK(texture)
|
|
@ -1,220 +1,6 @@
|
|||||||
#---------------------------------------------------------------------------------
|
# This is a minimal makefile only used for the examples. If you want a makefile
|
||||||
.SUFFIXES:
|
# for your project, take one from the templates inside examples/templates.
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ifeq ($(strip $(DEVKITARM)),)
|
NITROFSDIR := nitrofiles
|
||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(DEVKITARM)/ds_rules
|
include ../../Makefile.example
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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
|
|
||||||
|
|
||||||
# These set the information text in the nds file
|
|
||||||
GAME_TITLE := $(shell basename $(CURDIR))
|
|
||||||
GAME_SUBTITLE1 := Nitro Engine example
|
|
||||||
GAME_SUBTITLE2 := github.com/AntonioND/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := -lNE -lfat -lnds9
|
|
||||||
|
|
||||||
# automatigically add libraries for NitroFS
|
|
||||||
ifneq ($(strip $(NITRO)),)
|
|
||||||
LIBS := -lfilesystem -lfat $(LIBS)
|
|
||||||
endif
|
|
||||||
# automagically add maxmod library
|
|
||||||
ifneq ($(strip $(AUDIO)),)
|
|
||||||
LIBS := -lmm9 $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# list of directories containing libraries, this must be the top level containing
|
|
||||||
# include and lib
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 $(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
|
|
||||||
#---------------------------------------------------------------------------------------
|
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
# This is a minimal makefile only used for the examples. If you want a makefile
|
|
||||||
# for your project, take one from the templates inside examples/templates.
|
|
||||||
|
|
||||||
NITROFSDIR := nitrofiles
|
|
||||||
|
|
||||||
include ../../Makefile.example.blocksds
|
|
@ -1,10 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
NITRO_ENGINE=../../..
|
||||||
ASSETS=$NITRO_ENGINE/examples/assets
|
ASSETS=$NITRO_ENGINE/examples/assets
|
||||||
TOOLS=$NITRO_ENGINE/tools
|
TOOLS=$NITRO_ENGINE/tools
|
||||||
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
||||||
GRIT=grit
|
BLOCKSDS="${BLOCKSDS:-/opt/blocksds/core/}"
|
||||||
|
GRIT=$BLOCKSDS/tools/grit/grit
|
||||||
|
|
||||||
rm -rf nitrofiles
|
rm -rf nitrofiles
|
||||||
mkdir -p nitrofiles
|
mkdir -p nitrofiles
|
||||||
|
@ -1,220 +1,6 @@
|
|||||||
#---------------------------------------------------------------------------------
|
# This is a minimal makefile only used for the examples. If you want a makefile
|
||||||
.SUFFIXES:
|
# for your project, take one from the templates inside examples/templates.
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ifeq ($(strip $(DEVKITARM)),)
|
NITROFSDIR := nitrofiles
|
||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(DEVKITARM)/ds_rules
|
include ../../Makefile.example
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 :=
|
|
||||||
GRAPHICS :=
|
|
||||||
AUDIO :=
|
|
||||||
ICON :=
|
|
||||||
|
|
||||||
# specify a directory which contains the nitro filesystem
|
|
||||||
# this is relative to the Makefile
|
|
||||||
NITRO := nitrofiles
|
|
||||||
|
|
||||||
# These set the information text in the nds file
|
|
||||||
GAME_TITLE := $(shell basename $(CURDIR))
|
|
||||||
GAME_SUBTITLE1 := Nitro Engine example
|
|
||||||
GAME_SUBTITLE2 := github.com/AntonioND/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := -lNE -lfat -lnds9
|
|
||||||
|
|
||||||
# automatigically add libraries for NitroFS
|
|
||||||
ifneq ($(strip $(NITRO)),)
|
|
||||||
LIBS := -lfilesystem -lfat $(LIBS)
|
|
||||||
endif
|
|
||||||
# automagically add maxmod library
|
|
||||||
ifneq ($(strip $(AUDIO)),)
|
|
||||||
LIBS := -lmm9 $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# list of directories containing libraries, this must be the top level containing
|
|
||||||
# include and lib
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 $(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
|
|
||||||
#---------------------------------------------------------------------------------------
|
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
# This is a minimal makefile only used for the examples. If you want a makefile
|
|
||||||
# for your project, take one from the templates inside examples/templates.
|
|
||||||
|
|
||||||
BINDIRS := data
|
|
||||||
NITROFSDIR := nitrofiles
|
|
||||||
|
|
||||||
include ../../Makefile.example.blocksds
|
|
@ -1,10 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
NITRO_ENGINE=../../..
|
||||||
ASSETS=$NITRO_ENGINE/examples/assets
|
ASSETS=$NITRO_ENGINE/examples/assets
|
||||||
TOOLS=$NITRO_ENGINE/tools
|
TOOLS=$NITRO_ENGINE/tools
|
||||||
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
||||||
GRIT=grit
|
BLOCKSDS="${BLOCKSDS:-/opt/blocksds/core/}"
|
||||||
|
GRIT=$BLOCKSDS/tools/grit/grit
|
||||||
|
|
||||||
rm -rf nitrofiles
|
rm -rf nitrofiles
|
||||||
mkdir -p nitrofiles
|
mkdir -p nitrofiles
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
|
|
||||||
//{{BLOCK(texture)
|
|
||||||
|
|
||||||
//======================================================================
|
|
||||||
//
|
|
||||||
// texture, 256x256@16,
|
|
||||||
// Alphabit on.
|
|
||||||
// + bitmap not compressed
|
|
||||||
// Total size: 131072 = 131072
|
|
||||||
//
|
|
||||||
// Time-stamp: 2024-01-27, 18:13:28
|
|
||||||
// Exported by Cearn's GBA Image Transmogrifier, v0.9.2
|
|
||||||
// ( http://www.coranac.com/projects/#grit )
|
|
||||||
//
|
|
||||||
//======================================================================
|
|
||||||
|
|
||||||
#ifndef GRIT_TEXTURE_H
|
|
||||||
#define GRIT_TEXTURE_H
|
|
||||||
|
|
||||||
#define textureBitmapLen 131072
|
|
||||||
extern const unsigned int textureBitmap[32768];
|
|
||||||
|
|
||||||
#endif // GRIT_TEXTURE_H
|
|
||||||
|
|
||||||
//}}BLOCK(texture)
|
|
@ -64,7 +64,7 @@ int main(int argc, char *argv[])
|
|||||||
// Load mesh from the filesystem and assign it to the object "Model".
|
// Load mesh from the filesystem and assign it to the object "Model".
|
||||||
NE_ModelLoadStaticMeshFAT(Scene.Model, "robot.bin");
|
NE_ModelLoadStaticMeshFAT(Scene.Model, "robot.bin");
|
||||||
// Load a RGB texture from RAM and assign it to "Material".
|
// Load a RGB texture from RAM and assign it to "Material".
|
||||||
NE_MaterialTexLoadFAT(Material, NE_RGB5, 256, 256, NE_TEXGEN_TEXCOORD,
|
NE_MaterialTexLoadFAT(Material, NE_A1RGB5, 256, 256, NE_TEXGEN_TEXCOORD,
|
||||||
"texture.img.bin");
|
"texture.img.bin");
|
||||||
|
|
||||||
// Assign texture to model...
|
// Assign texture to model...
|
||||||
|
@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
NITROFSDIR := nitrofiles
|
NITROFSDIR := nitrofiles
|
||||||
|
|
||||||
include ../../Makefile.example.blocksds
|
include ../../Makefile.example
|
@ -1,6 +0,0 @@
|
|||||||
# This is a minimal makefile only used for the examples. If you want a makefile
|
|
||||||
# for your project, take one from the templates inside examples/templates.
|
|
||||||
|
|
||||||
NITROFSDIR := nitrofiles
|
|
||||||
|
|
||||||
include ../../Makefile.example.blocksds
|
|
@ -1,6 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
GRIT=/opt/blocksds/core/tools/grit/grit
|
BLOCKSDS="${BLOCKSDS:-/opt/blocksds/core/}"
|
||||||
|
GRIT=$BLOCKSDS/tools/grit/grit
|
||||||
|
|
||||||
rm -rf nitrofiles
|
rm -rf nitrofiles
|
||||||
mkdir -p nitrofiles
|
mkdir -p nitrofiles
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -1,220 +1,6 @@
|
|||||||
#---------------------------------------------------------------------------------
|
# This is a minimal makefile only used for the examples. If you want a makefile
|
||||||
.SUFFIXES:
|
# for your project, take one from the templates inside examples/templates.
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ifeq ($(strip $(DEVKITARM)),)
|
GFXDIRS := graphics
|
||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(DEVKITARM)/ds_rules
|
include ../../Makefile.example
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 :=
|
|
||||||
GRAPHICS := graphics
|
|
||||||
AUDIO :=
|
|
||||||
ICON :=
|
|
||||||
|
|
||||||
# specify a directory which contains the nitro filesystem
|
|
||||||
# this is relative to the Makefile
|
|
||||||
NITRO :=
|
|
||||||
|
|
||||||
# These set the information text in the nds file
|
|
||||||
GAME_TITLE := $(shell basename $(CURDIR))
|
|
||||||
GAME_SUBTITLE1 := Nitro Engine example
|
|
||||||
GAME_SUBTITLE2 := github.com/AntonioND/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := -lNE -lfat -lnds9
|
|
||||||
|
|
||||||
# automatigically add libraries for NitroFS
|
|
||||||
ifneq ($(strip $(NITRO)),)
|
|
||||||
LIBS := -lfilesystem -lfat $(LIBS)
|
|
||||||
endif
|
|
||||||
# automagically add maxmod library
|
|
||||||
ifneq ($(strip $(AUDIO)),)
|
|
||||||
LIBS := -lmm9 $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# list of directories containing libraries, this must be the top level containing
|
|
||||||
# include and lib
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 $(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
|
|
||||||
#---------------------------------------------------------------------------------------
|
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
# This is a minimal makefile only used for the examples. If you want a makefile
|
|
||||||
# for your project, take one from the templates inside examples/templates.
|
|
||||||
|
|
||||||
GFXDIRS := graphics
|
|
||||||
|
|
||||||
include ../../Makefile.example.blocksds
|
|
@ -1,220 +1,7 @@
|
|||||||
#---------------------------------------------------------------------------------
|
# This is a minimal makefile only used for the examples. If you want a makefile
|
||||||
.SUFFIXES:
|
# for your project, take one from the templates inside examples/templates.
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ifeq ($(strip $(DEVKITARM)),)
|
BINDIRS := data
|
||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
GFXDIRS := graphics
|
||||||
endif
|
|
||||||
|
|
||||||
include $(DEVKITARM)/ds_rules
|
include ../../Makefile.example
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := graphics
|
|
||||||
AUDIO :=
|
|
||||||
ICON :=
|
|
||||||
|
|
||||||
# specify a directory which contains the nitro filesystem
|
|
||||||
# this is relative to the Makefile
|
|
||||||
NITRO :=
|
|
||||||
|
|
||||||
# These set the information text in the nds file
|
|
||||||
GAME_TITLE := $(shell basename $(CURDIR))
|
|
||||||
GAME_SUBTITLE1 := Nitro Engine example
|
|
||||||
GAME_SUBTITLE2 := github.com/AntonioND/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := -lNE -lfat -lnds9
|
|
||||||
|
|
||||||
# automatigically add libraries for NitroFS
|
|
||||||
ifneq ($(strip $(NITRO)),)
|
|
||||||
LIBS := -lfilesystem -lfat $(LIBS)
|
|
||||||
endif
|
|
||||||
# automagically add maxmod library
|
|
||||||
ifneq ($(strip $(AUDIO)),)
|
|
||||||
LIBS := -lmm9 $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# list of directories containing libraries, this must be the top level containing
|
|
||||||
# include and lib
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 $(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
|
|
||||||
#---------------------------------------------------------------------------------------
|
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
# This is a minimal makefile only used for the examples. If you want a makefile
|
|
||||||
# for your project, take one from the templates inside examples/templates.
|
|
||||||
|
|
||||||
BINDIRS := data
|
|
||||||
GFXDIRS := graphics
|
|
||||||
|
|
||||||
include ../../Makefile.example.blocksds
|
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
NITRO_ENGINE=../../..
|
||||||
ASSETS=$NITRO_ENGINE/examples/assets
|
ASSETS=$NITRO_ENGINE/examples/assets
|
||||||
TOOLS=$NITRO_ENGINE/tools
|
TOOLS=$NITRO_ENGINE/tools
|
||||||
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
||||||
|
Binary file not shown.
@ -52,7 +52,7 @@ int main(int argc, char *argv[])
|
|||||||
// Load mesh from RAM and assign it to the object "Model".
|
// Load mesh from RAM and assign it to the object "Model".
|
||||||
NE_ModelLoadStaticMesh(Scene.Model, sphere_vertex_colors_bin);
|
NE_ModelLoadStaticMesh(Scene.Model, sphere_vertex_colors_bin);
|
||||||
// Load a RGB texture from RAM and assign it to "Material".
|
// Load a RGB texture from RAM and assign it to "Material".
|
||||||
NE_MaterialTexLoad(Material, NE_RGB5, 256, 256, NE_TEXGEN_TEXCOORD,
|
NE_MaterialTexLoad(Material, NE_A1RGB5, 256, 256, NE_TEXGEN_TEXCOORD,
|
||||||
textureBitmap);
|
textureBitmap);
|
||||||
|
|
||||||
// Assign texture to model...
|
// Assign texture to model...
|
||||||
|
@ -1,220 +1,6 @@
|
|||||||
#---------------------------------------------------------------------------------
|
# This is a minimal makefile only used for the examples. If you want a makefile
|
||||||
.SUFFIXES:
|
# for your project, take one from the templates inside examples/templates.
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ifeq ($(strip $(DEVKITARM)),)
|
BINDIRS := data
|
||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(DEVKITARM)/ds_rules
|
include ../../Makefile.example
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 :=
|
|
||||||
|
|
||||||
# These set the information text in the nds file
|
|
||||||
GAME_TITLE := $(shell basename $(CURDIR))
|
|
||||||
GAME_SUBTITLE1 := Nitro Engine example
|
|
||||||
GAME_SUBTITLE2 := github.com/AntonioND/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := -lNE -lfat -lnds9
|
|
||||||
|
|
||||||
# automatigically add libraries for NitroFS
|
|
||||||
ifneq ($(strip $(NITRO)),)
|
|
||||||
LIBS := -lfilesystem -lfat $(LIBS)
|
|
||||||
endif
|
|
||||||
# automagically add maxmod library
|
|
||||||
ifneq ($(strip $(AUDIO)),)
|
|
||||||
LIBS := -lmm9 $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# list of directories containing libraries, this must be the top level containing
|
|
||||||
# include and lib
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 $(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
|
|
||||||
#---------------------------------------------------------------------------------------
|
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
# This is a minimal makefile only used for the examples. If you want a makefile
|
|
||||||
# for your project, take one from the templates inside examples/templates.
|
|
||||||
|
|
||||||
BINDIRS := data
|
|
||||||
|
|
||||||
include ../../Makefile.example.blocksds
|
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
NITRO_ENGINE=../../..
|
||||||
ASSETS=$NITRO_ENGINE/examples/assets
|
ASSETS=$NITRO_ENGINE/examples/assets
|
||||||
TOOLS=$NITRO_ENGINE/tools
|
TOOLS=$NITRO_ENGINE/tools
|
||||||
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
||||||
|
Binary file not shown.
@ -1,220 +1,6 @@
|
|||||||
#---------------------------------------------------------------------------------
|
# This is a minimal makefile only used for the examples. If you want a makefile
|
||||||
.SUFFIXES:
|
# for your project, take one from the templates inside examples/templates.
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ifeq ($(strip $(DEVKITARM)),)
|
GFXDIRS := graphics
|
||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(DEVKITARM)/ds_rules
|
include ../../Makefile.example
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 :=
|
|
||||||
GRAPHICS := graphics
|
|
||||||
AUDIO :=
|
|
||||||
ICON :=
|
|
||||||
|
|
||||||
# specify a directory which contains the nitro filesystem
|
|
||||||
# this is relative to the Makefile
|
|
||||||
NITRO :=
|
|
||||||
|
|
||||||
# These set the information text in the nds file
|
|
||||||
GAME_TITLE := $(shell basename $(CURDIR))
|
|
||||||
GAME_SUBTITLE1 := Nitro Engine example
|
|
||||||
GAME_SUBTITLE2 := github.com/AntonioND/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := -lNE -lfat -lnds9
|
|
||||||
|
|
||||||
# automatigically add libraries for NitroFS
|
|
||||||
ifneq ($(strip $(NITRO)),)
|
|
||||||
LIBS := -lfilesystem -lfat $(LIBS)
|
|
||||||
endif
|
|
||||||
# automagically add maxmod library
|
|
||||||
ifneq ($(strip $(AUDIO)),)
|
|
||||||
LIBS := -lmm9 $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# list of directories containing libraries, this must be the top level containing
|
|
||||||
# include and lib
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 $(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
|
|
||||||
#---------------------------------------------------------------------------------------
|
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
# This is a minimal makefile only used for the examples. If you want a makefile
|
|
||||||
# for your project, take one from the templates inside examples/templates.
|
|
||||||
|
|
||||||
GFXDIRS := graphics
|
|
||||||
|
|
||||||
include ../../Makefile.example.blocksds
|
|
@ -1,220 +1,7 @@
|
|||||||
#---------------------------------------------------------------------------------
|
# This is a minimal makefile only used for the examples. If you want a makefile
|
||||||
.SUFFIXES:
|
# for your project, take one from the templates inside examples/templates.
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ifeq ($(strip $(DEVKITARM)),)
|
BINDIRS := data
|
||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
GFXDIRS := graphics
|
||||||
endif
|
|
||||||
|
|
||||||
include $(DEVKITARM)/ds_rules
|
include ../../Makefile.example
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := graphics
|
|
||||||
AUDIO :=
|
|
||||||
ICON :=
|
|
||||||
|
|
||||||
# specify a directory which contains the nitro filesystem
|
|
||||||
# this is relative to the Makefile
|
|
||||||
NITRO :=
|
|
||||||
|
|
||||||
# These set the information text in the nds file
|
|
||||||
GAME_TITLE := $(shell basename $(CURDIR))
|
|
||||||
GAME_SUBTITLE1 := Nitro Engine example
|
|
||||||
GAME_SUBTITLE2 := github.com/AntonioND/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := -lNE -lfat -lnds9
|
|
||||||
|
|
||||||
# automatigically add libraries for NitroFS
|
|
||||||
ifneq ($(strip $(NITRO)),)
|
|
||||||
LIBS := -lfilesystem -lfat $(LIBS)
|
|
||||||
endif
|
|
||||||
# automagically add maxmod library
|
|
||||||
ifneq ($(strip $(AUDIO)),)
|
|
||||||
LIBS := -lmm9 $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# list of directories containing libraries, this must be the top level containing
|
|
||||||
# include and lib
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 $(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
|
|
||||||
#---------------------------------------------------------------------------------------
|
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
# This is a minimal makefile only used for the examples. If you want a makefile
|
|
||||||
# for your project, take one from the templates inside examples/templates.
|
|
||||||
|
|
||||||
BINDIRS := data
|
|
||||||
GFXDIRS := graphics
|
|
||||||
|
|
||||||
include ../../Makefile.example.blocksds
|
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
NITRO_ENGINE=../../..
|
||||||
ASSETS=$NITRO_ENGINE/examples/assets
|
ASSETS=$NITRO_ENGINE/examples/assets
|
||||||
TOOLS=$NITRO_ENGINE/tools
|
TOOLS=$NITRO_ENGINE/tools
|
||||||
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
||||||
|
Binary file not shown.
@ -62,7 +62,7 @@ int main(int argc, char *argv[])
|
|||||||
// Load mesh from RAM and assign it to the object "Model".
|
// Load mesh from RAM and assign it to the object "Model".
|
||||||
NE_ModelLoadStaticMesh(Scene.Model, robot_bin);
|
NE_ModelLoadStaticMesh(Scene.Model, robot_bin);
|
||||||
// Load a RGB texture from RAM and assign it to "Material".
|
// Load a RGB texture from RAM and assign it to "Material".
|
||||||
NE_MaterialTexLoad(Material, NE_RGB5, 256, 256, NE_TEXGEN_TEXCOORD,
|
NE_MaterialTexLoad(Material, NE_A1RGB5, 256, 256, NE_TEXGEN_TEXCOORD,
|
||||||
textureBitmap);
|
textureBitmap);
|
||||||
|
|
||||||
// Assign texture to model...
|
// Assign texture to model...
|
||||||
|
@ -1,5 +1,25 @@
|
|||||||
SUBDIRS:= `ls`
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
#
|
||||||
|
# SPDX-FileContributor: Antonio Niño Díaz, 2023-2024
|
||||||
|
|
||||||
|
.PHONY: all clean
|
||||||
|
|
||||||
|
MAKE := make
|
||||||
|
|
||||||
all:
|
all:
|
||||||
@for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i || { exit 1;} fi; done;
|
@for i in `ls`; do \
|
||||||
|
if test -e $$i/Makefile ; then \
|
||||||
|
cd $$i; \
|
||||||
|
$(MAKE) --no-print-directory || exit 1 ; \
|
||||||
|
cd ..; \
|
||||||
|
fi; \
|
||||||
|
done;
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i clean || { exit 1;} fi; done;
|
@for i in `ls`; do \
|
||||||
|
if test -e $$i/Makefile ; then \
|
||||||
|
cd $$i; \
|
||||||
|
$(MAKE) clean --no-print-directory || exit 1 ; \
|
||||||
|
cd ..; \
|
||||||
|
fi; \
|
||||||
|
done;
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
# SPDX-License-Identifier: CC0-1.0
|
|
||||||
#
|
|
||||||
# SPDX-FileContributor: Antonio Niño Díaz, 2023
|
|
||||||
|
|
||||||
.PHONY: all clean
|
|
||||||
|
|
||||||
MAKE := make
|
|
||||||
|
|
||||||
all:
|
|
||||||
@for i in `ls`; do \
|
|
||||||
if test -e $$i/Makefile.blocksds ; then \
|
|
||||||
cd $$i; \
|
|
||||||
$(MAKE) -f Makefile.blocksds --no-print-directory || { exit 1;}; \
|
|
||||||
cd ..; \
|
|
||||||
fi; \
|
|
||||||
done;
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@for i in `ls`; do \
|
|
||||||
if test -e $$i/Makefile.blocksds ; then \
|
|
||||||
cd $$i; \
|
|
||||||
$(MAKE) -f Makefile.blocksds clean --no-print-directory || { exit 1;}; \
|
|
||||||
cd ..; \
|
|
||||||
fi; \
|
|
||||||
done;
|
|
@ -1,220 +1,7 @@
|
|||||||
#---------------------------------------------------------------------------------
|
# This is a minimal makefile only used for the examples. If you want a makefile
|
||||||
.SUFFIXES:
|
# for your project, take one from the templates inside examples/templates.
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ifeq ($(strip $(DEVKITARM)),)
|
BINDIRS := data
|
||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
GFXDIRS := graphics
|
||||||
endif
|
|
||||||
|
|
||||||
include $(DEVKITARM)/ds_rules
|
include ../../Makefile.example
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := graphics
|
|
||||||
AUDIO :=
|
|
||||||
ICON :=
|
|
||||||
|
|
||||||
# specify a directory which contains the nitro filesystem
|
|
||||||
# this is relative to the Makefile
|
|
||||||
NITRO :=
|
|
||||||
|
|
||||||
# These set the information text in the nds file
|
|
||||||
GAME_TITLE := $(shell basename $(CURDIR))
|
|
||||||
GAME_SUBTITLE1 := Nitro Engine example
|
|
||||||
GAME_SUBTITLE2 := github.com/AntonioND/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 := -lNE -lfat -lnds9
|
|
||||||
|
|
||||||
# automatigically add libraries for NitroFS
|
|
||||||
ifneq ($(strip $(NITRO)),)
|
|
||||||
LIBS := -lfilesystem -lfat $(LIBS)
|
|
||||||
endif
|
|
||||||
# automagically add maxmod library
|
|
||||||
ifneq ($(strip $(AUDIO)),)
|
|
||||||
LIBS := -lmm9 $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# list of directories containing libraries, this must be the top level containing
|
|
||||||
# include and lib
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
LIBDIRS := $(LIBNDS) $(PORTLIBS) $(DEVKITPRO)/nitro-engine
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# 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 $(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
|
|
||||||
#---------------------------------------------------------------------------------------
|
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
# This is a minimal makefile only used for the examples. If you want a makefile
|
|
||||||
# for your project, take one from the templates inside examples/templates.
|
|
||||||
|
|
||||||
BINDIRS := data
|
|
||||||
GFXDIRS := graphics
|
|
||||||
|
|
||||||
include ../../Makefile.example.blocksds
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user