summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile45
1 files changed, 39 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index c19045b..2be82e1 100644
--- a/Makefile
+++ b/Makefile
@@ -20,6 +20,26 @@ endif
PROGRAM ?= hello
TARGET ?= sifive-hifive1
+# Setup differences between host platforms
+ifeq ($(OS),Windows_NT)
+ SED_RE_FLAG = -r
+else
+ UNAME_S := $(shell uname -s)
+ ifeq ($(UNAME_S),Linux)
+ SED_RE_FLAG = -r
+ endif
+ ifeq ($(UNAME_S),Darwin)
+ SED_RE_FLAG = -E
+ endif
+endif
+
+# Coremark require PORT_DIR set for different OS, freedom-metal for us!
+ifeq ($(PROGRAM),coremark)
+ifeq ($(PORT_DIR),)
+PORT_DIR = freedom-metal
+endif
+endif
+
TARGET_ROOT ?= $(abspath .)
PROGRAM_ROOT ?= $(abspath .)
@@ -93,8 +113,15 @@ help:
@echo " Exports a program for a single target into a standalone"
@echo " project directory at STANDALONE_DEST."
@echo ""
- @echo " For more information, view the Freedom E SDK Documentation at"
- @echo " https://sifive.github.io/freedom-e-sdk-docs/index.html"
+ @echo " open-docs"
+ @echo " Opens the Freedom E SDK documentation in your HTML"
+ @echo " viewer of choice. The documentation can also be found"
+ @echo " online at"
+ @echo " https://sifive.github.io/freedom-e-sdk-docs/index.html"
+
+.PHONY: open-docs
+open-docs: scripts/open-docs
+ $^
.PHONY: clean
clean:
@@ -102,9 +129,9 @@ clean:
#############################################################
# Enumerate BSPs and Programs
#
-# List all available boards and programs in a form that
-# Freedom Studio knows how to parse. Do not change the
-# format or fixed text of the output without consulting the
+# List all available boards and programs in a form that
+# Freedom Studio knows how to parse. Do not change the
+# format or fixed text of the output without consulting the
# Freedom Studio dev team.
#############################################################
@@ -131,7 +158,7 @@ list-targets:
list-target-tags:
@echo target-tags: $(shell find $(TARGET_ROOT)/bsp -name settings.mk | \
xargs grep -he "TARGET_TAGS" | \
- sed -r 's/TARGET_TAGS.*=(.*)/\1/' | \
+ sed $(SED_RE_FLAG) 's/TARGET_TAGS.*=(.*)/\1/' | \
tr ' ' '\n' | \
sort | \
uniq)
@@ -194,6 +221,9 @@ standalone: \
cp release.mk $</release.mk
echo "PROGRAM = $(PROGRAM)" > $</Makefile
+ifneq ($(PORT_DIR),)
+ echo "PORT_DIR = $(PORT_DIR)" > $</Makefile
+endif
cat scripts/standalone.mk >> $</Makefile
cat scripts/libmetal.mk >> $</Makefile
else # "rtl" not in TARGET_TAGS
@@ -220,6 +250,9 @@ standalone: \
cp release.mk $</release.mk
echo "PROGRAM = $(PROGRAM)" > $</Makefile
+ifneq ($(PORT_DIR),)
+ echo "PORT_DIR = $(PORT_DIR)" > $</Makefile
+endif
cat scripts/standalone.mk >> $</Makefile
cat scripts/libmetal.mk >> $</Makefile
endif # rtl in TARGET_TAGS