Skip to content

Instantly share code, notes, and snippets.

@ldunn
Created August 6, 2010 07:36
Show Gist options
  • Select an option

  • Save ldunn/510995 to your computer and use it in GitHub Desktop.

Select an option

Save ldunn/510995 to your computer and use it in GitHub Desktop.
#STAGE1=/usr/lib/grub/i386-pc/stage1
STAGE2=/usr/lib/grub/i386-pc/stage2_eltorito
all: $(ISO)
kernel:
@cd kernel/; $(MAKE) $(MFLAGS)
iso: $(ISO)
$(ISO): kernel
mkdir -p iso
mkdir -p iso/boot/grub
cp $(STAGE2) iso/boot/grub/stage2_eltorito
cp kernel/kern.elf iso/boot/kern.elf
echo "default 0" > iso/boot/grub/menu.lst
echo "timeout 10" >> iso/boot/grub/menu.lst
genisoimage -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o $(ISO) iso/
clean:
rm -rf iso/
@cd kernel/; $(MAKE) $(MFLAGS) clean
.PHONY: all iso kernel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment