Skip to content

Commit

Permalink
make: load only required dependency files.
Browse files Browse the repository at this point in the history
The old rules.mak loads dependency .d files using include directive
with file glob pattern "*.d". This breaks the build when build tree has
left-over *.d files from another build.

This patch fixes this by
  - loading precise list of .d files made from *.o and *.mo.
  - specifying explicit list of required dependency info files for
     *.hex autogenerated sources.

Note that Makefile still includes some .d in root directory by including
"*.d".

Signed-off-by: Victor Kaplansky <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
  • Loading branch information
vkaplans authored and mstsirkin committed Aug 13, 2015
1 parent 998b7b1 commit 27fa747
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion hw/i386/Makefile.objs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ obj-$(CONFIG_XEN) += ../xenpv/ xen/

obj-y += kvmvapic.o
obj-y += acpi-build.o

gen-hex-y += hw/i386/acpi-dsdt.hex
gen-hex-y += hw/i386/q35-acpi-dsdt.hex

hw/i386/acpi-build.o: hw/i386/acpi-build.c \
hw/i386/acpi-dsdt.hex hw/i386/q35-acpi-dsdt.hex
$(gen-hex-y)

-include $(gen-hex-y:.hex=.d)

iasl-option=$(shell if test -z "`$(1) $(2) 2>&1 > /dev/null`" \
; then echo "$(2)"; else echo "$(3)"; fi ;)
Expand Down
2 changes: 1 addition & 1 deletion rules.mak
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,6 @@ define unnest-vars
$(error $o added in $v but $o-objs is not set)))
$(shell mkdir -p ./ $(sort $(dir $($v))))
# Include all the .d files
$(eval -include $(addsuffix *.d, $(sort $(dir $($v)))))
$(eval -include $(patsubst %.o,%.d,$(patsubst %.mo,%.d,$($v))))
$(eval $v := $(filter-out %/,$($v))))
endef

0 comments on commit 27fa747

Please sign in to comment.