From 7743a2d4e2c19d00c5ae2d56203554671b39c882 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 4 Sep 2014 12:35:47 -0600 Subject: [PATCH] Don't copy build scripts for kernel build 'make exports' --- Makefile.unix | 9 ++++++++- Makefile.win | 11 +++++++++++ tools/mkexport.sh | 22 ++++++++++++---------- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/Makefile.unix b/Makefile.unix index 2d7bb4fca2..c3fe360a78 100644 --- a/Makefile.unix +++ b/Makefile.unix @@ -39,12 +39,19 @@ include $(TOPDIR)/tools/Config.mk -include $(TOPDIR)/Make.defs # Control build verbosity +# +# V=1,2: Enable echo of commands +# V=2: Enable bug/verbose options in tools and scripts ifeq ($(V),1) export Q := else +ifeq ($(V),2) +export Q := +else export Q := @ endif +endif # Default tools @@ -161,7 +168,7 @@ MKEXPORT_ARGS += -u endif endif -ifeq ($(V),1) +ifeq ($(V),2) MKEXPORT_ARGS += -d endif diff --git a/Makefile.win b/Makefile.win index bb90d77e49..93cb39ab8b 100644 --- a/Makefile.win +++ b/Makefile.win @@ -39,12 +39,19 @@ TOPDIR := ${shell echo %CD%} -include $(TOPDIR)\Make.defs # Control build verbosity +# +# V=1,2: Enable echo of commands +# V=2: Enable bug/verbose options in tools and scripts ifeq ($(V),1) export Q := else +ifeq ($(V),2) +export Q := +else export Q := @ endif +endif # This define is passed as EXTRADEFINES for kernel-mode builds. It is also passed # during PASS1 (but not PASS2) context and depend targets. @@ -154,6 +161,10 @@ MKEXPORT_ARGS = -u endif endif +ifeq ($(V),2) +MKEXPORT_ARGS += -d +endif + # This is the name of the final target (relative to the top level directorty) BIN = nuttx$(EXEEXT) diff --git a/tools/mkexport.sh b/tools/mkexport.sh index 562121bed6..cbdcddc78e 100755 --- a/tools/mkexport.sh +++ b/tools/mkexport.sh @@ -165,19 +165,21 @@ fi # Is there a linker script in this configuration? -if [ ! -z "${LDPATH}" ]; then +if [ "X${USRONLY}" != "Xy" ]; then + if [ ! -z "${LDPATH}" ]; then - # Apparently so. Verify that the script exists + # Apparently so. Verify that the script exists - if [ ! -f "${LDPATH}" ]; then - echo "MK: File ${LDPATH} does not exist" - exit 1 + if [ ! -f "${LDPATH}" ]; then + echo "MK: File ${LDPATH} does not exist" + exit 1 + fi + + # Copy the linker script + + cp -p "${LDPATH}" "${EXPORTDIR}/build/." || \ + { echo "MK: cp ${LDPATH} failed"; exit 1; } fi - - # Copy the linker script - - cp -p "${LDPATH}" "${EXPORTDIR}/build/." || \ - { echo "MK: cp ${LDPATH} failed"; exit 1; } fi # Save the compilation options