Re: [PATCH] Makefile: don't run rm without any files
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 13, 2013, 16:51 UTC
- Message-ID
- <7vtxpg9mxq.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1360771068-505-1-git-send-email-kraai@ftbfs.org>
Matt Kraai <kraai@ftbfs.org> writes:
> From: Matt Kraai <matt.kraai@amo.abbott.com> > > "rm -f -r" fails on QNX when not passed any files to remove.
I do not think it is limited to QNX.
> the clean target, since dep_dirs is empty.
And dep_dirs being empty under some circumstance shouldn't be limited to QNX, either.
I think your change does no harm, may be a good change if dep_dirs goes empty, but the justification is lacking. What caused your dep_dirs to become empty in the first place?
I am scratching my head because I see
OBJECTS := $(LIB_OBJS) $(BUILTIN_OBJS) $(PROGRAM_OBJS) $(TEST_OBJS) \
$(XDIFF_OBJS) \
$(VCSSVN_OBJS) \
git.o
dep_dirs := $(addsuffix .depend,$(sort $(dir $(OBJECTS))))Show 22 quoted lines
> Avoid this by merging two rm > command lines. > > Signed-off-by: Matt Kraai <matt.kraai@amo.abbott.com> > --- > Makefile | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/Makefile b/Makefile > index 5a2e02d..c2e3666 100644 > --- a/Makefile > +++ b/Makefile > @@ -2414,8 +2414,7 @@ clean: profile-clean > builtin/*.o $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB) > $(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X > $(RM) $(TEST_PROGRAMS) > - $(RM) -r bin-wrappers > - $(RM) -r $(dep_dirs) > + $(RM) -r bin-wrappers $(dep_dirs) > $(RM) -r po/build/ > $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h $(ETAGS_TARGET) tags cscope* > $(RM) -r $(GIT_TARNAME) .doc-tmp-dir