Use vpath directive
The vpath directive has two advantages over the VPATH variable:
1) it allows to skip searching of .o files; 2) the default semantics
are to append to the vpath, so there is no confusion between "VPATH=xyz"
and "VPATH+=xyz".
Since "vpath %.c %.h PATH" is not valid, I'm introducing a wrapper
macro to append one or more directories to the vpath.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
diff --git a/Makefile b/Makefile
index 2ca341b..1f284ae 100644
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,7 @@
.PHONY: all clean cscope distclean dvi html info install install-doc \
recurse-all speed tar tarbin test build-all
-VPATH=$(SRC_PATH):$(SRC_PATH)/hw
+$(call set-vpath, $(SRC_PATH):$(SRC_PATH)/hw)
LIBS+=-lz $(LIBS_TOOLS)