REVISION := $(shell git rev-parse HEAD | head -c10)+$(shell git rev-list --count HEAD)
REL ?= master
+EXTRA ?= -DCHAINLOADER=1
+
CROSS_ASFLAGS := -mlittle-endian -mcpu=arm946e-s -march=armv5te
-CROSS_CFLAGS := -MMD -MP -Wall -Wextra -Werror -fomit-frame-pointer -Os $(ASFLAGS) -fshort-wchar -fno-builtin -std=gnu11 -DVERSION=\"$(REVISION)\" -DREL=\"$(REL)\"
+CROSS_CFLAGS := -MMD -MP -Wall -Wextra -Werror -fomit-frame-pointer -Os $(ASFLAGS) -fshort-wchar -fno-builtin -std=gnu11 -DVERSION=\"$(REVISION)\" -DREL=\"$(REL)\" $(EXTRA)
CROSS_FLAGS := dir_out=$(abspath $(dir_out)) --no-print-directory
CROSS_LDFLAGS := -nostdlib -Wl,-z,defs -lgcc -Wl,-Map,$(dir_build)/link.map
;
}
+#ifdef CHAINLOADER
void chainload_menu();
+#endif
static struct options_s main_s[] = {
{ 0, "Options", "Internal options for the CFW. These are part of Corbenik itself.", call_fun, (uint32_t)menu_options, 0 },
{ 0, "Reboot", "Reboots the console.", call_fun, (uint32_t)reset, 0 },
{ 0, "Power off", "Powers off the console.", call_fun, (uint32_t)poweroff, 0 },
{ 0, "Save Configuration", "Save the configuration. You must do this prior to booting, otherwise nothing is done.", call_fun, (uint32_t)save_config, 0 },
+#ifdef CHAINLOADER
{ 0, "Chainload", "Boot another ARM9 payload file.", call_fun, (uint32_t)chainload_menu, 0 },
+#endif
{ 0, "Boot Firmware", "Generates caches, patches the firmware, and boots it.", break_menu, 0, 0 },
// Sentinel.