-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (35 loc) · 1.31 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
SOURCE_DIR = src
BUILD_DIR = build
include $(N64_INST)/include/n64.mk
# A for NTSC, P for PAL
N64_ROM_REGION="A"
N64_ROM_TITLE = "Vlak 64"
src = vlak_main.c
all: vlak64.z64
ASSETS_SPRITES = $(wildcard assets/*.png)
ASSETS_SFX = $(wildcard assets/*.wav)
ASSETS_MUSIC = $(wildcard assets/*.xm)
FS_SPRITES = $(addprefix filesystem/, $(notdir $(ASSETS_SPRITES:%.png=%.sprite)))
FS_SFX = $(addprefix filesystem/, $(notdir $(ASSETS_SFX:%.wav=%.wav64)))
FS_MUSIC = $(addprefix filesystem/, $(notdir $(ASSETS_MUSIC:%.xm=%.xm64)))
filesystem/%.sprite: assets/%.png
@mkdir -p $(dir $@)
@echo " [MKSPRITE] $< -> $@"
@$(N64_MKSPRITE) -f RGBA16 -o "$(dir $@)" "$<"
filesystem/%.wav64: assets/%.wav
@mkdir -p $(dir $@)
@echo " [AUDIOCONV64 (SFX)] $< -> $@"
@$(N64_AUDIOCONV) --wav-compress 0 -o "$(dir $@)" "$<"
filesystem/%.xm64: assets/%.xm
@mkdir -p $(dir $@)
@echo " [AUDIOCONV64 (MUSIC)] $< -> $@"
@$(N64_AUDIOCONV) -o "$(dir $@)" "$<"
$(BUILD_DIR)/vlak64.dfs: $(FS_SPRITES) $(FS_SFX) $(FS_MUSIC)
SOURCE_FILES := $(shell find $(SOURCE_DIR)/ -type f -name '*.c' | sort)
OBJECT_FILES := $(SOURCE_FILES:$(SOURCE_DIR)/%.c=$(BUILD_DIR)/%.o)
$(BUILD_DIR)/vlak64.elf: $(OBJECT_FILES)
vlak64.z64: $(BUILD_DIR)/vlak64.dfs
clean:
rm -rf $(BUILD_DIR) filesystem/ vlak64.z64
-include $(wildcard $(BUILD_DIR)/*.d)
.PHONY: all clean