Skip to content

Commit

Permalink
Makefile: support audio conversion from mp3 files too
Browse files Browse the repository at this point in the history
  • Loading branch information
rasky committed Nov 18, 2024
1 parent 2f032e8 commit 6afc74d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ IMAGE_LIST = $(wildcard $(ASSETS_DIR)/*.png) $(wildcard $(ASSETS_DIR)/core/*.png
FONT_LIST = $(wildcard $(ASSETS_DIR)/*.ttf)
MODEL_LIST = $(wildcard $(ASSETS_DIR)/*.glb)
SOUND_LIST = $(wildcard $(ASSETS_DIR)/*.wav) $(wildcard $(ASSETS_DIR)/core/*.wav)
SOUND2_LIST = $(wildcard $(ASSETS_DIR)/*.mp3) $(wildcard $(ASSETS_DIR)/core/*.mp3)
MUSIC_LIST = $(wildcard $(ASSETS_DIR)/*.xm)
ASSETS_LIST += $(subst $(ASSETS_DIR),$(FILESYSTEM_DIR),$(IMAGE_LIST:%.png=%.sprite))
ASSETS_LIST += $(subst $(ASSETS_DIR),$(FILESYSTEM_DIR),$(FONT_LIST:%.ttf=%.font64))
ASSETS_LIST += $(subst $(ASSETS_DIR),$(FILESYSTEM_DIR),$(MODEL_LIST:%.glb=%.t3dm))
ASSETS_LIST += $(subst $(ASSETS_DIR),$(FILESYSTEM_DIR),$(SOUND_LIST:%.wav=%.wav64))
ASSETS_LIST += $(subst $(ASSETS_DIR),$(FILESYSTEM_DIR),$(SOUND2_LIST:%.mp3=%.wav64))
ASSETS_LIST += $(subst $(ASSETS_DIR),$(FILESYSTEM_DIR),$(MUSIC_LIST:%.xm=%.xm64))

ifeq ($(DEBUG), 1)
Expand Down Expand Up @@ -60,6 +62,11 @@ $(FILESYSTEM_DIR)/%.wav64: $(ASSETS_DIR)/%.wav
@echo " [SFX] $@"
$(N64_AUDIOCONV) $(AUDIOCONV_FLAGS) -o $(dir $@) "$<"

$(FILESYSTEM_DIR)/%.wav64: $(ASSETS_DIR)/%.mp3
@mkdir -p $(dir $@)
@echo " [SFX] $@"
$(N64_AUDIOCONV) $(AUDIOCONV_FLAGS) -o $(dir $@) "$<"

$(FILESYSTEM_DIR)/%.xm64: $(ASSETS_DIR)/%.xm
@mkdir -p $(dir $@)
@echo " [XM] $@"
Expand Down

0 comments on commit 6afc74d

Please sign in to comment.