diff --git a/apps/Makefile b/apps/Makefile index 826694dad4..77f2012ef8 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -35,7 +35,6 @@ ############################################################################ -include $(TOPDIR)/Make.defs --include $(TOPDIR)/.config APPDIR = ${shell pwd} diff --git a/apps/examples/Makefile b/apps/examples/Makefile index 269d2b4643..2bff9934e6 100644 --- a/apps/examples/Makefile +++ b/apps/examples/Makefile @@ -104,13 +104,13 @@ all: nothing define SDIR_template $(1)_$(2): - $(MAKE) -C $(1) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" + $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" endef $(foreach SDIR, $(CNTXTDIRS), $(eval $(call SDIR_template,$(SDIR),context))) $(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),depend))) $(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),clean))) -$(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),disclean))) +$(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),distclean))) nothing: diff --git a/apps/examples/cxxtest/Makefile b/apps/examples/cxxtest/Makefile index e6bdd34fc3..b0f0befbf0 100644 --- a/apps/examples/cxxtest/Makefile +++ b/apps/examples/cxxtest/Makefile @@ -73,7 +73,7 @@ STACKSIZE = 4096 VPATH = all: .built -.PHONY: clean depend disclean chkcxx +.PHONY: clean depend distclean chkcxx chkcxx: ifneq ($(CONFIG_HAVE_CXX),y) diff --git a/apps/examples/elf/Makefile b/apps/examples/elf/Makefile index 24472139fb..8831a9336e 100644 --- a/apps/examples/elf/Makefile +++ b/apps/examples/elf/Makefile @@ -65,7 +65,7 @@ ROOTDEPPATH = --dep-path . --dep-path tests VPATH = tests all: .built -.PHONY: really_build clean_tests clean depend disclean +.PHONY: really_build clean_tests clean depend distclean $(AOBJS): %$(OBJEXT): %.S $(call ASSEMBLE, $<, $@) diff --git a/apps/examples/helloxx/Makefile b/apps/examples/helloxx/Makefile index fd126d345f..295d0116e7 100644 --- a/apps/examples/helloxx/Makefile +++ b/apps/examples/helloxx/Makefile @@ -73,7 +73,7 @@ STACKSIZE = 2048 VPATH = all: .built -.PHONY: clean depend disclean chkcxx +.PHONY: clean depend distclean chkcxx chkcxx: ifneq ($(CONFIG_HAVE_CXX),y) diff --git a/apps/examples/nettest/Makefile b/apps/examples/nettest/Makefile index 75e4cf0bea..c1c50bbb8f 100644 --- a/apps/examples/nettest/Makefile +++ b/apps/examples/nettest/Makefile @@ -96,7 +96,7 @@ STACKSIZE = 2048 VPATH = all: .built $(HOST_BIN) -.PHONY: clean depend disclean +.PHONY: clean depend distclean $(TARG_AOBJS): %$(OBJEXT): %.S $(call ASSEMBLE, $<, $@) diff --git a/apps/examples/nxflat/Makefile b/apps/examples/nxflat/Makefile index 07c163347d..4fc315592c 100644 --- a/apps/examples/nxflat/Makefile +++ b/apps/examples/nxflat/Makefile @@ -65,7 +65,7 @@ ROOTDEPPATH = --dep-path . VPATH = all: .built -.PHONY: headers clean depend disclean +.PHONY: headers clean depend distclean $(AOBJS): %$(OBJEXT): %.S $(call ASSEMBLE, $<, $@) diff --git a/apps/examples/romfs/Makefile b/apps/examples/romfs/Makefile index b247db6f62..3701412762 100644 --- a/apps/examples/romfs/Makefile +++ b/apps/examples/romfs/Makefile @@ -65,7 +65,7 @@ ROOTDEPPATH = --dep-path . VPATH = all: .built -.PHONY: checkgenromfs clean depend disclean +.PHONY: checkgenromfs clean depend distclean $(AOBJS): %$(OBJEXT): %.S $(call ASSEMBLE, $<, $@) diff --git a/apps/examples/udp/Makefile b/apps/examples/udp/Makefile index 6bfdce9cc1..d6c89cac44 100644 --- a/apps/examples/udp/Makefile +++ b/apps/examples/udp/Makefile @@ -87,7 +87,7 @@ ROOTDEPPATH = --dep-path . VPATH = all: .built -.PHONY: clean depend disclean +.PHONY: clean depend distclean $(TARG_AOBJS): %$(OBJEXT): %.S $(call ASSEMBLE, $<, $@) diff --git a/apps/graphics/Makefile b/apps/graphics/Makefile index bebb31b5a6..474118450b 100644 --- a/apps/graphics/Makefile +++ b/apps/graphics/Makefile @@ -48,13 +48,13 @@ all: nothing define SDIR_template $(1)_$(2): - $(MAKE) -C $(1) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" + $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" endef $(foreach SDIR, $(CNTXTDIRS), $(eval $(call SDIR_template,$(SDIR),context))) $(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),depend))) $(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),clean))) -$(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),disclean))) +$(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),distclean))) nothing: diff --git a/apps/interpreters/Makefile b/apps/interpreters/Makefile index 1eeab585e0..3569a0044a 100644 --- a/apps/interpreters/Makefile +++ b/apps/interpreters/Makefile @@ -52,12 +52,12 @@ all: nothing define SDIR_template $(1)_$(2): - $(MAKE) -C $(1) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" + $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" endef $(foreach SDIR, $(INSTALLED_DIRS), $(eval $(call SDIR_template,$(SDIR),depend))) $(foreach SDIR, $(INSTALLED_DIRS), $(eval $(call SDIR_template,$(SDIR),clean))) -$(foreach SDIR, $(INSTALLED_DIRS), $(eval $(call SDIR_template,$(SDIR),disclean))) +$(foreach SDIR, $(INSTALLED_DIRS), $(eval $(call SDIR_template,$(SDIR),distclean))) nothing: diff --git a/apps/netutils/Makefile b/apps/netutils/Makefile index 303b804b6c..b557c73cc8 100644 --- a/apps/netutils/Makefile +++ b/apps/netutils/Makefile @@ -49,12 +49,12 @@ all: nothing define SDIR_template $(1)_$(2): - $(MAKE) -C $(1) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" + $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" endef $(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),depend))) $(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),clean))) -$(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),disclean))) +$(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),distclean))) nothing: diff --git a/apps/system/Makefile b/apps/system/Makefile index 572598e398..c59059d811 100644 --- a/apps/system/Makefile +++ b/apps/system/Makefile @@ -41,9 +41,15 @@ SUBDIRS = free i2c install readline poweroff ramtron sdcard sysinfo # Create the list of installed runtime modules (INSTALLED_DIRS) +ifeq ($(CONFIG_WINDOWS_NATIVE),y) define ADD_DIRECTORY -INSTALLED_DIRS += ${shell if [ -r $1/Makefile ]; then echo "$1"; fi} + INSTALLED_DIRS += $(if $(wildcard .\$1\Makefile),$1,) endef +else +define ADD_DIRECTORY + INSTALLED_DIRS += $(if $(wildcard ./$1/Makefile),$1,) +endef +endif $(foreach DIR, $(SUBDIRS), $(eval $(call ADD_DIRECTORY,$(DIR)))) @@ -52,12 +58,12 @@ all: nothing define SDIR_template $(1)_$(2): - $(MAKE) -C $(1) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" + $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" endef $(foreach SDIR, $(INSTALLED_DIRS), $(eval $(call SDIR_template,$(SDIR),depend))) $(foreach SDIR, $(INSTALLED_DIRS), $(eval $(call SDIR_template,$(SDIR),clean))) -$(foreach SDIR, $(INSTALLED_DIRS), $(eval $(call SDIR_template,$(SDIR),disclean))) +$(foreach SDIR, $(INSTALLED_DIRS), $(eval $(call SDIR_template,$(SDIR),distclean))) nothing: diff --git a/nuttx/tools/Config.mk b/nuttx/tools/Config.mk index b7f8d9bbe0..f05933f1ab 100644 --- a/nuttx/tools/Config.mk +++ b/nuttx/tools/Config.mk @@ -154,10 +154,12 @@ define ARCHIVE endef endif -define CLEAN ifeq ($(CONFIG_WINDOWS_NATIVE),y) +define CLEAN $(Q) rm -f *.o *.a -else - $(Q) rm -f *.o *.a *~ .*.swp -endif endef +else +define CLEAN + $(Q) rm -f *.o *.a *~ .*.swp +endef +endif