Add test code and top level Makefile

This commit is contained in:
Byron Lathi
2024-03-03 12:52:44 -08:00
parent 0ba5888aa1
commit 42fbc17a2a
14 changed files with 227 additions and 12 deletions

View File

@@ -1,9 +1,32 @@
all: hw
ROM_TARGET=test_code/loop_test
.PHONY: hw
hw:
$(MAKE) -C hw
INIT_HEX=hw/super6502_fpga/init_hex.mem
HEX=sw/$(ROM_TARGET)/$(notdir $(ROM_TARGET)).bin
all: fpga_image
# FPGA
.PHONY: fpga_image
fpga_image: $(INIT_HEX)
$(MAKE) -C hw/super6502_fpga
# SW
.PHONY: toolchain
toolchain:
$(MAKE) -C sw/toolchain/cc65 -j $(shell nproc)
$(INIT_HEX): toolchain script/generate_rom_image.py $(HEX)
python script/generate_rom_image.py -i $(HEX) -o $@
$(HEX):
$(MAKE) -C sw/$(ROM) $(notdir $@)
.PHONY: clean
clean:
$(MAKE) -C hw $@
$(MAKE) -C hw/super6502_fpga $@
.PHONY: distclean
distclean: clean
$(MAKE) -C sw/toolchain/cc65 clean