Alexandre Raymond <cerb...@gmail.com> writes: > At the moment, "make distclean" relies on the TARGET_DIRS variable, set by > configure. The problem is that this variable does not always contain all > possible targets. > > For example, the following will leave build data in the tree: > > ./configure && make && ./configure --target-list=i386-softmmu \ > && make distclean > > as it will only remove the i386-softmmu build directory, although the > first build created additional directories.
Why is that a problem? > Solution : pass the full list of targets from configure to make via > the DEFAULT_TARGET_LIST variable. Well, I'd expect distclean to remove exactly what *this* makefile can build, and leave everything else alone. Your patch adds a special case to that simple rule: also remove not-configured target directories. Other not-configured stuff is still left behind. Special cases need special justification, hence my question above.