You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ma...@apache.org on 2020/10/30 06:05:39 UTC

[incubator-nuttx] 05/08: tools: cxd56: mkspk: automate mkspk build

This is an automated email from the ASF dual-hosted git repository.

masayuki pushed a commit to branch releases/10.0
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 1136f388ce96761651310cea354c33dc1239d26e
Author: Alin Jerpelea <al...@sony.com>
AuthorDate: Wed Oct 28 09:39:59 2020 +0100

    tools: cxd56: mkspk: automate mkspk build
    
    the mkspk tool will automaticaly be built if CONFIG_CXD56_BINARY
    is set.
    
    Test:
    nuttx.spk was succesfully generated
    
    Signed-off-by: Alin Jerpelea <al...@sony.com>
---
 boards/arm/cxd56xx/spresense/scripts/Make.defs      |  2 +-
 tools/Makefile.host                                 |  1 +
 .../spresense/scripts => tools/cxd56}/Config.mk     | 21 +++++++++------------
 tools/cxd56/{Makefile => Makefile.host}             |  2 +-
 4 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/boards/arm/cxd56xx/spresense/scripts/Make.defs b/boards/arm/cxd56xx/spresense/scripts/Make.defs
index 142e277..dae9247 100644
--- a/boards/arm/cxd56xx/spresense/scripts/Make.defs
+++ b/boards/arm/cxd56xx/spresense/scripts/Make.defs
@@ -35,7 +35,7 @@
 
 include $(TOPDIR)/.config
 include $(TOPDIR)/tools/Config.mk
-include $(TOPDIR)/boards/arm/cxd56xx/spresense/scripts/Config.mk
+include $(TOPDIR)/tools/cxd56/Config.mk
 include $(TOPDIR)/arch/arm/src/armv7-m/Toolchain.defs
 
 # Setup for the kind of memory that we are executing from
diff --git a/tools/Makefile.host b/tools/Makefile.host
index 3417a94..adf2686 100644
--- a/tools/Makefile.host
+++ b/tools/Makefile.host
@@ -261,6 +261,7 @@ ifneq ($(CONFIG_WINDOWS_NATIVE),y)
 	$(Q) rm -rf *.dSYM
 endif
 	$(Q) $(MAKE) -C pic32 -f Makefile.host clean
+	$(Q) $(MAKE) -C cxd56 -f Makefile.host clean
 	$(call DELFILE, incdir)
 	$(call DELFILE, incdir.exe)
 	$(call CLEAN)
diff --git a/boards/arm/cxd56xx/spresense/scripts/Config.mk b/tools/cxd56/Config.mk
similarity index 75%
rename from boards/arm/cxd56xx/spresense/scripts/Config.mk
rename to tools/cxd56/Config.mk
index 8c9bd3b..a6456a8 100644
--- a/boards/arm/cxd56xx/spresense/scripts/Config.mk
+++ b/tools/cxd56/Config.mk
@@ -1,5 +1,5 @@
 ############################################################################
-# board/arm/cxd56xx/spresense/script/Config.mk
+# tools/cxd56/Config.mk
 #
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
@@ -24,18 +24,15 @@
 
 # POSTBUILD -- Perform post build operations
 
+
 ifeq ($(CONFIG_CXD56_BINARY),y)
+
 define POSTBUILD
-	$(Q) if [ ! -f "tools/cxd56/mkspk" ] ; then \
-		echo ""; \
-		echo "Please run the following command to build the needed tool"; \
-		echo ""; \
-		echo "cd tools/cxd56 && make && cd ../.."; \
-		echo ""; \
-		echo "run make again to create the nuttx.spk image."; \
-	else \
-		echo "Generating: $(NUTTXNAME).spk"; \
-		tools/cxd56/mkspk -c2 nuttx nuttx nuttx.spk; \
-	fi
+	$(Q)echo "Generating: $(NUTTXNAME).spk"; \
+
+	+$(Q) $(MAKE) -C $(TOPDIR)$(DELIM)tools$(DELIM)cxd56 -f Makefile.host
+	tools$(DELIM)cxd56$(DELIM)mkspk$(HOSTEXEEXT) -c2 nuttx nuttx nuttx.spk;
+	$(Q)([ $$? -eq 0 ] && echo "Done.")
 endef
+
 endif
diff --git a/tools/cxd56/Makefile b/tools/cxd56/Makefile.host
similarity index 98%
rename from tools/cxd56/Makefile
rename to tools/cxd56/Makefile.host
index 8511987..8925481 100644
--- a/tools/cxd56/Makefile
+++ b/tools/cxd56/Makefile.host
@@ -1,5 +1,5 @@
 ############################################################################
-# tools/mkspk/Makefile
+# tools/cxd56/Makefile.host
 #
 #   Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <gn...@nuttx.org>