+ < $< | cat - livecd-post.sh > $@
+
+livecd-post.sh: livecd-post.sh.in p2v.init virt-p2v.sh inittab lvm.conf Makefile
+ rm -f $@
+ sed \
+ -e '/@P2V.INIT@/ r p2v.init' \
+ -e '/@P2V.INIT@/ d' \
+ -e '/@VIRT-P2V.SH@/ r virt-p2v.sh' \
+ -e '/@VIRT-P2V.SH@/ d' \
+ -e '/@INITTAB@/ r inittab' \
+ -e '/@INITTAB@/ d' \
+ -e '/@LVM.CONF@/ r lvm.conf' \
+ -e '/@LVM.CONF@/ d' \
+ < $< > $@
+
+# Run live CD under qemu.
+
+QEMU := qemu
+ISO := $(LABEL).iso
+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)
+
+# Standard rules.
+
+checkroot:
+ @if [ `id -u` -ne 0 ]; then \
+ echo "You must be root to perform this operation."; \
+ exit 1; \
+ fi
+
+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:
+ @for d in `find -type d -name CVS | grep -v '^\./debian/'`; \
+ do \
+ b=`dirname $$d`/; \
+ awk -F/ '$$1 != "D" {print $$2}' $$d/Entries | \
+ sed -e "s|^|$$b|" -e "s|^\./||"; \
+ done | 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