clean: bpftool_clean
        $(call QUIET_CLEAN, bpf-progs)
-       $(Q)rm -rf $(OUTPUT)*.o $(OUTPUT)bpf_jit_disasm $(OUTPUT)bpf_dbg \
+       $(Q)$(RM) -r -- $(OUTPUT)*.o $(OUTPUT)bpf_jit_disasm $(OUTPUT)bpf_dbg \
               $(OUTPUT)bpf_asm $(OUTPUT)bpf_exp.yacc.* $(OUTPUT)bpf_exp.lex.*
        $(call QUIET_CLEAN, core-gen)
-       $(Q)rm -f $(OUTPUT)FEATURE-DUMP.bpf
+       $(Q)$(RM) -- $(OUTPUT)FEATURE-DUMP.bpf
+       $(Q)$(RM) -r -- $(OUTPUT)feature
 
 install: $(PROGS) bpftool_install
        $(call QUIET_INSTALL, bpf_jit_disasm)
 
 
 clean: $(LIBBPF)-clean
        $(call QUIET_CLEAN, bpftool)
-       $(Q)$(RM) $(OUTPUT)bpftool $(OUTPUT)*.o $(OUTPUT)*.d
+       $(Q)$(RM) -- $(OUTPUT)bpftool $(OUTPUT)*.o $(OUTPUT)*.d
+       $(Q)$(RM) -r -- $(OUTPUT)libbpf/
        $(call QUIET_CLEAN, core-gen)
-       $(Q)$(RM) $(OUTPUT)FEATURE-DUMP.bpftool
+       $(Q)$(RM) -- $(OUTPUT)FEATURE-DUMP.bpftool
+       $(Q)$(RM) -r -- $(OUTPUT)feature/
 
 install: $(OUTPUT)bpftool
        $(call QUIET_INSTALL, bpftool)
 
 uninstall:
        $(call QUIET_UNINST, bpftool)
-       $(Q)$(RM) $(DESTDIR)$(prefix)/sbin/bpftool
-       $(Q)$(RM) $(DESTDIR)$(bash_compdir)/bpftool
+       $(Q)$(RM) -- $(DESTDIR)$(prefix)/sbin/bpftool
+       $(Q)$(RM) -- $(DESTDIR)$(bash_compdir)/bpftool
 
 doc:
        $(call descend,Documentation)