9
|
1 # vim: set noexpandtab:
|
|
2
|
|
3 all: lcfosc.elf
|
|
4
|
|
5 bootdisk: lcfosc.elf grub/menu.lst
|
|
6 objcopy -O binary lcfosc.elf lcfosc.bin
|
|
7 cp grub/emptybootdisk.img bootdisk.img
|
|
8 mcopy -D o -i bootdisk.img lcfosc.bin ::
|
|
9 mcopy -D o -i bootdisk.img grub/menu.lst ::/grub
|
|
10 mdir -i bootdisk.img
|
|
11
|
|
12 CRT0 = kernel/goto64.o
|
|
13
|
|
14 CFLAGS = -m64 \
|
|
15 -nostdinc \
|
|
16 -nostdlib \
|
|
17 -nostartfiles \
|
|
18 -fno-builtin \
|
|
19 -Iinclude
|
|
20
|
|
21 OBJECTS = \
|
|
22 kernel/video.o \
|
|
23 kernel/snprintf.o \
|
|
24 kernel/kernel.o
|
|
25
|
|
26 lcfosc.elf: $(CRT0) $(OBJECTS) linker.ld
|
|
27 ld -T linker.ld -o lcfosc.elf $(CRT0) $(OBJECTS)
|
|
28
|
|
29 %.o : %.asm
|
|
30 nasm -f elf64 -o $@ $<
|
|
31
|
|
32 %.o : %.c
|
|
33 gcc $(CFLAGS) -o $@ -c $< -Wall -Wextra -Werror
|
|
34
|
|
35 clean:
|
|
36 rm $(OBJECTS) $(CRT0) lcfosc.bin lcfosc.elf
|
|
37
|