The project’s makefile controls different features and settings for the output program. Additional rules can be added to build different components as well.
To edit these options, open the
makefile file inside the project’s folder in a text editor.
This is the name of the program that will be stored on the calculator.
NAME = PRGM
Icons make a more polished program that can be displayed in shells such as Cesium.
Icons are a 16x16 pixel image - provide the relative path to the image from the makefile via the
ICON = icon.png
DESCRIPTION to the program’s description.
It is recommended to keep this under 25 characters.
The description will be displayed in shells such as Cesium.
DESCRIPTION = "My awesome program"
Programs can tend to be quite large from a variety of factors such as sprites, bloated code, or other issues. The toolchain offers the ability to compress programs into a self-extracting executable. This does not change the execution size, but rather the executable’s storage size.
To enable this feature, open the project’s makefile and edit the line:
COMPRESSED = YES
Specifies the type of program compression to perform.
The default is
zx0 can also be used.
zx0 takes more time to compress, but usually has better results.
COMPRESSED_MODE = zx7
Programs can be built to be stored in the archive rather than RAM. To enable this feature, open the project’s makefile and change the line:
ARCHIVED = YES
Outputs a <name>.map file into the
bin directory that includes section, variable, and function addressing/size information of the compiled program.
To speed up linking this step can be disabled.
OUTPUT_MAP = YES
CFLAGS / CXXFLAGS
These flags are passed to the compiler.
CFLAGS is used for C source files,
CXXFLAGS is used for C++ source files.
CFLAGS = -Wall -Wextra -Oz CXXFLAGS = -Wall -Wextra -Oz
This option enables link-time optimization.
Depending on the program this can reduce the output size.
LTO = YES
These flags are passed directly to the fasmg linker.
Prefer the builtin OS CRT (Compiler-Run-Time) functions if they exist.
This can help to decrease the output size in some circumstances, as a select number of CRT functions will execute from flash.
PREFER_OS_CRT = NO
Prefer the builtin OS LIBC functions if they exist.
This can help to decrease the output size in some circumstances, as a select number of LIBC functions will execute from flash.
PREFER_OS_LIBC = YES
Space separated list of
libload libraries to mark as optional in the program.
If an optional library is not present on the device, the program will still execute and not be blocked from running by
libload, however calls to the library’s functions will crash the program.
If this option is left blank, libraries supplied to the function
libload_IsLibLoadedwill be automatically marked as optional.
Libraries specified by this option are forced to be optional, regardless of
See the libload library documentation for more information.
LIBLOAD_OPTIONAL = graphx fileioc
Extra C source files to be compiled in that are not located in the source directory.
EXTRA_C_SOURCES = <space separated list of sources>
Extra C++ source files to be compiled in that are not located in the source directory.
EXTRA_CXX_SOURCES = <space separated list of sources>
Extra assembly source files to be compiled in that are not located in the source directory.
EXTRA_ASM_SOURCES = <space separated list of sources>
Extra header files to be used in that are not located in the source directory.
EXTRA_HEADERS = <space separated list of headers>
Extra libload (
.lib) libraries to be added at link time.
EXTRA_LIBLOAD_LIBS = <space separated list of libraries>
Extra command(s) to run when
make clean is executed.
This is the command that is run when
make gfx is executed.
It can be overridden to perform any custom graphics conversions.
The default command navigates to the graphics directory and runs
MAKE_GFX = cd $(GFXDIR) && $(CONVIMG)
Add any files that you want to be built by the toolchain to this variable. Define rules for the files after including the main CEdev makefile.
DEPS = $(BINDIR)/levelpack.bin include $(shell cedev-config --makefile) $(BINDIR)/levelpack.bin: $(call MKDIR,$(@D)) echo "levelpack" > $(BINDIR)/levelpack.bin