Makefile Options

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.

Output Configuration

NAME

This is the name of the program that will be stored on the calculator.

NAME = PRGM

ICON

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 option.

ICON = icon.png

DESCRIPTION

Change 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"

COMPRESSED

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

ARCHIVED

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

OUTPUT_MAP

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. Default: YES.

OUTPUT_MAP = YES

Compiler Configuration

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

LTO

This option enables link-time optimization. Depending on the program this can reduce the output size. Default: YES.

LTO = YES

PREFER_OS_CRT

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. Default: NO.

PREFER_OS_CRT = NO

PREFER_OS_LIBC

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. Default: YES.

PREFER_OS_LIBC = YES

Miscellaneous Configuration

DEPS

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