You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/09/19 18:40:37 UTC

[GitHub] [incubator-nuttx] btashton commented on a change in pull request #1843: make/clean: clean the OBJ directly if declare in subdirectory

btashton commented on a change in pull request #1843:
URL: https://github.com/apache/incubator-nuttx/pull/1843#discussion_r491481695



##########
File path: tools/Config.mk
##########
@@ -458,7 +458,8 @@ define CLEAN
 endef
 else
 define CLEAN
-	$(Q) rm -f *$(OBJEXT) *$(LIBEXT) *~ .*.swp
+	$(call DELFILE, $(wildcard $(foreach obj, $(OBJS), $(addsuffix /$(obj), $(subst :, ,$(VPATH))))))
+	$(call DELFILE, *$(OBJEXT) *$(LIBEXT) *~ .*.swp)

Review comment:
       > > An alternative is to have both *$(OBJEXT) and $(OBJS). That considers both scenarios although there would be overlap between those two in some cases.
   > 
   > *$(OBJEXT) is not safe. What if it has no value? Catastrophe follows (this has happened to me!)
   > 
   > There would be no overlap if if the wildcard based clean were done second.
   
   Can we conditionally do  the rm if $(OBJEXT) is set or wrap it with a helper and error?  Seems like $(OBJEXT) not being set is a sign something went very wrong.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org