Skip to content

Commit

Permalink
Use -Os and dolxz
Browse files Browse the repository at this point in the history
Trim the last few bytes off to fit within the Qoob SX updater.

Most likely requires a custom dolxz build using clang and -Os.
  • Loading branch information
9ary committed Jun 13, 2018
1 parent de10231 commit e009506
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ INCLUDES := -nostdlibinc -isystem $(DEVKITPPC)/powerpc-eabi/include
# options for code generation
#---------------------------------------------------------------------------------

CFLAGS = -g -O2 -Wall $(MACHDEP) $(INCLUDE)
CFLAGS = -g -Os -Wall $(MACHDEP) $(INCLUDE)
CXXFLAGS = $(CFLAGS)

LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map -T$(PWD)/ipl.ld
Expand Down Expand Up @@ -114,11 +114,11 @@ $(BUILD):
clean:
@echo clean ...
@rm -fr $(BUILD) $(OUTPUT).{elf,dol} $(OUTPUT).{gcb,vgc} \
$(OUTPUT)_lz.{dol,elf,qbsx} $(OUTPUT_SX) $(OUTPUT)_xeno.{bin,elf}
$(OUTPUT)_xz.{dol,elf,qbsx} $(OUTPUT_SX) $(OUTPUT)_xeno.{bin,elf}

#---------------------------------------------------------------------------------
run: $(BUILD)
usb-load $(OUTPUT).dol
usb-load $(OUTPUT)_xz.dol


#---------------------------------------------------------------------------------
Expand All @@ -137,19 +137,19 @@ $(OUTPUT).elf: $(OFILES)
@echo pack IPL ... $(notdir $@)
@cd $(PWD); ./dol2ipl.py ipl.rom $< $@

$(OUTPUT)_lz.dol: $(OUTPUT).dol
$(OUTPUT)_xz.dol: $(OUTPUT).dol
@echo compress ... $(notdir $@)
@dollz3 $< $@ -m
@dolxz $< $@ -cube

$(OUTPUT)_lz.elf: $(OUTPUT)_lz.dol
$(OUTPUT)_xz.elf: $(OUTPUT)_xz.dol
@echo dol2elf ... $(notdir $@)
@doltool -e $<

%.qbsx: %.elf
@echo pack IPL ... $(notdir $@)
@cd $(PWD); ./dol2ipl.py /dev/null $< $@

$(OUTPUT_SX): $(OUTPUT)_lz.qbsx
$(OUTPUT_SX): $(OUTPUT)_xz.qbsx
@echo splice ... $@
@cd $(PWD); cp -f qoob_sx_13c_upgrade.elf $@
@cd $(PWD); dd if=$< of=$@ obs=4 seek=1851 conv=notrunc
Expand Down

0 comments on commit e009506

Please sign in to comment.