diff options
author | Bunnaroath Sou <bsou@sifive.com> | 2019-03-27 18:05:49 -0700 |
---|---|---|
committer | Hsiang-Chia.Huang <hsiangchiah@sifive.com> | 2019-06-02 18:30:10 -0700 |
commit | 7fff977c8853a9c30f0017f4e47dd838b529997d (patch) | |
tree | 93923b43b5c3335d29919a9afbc52c8bc1ff95d9 | |
parent | f2c7f75ceef24aec9891d75c2b4fb5db5b847868 (diff) |
Update Makefile to handle special ENV require for coremark, dhrystone
-rw-r--r-- | Makefile | 19 | ||||
-rw-r--r-- | scripts/standalone.mk | 1 |
2 files changed, 17 insertions, 3 deletions
@@ -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) \ |