Files
x86-bare-metal-examples/multiboot/hello-world/Makefile

18 lines
361 B
Makefile
Raw Normal View History

2015-09-12 11:37:30 +02:00
# main.elf is the main output: the multiboot file.
2015-09-11 12:12:31 +02:00
main.elf: entry.o main.o
ld -m elf_i386 -nostdlib -T linker.ld -o '$@' $^
entry.o: entry.asm
2015-09-12 11:37:30 +02:00
nasm -f elf32 '$<' -o '$@'
2015-09-11 12:12:31 +02:00
main.o: main.c
2015-09-12 11:37:30 +02:00
gcc -c -m32 -std=c99 -ffreestanding -fno-builtin -Os -o '$@' -Wall -Wextra '$<'
2015-09-11 12:12:31 +02:00
clean:
rm -f *.elf *.o
run: main.elf
qemu-system-i386 -kernel '$<'
.PHONY: clean run