diff --git a/src/Makefile b/src/Makefile index 03d5d76cd2f..713a1b6bb9b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -526,8 +526,8 @@ endif # These rules clean things up. 'modclean' cleans files generated by 'modules' # (except that it doesn't remove the modules that were copied to rtlib) -# 'clean' cleans everything but dependency files, and 'depclean' cleans them -# too. +# 'clean' removes the build products (including, via 'objects', the userspace +# dependency files), and 'depclean' removes the dependency files alone. modclean: find -name '.*.cmd' -or -name '*.ko' -or -name '*.mod.c' -or -name '*.mod.o' | xargs rm -f -rm -rf .tmp_versions @@ -535,8 +535,15 @@ modclean: -rm -f ../rtlib/*.ko -rm -f ../rtlib/*.so +# Realtime dependency files live in 'depends'; userspace ones sit next to +# their objects as objects/**/*.d, so both have to go. Dropping them forces +# no recompilation (nothing depends on a .d existing), but it does clear +# stale prerequisites -- a dependency file naming a source that has since +# been renamed or moved otherwise aborts the build with "No rule to make +# target", and there is no way out of that short of a full 'make clean'. depclean: -rm -rf depends + -find objects -name '*.d' -print0 2>/dev/null | xargs -0 -r rm -f clean: genclean depclean modclean genclean: