]> Chaos Git - corbenik/corbenik.git/commitdiff
Fixups to build system v0.1.1
authorchaoskagami <chaos.kagami@gmail.com>
Tue, 21 Jun 2016 21:17:12 +0000 (17:17 -0400)
committerchaoskagami <chaos.kagami@gmail.com>
Tue, 21 Jun 2016 21:17:12 +0000 (17:17 -0400)
Makefile
external/Makefile
source/chain.c
source/menu.c

index 16337508969a3cabb1a9c718e508ae9de15b6d70..76e916f4492d4573cb7f425a14c7608ec5800a3f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -26,10 +26,11 @@ dir_out    := out
 REVISION := $(shell git rev-parse HEAD | head -c10)+$(shell git rev-list --count HEAD)
 REL ?= master
 
-EXTRA ?= -DCHAINLOADER=1
+# Default to enabling chainloader.
+CHAINLOADER ?= 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)\" $(EXTRA)
+CROSS_CFLAGS  := -MMD -MP -Wall -Wextra -Werror -fomit-frame-pointer -Os $(ASFLAGS) -fshort-wchar -fno-builtin -std=gnu11 -DVERSION=\"$(REVISION)\" -DREL=\"$(REL)\" -DCHAINLOADER=$(CHAINLOADER)
 CROSS_FLAGS   := dir_out=$(abspath $(dir_out)) --no-print-directory
 CROSS_LDFLAGS := -nostdlib -Wl,-z,defs -lgcc -Wl,-Map,$(dir_build)/link.map
 
@@ -37,6 +38,17 @@ objects_cfw = $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \
                          $(patsubst $(dir_source)/%.c, $(dir_build)/%.o, \
                          $(call rwildcard, $(dir_source), *.s *.c)))
 
+.PHONY: release
+release:
+       mkdir -p rel
+       make clean
+       make CHAINLOADER=0 REL=$(REL) full
+       mv out/release.zip rel/release-nochain.zip
+       cat out/release.zip.sha512 | sed 's/release.zip/release-nochain.zip/' > rel/release-nochain.zip.sha512
+       make clean
+       make CHAINLOADER=1 REL=$(REL) full
+       mv out/release.zip out/release.zip.sha512 rel/
+
 .PHONY: all
 all: hosttools font a9lh patch external
 
@@ -62,7 +74,7 @@ contrib:
 
 .PHONY: external
 external:
-       make -C external dir_out=$(dir_out) fw_folder=$(fw_folder)
+       make -C external dir_out=$(dir_out) fw_folder=$(fw_folder) CHAINLOADER=$(CHAINLOADER)
 
 .PHONY: patch
 patch:
index dbbf79a5bfdd33c04f5701155e93148e1908dbe5..dd7035da47d09a80de670434f4989a5db250b7d5 100644 (file)
@@ -7,7 +7,9 @@ all: loader bits screeninit
        cp loader/loader.cxi $(out)/module/loader.cxi
        cp bits/backdoor.bin $(out)/bits/backdoor.bin
        cp bits/emunand.bin $(out)/bits/emunand.bin
+ifeq "$(CHAINLOADER)" "1"
        cp bits/chain.bin $(out)/bits/chain.bin
+endif
        cp bits/reboot_hook.bin $(out)/bits/reboot_hook.bin
        cp bits/reboot_code.bin $(out)/bits/reboot_code.bin
        cp screeninit/build/screeninit.bin $(out)/bits/screeninit.bin
index 521ec9ad695b85b707fc1b7ef44900cd00d0af1e..2627d6671a71ae0ce36ab386019e9248d2eac9e3 100644 (file)
@@ -1,4 +1,4 @@
-#ifdef CHAINLOADER
+#if defined(CHAINLOADER) && CHAINLOADER == 1
 
 #include "common.h"
 #include "firm/firm.h"
index 85b34b2d343062639d08d9faeab6ecc7de931bf8..608472244bd5536f9c9b0d5ef56399f364b5b8bf 100644 (file)
@@ -300,7 +300,7 @@ poweroff()
         ;
 }
 
-#ifdef CHAINLOADER
+#if defined(CHAINLOADER) && CHAINLOADER == 1
 void chainload_menu();
 #endif
 
@@ -312,7 +312,7 @@ static struct options_s main_s[] = {
     { 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
+#if defined(CHAINLOADER) && CHAINLOADER == 1
     { 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 },