Coalesced audio rules into audio.mk

This commit is contained in:
Icedude907 2023-11-15 13:36:35 +13:00
parent 85f4ca6943
commit cf1eaea7f7
2 changed files with 24 additions and 9 deletions

View file

@ -86,8 +86,6 @@ DATA_SRC_SUBDIR = src/data
DATA_ASM_SUBDIR = data DATA_ASM_SUBDIR = data
SONG_SUBDIR = sound/songs SONG_SUBDIR = sound/songs
MID_SUBDIR = sound/songs/midi MID_SUBDIR = sound/songs/midi
SAMPLE_SUBDIR = sound/direct_sound_samples
CRY_SUBDIR = sound/direct_sound_samples/cries
C_BUILDDIR = $(OBJ_DIR)/$(C_SUBDIR) C_BUILDDIR = $(OBJ_DIR)/$(C_SUBDIR)
GFLIB_BUILDDIR = $(OBJ_DIR)/$(GFLIB_SUBDIR) GFLIB_BUILDDIR = $(OBJ_DIR)/$(GFLIB_SUBDIR)
@ -263,7 +261,7 @@ include graphics_file_rules.mk
include map_data_rules.mk include map_data_rules.mk
include spritesheet_rules.mk include spritesheet_rules.mk
include json_data_rules.mk include json_data_rules.mk
include songs.mk include audio_rules.mk
%.s: ; %.s: ;
%.png: ; %.png: ;
@ -277,8 +275,6 @@ include songs.mk
%.gbapal: %.png ; $(GFX) $< $@ %.gbapal: %.png ; $(GFX) $< $@
%.lz: % ; $(GFX) $< $@ %.lz: % ; $(GFX) $< $@
%.rl: % ; $(GFX) $< $@ %.rl: % ; $(GFX) $< $@
$(CRY_SUBDIR)/%.bin: $(CRY_SUBDIR)/%.aif ; $(AIF) $< $@ --compress
sound/%.bin: sound/%.aif ; $(AIF) $< $@
ifeq ($(MODERN),0) ifeq ($(MODERN),0)
@ -393,9 +389,6 @@ $(foreach src, $(REGULAR_DATA_ASM_SRCS), $(eval $(call SRC_ASM_DATA_DEP,$(patsub
endif endif
endif endif
$(SONG_BUILDDIR)/%.o: $(SONG_SUBDIR)/%.s
$(AS) $(ASFLAGS) -I sound -o $@ $<
$(OBJ_DIR)/sym_bss.ld: sym_bss.txt $(OBJ_DIR)/sym_bss.ld: sym_bss.txt
$(RAMSCRGEN) .bss $< ENGLISH > $@ $(RAMSCRGEN) .bss $< ENGLISH > $@

View file

@ -1,6 +1,28 @@
# This file contains rules for making assemblies for most music in the game. # This file contains rules for making assemblies for most music in the game.
MID_ASM_DIR = $(MID_SUBDIR) CRY_SUBDIR := sound/direct_sound_samples/cries
MID_ASM_DIR := $(MID_SUBDIR)
CRY_BIN_DIR := $(CRY_SUBDIR)
SOUND_BIN_DIR := sound
SPECIAL_OUTDIRS := $(MID_ASM_DIR) $(CRY_BIN_DIR)
SPECIAL_OUTDIRS += $(SOUND_BIN_DIR) $(SOUND_BIN_DIR)/direct_sound_samples/phonemes $(SOUND_BIN_DIR)/direct_sound_samples/cries
$(shell mkdir -p $(SPECIAL_OUTDIRS) )
# Assembly song compilation
$(SONG_BUILDDIR)/%.o: $(SONG_SUBDIR)/%.s
$(AS) $(ASFLAGS) -I sound -o $@ $<
$(MID_BUILDDIR)/%.o: $(MID_ASM_DIR)/%.s
$(AS) $(ASFLAGS) -I sound -o $@ $<
# Compressed cries
$(CRY_BIN_DIR)/%.bin: $(CRY_SUBDIR)/%.aif
$(AIF) $< $@ --compress
# Uncompressed sounds
$(SOUND_BIN_DIR)/%.bin: sound/%.aif
$(AIF) $< $@
# For each line in midi.cfg, we do some trickery to convert it into a make rule for the `.mid` file described on the line # For each line in midi.cfg, we do some trickery to convert it into a make rule for the `.mid` file described on the line
# Data following the colon in said file corresponds to arguments passed into mid2agb # Data following the colon in said file corresponds to arguments passed into mid2agb