summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--automake.tail.mk5
1 files changed, 3 insertions, 2 deletions
diff --git a/automake.tail.mk b/automake.tail.mk
index a24820b..ba31935 100644
--- a/automake.tail.mk
+++ b/automake.tail.mk
@@ -56,8 +56,9 @@ _am_phony = build install uninstall mostlyclean clean distclean maintainer-clean
.PHONY: $(addprefix $(outdir)/,$(_am_phony))
$(addprefix $(outdir)/,uninstall mostlyclean clean distclean maintainer-clean)::
- $(RM) -- $(sort $(_am_$(@F)/$(@D)))
- $(RMDIRS) $(sort $(dir $(_am_$(@F)/$(@D)))) 2>/dev/null || $(TRUE)
+ $(RM) -- $(filter-out %/,$(sort $(_am_$(@F)/$(@D))))
+ $(RM) -r -- $(filter %/,$(sort $(_am_$(@F)/$(@D))))
+ $(RMDIRS) $(sort $(dir $(patsubst %/,%,$(_am_$(@F)/$(@D))))) 2>/dev/null || $(TRUE)
# 'build' and 'install' must be defined later, because the
# am_*_files/* variables might not be complete yet.