-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (35 loc) · 1.29 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
BUILD_DIR=build
include $(N64_INST)/include/n64.mk
src = ucodetest.c
asm = rsp_blend.S
assets_xm = $(wildcard assets/*.xm)
assets_wav = $(wildcard assets/*.wav)
assets_png = $(wildcard assets/*.png)
assets_conv = $(addprefix filesystem/,$(notdir $(assets_xm:%.xm=%.xm64))) \
$(addprefix filesystem/,$(notdir $(assets_wav:%.wav=%.wav64))) \
$(addprefix filesystem/,$(notdir $(assets_png:%.png=%.sprite)))
AUDIOCONV_FLAGS ?=
MKSPRITE_FLAGS ?=
all: ucodetest.z64
filesystem/%.xm64: assets/%.xm
@mkdir -p $(dir $@)
@echo " [AUDIO] $@"
@$(N64_AUDIOCONV) $(AUDIOCONV_FLAGS) -o filesystem $<
filesystem/%.wav64: assets/%.wav
@mkdir -p $(dir $@)
@echo " [AUDIO] $@"
@$(N64_AUDIOCONV) -o filesystem $<
filesystem/%.sprite: assets/%.png
@mkdir -p $(dir $@)
@echo " [SPRITE] $@"
@$(N64_MKSPRITE) $(MKSPRITE_FLAGS) -o filesystem "$<"
filesystem/n64brew.sprite: MKSPRITE_FLAGS=--format RGBA16 --tiles 32,32
filesystem/tiles.sprite: MKSPRITE_FLAGS=--format CI4 --tiles 32,32
$(BUILD_DIR)/ucodetest.dfs: $(assets_conv)
$(BUILD_DIR)/ucodetest.elf: $(src:%.c=$(BUILD_DIR)/%.o) $(asm:%.S=$(BUILD_DIR)/%.o)
ucodetest.z64: N64_ROM_TITLE="RSPQ Demo"
ucodetest.z64: $(BUILD_DIR)/ucodetest.dfs
clean:
rm -rf $(BUILD_DIR) *.z64
.PHONY: clean
-include $(wildcard $(BUILD_DIR)/*.d))