summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 10 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 382b69888..a0f93e250 100644
--- a/Makefile
+++ b/Makefile
@@ -32,6 +32,8 @@ OBJCOPY := $(DEVKITARM)/bin/arm-none-eabi-objcopy
LIBGCC := tools/agbcc/lib/libgcc.a
+LIBC := tools/agbcc/lib/libc.a
+
SHA1 := sha1sum -c
GFX := tools/gbagfx/gbagfx
@@ -47,7 +49,7 @@ RAMSCRGEN := tools/ramscrgen/ramscrgen
# Secondary expansion is required for dependency variables in object rules.
.SECONDEXPANSION:
-.PRECIOUS: %.1bpp %.4bpp %.8bpp %.gbapal %.lz %.rl
+.PRECIOUS: %.1bpp %.4bpp %.8bpp %.gbapal %.lz %.rl %.pcm %.bin sound/direct_sound_samples/cry_%.bin
.PHONY: rom clean compare tidy
@@ -75,6 +77,8 @@ compare: $(ROM)
@$(SHA1) rom.sha1
clean: tidy
+ rm -f sound/direct_sound_samples/*.bin
+ rm -f $(SONG_OBJS)
find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec rm {} +
tidy:
@@ -95,6 +99,10 @@ include graphics_file_rules.mk
%.gbapal: %.png ; $(GFX) $< $@
%.lz: % ; $(GFX) $< $@
%.rl: % ; $(GFX) $< $@
+sound/direct_sound_samples/cry_%.bin: sound/direct_sound_samples/cry_%.aif ; $(AIF) $< $@ --compress
+%.bin: %.aif ; $(AIF) $< $@
+sound/songs/%.s: sound/songs/%.mid
+ cd $(@D) && ../../$(MID) $(<F)
$(C_BUILDDIR)/libc.o: CC1 := tools/agbcc/bin/old_agbcc
$(C_BUILDDIR)/libc.o: CFLAGS := -O2
@@ -154,7 +162,7 @@ $(OBJ_DIR)/ld_script.ld: ld_script.txt $(OBJ_DIR)/sym_bss.ld $(OBJ_DIR)/sym_comm
cd $(OBJ_DIR) && sed -f ../../ld_script.sed ../../$< | sed "s#tools/#../../tools/#g" > ld_script.ld
$(ELF): $(OBJ_DIR)/ld_script.ld $(OBJS)
- cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ $(OBJS_REL) ../../$(LIBGCC)
+ cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ $(OBJS_REL) ../../$(LIBGCC) ../../$(LIBC)
$(ROM): $(ELF)
$(OBJCOPY) -O binary --gap-fill 0xFF --pad-to 0x9000000 $< $@