+
+# Run live CD under qemu.
+
+QEMU := qemu
+HDA :=
+HDB :=
+
+QEMU_ARGS := -m 512 -cdrom $(ISO) -boot d
+ifneq ($(HDA),)
+QEMU_ARGS += -hda $(HDA)
+endif
+ifneq ($(HDB),)
+QEMU_ARGS += -hdb $(HDB)
+endif
+
+boot:
+ $(QEMU) $(QEMU_ARGS)
+
+# Update an existing ISO.
+
+update: checkroot
+ -./update-iso.ml delete $(ISO)
+ ./update-iso.ml add $(ISO) virt-p2v.ml
+
+# Check that we are root.
+
+checkroot:
+ @if [ `id -u` -ne 0 ]; then \
+ echo "You must be root to perform this operation."; \
+ exit 1; \
+ fi
+
+# Check that the script compiles.
+
+checkscript:
+ ./virt-p2v.ml --test
+
+# Clean.
+
+clean:
+ rm -f *~ core livecd.ks livecd-post.sh
+
+# Manifest.
+
+dist:
+ $(MAKE) check-manifest
+ rm -rf $(PACKAGE)-$(VERSION)
+ mkdir $(PACKAGE)-$(VERSION)
+ tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
+ tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
+ rm -rf $(PACKAGE)-$(VERSION)
+ ls -l $(PACKAGE)-$(VERSION).tar.gz
+
+check-manifest:
+ @hg manifest | sort > .check-manifest; \
+ sort MANIFEST > .orig-manifest; \
+ diff -u .orig-manifest .check-manifest; rv=$$?; \
+ rm -f .orig-manifest .check-manifest; \
+ exit $$rv
+
+.PHONY: build boot checkroot
\ No newline at end of file