summaryrefslogtreecommitdiff
path: root/nuttx/tools
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-11-17 18:54:53 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-11-17 18:54:53 +0000
commita444a16f4746959a1332cb21749fbdf9a31df091 (patch)
treed220ebef3bfba64591298b4c51a0c0dd6e10ae0b /nuttx/tools
parentb023c1b10ea54b6fc54f0ec747c766187c58190f (diff)
downloadpx4-nuttx-a444a16f4746959a1332cb21749fbdf9a31df091.tar.gz
px4-nuttx-a444a16f4746959a1332cb21749fbdf9a31df091.tar.bz2
px4-nuttx-a444a16f4746959a1332cb21749fbdf9a31df091.zip
Most of the changes needed to support Windows native clean; distclean is has a problem
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5367 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/tools')
-rw-r--r--nuttx/tools/Config.mk30
-rw-r--r--nuttx/tools/Makefile.host18
2 files changed, 42 insertions, 6 deletions
diff --git a/nuttx/tools/Config.mk b/nuttx/tools/Config.mk
index 4cdda113c..aafb58f35 100644
--- a/nuttx/tools/Config.mk
+++ b/nuttx/tools/Config.mk
@@ -2,7 +2,9 @@
# Config.mk
# Global build rules and macros.
#
+# Copyright (C) 2011 Gregory Nutt. All rights reserved.
# Author: Richard Cochran
+# Gregory Nutt <gnutt@nuttx.org>
#
# This file (along with $(TOPDIR)/.config) must be included by every
# configuration-specific Make.defs file.
@@ -43,6 +45,12 @@ CONFIG_ARCH := $(patsubst "%",%,$(strip $(CONFIG_ARCH)))
CONFIG_ARCH_CHIP := $(patsubst "%",%,$(strip $(CONFIG_ARCH_CHIP)))
CONFIG_ARCH_BOARD := $(patsubst "%",%,$(strip $(CONFIG_ARCH_BOARD)))
+# Some defaults just to prohibit some bad behavior if for some reason they
+# are not defined
+
+OBJEXT ?= .o
+LIBEXT ?= .a
+
# DELIM - Path segment delimiter character
#
# Depends on this settings defined in board-specific defconfig file installed
@@ -167,12 +175,30 @@ define ARCHIVE
endef
endif
+# DELFILE - Delete one file
+
+ifeq ($(CONFIG_WINDOWS_NATIVE),y)
+define DELFILE
+ $(Q) if exist $1 (del /f /q $1)
+endef
+else
+define CLEAN
+ $(Q) rm -f $1
+endef
+endif
+
+# CLEAN - Default clean target
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
define CLEAN
- $(Q) rm -f *.o *.a
+ $(Q) if exist *$(OBJEXT) (del /f /q *$(OBJEXT))
+ $(Q) if exist *$(LIBEXT) (del /f /q *$(LIBEXT))
+ $(Q) if exist *~ (del /f /q *~)
+ $(Q) if exist (del /f /q .*.swp)
endef
else
define CLEAN
- $(Q) rm -f *.o *.a *~ .*.swp
+ $(Q) rm -f *$(OBJEXT) *$(LIBEXT) *~ .*.swp
endef
endif
+ \ No newline at end of file
diff --git a/nuttx/tools/Makefile.host b/nuttx/tools/Makefile.host
index 16975a42a..559192c5e 100644
--- a/nuttx/tools/Makefile.host
+++ b/nuttx/tools/Makefile.host
@@ -122,8 +122,18 @@ mkdeps: mkdeps$(HOSTEXEEXT)
endif
clean:
- $(Q) rm -f *.o *.a *~ .*.swp
- $(Q) rm -f mkdeps mkconfig mksyscall mkversion bdf-converter
- $(Q) rm -f mkdeps.exe mkconfig.exe mksyscall.exe mkversion.exe bdf-converter.exe
+ $(call DELFILE mkdeps)
+ $(call DELFILE mkdeps.exe)
+ $(call DELFILE mkconfig)
+ $(call DELFILE mkconfig.exe)
+ $(call DELFILE Make.dep)
+ $(call DELFILE mksyscall)
+ $(call DELFILE mksyscall.exe)
+ $(call DELFILE mkversion)
+ $(call DELFILE mkversion.exe)
+ $(call DELFILE bdf-converter)
+ $(call DELFILE bdf-converter.exe)
+ifneq ($(CONFIG_WINDOWS_NATIVE),y)
$(Q) rm -rf *.dSYM
-
+endif
+ $(call CLEAN)