diff --git a/Makefile b/Makefile index eb4886941..38848b5f9 100644 --- a/Makefile +++ b/Makefile @@ -73,7 +73,7 @@ dist-no-debug: all cp fusee/fusee-secondary/fusee-secondary-experimental.bin atmosphere-$(AMSVER)/atmosphere/fusee-secondary.bin cp fusee/fusee-secondary/fusee-secondary-experimental.bin atmosphere-$(AMSVER)/sept/payload.bin cp sept/sept-primary/sept-primary.bin atmosphere-$(AMSVER)/sept/sept-primary.bin - cp sept/sept-secondary/sept-secondary.bin atmosphere-$(AMSVER)/sept/sept-secondary.bin + cp sept/sept-secondary/sept-secondary.bin atmosphere-$(AMSVER)/sept/sept-secondary.bin || true cp sept/sept-secondary/sept-secondary_00.enc atmosphere-$(AMSVER)/sept/sept-secondary_00.enc cp sept/sept-secondary/sept-secondary_01.enc atmosphere-$(AMSVER)/sept/sept-secondary_01.enc cp sept/sept-secondary/sept-secondary_dev_00.enc atmosphere-$(AMSVER)/sept/sept-secondary_dev_00.enc @@ -126,7 +126,7 @@ dist: dist-no-debug cp fusee/fusee-mtc/fusee-mtc.elf atmosphere-$(AMSVER)-debug/fusee-mtc.elf cp fusee/fusee-secondary/fusee-secondary-experimental.elf atmosphere-$(AMSVER)-debug/fusee-secondary.elf cp sept/sept-primary/sept-primary.elf atmosphere-$(AMSVER)-debug/sept-primary.elf - cp sept/sept-secondary/sept-secondary.elf atmosphere-$(AMSVER)-debug/sept-secondary.elf + cp sept/sept-secondary/sept-secondary.elf atmosphere-$(AMSVER)-debug/sept-secondary.elf || true cp sept/sept-secondary/key_derivation/key_derivation.elf atmosphere-$(AMSVER)-debug/sept-secondary-key-derivation.elf cp exosphere/loader_stub/loader_stub.elf atmosphere-$(AMSVER)-debug/exosphere-loader-stub.elf cp exosphere/program/program.elf atmosphere-$(AMSVER)-debug/exosphere-program.elf diff --git a/exosphere/Makefile b/exosphere/Makefile index 6ce912754..9884554f3 100644 --- a/exosphere/Makefile +++ b/exosphere/Makefile @@ -5,14 +5,17 @@ define ATMOSPHERE_ADD_TARGET ATMOSPHERE_BUILD_CONFIGS += $(strip $1) -$(strip $1): exosphere$(strip $2).bin check_warmboot_$(strip $1) - @cp warmboot/warmboot$(strip $2).bin warmboot$(strip $2).bin +$(strip $1): exosphere$(strip $2).bin warmboot$(strip $2).bin exosphere$(strip $2).bin: loader_stub/loader_stub$(strip $2).bin @cp loader_stub/loader_stub$(strip $2).bin exosphere$(strip $2).bin @printf LENY >> exosphere$(strip $2).bin @echo "Built exosphere$(strip $2).bin..." +warmboot$(strip $2).bin: warmboot/warmboot$(strip $2).bin + @cp warmboot/warmboot$(strip $2).bin warmboot$(strip $2).bin + @echo "Built warmboot$(strip $2).bin..." + check_program_$(strip $1): @$$(MAKE) -C program $(strip $1) @@ -22,6 +25,8 @@ check_warmboot_$(strip $1): loader_stub/loader_stub$(strip $2).bin: check_program_$(strip $1) @$$(MAKE) -C loader_stub $(strip $1) +warmboot/warmboot$(strip $2).bin: check_warmboot_$(strip $1) + clean-$(strip $1): clean-program-$(strip $1) clean-loader_stub-$(strip $1) clean-warmboot-$(strip $1) @rm -rf exosphere$(strip $2).bin warmboot$(strip $2).bin diff --git a/fusee/fusee-secondary/Makefile b/fusee/fusee-secondary/Makefile index 62520cc2c..ffe4b323f 100644 --- a/fusee/fusee-secondary/Makefile +++ b/fusee/fusee-secondary/Makefile @@ -216,7 +216,7 @@ sept_primary.bin.o sept_primary_bin.h: sept-primary.bin @echo $(notdir $<) @$(_bin2o) -sept_secondary_00.enc.o sept_secondary_00.h: sept-secondary_00.enc +sept_secondary_00.enc.o sept_secondary_00_enc.h: sept-secondary_00.enc #--------------------------------------------------------------------------------- @echo $(notdir $<) @$(_bin2o) diff --git a/sept/sept-secondary/Makefile b/sept/sept-secondary/Makefile index 93624f79e..7eade86fd 100644 --- a/sept/sept-secondary/Makefile +++ b/sept/sept-secondary/Makefile @@ -123,15 +123,24 @@ check_rebootstub: check_key_derivation: @$(MAKE) -C key_derivation -$(BUILD): check_rebootstub check_key_derivation ifeq ($(strip $(SEPT_00_ENC_PATH)),) +$(BUILD): check_rebootstub check_key_derivation @[ -d $@ ] || mkdir -p $@ @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile else +$(BUILD): $(TOPDIR)/$(TARGET)_00.enc $(TOPDIR)/$(TARGET)_01.enc $(TOPDIR)/$(TARGET)_dev_00.enc $(TOPDIR)/$(TARGET)_dev_01.enc @touch $(TOPDIR)/$(TARGET).bin + +$(TOPDIR)/$(TARGET)_00.enc: $(SEPT_00_ENC_PATH) @cp $(SEPT_00_ENC_PATH) $(TOPDIR)/$(TARGET)_00.enc + +$(TOPDIR)/$(TARGET)_01.enc: $(SEPT_01_ENC_PATH) @cp $(SEPT_01_ENC_PATH) $(TOPDIR)/$(TARGET)_01.enc + +$(TOPDIR)/$(TARGET)_dev_00.enc: $(SEPT_DEV_00_ENC_PATH) @cp $(SEPT_DEV_00_ENC_PATH) $(TOPDIR)/$(TARGET)_dev_00.enc + +$(TOPDIR)/$(TARGET)_dev_01.enc: $(SEPT_DEV_01_ENC_PATH) @cp $(SEPT_DEV_01_ENC_PATH) $(TOPDIR)/$(TARGET)_dev_01.enc endif diff --git a/stratosphere/boot/Makefile b/stratosphere/boot/Makefile index 40b971879..471a79260 100644 --- a/stratosphere/boot/Makefile +++ b/stratosphere/boot/Makefile @@ -24,16 +24,6 @@ SFILES := $(call FIND_SOURCE_FILES,$(SOURCES),s) BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) fusee-primary.bin -#--------------------------------------------------------------------------------- -# boot has a custom bin2o rule for fusee-primary -> fusee_primary -#--------------------------------------------------------------------------------- -define _bin2o - bin2s $< | $(AS) -o $(@) - echo "extern const u8" `(echo $( `(echo $(> `(echo $(> `(echo $( fusee_primary +#--------------------------------------------------------------------------------- +define _bin2o + bin2s $< | $(AS) -o $(@) + echo "extern const u8" `(echo $( `(echo $(> `(echo $(> `(echo $( #include "boot_power_utils.hpp" #include "boot_pmic_driver.hpp" -#include "fusee-primary_bin.h" +#include "fusee_primary_bin.h" namespace ams::boot {