From 94bc6eba39371cd9bd407746bda8d309db995065 Mon Sep 17 00:00:00 2001 From: "(Tim) Efthimis Kritikos" Date: Fri, 8 Dec 2023 22:10:11 +0000 Subject: [PATCH] Build system: Added help text and target mrproper which also deletes downloaded source code --- Makefile | 29 +++++++++++++++++++++++++++++ boot_code/Makefile | 2 ++ common.mk | 1 + system/Makefile | 5 +++++ 4 files changed, 37 insertions(+) diff --git a/Makefile b/Makefile index ab2d7ab..c9961dc 100644 --- a/Makefile +++ b/Makefile @@ -49,8 +49,37 @@ clean: ${Q}make ${MAKEOPTS} PRINT_PATH_PREFIX=system/ -C system clean ${Q}make ${MAKEOPTS} PRINT_PATH_PREFIX=boot_code/ -C boot_code clean +.PHONY: mrproper +mrproper: clean + ${Q}make ${MAKEOPTS} PRINT_PATH_PREFIX=system/ -C system mrproper + ${Q}make ${MAKEOPTS} PRINT_PATH_PREFIX=boot_code/ -C boot_code mrproper + +.PHONY: upload upload: boot_code/bios.stxt ${Q}make ${MAKEOPTS} PRINT_PATH_PREFIX=system/ -C system upload +.PHONY: fpga_sim fpga_sim: boot_code/bios.stxt ${Q}make ${MAKEOPTS} PRINT_PATH_PREFIX=system/ -C system fpga_sim + +.PHONY: fpga +help: + @echo 'Simulation targets:' + @echo ' - No target will start a simulation with the default' + @echo ' program loaded to memory' + @echo ' boot_code/[name].run - Start a simulation and load memory with the' + @echo ' assembled code from boot_code/[name].asm' + @echo ' boot_code/[name].wave - like the above but write trace file and start' + @echo ' gtkwave with it' + @echo ' boot_code/[name].disas - assemble and show the disassembly of the binary' + @echo '' + @echo 'Synthesis targets:' + @echo ' upload - Build a bitstream for the board selected in' + @echo ' common.mk and upload it if possible' + @echo ' fpga_sim - Simulate the SoC that gets build for the configured' + @echo ' fpga board' + @echo '' + @echo 'Cleaning targets:' + @echo ' clean - Delete all non-source files generated by the build' + @echo ' system' + @echo ' mrproper - clean + delete downloaded external source IP files' diff --git a/boot_code/Makefile b/boot_code/Makefile index 95fa50d..40c56b9 100644 --- a/boot_code/Makefile +++ b/boot_code/Makefile @@ -46,3 +46,5 @@ include ../common.mk clean: $(call QUIET_CLEAN,boot_code) ${Q}rm -f $(BUILD_FILES) *.bf.asm + +mrproper: diff --git a/common.mk b/common.mk index 5fc5032..8658eed 100644 --- a/common.mk +++ b/common.mk @@ -51,6 +51,7 @@ ifeq "${QUIET}" "1" QUIET_DOWNLOAD = @echo ' DOWNLOAD '${PRINT_PATH_PREFIX}$@; QUIET_CLEAN = @echo ' CLEAN '${PRINT_PATH_PREFIX}; + QUIET_MRPROPER = @echo ' MRPROPER '${PRINT_PATH_PREFIX}; QUIET_VERILATOR_RUN = @printf ' %s %s\n' $1 $2; Q = @ MAKEOPTS=--no-print-directory diff --git a/system/Makefile b/system/Makefile index f8c5b4b..6bd0b70 100644 --- a/system/Makefile +++ b/system/Makefile @@ -165,3 +165,8 @@ dfu_upload:${BUILD_FILES_PREFIX}bitstream_${BUILD_NAME}.dfu clean: $(call QUIET_CLEAN,system) ${Q}rm -rf ${SYSTEM_VVP} *.fst boot_code.txt boot_code.bin *memdump *memdumptxt obj_dir simplified_ucode.txt abc.history build + +.PHONY: mrproper +mrproper: + $(call QUIET_MRPROPER,system) + ${Q}rm -f external_ip/litedram_core_ecp5_phy.v external_ip/litedram_core_ecp5_phy_sim.v