forked from Atmosphere-NX/Atmosphere
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
154 lines (127 loc) · 6.24 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
ATMOSPHERE_BUILD_CONFIGS :=
all: nx_release
clean: clean-nx_release
THIS_MAKEFILE := $(abspath $(lastword $(MAKEFILE_LIST)))
CURRENT_DIRECTORY := $(abspath $(dir $(THIS_MAKEFILE)))
define ATMOSPHERE_ADD_TARGET
ATMOSPHERE_BUILD_CONFIGS += $(strip $1)
$(strip $1):
@echo "Building $(strip $1)"
@$$(MAKE) -f $(CURRENT_DIRECTORY)/atmosphere.mk ATMOSPHERE_MAKEFILE_TARGET="$(strip $1)" ATMOSPHERE_BUILD_NAME="$(strip $2)" ATMOSPHERE_BOARD="$(strip $3)" ATMOSPHERE_CPU="$(strip $4)" $(strip $5)
clean-$(strip $1):
@echo "Cleaning $(strip $1)"
@$$(MAKE) -f $(CURRENT_DIRECTORY)/atmosphere.mk clean ATMOSPHERE_MAKEFILE_TARGET="$(strip $1)" ATMOSPHERE_BUILD_NAME="$(strip $2)" ATMOSPHERE_BOARD="$(strip $3)" ATMOSPHERE_CPU="$(strip $4)" $(strip $5)
endef
define ATMOSPHERE_ADD_TARGETS
$(eval $(call ATMOSPHERE_ADD_TARGET, $(strip $1)_release, release, $(strip $2), $(strip $3), \
ATMOSPHERE_BUILD_SETTINGS="$(strip $4)" \
))
$(eval $(call ATMOSPHERE_ADD_TARGET, $(strip $1)_debug, debug, $(strip $2), $(strip $3), \
ATMOSPHERE_BUILD_SETTINGS="$(strip $4) -DAMS_BUILD_FOR_DEBUGGING" ATMOSPHERE_BUILD_FOR_DEBUGGING=1 \
))
$(eval $(call ATMOSPHERE_ADD_TARGET, $(strip $1)_audit, audit, $(strip $2), $(strip $3), \
ATMOSPHERE_BUILD_SETTINGS="$(strip $4) -DAMS_BUILD_FOR_AUDITING" ATMOSPHERE_BUILD_FOR_DEBUGGING=1 ATMOSPHERE_BUILD_FOR_AUDITING=1 \
))
endef
$(eval $(call ATMOSPHERE_ADD_TARGETS, nx, nx-hac-001, arm-cortex-a57,))
clean-all: $(foreach config,$(ATMOSPHERE_BUILD_CONFIGS),clean-$(config))
clean-logo:
$(info ---------------------------------------------------------)
$(info Building logo in $(CURDIR))
$(info ---------------------------------------------------------)
git checkout master
python3 $(CURDIR)/stratosphere/boot/source/bmp_to_array.py
make -C $(CURDIR)/stratosphere/boot clean -j12
git checkout 8gb_DRAM
python3 $(CURDIR)/stratosphere/boot/source/bmp_to_array.py
make -C $(CURDIR)/stratosphere/boot clean -j12
git checkout master
kefir-version:
cd libraries/libstratosphere && $(MAKE) -j12 clean && cd ../../stratosphere/ams_mitm && $(MAKE) -j12 clean && cd ../.. && $(MAKE) -j12
clear:
$(MAKE) clean -j12
$(MAKE) -j12
hekate:
@echo "Building Hekate"
@cd ../hekate && git pull && make clean && make -j12
@mkdir -p /mnt/f/git/dev/_kefir/8gb/bootloader/sys/
@find /mnt/f/git/dev/_kefir/8gb/ -type f ! -name 'run.te' -delete
@cp ../hekate/output/*.bso /mnt/f/git/dev/_kefir/8gb/bootloader/sys/ || echo "Warning: No .bso files found or copy failed"
@cp ../hekate/output/nyx.bin /mnt/f/git/dev/_kefir/8gb/bootloader/sys/nyx.bin || echo "Warning: nyx.bin not found or copy failed"
@cp ../hekate/output/payload.bin /mnt/f/git/dev/_kefir/8gb/payload.bin || echo "Warning: payload.bin not found or copy failed"
8gb_DRAM:
$(info ---------------------------------------------------------)
$(info Built with 8GB DRAM!)
$(info ---------------------------------------------------------)
git checkout 8gb_DRAM
git merge master --no-edit
$(MAKE) -f atmosphere.mk package3 -j12
$(MAKE) -C fusee -j12
$(MAKE) hekate
mkdir -p /mnt/f/git/dev/_kefir/8gb/atmosphere/
mkdir -p /mnt/f/git/dev/_kefir/8gb/bootloader/payloads/
cp fusee/out/nintendo_nx_arm_armv4t/release/package3 /mnt/f/git/dev/_kefir/8gb/atmosphere/package3
cp fusee/out/nintendo_nx_arm_armv4t/release/fusee.bin /mnt/f/git/dev/_kefir/8gb/bootloader/payloads/fusee.bin
python utilities/insert_splash_screen.py ~/dev/_kefir/bootlogo/splash_logo.png /mnt/f/git/dev/_kefir/8gb/atmosphere/package3
$(info ---------------------------------------------------------)
$(info FINISH building with 8GB DRAM!)
$(info ---------------------------------------------------------)
git checkout master
8gb_DRAM-clean:
$(info ---------------------------------------------------------)
$(info Built with 8GB DRAM!)
$(info ---------------------------------------------------------)
git checkout 8gb_DRAM
git merge master --no-edit
$(MAKE) clean -j12
$(MAKE) -f atmosphere.mk package3 -j12
$(MAKE) -C fusee -j12
$(MAKE) hekate
mkdir -p /mnt/f/git/dev/_kefir/8gb/atmosphere/
mkdir -p /mnt/f/git/dev/_kefir/8gb/bootloader/payloads/
cp fusee/out/nintendo_nx_arm_armv4t/release/package3 /mnt/f/git/dev/_kefir/8gb/atmosphere/package3
cp fusee/out/nintendo_nx_arm_armv4t/release/fusee.bin /mnt/f/git/dev/_kefir/8gb/bootloader/payloads/fusee.bin
python utilities/insert_splash_screen.py ~/dev/_kefir/bootlogo/splash_logo.png /mnt/f/git/dev/_kefir/8gb/atmosphere/package3
$(info ---------------------------------------------------------)
$(info FINISH building with 8GB DRAM!)
$(info ---------------------------------------------------------)
git checkout master
oc:
$(info ---------------------------------------------------------)
$(info Built with OC)
$(info ---------------------------------------------------------)
git checkout oc
git merge master --no-edit
$(MAKE) -C stratosphere/loader -j12
cp stratosphere/loader/out/nintendo_nx_arm64_armv8a/release/loader.kip /mnt/f/git/dev/_kefir/kefir/config/uberhand/packages/oc/atmosphere/kips/kefir.kip
$(info ---------------------------------------------------------)
$(info FINISH building OC!)
$(info ---------------------------------------------------------)
git checkout master
oc-clean:
$(info ---------------------------------------------------------)
$(info Built with OC)
$(info ---------------------------------------------------------)
git checkout oc
git merge master --no-edit
$(MAKE) clean -j12
$(MAKE) -C stratosphere/loader -j12
cp stratosphere/loader/out/nintendo_nx_arm64_armv8a/release/loader.kip /mnt/f/git/dev/_kefir/kefir/config/uberhand/packages/oc/atmosphere/kips/kefir.kip
$(info ---------------------------------------------------------)
$(info FINISH building OC!)
$(info ---------------------------------------------------------)
git checkout master
build-kefir:
git checkout master
$(MAKE) clean -j12
$(MAKE) clean-logo
$(MAKE) 8gb_DRAM-clean
$(MAKE) oc-clean
$(MAKE) nx_release -j12
build-kefir-fast:
git checkout master
# $(MAKE) clean-logo
$(MAKE) 8gb_DRAM
$(MAKE) oc
$(MAKE) nx_release -j12
.PHONY: all clean clean-all kefir-version $(foreach config,$(ATMOSPHERE_BUILD_CONFIGS), $(config) clean-$(config))