25 lines
438 B
Makefile
25 lines
438 B
Makefile
CFLAGS= -m32 -Wfatal-errors -nostdlib -Wno-builtin-declaration-mismatch
|
|
ASFLAGS= --32
|
|
LDFLAGS= -melf_i386 -nostdlib -e loader -T link.ld
|
|
OBJS=loader.o kernel.o stdio.o
|
|
|
|
all: kernel
|
|
|
|
run: kernel
|
|
qemu-system-x86_64 -enable-kvm -m 256m -kernel $^
|
|
|
|
kernel: $(OBJS)
|
|
$(LD) $(LDFLAGS) $^ -o $@
|
|
|
|
install: $(OBJS)
|
|
cp ./kernel /boot/mykernel
|
|
|
|
%.o: %.c
|
|
$(CC) $(CFLAGS) -c $^
|
|
|
|
%.o: %.s
|
|
$(AS) $(ASFLAGS) -c $^ -o $@
|
|
|
|
clean:
|
|
$(RM) $(OBJS) kernel
|