From 3da1e2e24fb713e87984bc18d7c1c4c44a97fa47 Mon Sep 17 00:00:00 2001 From: Nathaniel Graff Date: Fri, 8 Mar 2019 10:24:33 -0800 Subject: Support Debug/Release configurations - Puts shared flags in scripts/standalone and adds "build configurations" for debug and release which customize the build flags for specific purposes. - Documents CONFIGURATION in Sphinx docs and makefile help Signed-off-by: Nathaniel Graff --- Makefile | 46 +++++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 15 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 355524e..319903a 100644 --- a/Makefile +++ b/Makefile @@ -64,31 +64,37 @@ help: @echo " SiFive Freedom E Software Development Kit " @echo " Makefile targets:" @echo "" - @echo " software [PROGRAM=$(PROGRAM) TARGET=$(TARGET)]:" - @echo " Build a software program to load with the" - @echo " debugger." + @echo " software [PROGRAM=$(PROGRAM)] [TARGET=$(TARGET)]" + @echo " [CONFIGURATION=$(CONFIGURATION)]:" + @echo " Builds the requested PROGRAM for the TARGET using the" + @echo " specified build CONFIGURATION." @echo "" - @echo " metal [TARGET=$(TARGET)]" - @echo " Build the Freedom Metal library for TARGET" + @echo " metal [TARGET=$(TARGET)] [CONFIGURATION=$(CONFIGURATION)]" + @echo " Builds the Freedom Metal library for TARGET." @echo "" - @echo " clean [PROGRAM=$(PROGRAM) TARGET=$(TARGET)]:" - @echo " Clean compiled objects for a specified " + @echo " clean [PROGRAM=$(PROGRAM)] [TARGET=$(TARGET)]" + @echo " [CONFIGURATION=$(CONFIGURATION)]:" + @echo " Cleans compiled objects for a specified " @echo " software program." @echo "" - @echo " upload [PROGRAM=$(PROGRAM) TARGET=$(TARGET)]:" - @echo " Launch OpenOCD to flash your program to the" - @echo " on-board Flash." + @echo " upload [PROGRAM=$(PROGRAM)] [TARGET=$(TARGET)]" + @echo " [CONFIGURATION=$(CONFIGURATION)]:" + @echo " For board and FPGA TARGETs, uploads the program to the" + @echo " on-board flash." @echo "" - @echo " debug [PROGRAM=$(PROGRAM) TARGET=$(TARGET)]:" - @echo " Launch OpenOCD and attach GDB to the running program." + @echo " debug [PROGRAM=$(PROGRAM)] [TARGET=$(TARGET)]" + @echo " [CONFIGURATION=$(CONFIGURATION)]:" + @echo " For board and FPGA TARGETs, attaches GDB to the" + @echo " running program." @echo "" @echo " standalone STANDALONE_DEST=/path/to/desired/location" @echo " [INCLUDE_METAL_SOURCES=1] [PROGRAM=$(PROGRAM)]" - @echo " [TARGET=$(TARGET)]:" - @echo " Export a program for a single target into a standalone" + @echo " [TARGET=$(TARGET)] [CONFIGURATION=$(CONFIGURATION)]:" + @echo " Exports a program for a single target into a standalone" @echo " project directory at STANDALONE_DEST." @echo "" - @echo " For more information, read the accompanying README.md" + @echo " For more information, view the Freedom E SDK Documentation at" + @echo " https://sifive.github.io/freedom-e-sdk-docs/index.html" .PHONY: clean clean: @@ -160,6 +166,8 @@ standalone: \ $(STANDALONE_DEST)/src \ $(SRC_DIR) \ freedom-metal \ + debug.mk \ + release.mk \ scripts/standalone.mk \ scripts/libmetal.mk cp -r $(addprefix $(BSP_DIR)/,$(filter-out build,$(shell ls $(BSP_DIR)))) $ $> $> $ $> $