From 75f1d519400434226a4a8a3e09c04c8fbb5e00c3 Mon Sep 17 00:00:00 2001 From: Rozelette Date: Wed, 7 Apr 2021 17:38:23 -0500 Subject: [PATCH] Optimization when building all to let compression happen as early as possible (#98) --- Makefile | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index b7224ebab3..1c0a1999f8 100644 --- a/Makefile +++ b/Makefile @@ -141,9 +141,7 @@ ifeq ($(COMPARE),1) @md5sum -c checksum.md5 endif -all: - $(MAKE) $(UNCOMPRESSED_ROM) - $(MAKE) $(ROM) +all: $(UNCOMPRESSED_ROM) $(ROM) ; build/code.elf: $(O_FILES) linker_scripts/code_script.txt undef.txt linker_scripts/object_script.txt linker_scripts/dmadata_script.txt $(LD) -T linker_scripts/code_script.txt -T undef.txt -T linker_scripts/object_script.txt -T linker_scripts/dmadata_script.txt --no-check-sections --accept-unknown-input-arch -Map build/mm.map -N -o $@ @@ -160,11 +158,8 @@ build/dmadata: $(COMP_FILES) $(DECOMP_FILES) $(BASEROM_BUILD_FILES) build/uncompressed_dmadata: $(DECOMP_FILES) $(BASEROM_BUILD_FILES) ./tools/dmadata.py ./tables/dmadata_table.txt $@ -u -build/baserom/boot: build/boot.bin - cp $< $@ - -build/decomp/code: build/code.bin - cp $< $@ +build/baserom/boot build/decomp/code: build/code.elf + @$(OBJCOPY) --dump-section $(notdir $@)=$@ $< /dev/null build/decomp/ovl_%: build/code.elf @$(OBJCOPY) --dump-section ovl_$*=$@ $< /dev/null @@ -201,9 +196,6 @@ init: # Recipes -build/%.bin: build/code.elf - @$(OBJCOPY) --dump-section $*=$@ $< /dev/null - build/baserom/%: baserom/% @cp $< $@