-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile.blocksds
129 lines (99 loc) · 3.16 KB
/
Makefile.blocksds
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
# SPDX-License-Identifier: CC0-1.0
#
# SPDX-FileContributor: Antonio Niño Díaz, 2023
# User config
# ===========
NAME := uxnds
GAME_TITLE := uxnds v0.5.1
GAME_SUBTITLE := tiny virtual machine
GAME_AUTHOR := 08/07/2024
GAME_ICON := misc/uxn32.png
#NAME := donsol
#GAME_TITLE = Donsol
#GAME_AUTHOR := Rek & Devine
#GAME_ICON := misc/donsol32.png
#NITROFATDIR := romfs/nds
# DLDI and internal SD slot of DSi
# --------------------------------
# Root folder of the SD image
SDROOT := sdroot
# Name of the generated image it "DSi-1.sd" for no$gba in DSi mode
SDIMAGE := image.bin
# Tools
# -----
MAKE := make
RM := rm -rf
# Verbose flag
# ------------
ifeq ($(VERBOSE),1)
V :=
else
V := @
endif
# Directories
# -----------
ARM9DIR := arm9
ARM7DIR := arm7
# Build artfacts
# --------------
NITROFAT_IMG := build_blocksds/nitrofat.bin
ROM := $(NAME).nds
ROM_DEBUG := $(NAME)_debug.nds
ROM_PROFILE := $(NAME)_profile.nds
# Targets
# -------
.PHONY: all clean arm9 arm9debug arm9profile arm7 sdimage
all: $(ROM) $(ROM_DEBUG) $(ROM_PROFILE)
clean:
@echo " CLEAN"
$(V)$(MAKE) -f Makefile.blocksds.arm9 clean --no-print-directory DEBUG=false PROFILE=false
$(V)$(MAKE) -f Makefile.blocksds.arm9 clean --no-print-directory DEBUG=true PROFILE=false
$(V)$(MAKE) -f Makefile.blocksds.arm9 clean --no-print-directory DEBUG=false PROFILE=true
$(V)$(MAKE) -f Makefile.blocksds.arm7 clean --no-print-directory
$(V)$(RM) $(ROM) build $(SDIMAGE)
arm9:
$(V)+$(MAKE) -f Makefile.blocksds.arm9 --no-print-directory DEBUG=false PROFILE=false
arm9debug:
$(V)+$(MAKE) -f Makefile.blocksds.arm9 --no-print-directory DEBUG=true PROFILE=false
arm9profile:
$(V)+$(MAKE) -f Makefile.blocksds.arm9 --no-print-directory DEBUG=false PROFILE=true
arm7:
$(V)+$(MAKE) -f Makefile.blocksds.arm7 --no-print-directory
ifneq ($(strip $(NITROFATDIR)),)
# Additional arguments for ndstool
NDSTOOL_FAT := -F $(NITROFAT_IMG)
$(NITROFAT_IMG): $(NITROFATDIR)
@echo " MKFATIMG $@ $(NITROFATDIR)"
$(V)$(BLOCKSDS)/tools/mkfatimg/mkfatimg -t $(NITROFATDIR) $@ 0
# Make the NDS ROM depend on the filesystem image only if it is needed
$(ROM): $(NITROFAT_IMG)
$(ROM_DEBUG): $(NITROFAT_IMG)
$(ROM_PROFILE): $(NITROFAT_IMG)
endif
# Combine the title strings
ifeq ($(strip $(GAME_SUBTITLE)),)
GAME_FULL_TITLE := $(GAME_TITLE);$(GAME_AUTHOR)
else
GAME_FULL_TITLE := $(GAME_TITLE);$(GAME_SUBTITLE);$(GAME_AUTHOR)
endif
$(ROM): arm9 arm7
@echo " NDSTOOL $@"
$(V)$(BLOCKSDS)/tools/ndstool/ndstool -c $@ \
-7 build_blocksds/arm7/arm7.elf -9 build_blocksds/arm9/arm9.elf \
-b $(GAME_ICON) "$(GAME_FULL_TITLE)" \
$(NDSTOOL_FAT)
$(ROM_DEBUG): arm9debug arm7
@echo " NDSTOOL $@"
$(V)$(BLOCKSDS)/tools/ndstool/ndstool -c $@ \
-7 build_blocksds/arm7/arm7.elf -9 build_blocksds/arm9_debug/arm9.elf \
-b $(GAME_ICON) "$(GAME_FULL_TITLE)" \
$(NDSTOOL_FAT)
$(ROM_PROFILE): arm9profile arm7
@echo " NDSTOOL $@"
$(V)$(BLOCKSDS)/tools/ndstool/ndstool -c $@ \
-7 build_blocksds/arm7/arm7.elf -9 build_blocksds/arm9_profile/arm9.elf \
-b $(GAME_ICON) "$(GAME_FULL_TITLE)" \
$(NDSTOOL_FAT)
sdimage:
@echo " IMGBUILD $(SDIMAGE) $(SDROOT)"
$(V)sh $(BLOCKSDS)/tools/imgbuild/imgbuild.sh $(SDIMAGE) $(SDROOT)