summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Mills <kevin.mills@sifive.com>2019-06-20 11:10:26 -0700
committerKevin Mills <kevin.mills@sifive.com>2019-06-20 11:10:26 -0700
commit55f4362c9827474b8666ec0506e94b2a41c3e8e2 (patch)
tree31e3764d2cd7e81f1a82c2f7fddfa31e2fb1ec08
parent4e14a479f958fa2f4259035f3a47d799c6aa4c07 (diff)
fixup standalone targets to work.
-rw-r--r--Makefile12
1 files changed, 10 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 2be82e1..aa1839e 100644
--- a/Makefile
+++ b/Makefile
@@ -214,7 +214,11 @@ standalone: \
find $</scripts/elf2hex -name ".git*" | xargs rm -rf
+ifeq ($(PORT_DIR),)
$(MAKE) -C $(SRC_DIR) clean
+else
+ $(MAKE) -C $(SRC_DIR) PORT_DIR=${PORT_DIR} clean
+endif
cp -r $(SRC_DIR)/* $</src/
cp debug.mk $</debug.mk
@@ -222,7 +226,7 @@ standalone: \
echo "PROGRAM = $(PROGRAM)" > $</Makefile
ifneq ($(PORT_DIR),)
- echo "PORT_DIR = $(PORT_DIR)" > $</Makefile
+ echo "PORT_DIR = $(PORT_DIR)" >> $</Makefile
endif
cat scripts/standalone.mk >> $</Makefile
cat scripts/libmetal.mk >> $</Makefile
@@ -243,7 +247,11 @@ standalone: \
find $</freedom-metal -name ".git*" | xargs rm -rf
+ifeq ($(PORT_DIR),)
$(MAKE) -C $(SRC_DIR) clean
+else
+ $(MAKE) -C $(SRC_DIR) PORT_DIR=${PORT_DIR} clean
+endif
cp -r $(SRC_DIR)/* $</src/
cp debug.mk $</debug.mk
@@ -251,7 +259,7 @@ standalone: \
echo "PROGRAM = $(PROGRAM)" > $</Makefile
ifneq ($(PORT_DIR),)
- echo "PORT_DIR = $(PORT_DIR)" > $</Makefile
+ echo "PORT_DIR = $(PORT_DIR)" >> $</Makefile
endif
cat scripts/standalone.mk >> $</Makefile
cat scripts/libmetal.mk >> $</Makefile