-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
78 lines (63 loc) · 2.01 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
V=1
SOURCE_DIR=src
BUILD_DIR=build
DEVELOPMENT=0
ADDITIONAL_C_FLAGS = -DNDEBUG
include $(N64_INST)/include/n64.mk
# TODO: use a wildcard here
OBJS = $(BUILD_DIR)/summer.o \
$(BUILD_DIR)/player.o \
$(BUILD_DIR)/terrain.o \
$(BUILD_DIR)/tutorial.o \
$(BUILD_DIR)/dialogue.o \
$(BUILD_DIR)/menu.o \
$(BUILD_DIR)/intro.o \
$(BUILD_DIR)/story.o
assets = $(wildcard assets/*.glb)
assets_ttf = $(wildcard assets/*.ttf)
assets_png = $(wildcard assets/*.png)
assets_wav = $(wildcard assets/*.wav)
assets_conv = $(addprefix filesystem/,$(notdir $(assets_ttf:%.ttf=%.font64))) \
$(addprefix filesystem/,$(notdir $(assets:%.glb=%.model64))) \
$(addprefix filesystem/,$(notdir $(assets_png:%.png=%.sprite))) \
filesystem/map.terrain
ifneq ($(DEVELOPMENT), 1)
assets_conv += $(addprefix filesystem/,$(notdir $(assets_wav:%.wav=%.wav64)))
else
ADDITIONAL_C_FLAGS += -DDEVELOPMENT
endif
all: summer.z64
.PHONY: all
filesystem/%.wav64: assets/%.wav
@mkdir -p $(dir $@)
@echo " [AUDIO] $@"
@$(N64_AUDIOCONV) -o filesystem $<
MKSPRITE_FLAGS=--format RGBA32
filesystem/%.sprite: assets/%.png
@mkdir -p $(dir $@)
@echo " [SPRITE] $@"
@$(N64_MKSPRITE) $(MKSPRITE_FLAGS) -o filesystem "$<"
filesystem/map.terrain: assets/terrain/map.glb
$(MAKE) -C tools
@mkdir -p $(dir $@)
@echo " [TERRAIN] $@"
./tools/mkterrain -v -o filesystem "$<"
filesystem/%.model64: assets/%.glb
@mkdir -p $(dir $@)
@echo " [MODEL] $@"
@$(N64_MKMODEL) -o filesystem "$<"
filesystem/%.font64: assets/%.ttf
@mkdir -p $(dir $@)
@echo " [FONT] $@"
@$(N64_MKFONT) $(MKFONT_FLAGS) -o filesystem "$<"
filesystem/font_small.font64: MKFONT_FLAGS+=--size 12
filesystem/font_big.font64: MKFONT_FLAGS+=--size 16
$(BUILD_DIR)/summer.dfs: $(assets_conv)
$(BUILD_DIR)/summer.elf: $(OBJS)
summer.z64: N64_ROM_TITLE="Summer"
summer.z64: $(BUILD_DIR)/summer.dfs
summer.z64: CFLAGS+= -Wno-error -Iinclude -Ibox2d/include -Ibox2d/src $(ADDITIONAL_C_FLAGS)
clean:
rm -f $(BUILD_DIR)/* *.z64 filesystem/*
.PHONY: clean
-include $(wildcard $(BUILD_DIR)/*.d)