-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
97 lines (75 loc) · 2.71 KB
/
Copy pathMakefile
File metadata and controls
97 lines (75 loc) · 2.71 KB
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
BUILD_DIR=build
include $(N64_INST)/include/n64.mk
PROJECT_NAME = "snapper64"
N64_CXXFLAGS += -std=gnu++23 -O3 -fno-exceptions -fsingle-precision-constant
src = $(wildcard src/*.cpp)
src += $(wildcard src/tests/*.cpp)
src += $(wildcard src/framework/*.cpp)
src += $(wildcard src/renderer/*.cpp)
src += $(wildcard src/utils/*.cpp)
src += $(wildcard src/menu/*.cpp)
assets_png = $(wildcard assets/*.rgba16.png)
assets_test = $(wildcard assets/*.test.7z)
assets_conv = $(patsubst assets/%,filesystem/%,$(assets_png:%.png=%.sprite))
# assets_conv += $(patsubst assets/%,filesystem/%,$(assets_test:%.test.7z=%.test))
test_dumps = $(assets_test:assets/%.test.7z=pack_data/%.test)
all: $(PROJECT_NAME).z64
# Generate testList.h by scanning files in src/tests/
src/testList.h: $(sort $(wildcard src/tests/*.cpp))
@echo " [TEST LIST] $@"
@echo "// This file is auto-generated. Do not edit directly." > $@
@for f in $(wildcard src/tests/*.cpp); do \
name=$$(basename $$f .cpp); \
echo "TEST_ENTRY($$name)" >> $@; \
done
$(BUILD_DIR)/src/main.o: src/testList.h
filesystem/%.sprite: assets/%.png
@mkdir -p $(dir $@)
@echo " [SPRITE] $@"
$(N64_MKSPRITE) $(MKSPRITE_FLAGS) -o $(dir $@) "$<"
pack_data/%.test: assets/%.test.7z
@mkdir -p $(dir $@)
@echo " [TEST-DUMP] $@ $<"
# cp "$<" $@
7z e "$<" -o$(dir $@) -y -bso0 -bsp0
$(N64_BINDIR)/mkasset -c 3 -o $(dir $@) $@
filesystem/tests.pack: tools/data_converter tools/data_bundler
filesystem/tests.pack.idx: tools/data_converter tools/data_bundler
filesystem/tests.pack.idx filesystem/tests.pack: $(test_dumps)
@mkdir -p $(dir $@)
@echo " [PACK] $@"
tools/data_bundler pack_data filesystem/tests.pack
$(N64_BINDIR)/mkasset -c 3 -o filesystem filesystem/tests.pack.idx
# PC side tools
tools/data_converter: tools/dataConverter.cpp
make -C tools
tools/data_bundler: tools/dataBundler.cpp
make -C tools
$(BUILD_DIR)/$(PROJECT_NAME).dfs: $(assets_conv) filesystem/tests.pack filesystem/tests.pack.idx
$(BUILD_DIR)/$(PROJECT_NAME).elf: $(src:%.cpp=$(BUILD_DIR)/%.o)
$(PROJECT_NAME).z64: N64_ROM_TITLE="Snapper64 - RDP Test"
$(PROJECT_NAME).z64: N64_ROM_SAVETYPE=sram256k
$(PROJECT_NAME).z64: $(BUILD_DIR)/$(PROJECT_NAME).dfs
sc64:
make -j8
curl 192.168.0.6:9065/off
sleep 1
# sc64deployer --remote 192.168.0.6:9064 upload --tv ntsc *.z64
sc64deployer upload --tv ntsc *.z64
curl 192.168.0.6:9065/on
sc64_pal:
make -j8
curl 192.168.0.6:9065/off
sleep 1
sc64deployer --remote 192.168.0.6:9064 upload --tv pal *.z64
curl 192.168.0.6:9065/on
clean:
rm -rf $(BUILD_DIR) *.z64 src/testList.h
cleanAll:
rm -rf $(BUILD_DIR) *.z64 src/testList.h
rm -rf filesystem
cleanDumps:
rm -rf filesystem/*.test
rm -rf pack_data/*.test
-include $(wildcard $(BUILD_DIR)/*.d)
.PHONY: all clean