XEN_LINUX_MIRROR ?= http://www.kernel.org/pub/linux/kernel/v2.6/
XEN_LINUX_TARBALL ?= linux-$(LINUX_VER)-xen.tar.bz2

LINUX_SRCDIR ?= linux-$(LINUX_VER)

KETCHUP ?= python buildconfigs/ketchup

vpath linux-%.tar.bz2 $(LINUX_SRC_PATH)

# download a pristine Linux kernel tarball if there isn't one in LINUX_SRC_PATH
linux-%.tar.bz2:
	@echo "Cannot find $@ in path $(LINUX_SRC_PATH)"
	false wget $(XEN_LINUX_MIRROR)/$@ -O./$@

# XXX create a pristine tree for diff -Nurp convenience

%/.valid-src: $(__XEN_LINUX_UPDATE)
	$(KETCHUP) -d $(@D) $(LINUX_VER)
	touch $@ # update timestamp to avoid rebuild
