summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile19
-rw-r--r--scripts/standalone.mk1
2 files changed, 17 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index c19045b..e742c35 100644
--- a/Makefile
+++ b/Makefile
@@ -20,6 +20,13 @@ endif
PROGRAM ?= hello
TARGET ?= sifive-hifive1
+# 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 .)
@@ -102,9 +109,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.
#############################################################
@@ -194,6 +201,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 +230,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
diff --git a/scripts/standalone.mk b/scripts/standalone.mk
index 6f87950..0526bd1 100644
--- a/scripts/standalone.mk
+++ b/scripts/standalone.mk
@@ -171,6 +171,7 @@ $(PROGRAM_ELF): \
$(BSP_DIR)/metal.$(LINK_TARGET).lds
mkdir -p $(dir $@)
$(MAKE) -C $(SRC_DIR) $(basename $(notdir $@)) \
+ PORT_DIR=$(PORT_DIR) \
AR=$(RISCV_AR) \
CC=$(RISCV_GCC) \
CXX=$(RISCV_GXX) \