On 06/08/2017 02:40 AM, Thomas Huth wrote: > When doing a "make -j10" in the vanilla QEMU source tree (without > running "configure first), the Makefile currently generates two > files already, qemu-version.h and qemu-options.def. This should not > happen, so let's make these targets depend on config-host.mak. > Also the targets that use python can not be executed without the > $(PYTHON) from config-host.mak, so these should depend on the config- > host.mak file, too (these targets generate some ugly error messages > otherwise during "make -j10"). > > Signed-off-by: Thomas Huth > --- > v2: > - Add the dependency to the targets that use $(PYTHON) instead of > adding it to $(qapi-py) > > @@ -312,6 +312,7 @@ qemu-version.h: FORCE > > config-host.h: config-host.h-timestamp > config-host.h-timestamp: config-host.mak > +qemu-options.def: config-host.mak > qemu-options.def: $(SRC_PATH)/qemu-options.hx $(SRC_PATH)/scripts/hxtool > $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$@") This works (namely, splitting the dependencies between a no-op rule and the real rule: a:b a:c recipe ), but looks unusual compared to having a single rule with all the dependencies: a: b c recipe > @@ -394,17 +395,17 @@ gen-out-type = $(subst .,-,$(suffix $@)) > qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py > > qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\ > -$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py) > +$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py) config-host.mak > $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \ Long line. Let's use \ line-splitting to keep things under 80 columns (if Fam's suggestion of adding the dependency just once doesn't pan out). > $(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \ > "GEN","$@") > qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h :\ > -$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py) > +$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py) config-host.mak More long lines ahead. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org