forked from Hartie95/BootCtr9
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (43 loc) · 1.62 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
.PHONY : all hax firm0 firm1 sector stage2 installer clean
TARGET = arm9loaderhax
PYTHON = python
INDIR = data_input
OUTDIR = data_output
all : $(OUTDIR) hax installer
hax : $(OUTDIR) firm0 firm1 sector stage2 arm9bootloader
$(OUTDIR):
@[ -d $(OUTDIR) ] || mkdir -p $(OUTDIR)
firm0 :
@cd payload_stage1 && make
@cp $(INDIR)/new3ds90.firm $(OUTDIR)/firm0.bin
@dd if=payload_stage1/payload_stage1.bin of=$(OUTDIR)/firm0.bin bs=512 seek=1922 conv=notrunc
@echo FIRM0 done!
firm1 :
@cp $(INDIR)/new3ds10.firm $(OUTDIR)/firm1.bin
@echo FIRM1 done!
sector :
@$(PYTHON) common/sector_generator.py $(INDIR)/secret_sector.bin $(INDIR)/otp.bin $(OUTDIR)/sector.bin
@echo SECTOR done!
arm9bootloader :
@echo make BOOTLOADER
@cd bootloader && make
@cp bootloader/arm9bootloader.bin $(OUTDIR)/arm9bootloader.bin
@echo BOOTLOADER done!
stage2:
@cd payload_stage2 && make
@dd if=payload_stage2/payload_stage2.bin of=$(OUTDIR)/firm1.bin bs=512 seek=1936 conv=notrunc
@cp payload_stage2/payload_stage2.bin $(OUTDIR)/stage0x5C000.bin
installer:
@cp $(OUTDIR)/sector.bin payload_installer/brahma2/data/sector.bin
@cp $(OUTDIR)/firm0.bin payload_installer/brahma2/data/firm0.bin
@cp $(OUTDIR)/firm1.bin payload_installer/brahma2/data/firm1.bin
@cp $(OUTDIR)/stage0x5C000.bin payload_installer/brahma2/data/stage2.bin
@cd payload_installer && make TARGET=../$(OUTDIR)/$(TARGET)
@echo INSTALLER done!
clean:
@echo clean...
@cd payload_stage1 && make clean
@cd payload_stage2 && make clean
@cd bootloader && make clean
@cd payload_installer && make clean TARGET=../$(TARGET)
@rm -fr $(OUTDIR) payload_installer/brahma2/data/*.bin