summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorNathaniel Graff <nathaniel.graff@sifive.com>2019-03-08 10:24:33 -0800
committerNathaniel Graff <nathaniel.graff@sifive.com>2019-03-12 13:36:41 -0700
commit3da1e2e24fb713e87984bc18d7c1c4c44a97fa47 (patch)
tree132315885208178adde42abf1100acf5379661a8 /Makefile
parent97273d31d812b3ead12fa050fd90c03dafa4f26c (diff)
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 <nathaniel.graff@sifive.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile46
1 files changed, 31 insertions, 15 deletions
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)))) $</bsp/
@@ -171,6 +179,9 @@ standalone: \
$(MAKE) -C $(SRC_DIR) clean
cp -r $(SRC_DIR)/* $</src/
+ cp debug.mk $</debug.mk
+ cp release.mk $</release.mk
+
echo "PROGRAM = $(PROGRAM)" > $</Makefile
cat scripts/standalone.mk >> $</Makefile
cat scripts/libmetal.mk >> $</Makefile
@@ -183,12 +194,17 @@ standalone: \
$(BSP_DIR)/install/lib/libmetal.a \
$(BSP_DIR)/install/lib/libmetal-gloss.a \
$(SRC_DIR) \
+ debug.mk \
+ release.mk \
scripts/standalone.mk
cp -r $(addprefix $(BSP_DIR)/,$(filter-out build,$(shell ls $(BSP_DIR)))) $</bsp/
$(MAKE) -C $(SRC_DIR) clean
cp -r $(SRC_DIR)/* $</src/
+ cp debug.mk $</debug.mk
+ cp release.mk $</release.mk
+
echo "PROGRAM = $(PROGRAM)" > $</Makefile
cat scripts/standalone.mk >> $</Makefile
endif