Am 04.03.2012 10:10, schrieb Michael S. Tsirkin: > I ended up with qmp-commands.h in target directories, > which makes build fail as it is found before the > main header. > make clean fixes it, but it might get triggered > again when we make some header target-independent next. > It's easy to just make sure all such leftovers are > removed, so let's do this. > > Signed-off-by: Michael S. Tsirkin <m...@redhat.com> > > diff --git a/Makefile b/Makefile > index e66e885..958a414 100644 > --- a/Makefile > +++ b/Makefile > @@ -89,6 +89,7 @@ qemu-options.def: $(SRC_PATH)/qemu-options.hx > SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS)) > > subdir-%: $(GENERATED_HEADERS) > + $(call quiet-command,rm -f $(foreach header, $(GENERATED_HEADERS), > "$*/$(header)"),)
Nack. While this happens to fix an issue you encountered this is just plain wrong and dangerous. It takes a list of currently generated headers in the main directory and deletes them in all target folders on every compile; it's not forbidden to have a header of the same name in both directories, whether generated or not. I am all for making make clean do what it claims though. The real solution to this problem would be to make sure by careful review not to move files around in such a conflicting way (rename them instead) rather than posting a note to please run make clean or make distclean (which is fine if you have to do it once, bothersome for multiple repos, and unhelpful for bisecting). Andreas > $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" > TARGET_DIR="$*/" all,) > > ifneq ($(wildcard config-host.mak),) -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg