From a444a16f4746959a1332cb21749fbdf9a31df091 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 17 Nov 2012 18:54:53 +0000 Subject: 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 --- nuttx/tools/Config.mk | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'nuttx/tools/Config.mk') 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 # # 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 -- cgit v1.2.3