On Wed, Jan 25, 2017 at 04:14:10PM +0000, Daniel P. Berrange wrote: > One final complication is that the absolute '-I$(BUILD_DIR)/$(@D)' > will sometimes end up pointing to a non-existant directory if > that sub-dir does not have any target-independant files to be > built. Rather than try to dynamically filter this, a simple > 'mkdir' ensures $(BUILD_DIR)/$(@D) is guaranteed to exist at > all times. > > @@ -359,6 +374,7 @@ define unnest-vars > $(eval $(o:%.mo=%$(DSOSUF)): module-common.o $($o-objs)), > $(error $o added in $v but $o-objs is not set))) > $(shell mkdir -p ./ $(sort $(dir $($v)))) > + $(shell cd $(BUILD_DIR) && mkdir -p ./ $(sort $(dir $($v)))) > # Include all the .d files > $(eval -include $(patsubst %.o,%.d,$(patsubst %.mo,%.d,$($v)))) > $(eval $v := $(filter-out %/,$($v))))
After this change building QEMU leaves a lot of empty directories in the parent directory: $ mkdir empty_dir $ cd empty_dir $ git clone https://github.com/qemu/qemu $ cd qemu $ ./configure ... $ ls .. qemu $ make $ ls .. audio chardev fsdev linux-user net qom target backends crypto hw migration qapi replay ui block disas io nbd qemu slirp util Berto