From edba90fb16ec7224da591ab8f83efe3673853a3f Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 20 May 2015 16:03:33 +0200 Subject: first commit Based on x86/bios from lkvm Signed-off-by: Paolo Bonzini --- Makefile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0fb6c95 --- /dev/null +++ b/Makefile @@ -0,0 +1,27 @@ +obj16-y = e820.o int10.o int15.o +obj-y = $(obj16-y) entry.o +all-y = bios.bin + +BIOS_CFLAGS += -m32 +BIOS_CFLAGS += -march=i386 +BIOS_CFLAGS += -mregparm=3 +BIOS_CFLAGS += -fno-stack-protector +BIOS_CFLAGS += -Iinclude +$(obj16-y): BIOS_CFLAGS += -include code16gcc.h + +all: $(all-y) + +.PRECIOUS: %.o +%.o: %.c + $(CC) $(CFLAGS) $(BIOS_CFLAGS) -c -s $< -o $@ +%.o: %.S + $(CC) $(CFLAGS) $(BIOS_CFLAGS) -c -s $< -o $@ + +bios.bin.elf: $(obj-y) rom.ld.S + $(LD) -T rom.ld.S -o bios.bin.elf $(obj-y) + +bios.bin: bios.bin.elf + objcopy -O binary bios.bin.elf bios.bin + +clean: + rm $(obj-y) $(all-y) bios.bin.elf -- cgit v1.1