kvm compiles
[kvm-coreboot.git] / packages / kvm / kvm.mk
blob1a08be03388fcda5e05ae5fb89a51299ff413ff5
1 KVM_URL=http://heanet.dl.sourceforge.net/sourceforge/kvm
2 KVM_VERSION=70
3 KVM_SOURCE=kvm-$(KVM_VERSION).tar.gz
4 KVM_DIR=$(BUILD_DIR)/kvm
5 KVM_SRC_DIR=$(KVM_DIR)/kvm-$(KVM_VERSION)
6 KVM_STAMP_DIR=$(KVM_DIR)/stamps
8 #KVM_PATCHES=$(PACKAGE_DIR)/kvm/patches/kernel-asm-rsync.patch
10 $(SOURCE_DIR)/$(KVM_SOURCE):
11 mkdir -p $(SOURCE_DIR)
12 @ wget $(WGET_Q) -P $(SOURCE_DIR) $(KVM_URL)/$(KVM_SOURCE)
14 $(KVM_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(KVM_SOURCE)
15 tar -C $(KVM_DIR) -zxf $(SOURCE_DIR)/$(KVM_SOURCE)
16 touch $@
18 $(KVM_STAMP_DIR)/.patched: $(KVM_STAMP_DIR)/.unpacked
19 @ echo "Patching kvm..."
20 @ $(BIN_DIR)/doquilt.sh $(KVM_SRC_DIR) $(KVM_PATCHES)
21 @ touch $@
24 $(KVM_STAMP_DIR)/.configured: $(KVM_STAMP_DIR)/.patched
25 @ ( export CC=$(HOST_CC); unset LIBS; \
26 cd $(KVM_SRC_DIR); ./configure \
27 --qemu-cflags=" -Os -s " \
28 --prefix=$(STAGING_DIR) \
29 --disable-sdl \
30 --disable-gfx-check \
31 --disable-vnc-tls \
32 --disable-slirp )
34 $(KVM_SRC_DIR): $(KVM_STAMP_DIR)/.configured
35 @ ( export CC=$(HOST_CC); export CFLAGS="$(HOST_CFLAGS)"; \
36 export LDFLAGS="$(HOST_LDFLAGS) -L."; unset LIBS; \
37 $(MAKE) -C $(KVM_SRC_DIR) libkvm user qemu )
40 $(INITRD_DIR)/bin/kvm: $(KVM_SRC_DIR)
41 install -d $(INITRD_DIR)/bin
42 install -m 0744 $(KVM_SRC_DIR)/kvm $(INITRD_DIR)/bin
44 $(KVM_STAMP_DIR):
45 mkdir -p $@
47 kvm: $(KVM_STAMP_DIR) $(INITRD_DIR)/bin/kvm
49 kvm-clean:
50 @ rm -f $(KVM_STAMP_DIR)/.configured
51 ifneq ($(wildcard $(KVM_SRC_DIR)/Makefile),)
52 $(MAKE) -C $(KVM_SRC_DIR) clean
53 endif
54 kvm-distclean:
55 rm -rf $(KVM_DIR)/*