diff --git a/graphics/Makefile b/graphics/Makefile index 2e4d9d1fae..b000d11fbe 100644 --- a/graphics/Makefile +++ b/graphics/Makefile @@ -138,6 +138,11 @@ mklibgraphics: $(BIN) depend: .depend +clean_context: + $(Q) $(MAKE) -C nxglib -f Makefile.devblit distclean TOPDIR=$(TOPDIR) EXTRADEFINES=$(EXTRADEFINES) + $(Q) $(MAKE) -C nxglib -f Makefile.pwfb distclean TOPDIR=$(TOPDIR) EXTRADEFINES=$(EXTRADEFINES) + $(Q) $(MAKE) -C nxglib -f Makefile.cursor distclean TOPDIR=$(TOPDIR) EXTRADEFINES=$(EXTRADEFINES) + context: gensources clean: @@ -147,10 +152,7 @@ clean: $(call DELFILE, $(BIN)) $(call CLEAN) -distclean: clean - $(Q) $(MAKE) -C nxglib -f Makefile.devblit distclean TOPDIR=$(TOPDIR) EXTRADEFINES=$(EXTRADEFINES) - $(Q) $(MAKE) -C nxglib -f Makefile.pwfb distclean TOPDIR=$(TOPDIR) EXTRADEFINES=$(EXTRADEFINES) - $(Q) $(MAKE) -C nxglib -f Makefile.cursor distclean TOPDIR=$(TOPDIR) EXTRADEFINES=$(EXTRADEFINES) +distclean: clean clean_context $(call DELFILE, Make.dep) $(call DELFILE, .depend) diff --git a/tools/Directories.mk b/tools/Directories.mk index ab12a3f561..61fd385a50 100644 --- a/tools/Directories.mk +++ b/tools/Directories.mk @@ -39,8 +39,11 @@ # CONTEXTDIRS include directories that have special, one-time pre-build # requirements. Normally this includes things like auto-generation of # configuration specific files or creation of configurable symbolic links -# CLEANDIRS are the directories that will clean in. These are -# all directories that we know about. +# CLEANDIRS are the directories that the clean target will executed in. +# These are all directories that we know about. +# CCLEANDIRS are directories that the clean_context target will execute in. +# The clean_context target "undoes" the actions of the context target. +# Only directories known to require cleaning are included. # KERNDEPDIRS are the directories in which we will build target dependencies. # If NuttX and applications are built separately (CONFIG_BUILD_PROTECTED or # CONFIG_BUILD_KERNEL), then this holds only the directories containing @@ -50,6 +53,7 @@ # CONFIG_BUILD_KERNEL is selected, then applications are not build at all. CLEANDIRS := +CCLEANDIRS := boards $(APPDIR) graphics KERNDEPDIRS := USERDEPDIRS := diff --git a/tools/Makefile.unix b/tools/Makefile.unix index 7107578894..39d016c45d 100644 --- a/tools/Makefile.unix +++ b/tools/Makefile.unix @@ -109,8 +109,11 @@ APPDIR := ${shell if [ -r $(CONFIG_APPS_DIR)/Makefile ]; then echo "$(CONFIG_APP # CONTEXTDIRS include directories that have special, one-time pre-build # requirements. Normally this includes things like auto-generation of # configuration specific files or creation of configurable symbolic links -# CLEANDIRS are the directories that will clean in. These are -# all directories that we know about. +# CLEANDIRS are the directories that the clean target will executed in. +# These are all directories that we know about. +# CCLEANDIRS are directories that the clean_context target will execute in. +# The clean_context target "undoes" the actions of the context target. +# Only directories known to require cleaning are included. # KERNDEPDIRS are the directories in which we will build target dependencies. # If NuttX and applications are built separately (CONFIG_BUILD_PROTECTED or # CONFIG_BUILD_KERNEL), then this holds only the directories containing @@ -393,8 +396,11 @@ context: check_context staging include/nuttx/config.h include/nuttx/version.h in # and symbolic links created by the context target. clean_context: - $(Q) $(MAKE) -C boards TOPDIR="$(TOPDIR)" clean_context - $(Q) $(MAKE) -C $(CONFIG_APPS_DIR) TOPDIR="$(TOPDIR)" clean_context + $(Q) for dir in $(CCLEANDIRS) ; do \ + if [ -e $$dir/Makefile ]; then \ + $(MAKE) -C $$dir TOPDIR="$(TOPDIR)" clean_context ; \ + fi \ + done $(call DELFILE, include/math.h) $(call DELFILE, include/stdarg.h) $(call DELFILE, include/setjmp.h) diff --git a/tools/Makefile.win b/tools/Makefile.win index a40ab7cb20..aa66a338a9 100644 --- a/tools/Makefile.win +++ b/tools/Makefile.win @@ -91,8 +91,11 @@ APPDIR := ${shell if exist "$(CONFIG_APPS_DIR)\Makefile" echo $(CONFIG_APPS_DIR) # CONTEXTDIRS include directories that have special, one-time pre-build # requirements. Normally this includes things like auto-generation of # configuration specific files or creation of configurable symbolic links -# CLEANDIRS are the directories that will clean in. These are -# all directories that we know about. +# CLEANDIRS are the directories that the clean target will executed in. +# These are all directories that we know about. +# CCLEANDIRS are directories that the clean_context target will execute in. +# The clean_context target "undoes" the actions of the context target. +# Only directories known to require cleaning are included. # KERNDEPDIRS are the directories in which we will build target dependencies. # If NuttX and applications are built separately (CONFIG_BUILD_PROTECTED or # CONFIG_BUILD_KERNEL), then this holds only the directories containing @@ -407,8 +410,7 @@ context: check_context staging include\nuttx\config.h include\nuttx\version.h in # and symbolic links created by the context target. clean_context: - $(Q) $(MAKE) -C boards TOPDIR="$(TOPDIR)" clean_context - $(Q) $(MAKE) -C $(CONFIG_APPS_DIR) TOPDIR="$(TOPDIR)" clean_context + $(Q) for %%G in ($(CCLEANDIRS)) do ( if exist %%G\Makefile $(MAKE) -C %%G TOPDIR="$(TOPDIR)" clean_context ) $(call DELFILE, include\nuttx\config.h) $(call DELFILE, include\nuttx\version.h) $(call DELFILE, include\math.h) diff --git a/tools/nxstyle.c b/tools/nxstyle.c index 4031f33007..165c5becc1 100644 --- a/tools/nxstyle.c +++ b/tools/nxstyle.c @@ -285,6 +285,13 @@ int main(int argc, char **argv, char **envp) * REVISIT: Generates a false alarm if the current line is also * a comment. Generally it is acceptable for one comment to * follow another with no space separation. + * + * REVISIT: prevbrhcmt is tested to case the preceding line + * contained comments to the right of the code. In such cases, + * the comments are normally aligned and do not follow normal + * indentation rules. However, this code will generate a false + * alarm if the comments are aligned to the right BUT the + * preceding line has no comment. */ if (line[n] != '}' /* && line[n] != '#' */ && !prevbrhcmt)