summaryrefslogtreecommitdiff
path: root/nuttx/tools/Config.mk
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/Config.mk
parentb023c1b10ea54b6fc54f0ec747c766187c58190f (diff)
downloadnuttx-a444a16f4746959a1332cb21749fbdf9a31df091.tar.gz
nuttx-a444a16f4746959a1332cb21749fbdf9a31df091.tar.bz2
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/Config.mk')
-rw-r--r--nuttx/tools/Config.mk30
1 files changed, 28 insertions, 2 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