Skip to content

Commit

Permalink
Separated rom padding step so it does it after adding symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephane-D committed Dec 12, 2024
1 parent 40071af commit f2b5e85
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions makefile.gen
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ release: CFLAGS= $(FLAGS)
release: AFLAGS= $(FLAGS)
release: LIBMD= $(LIB)/libmd.a
release: $(OUT)/rom.bin $(OUT)/symbol.txt
.PHONY: release
release: padROM
.PHONY: release padROM

#release: $(info $$var is [${SRC_C}])

Expand All @@ -86,7 +87,8 @@ debug: AFLAGS= $(FLAGS)
debug: LIBMD= $(LIB)/libmd_debug.a
debug: $(OUT)/rom.bin $(OUT)/rom.out $(OUT)/symbol.txt
debug: injectSymbolsInROM
.PHONY: debug injectSymbolsInROM
debug: padROM
.PHONY: debug injectSymbolsInROM padROM

asm: FLAGS= $(DEFAULT_FLAGS) -O3 -fuse-linker-plugin -fno-web -fno-gcse -fomit-frame-pointer -S
asm: CFLAGS= $(FLAGS)
Expand Down Expand Up @@ -159,13 +161,14 @@ cleanDebug: cleandebug
cleanAsm: cleanasm
.PHONY: cleanRelease cleanDebug cleanAsm

padROM: $(OUT)/rom.bin
$(SIZEBND) $(OUT)/rom.bin -sizealign 131072 -checksum

injectSymbolsInROM: $(OUT)/rom.bin $(OUT)/rom.out $(OUT)/symbol.txt
$(CONVSYM) $(OUT)/symbol.txt $(OUT)/rom.bin -in txt -inopt "/fmt='%X %*[TtBbCcDd] %511s' /offsetFirst+" -range 0 FFFFFF -a -ref @MDDBG__SymbolDataPtr

$(OUT)/rom.bin: $(OUT)/rom.out $(OUT)/symbol.txt
$(OBJCPY) -O binary $(OUT)/rom.out $(OUT)/rom.bin
$(SIZEBND) $(OUT)/rom.bin -sizealign 131072 -checksum

$(OUT)/symbol.txt: $(OUT)/rom.out
$(NM) $(LTO_PLUGIN) -nl $(OUT)/rom.out > $(OUT)/symbol.txt
Expand Down

0 comments on commit f2b5e85

Please sign in to comment.