blob: 0cf5de30fa5491cfcfbbb9513a4fd12f99b93e3b [file] [log] [blame]
swissChili2b5acc82021-03-13 17:06:42 -08001init(kernel, kernel.elf)
2
3preset(freestanding)
4preset(optimize)
5preset(debug)
6preset(32)
7preset(warn)
8preset(nasm)
9
10archetype(c)
11archetype(asm)
12
13depends(initrd, $(ROOT)/boot/initrd, initrd.img)
14
swissChili64228692021-03-16 08:19:23 -070015LDFLAGS += -Tlink.ld -melf_i386
16ASMFLAGS += -felf
swissChili2b5acc82021-03-13 17:06:42 -080017QEMUFLAGS = -d cpu_reset
18
19OBJECTS = boot.o \
20 main.o \
21 descriptor_tables.o \
22 io.o \
23 vga.o \
24 gdt_flush.o \
25 idt.o \
26 log.o \
27 irq.o \
28 pic.o \
29 timer.o \
30 paging.o \
31 switch_table.o \
32 scan_codes.o \
33 kheap.o \
34 alloc.o \
35 vfs.o \
36 multiboot.o \
swissChili64228692021-03-16 08:19:23 -070037 vfs_initrd.o \
38 syscall.o
swissChili2b5acc82021-03-13 17:06:42 -080039
40type(custom_link)
41
42debug: kernel.elf
43 qemu-system-i386 -s -S -kernel kernel.elf &
44 @echo run "target remote localhost:1234" to connect to qemu
45 gdb
46 @pkill qemu-system-i38
47
48qemu: kernel.elf
49 qemu-system-i386 $(QEMUFLAGS) -monitor stdio -kernel kernel.elf -no-reboot
50
51qemu-iso: install
52 qemu-system-i386 $(QEMUFLAGS) -monitor stdio $(ROOT)/bin/bluejay.iso
53
54scan_codes.c: gen_scan_codes.py scan_codes.tsv
55 python3 $< > $@
56
57install: kernel.elf lib(initrd)
58 cp kernel.elf $(ROOT)/boot/
59 rm -f $(ROOT)/bin/bluejay.iso
60 grub-mkrescue -o $(ROOT)/bin/bluejay.iso $(ROOT)
61
62finish