From c5bcfc166d0504a919a9987526df4cf4587c2bbc Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 9 Jan 2016 17:27:56 -0600 Subject: [PATCH] tools/mkwindeps.sh. A script that coordinates the use of cnvwindeps.exe --- ChangeLog | 2 ++ Documentation | 2 +- Makefile.unix | 11 ++++++-- arch | 2 +- configs | 2 +- tools/Makefile.host | 4 +++ tools/mkwindeps.sh | 69 +++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 86 insertions(+), 6 deletions(-) create mode 100644 tools/mkwindeps.sh diff --git a/ChangeLog b/ChangeLog index dcb13526e1..c1f27a6d1f 100755 --- a/ChangeLog +++ b/ChangeLog @@ -11295,4 +11295,6 @@ * tools/cnvwindeps.c: Add a tool that will convert paths in dependencies generated by a Windows compiler so that they can be used with the Cygwin make (2016-01-09). + * tools/mkwindeps.sh: A script that coordinates us ov cnvwindeps.exe + (2016-01-09). diff --git a/Documentation b/Documentation index 1d164c4df5..e3d982b2f1 160000 --- a/Documentation +++ b/Documentation @@ -1 +1 @@ -Subproject commit 1d164c4df5b6577c52f88d56ce270bd4f7556963 +Subproject commit e3d982b2f1c179747551a015d5a4c11132dbfe47 diff --git a/Makefile.unix b/Makefile.unix index 28d0df608d..2aca0beb09 100644 --- a/Makefile.unix +++ b/Makefile.unix @@ -269,7 +269,12 @@ include/nuttx/config.h: $(TOPDIR)/.config tools/mkconfig$(HOSTEXEEXT) # Targets used to create dependencies tools/mkdeps$(HOSTEXEEXT): - $(Q) $(MAKE) -C tools -f Makefile.host TOPDIR="$(TOPDIR)" mkdeps$(HOSTEXEEXT) + $(Q) $(MAKE) -C tools -f Makefile.host TOPDIR="$(TOPDIR)" mkdeps$(HOSTEXEEXT) + +tools/cnvwindeps$(HOSTEXEEXT): +ifeq ($(CONFIG_WINDOWS_CYGWIN),y) + $(Q) $(MAKE) -C tools -f Makefile.host TOPDIR="$(TOPDIR)" cnvwindeps$(HOSTEXEEXT) +endif # dirlinks, and helpers # @@ -460,12 +465,12 @@ download: $(BIN) # pass1dep: Create pass1 build dependencies # pass2dep: Create pass2 build dependencies -pass1dep: context tools/mkdeps$(HOSTEXEEXT) +pass1dep: context tools/mkdeps$(HOSTEXEEXT) tools/cnvwindeps$(HOSTEXEEXT) $(Q) for dir in $(USERDEPDIRS) ; do \ $(MAKE) -C $$dir TOPDIR="$(TOPDIR)" depend ; \ done -pass2dep: context tools/mkdeps$(HOSTEXEEXT) +pass2dep: context tools/mkdeps$(HOSTEXEEXT) tools/cnvwindeps$(HOSTEXEEXT) $(Q) for dir in $(KERNDEPDIRS) ; do \ $(MAKE) -C $$dir TOPDIR="$(TOPDIR)" EXTRADEFINES=$(KDEFINE) depend; \ done diff --git a/arch b/arch index 4570fe271a..95a83af6d1 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit 4570fe271a034ae7aa23e579064f90c75594f985 +Subproject commit 95a83af6d1ee3d2ecd2cd6a3c3bb4a99c4c06d7a diff --git a/configs b/configs index da294ce5cc..7b507f0c3c 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit da294ce5cc305030e4f9bb8bd238054f20317525 +Subproject commit 7b507f0c3c812869cb4ec5981b740ac94444b49f diff --git a/tools/Makefile.host b/tools/Makefile.host index 3cc0080261..08cf639016 100644 --- a/tools/Makefile.host +++ b/tools/Makefile.host @@ -165,8 +165,12 @@ endif # cnvwindeps - Convert dependences generated by a Windows native toolchain # for use in a Cygwin/POSIX build environment +ifeq ($(CONFIG_WINDOWS_CYGWIN),y) cnvwindeps$(HOSTEXEEXT): cnvwindeps.c $(Q) $(HOSTCC) $(HOSTCFLAGS) -o cnvwindeps$(HOSTEXEEXT) cnvwindeps.c +else +cnvwindeps$(HOSTEXEEXT): +endif ifdef HOSTEXEEXT cnvwindeps: cnvwindeps$(HOSTEXEEXT) diff --git a/tools/mkwindeps.sh b/tools/mkwindeps.sh new file mode 100644 index 0000000000..ce50a32ae9 --- /dev/null +++ b/tools/mkwindeps.sh @@ -0,0 +1,69 @@ +#!/bin/bash +# tools/mkwindeps.sh +# +# Copyright (C) 2016 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +# set -x + +# Make sure that we know where we are + +TOOLDIR=$(dirname $0) + +if [ ! -x ${TOOLDIR}/mkwindeps.sh ]; then + echo "ERROR: tools/ directory not found" + exit 1 +fi + +# Make sure that executables are ready + +MKDEPS=${TOOLDIR}/mkdeps.exe +CNVWINDEPS=${TOOLDIR}/cnvwindeps.exe + +if [ ! -x ${MKDEPS} ]; then + echo "ERROR: tools/mkdeps.exe does not exist" + exit 1 +fi + +if [ ! -x ${CNVWINDEPS} ]; then + echo "ERROR: tools/cnvwindeps.exe does not exist" + exit 1 +fi + +# Run the mkdeps.exe program to generate a Windows dependency file + +TMPFILE=$(mktemp) +${MKDEPS} $* > ${TMPFILE} || { echo "mkdeps.exe failed"; exit 1; } + +# Then convert this to a POSIX dependency file (on stdout) + +${CNVWINDEPS} ${TMPFILE} +rm -f ${TMPFILE}