-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
80 lines (55 loc) · 2.49 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
ifeq ($(strip $(DEVKITARM)),)
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
endif
ifeq ($(strip $(CTRULIB)),)
$(error "Please set CTRULIB in your environment. export DEVKITARM=<path to>ctrulib/libctru")
endif
ifeq ($(filter $(DEVKITARM)/bin,$(PATH)),)
export PATH:=$(DEVKITARM)/bin:$(PATH)
endif
export HOME := $(CURDIR)
# FIRMVERSION = OLD_MEMMAP
# FIRMVERSION = NEW_MEMMAP
# CNVERSION = WEST
# CNVERSION = JPN
export FIRMVERSION
export CNVERSION
OUTNAME = $(FIRMVERSION)_$(CNVERSION)
SCRIPTS = "scripts"
.PHONY: directories all build/constants firm_constants/constants.txt cn_constants/constants.txt cn_qr_initial_loader/cn_qr_initial_loader.bin.png cn_save_initial_loader/cn_save_initial_loader.bin cn_secondary_payload/cn_secondary_payload.bin
all: directories build/constants q/$(OUTNAME).png p/$(OUTNAME).bin build/cn_save_initial_loader.bin
directories:
@mkdir -p build && mkdir -p build/cro
@mkdir -p p
@mkdir -p q
q/$(OUTNAME).png: build/cn_qr_initial_loader.bin.png
@cp build/cn_qr_initial_loader.bin.png q/$(OUTNAME).png
p/$(OUTNAME).bin: build/cn_secondary_payload.bin
@cp build/cn_secondary_payload.bin p/$(OUTNAME).bin
firm_constants/constants.txt:
@cd firm_constants && make
cn_constants/constants.txt:
@cd cn_constants && make
build/constants: firm_constants/constants.txt cn_constants/constants.txt
@python $(SCRIPTS)/makeHeaders.py $(FIRMVERSION) $(CNVERSION) build/constants $^
build/cn_qr_initial_loader.bin.png: cn_qr_initial_loader/cn_qr_initial_loader.bin.png
@cp cn_qr_initial_loader/cn_qr_initial_loader.bin.png build
cn_qr_initial_loader/cn_qr_initial_loader.bin.png:
@cd cn_qr_initial_loader && make
build/cn_save_initial_loader.bin: cn_save_initial_loader/cn_save_initial_loader.bin
@cp cn_save_initial_loader/cn_save_initial_loader.bin build
cn_save_initial_loader/cn_save_initial_loader.bin:
@cd cn_save_initial_loader && make
build/cn_secondary_payload.bin: cn_secondary_payload/cn_secondary_payload.bin
@python $(SCRIPTS)/blowfish.py cn_secondary_payload/cn_secondary_payload.bin build/cn_secondary_payload.bin scripts
cn_secondary_payload/cn_secondary_payload.bin: build/cn_save_initial_loader.bin
@cp build/cn_save_initial_loader.bin cn_secondary_payload/data
@cd cn_secondary_payload && make
clean:
@rm -rf build/*
@cd firm_constants && make clean
@cd cn_constants && make clean
@cd cn_qr_initial_loader && make clean
@cd cn_save_initial_loader && make clean
@cd cn_secondary_payload && make clean
@echo "all cleaned up !"