Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

Commit

Permalink
Move parse_roms.py artifacts into build/
Browse files Browse the repository at this point in the history
  • Loading branch information
kbeckmann committed Jan 3, 2021
1 parent f91e201 commit 909d60f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -255,19 +255,19 @@ endef
$(eval $(foreach obj,$(SDK_C_SOURCES) $(SDK_ASM_SOURCES),$(call sdk_obj_prereq_gen,$(obj))))

# Run parse_roms.py to generate information about the roms
Core/Src/retro-go/gb_roms.c Core/Src/retro-go/nes_roms.c saveflash.ld &: parse_roms.py
Core/Src/retro-go/gb_roms.c Core/Src/retro-go/nes_roms.c $(BUILD_DIR)/saveflash.ld &: parse_roms.py | $(BUILD_DIR)
$(V)$(ECHO) [ PYTHON3 ] $(notdir $<)
$(V)$(BASH) -c " \
cp -f rom_hashes.txt rom_hashes_old.txt 2> /dev/null; \
find ./roms -type f -exec sha1sum {} \; > rom_hashes.txt && \
diff rom_hashes.txt rom_hashes_old.txt 2> /dev/null || $(PYTHON3) parse_roms.py --flash-size $(EXTFLASH_SIZE) && \
rm -f rom_hashes_old.txt; \
cp -f $(BUILD_DIR)/rom_hashes.txt $(BUILD_DIR)/rom_hashes_old.txt 2> /dev/null; \
find ./roms -type f -exec sha1sum {} \; > $(BUILD_DIR)/rom_hashes.txt && \
diff $(BUILD_DIR)/rom_hashes.txt $(BUILD_DIR)/rom_hashes_old.txt 2> /dev/null || $(PYTHON3) parse_roms.py --flash-size $(EXTFLASH_SIZE) && \
rm -f $(BUILD_DIR)/rom_hashes_old.txt; \
"
.PHONY: Core/Src/retro-go/gb_roms.c Core/Src/retro-go/nes_roms.c saveflash.ld
.PHONY: Core/Src/retro-go/gb_roms.c Core/Src/retro-go/nes_roms.c $(BUILD_DIR)/saveflash.ld

# TODO: Hard-coded dependencies. Possible to solve in a nicer way?
Core/Src/retro-go/rom_manager.c: Core/Src/retro-go/gb_roms.c Core/Src/retro-go/nes_roms.c
STM32H7B0VBTx_FLASH.ld: saveflash.ld
STM32H7B0VBTx_FLASH.ld: $(BUILD_DIR)/saveflash.ld

Core/Inc/githash.h:
$(V)./githash.sh > $@
Expand Down
2 changes: 1 addition & 1 deletion STM32H7B0VBTx_FLASH.ld
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ __EXTFLASH_START__ = 0x90000000;


/* saveflash.ld sets __SAVEFLASH_LENGTH__ */
INCLUDE saveflash.ld
INCLUDE build/saveflash.ld

__EXTFLASH_LENGTH__ = DEFINED(__EXTFLASH_TOTAL_LENGTH__) ? __EXTFLASH_TOTAL_LENGTH__ - __SAVEFLASH_LENGTH__ : 1024K - __SAVEFLASH_LENGTH__ ;
__SAVEFLASH_START__ = __EXTFLASH_START__ + __EXTFLASH_LENGTH__;
Expand Down
2 changes: 1 addition & 1 deletion parse_roms.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def parse(self, args):
print(f"Error: External flash will overflow!")
exit(-1)

self.generate_saveflash("saveflash.ld", total_save_size)
self.generate_saveflash("build/saveflash.ld", total_save_size)


if __name__ == "__main__":
Expand Down

0 comments on commit 909d60f

Please sign in to comment.