-
Notifications
You must be signed in to change notification settings - Fork 81
/
Makefile
125 lines (101 loc) · 4.19 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
# Copyright (C) 2015 The PASTA Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
CODE_FILE := code.bin
SYS_PATH := rxTools/sys
SET_SYS_PATH := SYS_PATH=$(SYS_PATH)
export PATCHES_PATH := $(SYS_PATH)/patches
SET_CODE_PATH := CODE_PATH=$(SYS_PATH)/$(CODE_FILE)
SET_DATNAME := DATNAME=$(SYS_PATH)/$(CODE_FILE)
export INCDIR := -I$(CURDIR)/include
export RXTOOLSMK := $(CURDIR)/common.mk
export GIT_VERSION := $(shell git rev-parse --short HEAD)
ifeq ($(GIT_VERSION),)
GIT_VERSION := "N/A"
endif
CFLAGS = -std=c11 -O2 -Wall -Wextra
ROPFLAGS = $(SET_DATNAME) DISPNAME=rxTools GRAPHICS=../logo
BRAHFLAGS = name=$(CODE_FILE) filepath=$(SYS_PATH)/ \
APP_TITLE='rxTools' \
APP_DESCRIPTION='Roxas75 3DS Toolkit & Custom Firmware' \
APP_AUTHOR='Patois, et al.' \
ICON=$(abspath icon.png)
.PHONY: all-target-patches all-target-theme all-target-mset all-target-brahma \
reboot/reboot.bin clean distclean release \
release-licenses release-doc release-lang release-patches \
release-theme release-tools release-mset release-brahma
all-target-brahma:
$(MAKE) $(BRAHFLAGS) -C CakeBrah
all-target-mset:
@$(MAKE) $(ROPFLAGS) -C CakesROP
@$(MAKE) $(SET_DATNAME) -C CakesROP/CakesROPSpider
all-target-patches: rxmode
@$(MAKE) -C $<
all-target-rxtools: rxtools
@$(MAKE) $(SET_SYS_PATH) -C $<
all-target-theme:
@$(MAKE) -C theme
reboot/reboot.bin:
$(MAKE) -C $(dir $@)
distclean:
@rm -rf release
clean: distclean
@$(MAKE) $(SET_SYS_PATH) -C rxtools clean
@$(MAKE) -C rxmode clean
@$(MAKE) -C reboot clean
@$(MAKE) $(BRAHFLAGS) -C CakeBrah clean
@$(MAKE) -C theme clean
@$(MAKE) $(ROPFLAGS) -C CakesROP clean
@$(MAKE) $(SET_DATNAME) -C CakesROP/CakesROPSpider clean
release: release-licenses release-rxtools release-doc release-lang \
release-patches release-theme release-tools release-mset release-brahma
release-licenses:
@mkdir -p release
@cp LICENSE release
@cp rxtools/source/lib/jsmn/LICENSE release/LICENSE_JSMN
@cp rxtools/CakeHax/LICENSE.txt release/LICENSE_CakeHax.txt
@cp CakesROP/LICENSE release/LICENSE_CakesROP
release-rxtools: all-target-rxtools
@mkdir -p release/$(SYS_PATH)
@cp rxtools/build/code.bin release/$(SYS_PATH)
@cp rxtools/build/font.bin release/$(SYS_PATH)
release-doc:
@cp README.md "docs/QuickStartGuide(v3.0_BETA).pdf" release
release-lang:
mkdir -p release/rxTools/lang
@cp lang/* release/rxTools/lang
release-patches: reboot/reboot.bin all-target-patches
@mkdir -p release/$(SYS_PATH) release/$(PATCHES_PATH)
@cp reboot/reboot.bin release/$(SYS_PATH)
@cp rxmode/build/ctr/native_firm.elf release/$(PATCHES_PATH)/0004013800000002.elf
@cp rxmode/build/ctr/twl_firm.elf release/$(PATCHES_PATH)/0004013800000102.elf
@cp rxmode/build/ctr/agb_firm.elf release/$(PATCHES_PATH)/0004013800000202.elf
@cp rxmode/build/ktr/native_firm.elf release/$(PATCHES_PATH)/0004013820000002.elf
release-theme: all-target-theme
mkdir -p release/rxTools/theme/0
@mv theme/*.bin release/rxTools/theme/0
@cp theme/LANG.txt tools/themetool.sh tools/themetool.bat release/rxTools/theme/0
release-tools:
@mkdir -p release/Tools/fbi_injection release/Tools/scripts
@cp tools/o3ds_cdn_firm.py tools/n3ds_cdn_firm.py tools/readme.txt release/Tools
@cp -r tools/fbi_injection/* release/Tools/fbi_injection/
@cp tools/scripts/* release/Tools/scripts/
release-mset: all-target-mset
@mkdir -p release/mset
@cp CakesROP/CakesROP.nds release/mset/rxinstaller.nds
@cp CakesROP/CakesROPSpider/code.bin release/mset/rxinstaller.bin
release-brahma: all-target-brahma
@mkdir -p release/ninjhax/rxTools
@cp CakeBrah/code.bin.3dsx release/ninjhax/rxTools/rxTools.3dsx
@cp CakeBrah/code.bin.smdh release/ninjhax/rxTools/rxTools.smdh