From 6053960215538a7eda160d9d5dda0a61e62b39f3 Mon Sep 17 00:00:00 2001 From: dgrubb Date: Mon, 26 Jun 2017 11:11:54 -0500 Subject: Update Makefile with more user-friendly clean options 1) Change target 'clean' to refer to 'software_clean' rather than 'toolchain-clean' and 'openocd-clean'. 2) Update Makefile help to reflect changes. --- Makefile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 11f239f..6d663a7 100644 --- a/Makefile +++ b/Makefile @@ -71,6 +71,12 @@ help: @echo " tools [BOARD = $(BOARD)]:" @echo " Install compilation & debugging tools to target your desired board." @echo "" + @echo " toolchain-clean:" + @echo " Removes the installed toolchain." + @echo "" + @echo " openocd-clean:" + @echo " Removes the locally built instance of OpenOCD." + @echo "" @echo " uninstall:" @echo " Uninstall the compilation & debugging tools." @echo "" @@ -78,6 +84,10 @@ help: @echo " Build a software program to load with the" @echo " debugger." @echo "" + @echo " clean [PROGRAM=$(PROGRAM) BOARD=$(BOARD)]:" + @echo " Clean compiled objects for a specified " + @echo " software program." + @echo "" @echo " upload [PROGRAM=$(PROGRAM) BOARD=$(BOARD)]:" @echo " Launch OpenOCD to flash your program to the" @echo " on-board Flash." @@ -92,9 +102,6 @@ help: @echo "" @echo " For more information, visit dev.sifive.com" -.PHONY: clean -clean: - ############################################################# # This section is for tool installation ############################################################# @@ -144,7 +151,6 @@ $(builddir)/riscv-gnu-toolchain/%-elf/configure.stamp: date > $@ .PHONY: toolchain-clean -clean: toolchain-clean toolchain-clean: rm -rf $(toolchain_builddir) @@ -180,7 +186,6 @@ $(openocd_builddir)/configure.stamp: date > $@ .PHONY: openocd-clean -clean: openocd-clean openocd-clean: rm -rf $(openocd_builddir) @@ -191,6 +196,7 @@ PROGRAM_DIR = software/$(PROGRAM) PROGRAM_ELF = software/$(PROGRAM)/$(PROGRAM) .PHONY: software_clean +clean: software_clean software_clean: $(MAKE) -C $(PROGRAM_DIR) CC=$(RISCV_GCC) RISCV_ARCH=$(RISCV_ARCH) RISCV_ABI=$(RISCV_ABI) AR=$(RISCV_AR) BSP_BASE=$(abspath bsp) BOARD=$(BOARD) LINK_TARGET=$(LINK_TARGET) clean -- cgit v1.2.1-18-gbd029