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)))) $ $> $> $ $> $ Date: Tue, 12 Mar 2019 09:58:13 -0700 Subject: ELF output has .elf extension Signed-off-by: Nathaniel Graff --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 319903a..ee3b396 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ PROGRAM_ROOT ?= $(abspath .) SRC_DIR = $(PROGRAM_ROOT)/software/$(PROGRAM) -PROGRAM_ELF = $(SRC_DIR)/$(PROGRAM) +PROGRAM_ELF = $(SRC_DIR)/$(PROGRAM).elf PROGRAM_HEX = $(SRC_DIR)/$(PROGRAM).hex ############################################################# -- cgit v1.2.3 From 1b72ca73835d6064b467a126a392f4539fa2f10a Mon Sep 17 00:00:00 2001 From: Nathaniel Graff Date: Tue, 12 Mar 2019 10:09:10 -0700 Subject: Build metal libs into install/lib/CONFIGURATION Removes the INCLUDE_METAL_SOURCES option. If we want to be able to support multiple build configurations for standalone projects, the Metal library must be rebuilt to take into account those options. An alternative is to put back the prebuilt library option and just remove the configuration option from standalone projects without the Metal library sources. Signed-off-by: Nathaniel Graff --- Makefile | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ee3b396..96e8fd5 100644 --- a/Makefile +++ b/Makefile @@ -88,8 +88,7 @@ help: @echo " running program." @echo "" @echo " standalone STANDALONE_DEST=/path/to/desired/location" - @echo " [INCLUDE_METAL_SOURCES=1] [PROGRAM=$(PROGRAM)]" - @echo " [TARGET=$(TARGET)] [CONFIGURATION=$(CONFIGURATION)]:" + @echo " [PROGRAM=$(PROGRAM)] [TARGET=$(TARGET)]:" @echo " Exports a program for a single target into a standalone" @echo " project directory at STANDALONE_DEST." @echo "" @@ -158,8 +157,6 @@ $(STANDALONE_DEST): $(STANDALONE_DEST)/%: mkdir -p $@ -ifneq ($(INCLUDE_METAL_SOURCES),) - standalone: \ $(STANDALONE_DEST) \ $(STANDALONE_DEST)/bsp \ @@ -186,28 +183,6 @@ standalone: \ cat scripts/standalone.mk >> $> $ $> $ Date: Tue, 12 Mar 2019 10:22:46 -0700 Subject: Build program into SRC_DIR/CONFIGURATION/PROGRAM Signed-off-by: Nathaniel Graff --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 96e8fd5..3853c53 100644 --- a/Makefile +++ b/Makefile @@ -25,8 +25,8 @@ PROGRAM_ROOT ?= $(abspath .) SRC_DIR = $(PROGRAM_ROOT)/software/$(PROGRAM) -PROGRAM_ELF = $(SRC_DIR)/$(PROGRAM).elf -PROGRAM_HEX = $(SRC_DIR)/$(PROGRAM).hex +PROGRAM_ELF = $(SRC_DIR)/$(CONFIGURATION)/$(PROGRAM).elf +PROGRAM_HEX = $(SRC_DIR)/$(CONFIGURATION)/$(PROGRAM).hex ############################################################# # BSP Loading -- cgit v1.2.3